summaryrefslogtreecommitdiff
path: root/Userland/Applications
diff options
context:
space:
mode:
authorMarcus Nilsson <brainbomb@gmail.com>2021-07-01 13:42:42 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-05 20:39:30 +0200
commit9df3550e5818e0426ff5391437b14fc6da131c9e (patch)
tree246ad6128e191f4772803b5491a0b2d0b74135de /Userland/Applications
parent36abb38f263dbf9cb372f2d6c44999efbda250f1 (diff)
downloadserenity-9df3550e5818e0426ff5391437b14fc6da131c9e.zip
PixelPaint: Change color of disabled layers in LayerListWidget
Diffstat (limited to 'Userland/Applications')
-rw-r--r--Userland/Applications/PixelPaint/LayerListWidget.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/Userland/Applications/PixelPaint/LayerListWidget.cpp b/Userland/Applications/PixelPaint/LayerListWidget.cpp
index 6618633938..6bf6c00d27 100644
--- a/Userland/Applications/PixelPaint/LayerListWidget.cpp
+++ b/Userland/Applications/PixelPaint/LayerListWidget.cpp
@@ -86,17 +86,22 @@ void LayerListWidget::paint_event(GUI::PaintEvent& event)
painter.fill_rect(adjusted_rect, palette().selection());
}
- painter.draw_rect(adjusted_rect, Color::Black);
+ painter.draw_rect(adjusted_rect, palette().color(ColorRole::BaseText));
Gfx::IntRect thumbnail_rect { adjusted_rect.x(), adjusted_rect.y(), adjusted_rect.height(), adjusted_rect.height() };
thumbnail_rect.shrink(8, 8);
painter.draw_scaled_bitmap(thumbnail_rect, layer.bitmap(), layer.bitmap().rect());
- painter.draw_rect(thumbnail_rect, Color::Black);
Gfx::IntRect text_rect { thumbnail_rect.right() + 10, adjusted_rect.y(), adjusted_rect.width(), adjusted_rect.height() };
text_rect.intersect(adjusted_rect);
- painter.draw_text(text_rect, layer.name(), Gfx::TextAlignment::CenterLeft, layer.is_selected() ? palette().selection_text() : palette().button_text());
+ if (layer.is_visible()) {
+ painter.draw_text(text_rect, layer.name(), Gfx::TextAlignment::CenterLeft, layer.is_selected() ? palette().selection_text() : palette().button_text());
+ painter.draw_rect(thumbnail_rect, palette().color(ColorRole::BaseText));
+ } else {
+ painter.draw_text(text_rect, layer.name(), Gfx::TextAlignment::CenterLeft, palette().color(ColorRole::DisabledText));
+ painter.draw_rect(thumbnail_rect, palette().color(ColorRole::DisabledText));
+ }
};
for (auto& gadget : m_gadgets) {