From aae54bdbde5fb8c0100eaaaeaa00194f3a0fcdd6 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 24 Dec 2019 22:01:32 +0100 Subject: [PATCH] LibDraw: Add ColorRole::BaseText (to be painted on ColorRole::Base) --- Base/res/themes/Dark.ini | 1 + Base/res/themes/Default.ini | 1 + Base/res/themes/Xmas.ini | 1 + Libraries/LibDraw/Palette.h | 1 + Libraries/LibDraw/SystemTheme.cpp | 1 + Libraries/LibDraw/SystemTheme.h | 1 + Libraries/LibGUI/GItemView.cpp | 2 ++ Libraries/LibGUI/GListView.cpp | 1 + Libraries/LibGUI/GTableView.cpp | 1 + Libraries/LibGUI/GTextEditor.cpp | 2 ++ Libraries/LibGUI/GTreeView.cpp | 1 + 11 files changed, 13 insertions(+) diff --git a/Base/res/themes/Dark.ini b/Base/res/themes/Dark.ini index 8e9d934f12b..adb65bb2dc7 100644 --- a/Base/res/themes/Dark.ini +++ b/Base/res/themes/Dark.ini @@ -26,6 +26,7 @@ WindowText=white Button=#555555 ButtonText=white Base=#424242 +BaseText=white ThreedHighlight=#6f6f6f ThreedShadow1=#3d3e40 diff --git a/Base/res/themes/Default.ini b/Base/res/themes/Default.ini index 2110c4c43f4..f9126edf72f 100644 --- a/Base/res/themes/Default.ini +++ b/Base/res/themes/Default.ini @@ -27,6 +27,7 @@ Button=#d4d0c8 ButtonText=black Base=white +BaseText=black ThreedHighlight=white ThreedShadow1=#808080 diff --git a/Base/res/themes/Xmas.ini b/Base/res/themes/Xmas.ini index 83febd83d58..28802585ce0 100644 --- a/Base/res/themes/Xmas.ini +++ b/Base/res/themes/Xmas.ini @@ -27,6 +27,7 @@ Button=#d46c64 ButtonText=black Base=#d3d7c4 +BaseText=black ThreedHighlight=#e69e99 ThreedShadow1=#a24841 diff --git a/Libraries/LibDraw/Palette.h b/Libraries/LibDraw/Palette.h index e7cbd222117..2d5acf784f3 100644 --- a/Libraries/LibDraw/Palette.h +++ b/Libraries/LibDraw/Palette.h @@ -31,6 +31,7 @@ public: Color menu_base() const { return color(ColorRole::MenuBase); } Color menu_selection() const { return color(ColorRole::MenuSelection); } Color base() const { return color(ColorRole::Base); } + Color base_text() const { return color(ColorRole::BaseText); } Color button() const { return color(ColorRole::Button); } Color button_text() const { return color(ColorRole::ButtonText); } Color threed_highlight() const { return color(ColorRole::ThreedHighlight); } diff --git a/Libraries/LibDraw/SystemTheme.cpp b/Libraries/LibDraw/SystemTheme.cpp index 1ca8ede2ebb..38178f9be4e 100644 --- a/Libraries/LibDraw/SystemTheme.cpp +++ b/Libraries/LibDraw/SystemTheme.cpp @@ -54,6 +54,7 @@ RefPtr load_system_theme(const String& path) DO_COLOR(Window); DO_COLOR(WindowText); DO_COLOR(Base); + DO_COLOR(BaseText); DO_COLOR(Button); DO_COLOR(ButtonText); DO_COLOR(DesktopBackground); diff --git a/Libraries/LibDraw/SystemTheme.h b/Libraries/LibDraw/SystemTheme.h index 4150dbef41c..b7b153546e5 100644 --- a/Libraries/LibDraw/SystemTheme.h +++ b/Libraries/LibDraw/SystemTheme.h @@ -27,6 +27,7 @@ enum class ColorRole { Button, ButtonText, Base, + BaseText, ThreedHighlight, ThreedShadow1, ThreedShadow2, diff --git a/Libraries/LibGUI/GItemView.cpp b/Libraries/LibGUI/GItemView.cpp index 15581486b70..31c69d3299c 100644 --- a/Libraries/LibGUI/GItemView.cpp +++ b/Libraries/LibGUI/GItemView.cpp @@ -10,6 +10,8 @@ GItemView::GItemView(GWidget* parent) : GAbstractView(parent) { + set_background_role(ColorRole::Base); + set_foreground_role(ColorRole::BaseText); set_frame_shape(FrameShape::Container); set_frame_shadow(FrameShadow::Sunken); set_frame_thickness(2); diff --git a/Libraries/LibGUI/GListView.cpp b/Libraries/LibGUI/GListView.cpp index d9971469ca2..c41f68e151c 100644 --- a/Libraries/LibGUI/GListView.cpp +++ b/Libraries/LibGUI/GListView.cpp @@ -8,6 +8,7 @@ GListView::GListView(GWidget* parent) : GAbstractView(parent) { set_background_role(ColorRole::Base); + set_foreground_role(ColorRole::BaseText); set_frame_shape(FrameShape::Container); set_frame_shadow(FrameShadow::Sunken); set_frame_thickness(2); diff --git a/Libraries/LibGUI/GTableView.cpp b/Libraries/LibGUI/GTableView.cpp index e4a90e7d91a..5b88dd96a91 100644 --- a/Libraries/LibGUI/GTableView.cpp +++ b/Libraries/LibGUI/GTableView.cpp @@ -14,6 +14,7 @@ GTableView::GTableView(GWidget* parent) : GAbstractColumnView(parent) { set_background_role(ColorRole::Base); + set_foreground_role(ColorRole::BaseText); } GTableView::~GTableView() diff --git a/Libraries/LibGUI/GTextEditor.cpp b/Libraries/LibGUI/GTextEditor.cpp index accd3890d6e..8416950cb40 100644 --- a/Libraries/LibGUI/GTextEditor.cpp +++ b/Libraries/LibGUI/GTextEditor.cpp @@ -26,6 +26,8 @@ GTextEditor::GTextEditor(Type type, GWidget* parent) : GScrollableWidget(parent) , m_type(type) { + set_background_role(ColorRole::Base); + set_foreground_role(ColorRole::BaseText); set_document(GTextDocument::create()); set_frame_shape(FrameShape::Container); set_frame_shadow(FrameShadow::Sunken); diff --git a/Libraries/LibGUI/GTreeView.cpp b/Libraries/LibGUI/GTreeView.cpp index a74b36768b3..0310509dc51 100644 --- a/Libraries/LibGUI/GTreeView.cpp +++ b/Libraries/LibGUI/GTreeView.cpp @@ -25,6 +25,7 @@ GTreeView::GTreeView(GWidget* parent) : GAbstractColumnView(parent) { set_background_role(ColorRole::Base); + set_foreground_role(ColorRole::BaseText); set_size_columns_to_fit_content(true); set_headers_visible(false); m_expand_bitmap = GraphicsBitmap::load_from_file("/res/icons/treeview-expand.png");