summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2023-05-10 17:01:22 -0400
committerAndreas Kling <kling@serenityos.org>2023-05-13 12:53:49 +0200
commitaaf60053f19c68091221a1f34e482dda05a09f1c (patch)
tree9654e95b7e0909fab79bf6a5b3efecd940ca4c85
parentec29d3abae506df830506ca3d3a15a76c5a4192b (diff)
downloadserenity-aaf60053f19c68091221a1f34e482dda05a09f1c.zip
LibGUI: Use ColorRole::DisabledText when AbstractView is disabled
And only paint GlyphMapWidget's frame if disabled
-rw-r--r--Userland/Libraries/LibGUI/AbstractView.cpp4
-rw-r--r--Userland/Libraries/LibGUI/GlyphMapWidget.cpp3
2 files changed, 6 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGUI/AbstractView.cpp b/Userland/Libraries/LibGUI/AbstractView.cpp
index cc78fb985b..4bc0fb2140 100644
--- a/Userland/Libraries/LibGUI/AbstractView.cpp
+++ b/Userland/Libraries/LibGUI/AbstractView.cpp
@@ -715,7 +715,9 @@ void AbstractView::draw_item_text(Gfx::Painter& painter, ModelIndex const& index
return;
Color text_color;
- if (is_selected)
+ if (!is_enabled())
+ text_color = palette().color(Gfx::ColorRole::DisabledText);
+ else if (is_selected)
text_color = is_focused() ? palette().selection_text() : palette().inactive_selection_text();
else
text_color = index.data(ModelRole::ForegroundColor).to_color(palette().color(foreground_role()));
diff --git a/Userland/Libraries/LibGUI/GlyphMapWidget.cpp b/Userland/Libraries/LibGUI/GlyphMapWidget.cpp
index 3908934d8c..a4d1acd49c 100644
--- a/Userland/Libraries/LibGUI/GlyphMapWidget.cpp
+++ b/Userland/Libraries/LibGUI/GlyphMapWidget.cpp
@@ -120,6 +120,9 @@ void GlyphMapWidget::paint_event(PaintEvent& event)
{
Frame::paint_event(event);
+ if (!is_enabled())
+ return;
+
Painter painter(*this);
painter.add_clip_rect(widget_inner_rect());
painter.add_clip_rect(event.rect());