mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-14 15:13:07 +00:00
LibGUI: Use ColorRole::DisabledText when AbstractView is disabled
And only paint GlyphMapWidget's frame if disabled
This commit is contained in:
parent
ec29d3abae
commit
aaf60053f1
Notes:
sideshowbarker
2024-07-17 02:37:08 +09:00
Author: https://github.com/thankyouverycool
Commit: aaf60053f1
Pull-request: https://github.com/SerenityOS/serenity/pull/18764
Reviewed-by: https://github.com/caoimhebyrne ✅
2 changed files with 6 additions and 1 deletions
|
@ -715,7 +715,9 @@ void AbstractView::draw_item_text(Gfx::Painter& painter, ModelIndex const& index
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Color text_color;
|
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();
|
text_color = is_focused() ? palette().selection_text() : palette().inactive_selection_text();
|
||||||
else
|
else
|
||||||
text_color = index.data(ModelRole::ForegroundColor).to_color(palette().color(foreground_role()));
|
text_color = index.data(ModelRole::ForegroundColor).to_color(palette().color(foreground_role()));
|
||||||
|
|
|
@ -120,6 +120,9 @@ void GlyphMapWidget::paint_event(PaintEvent& event)
|
||||||
{
|
{
|
||||||
Frame::paint_event(event);
|
Frame::paint_event(event);
|
||||||
|
|
||||||
|
if (!is_enabled())
|
||||||
|
return;
|
||||||
|
|
||||||
Painter painter(*this);
|
Painter painter(*this);
|
||||||
painter.add_clip_rect(widget_inner_rect());
|
painter.add_clip_rect(widget_inner_rect());
|
||||||
painter.add_clip_rect(event.rect());
|
painter.add_clip_rect(event.rect());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue