From 76135860970d050bede30f334cb4e08a0f67e5ce Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Mon, 1 Nov 2021 17:03:58 +0000 Subject: [PATCH] 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. :^) --- Userland/Applications/ThemeEditor/PreviewWidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Applications/ThemeEditor/PreviewWidget.cpp b/Userland/Applications/ThemeEditor/PreviewWidget.cpp index bd501c5126..eb2ab93e72 100644 --- a/Userland/Applications/ThemeEditor/PreviewWidget.cpp +++ b/Userland/Applications/ThemeEditor/PreviewWidget.cpp @@ -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)