mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
PixelPaint: Draw layers from bottom of panel, adjust spacing
If we don't have enough layers to be able to scroll, the layers are pushed to be at the top of the layer list. This doesn't make much sense now that we are correctly drawing the layers in the right order, so now we draw them justified towards the bottom. Previously we were also clipping the bottom gadget slightly when there were enough layers to scroll. Now, I'm adding some offset to the total height to account for this and give equivalent spacing from the top and bottom layers.
This commit is contained in:
parent
339f0d5bca
commit
0c56f06994
Notes:
sideshowbarker
2024-07-18 04:51:07 +09:00
Author: https://github.com/mustafaquraish Commit: https://github.com/SerenityOS/serenity/commit/0c56f06994f Pull-request: https://github.com/SerenityOS/serenity/pull/9745 Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 2 additions and 2 deletions
|
@ -316,7 +316,8 @@ void LayerListWidget::cycle_through_selection(int delta)
|
|||
|
||||
void LayerListWidget::relayout_gadgets()
|
||||
{
|
||||
int y = 0;
|
||||
auto total_gadget_height = static_cast<int>(m_gadgets.size()) * vertical_step + 6;
|
||||
int y = max(0, height() - total_gadget_height);
|
||||
|
||||
Optional<size_t> hole_index;
|
||||
if (is_moving_gadget())
|
||||
|
@ -333,7 +334,6 @@ void LayerListWidget::relayout_gadgets()
|
|||
++index;
|
||||
}
|
||||
|
||||
auto total_gadget_height = static_cast<int>(m_gadgets.size()) * vertical_step;
|
||||
set_content_size({ widget_inner_rect().width(), total_gadget_height });
|
||||
vertical_scrollbar().set_range(0, max(total_gadget_height - height(), 0));
|
||||
update();
|
||||
|
|
Loading…
Reference in a new issue