Skip to content

Commit

Permalink
LibDraw: Tweak the hover highlight color.
Browse files Browse the repository at this point in the history
It was a tad too bright. Also make sure we're using the same color in
all the different places. At some point it would be nice to improve global
color settings, etc.
  • Loading branch information
awesomekling committed Jul 27, 2019
1 parent 34ccc7b commit 7cd2e73
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Libraries/LibDraw/StylePainter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ void StylePainter::paint_tab_button(Painter& painter, const Rect& rect, bool act
Color shadow_color2 = Color::from_rgb(0x404040);

if (hovered && enabled && !active)
base_color = Color::from_rgb(0xd4d4d4);
base_color = StylePainter::hover_highlight_color();

PainterStateSaver saver(painter);
painter.translate(rect.location());
Expand Down Expand Up @@ -55,7 +55,7 @@ static void paint_button_new(Painter& painter, const Rect& rect, bool pressed, b
else
button_color = Color::from_rgb(0xd6d2ce);
} else if (hovered && enabled)
button_color = Color::from_rgb(0xd4d4d4);
button_color = StylePainter::hover_highlight_color();

PainterStateSaver saver(painter);
painter.translate(rect.location());
Expand Down
4 changes: 4 additions & 0 deletions Libraries/LibDraw/StylePainter.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <LibDraw/Color.h>

class Painter;
class Rect;

Expand Down Expand Up @@ -28,4 +30,6 @@ class StylePainter {
static void paint_surface(Painter&, const Rect&, bool paint_vertical_lines = true, bool paint_top_line = true);
static void paint_frame(Painter&, const Rect&, FrameShape, FrameShadow, int thickness, bool skip_vertical_lines = false);
static void paint_window_frame(Painter&, const Rect&);

static Color hover_highlight_color() { return Color::from_rgb(0xe6e5e2); }
};
2 changes: 1 addition & 1 deletion Libraries/LibGUI/GSplitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ GSplitter::~GSplitter()

void GSplitter::enter_event(CEvent&)
{
set_background_color(Color::from_rgb(0xd6d2ce));
set_background_color(StylePainter::hover_highlight_color());
window()->set_override_cursor(m_orientation == Orientation::Horizontal ? GStandardCursor::ResizeHorizontal : GStandardCursor::ResizeVertical);
update();
}
Expand Down

0 comments on commit 7cd2e73

Please sign in to comment.