ThemeEditor: Offset the preview vertically to center it better
Previously, the active window being centered, and then the inactive one being higher, meant having an awkward gap at the bottom. This is a simple fix, and not perfect, but it helps. :^)
This commit is contained in:
parent
b51d2fee05
commit
7613586097
Notes:
sideshowbarker
2024-07-18 01:28:12 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/76135860970 Pull-request: https://github.com/SerenityOS/serenity/pull/10750 Reviewed-by: https://github.com/BenWiederhake ✅
1 changed files with 2 additions and 2 deletions
|
@ -210,7 +210,7 @@ void PreviewWidget::paint_event(GUI::PaintEvent& event)
|
|||
}
|
||||
};
|
||||
|
||||
auto active_rect = Gfx::IntRect(0, 0, 320, 240).centered_within(frame_inner_rect());
|
||||
auto active_rect = Gfx::IntRect(0, 0, 320, 240).centered_within(frame_inner_rect()).translated(0, 20);
|
||||
auto inactive_rect = active_rect.translated(-20, -20);
|
||||
|
||||
paint_window("Inactive window", inactive_rect, Gfx::WindowTheme::WindowState::Inactive, *m_active_window_icon);
|
||||
|
@ -219,7 +219,7 @@ void PreviewWidget::paint_event(GUI::PaintEvent& event)
|
|||
|
||||
void PreviewWidget::resize_event(GUI::ResizeEvent&)
|
||||
{
|
||||
m_gallery->set_relative_rect(Gfx::IntRect(0, 0, 320, 240).centered_within(rect()));
|
||||
m_gallery->set_relative_rect(Gfx::IntRect(0, 0, 320, 240).centered_within(rect()).translated(0, 20));
|
||||
}
|
||||
|
||||
void PreviewWidget::drop_event(GUI::DropEvent& event)
|
||||
|
|
Loading…
Add table
Reference in a new issue