From 8321908abe7a3cfef4b90f80f40e6fa004cc8927 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 17 Feb 2019 12:08:28 +0100 Subject: [PATCH] LibGUI: Tweak the scrollbar and button styles a bit. --- LibGUI/GScrollBar.cpp | 6 +++--- LibGUI/GStyle.cpp | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/LibGUI/GScrollBar.cpp b/LibGUI/GScrollBar.cpp index e8d4bd3055c..01d1cc2ea4c 100644 --- a/LibGUI/GScrollBar.cpp +++ b/LibGUI/GScrollBar.cpp @@ -165,9 +165,9 @@ Rect GScrollBar::scrubber_rect() const return { }; float x_or_y; if (m_value == m_min) - x_or_y = button_size(); + x_or_y = button_size() - 1; else if (m_value == m_max) - x_or_y = (orientation() == Orientation::Vertical ? height() : width()) - (button_size() * 2); + x_or_y = ((orientation() == Orientation::Vertical ? height() : width()) - (button_size() * 2)) + 1; else { float range_size = m_max - m_min; float available = scrubbable_range_in_pixels(); @@ -194,7 +194,7 @@ void GScrollBar::paint_event(GPaintEvent&) painter.draw_bitmap(down_button_rect().location().translated(3, 3), orientation() == Orientation::Vertical ? *s_down_arrow_bitmap : *s_right_arrow_bitmap, has_scrubber() ? Color::Black : Color::MidGray); if (has_scrubber()) - GStyle::the().paint_button(painter, scrubber_rect(), m_scrubbing); + GStyle::the().paint_button(painter, scrubber_rect(), false); } void GScrollBar::mousedown_event(GMouseEvent& event) diff --git a/LibGUI/GStyle.cpp b/LibGUI/GStyle.cpp index a0ab4e94725..092a3598cc3 100644 --- a/LibGUI/GStyle.cpp +++ b/LibGUI/GStyle.cpp @@ -33,19 +33,19 @@ void GStyle::paint_button(Painter& painter, const Rect& rect, bool pressed) } else { // Base painter.fill_rect({ 3, 3, rect.width() - 5, rect.height() - 5 }, button_color); - painter.fill_rect_with_gradient({ 3, 3, rect.width() - 5, rect.height() - 5 }, button_color, Color::White); + painter.fill_rect_with_gradient({ 2, 2, rect.width() - 3, rect.height() - 3 }, button_color, Color::White); // White highlight painter.draw_line({ 1, 1 }, { rect.width() - 2, 1 }, highlight_color); - painter.draw_line({ 1, 2 }, { rect.width() - 3, 2 }, highlight_color); - painter.draw_line({ 1, 3 }, { 1, rect.height() - 2 }, highlight_color); - painter.draw_line({ 2, 3 }, { 2, rect.height() - 3 }, highlight_color); + //painter.draw_line({ 1, 2 }, { rect.width() - 3, 2 }, highlight_color); + painter.draw_line({ 1, 2 }, { 1, rect.height() - 2 }, highlight_color); + //painter.draw_line({ 2, 3 }, { 2, rect.height() - 3 }, highlight_color); // Gray shadow - painter.draw_line({ rect.width() - 2, 1 }, { rect.width() - 2, rect.height() - 4 }, shadow_color); - painter.draw_line({ rect.width() - 3, 2 }, { rect.width() - 3, rect.height() - 4 }, shadow_color); + painter.draw_line({ rect.width() - 2, 1 }, { rect.width() - 2, rect.height() - 3 }, shadow_color); + //painter.draw_line({ rect.width() - 3, 2 }, { rect.width() - 3, rect.height() - 4 }, shadow_color); painter.draw_line({ 1, rect.height() - 2 }, { rect.width() - 2, rect.height() - 2 }, shadow_color); - painter.draw_line({ 2, rect.height() - 3 }, { rect.width() - 2, rect.height() - 3 }, shadow_color); + //painter.draw_line({ 2, rect.height() - 3 }, { rect.width() - 2, rect.height() - 3 }, shadow_color); } painter.translate(-rect.location().x(), -rect.location().y());