Bläddra i källkod

LibGUI+LibGfx+Base: Make tooltips color theme aware :^)

Also tweak the default tooltip color to be more bright and yellow!
Andreas Kling 4 år sedan
förälder
incheckning
3c5da01f94

+ 2 - 0
Base/res/themes/Basalt.ini

@@ -64,6 +64,8 @@ SyntaxControlKeyword=orchid
 SyntaxIdentifier=white
 SyntaxPreprocessorStatement=#ffafff
 SyntaxPreprocessorValue=orange
+Tooltip=#ffffe1
+TooltipText=black
 
 [Metrics]
 TitleHeight=24

+ 2 - 0
Base/res/themes/Dark.ini

@@ -56,3 +56,5 @@ SyntaxControlKeyword=orchid
 SyntaxIdentifier=lightskyblue
 SyntaxPreprocessorStatement=darkgray
 SyntaxPreprocessorValue=orange
+Tooltip=#ffffe1
+TooltipText=black

+ 2 - 0
Base/res/themes/Default.ini

@@ -64,6 +64,8 @@ SyntaxControlKeyword=black
 SyntaxIdentifier=#092e64
 SyntaxPreprocessorStatement=#008080
 SyntaxPreprocessorValue=#800000
+Tooltip=#ffffe1
+TooltipText=black
 
 [Metrics]
 TitleHeight=19

+ 2 - 0
Base/res/themes/Discord.ini

@@ -57,3 +57,5 @@ SyntaxControlKeyword=#021766
 SyntaxIdentifier=#333333
 SyntaxPreprocessorStatement=darkgray
 SyntaxPreprocessorValue=#320073
+Tooltip=#ffffe1
+TooltipText=black

+ 2 - 0
Base/res/themes/Faux Pas.ini

@@ -56,3 +56,5 @@ SyntaxControlKeyword=black
 SyntaxIdentifier=#092e64
 SyntaxPreprocessorStatement=#008080
 SyntaxPreprocessorValue=#800000
+Tooltip=#ffffe1
+TooltipText=black

+ 2 - 0
Base/res/themes/Hotdog Stand.ini

@@ -56,3 +56,5 @@ SyntaxControlKeyword=black
 SyntaxIdentifier=#092e64
 SyntaxPreprocessorStatement=#008080
 SyntaxPreprocessorValue=#800000
+Tooltip=#ffffe1
+TooltipText=black

+ 2 - 0
Base/res/themes/Joi.ini

@@ -56,3 +56,5 @@ SyntaxControlKeyword=black
 SyntaxIdentifier=#092e64
 SyntaxPreprocessorStatement=#008080
 SyntaxPreprocessorValue=#800000
+Tooltip=#ffffe1
+TooltipText=black

+ 2 - 0
Base/res/themes/Nord.ini

@@ -56,3 +56,5 @@ SyntaxControlKeyword=black
 SyntaxIdentifier=#092e64
 SyntaxPreprocessorStatement=#008080
 SyntaxPreprocessorValue=#800000
+Tooltip=#ffffe1
+TooltipText=black

+ 2 - 0
Base/res/themes/Redmond 2000.ini

@@ -60,6 +60,8 @@ SyntaxControlKeyword=black
 SyntaxIdentifier=#092e64
 SyntaxPreprocessorStatement=#008080
 SyntaxPreprocessorValue=#800000
+Tooltip=#ffffe1
+TooltipText=black
 
 [Metrics]
 TitleButtonWidth=17

+ 2 - 0
Base/res/themes/Redmond.ini

@@ -60,6 +60,8 @@ SyntaxControlKeyword=black
 SyntaxIdentifier=#092e64
 SyntaxPreprocessorStatement=#008080
 SyntaxPreprocessorValue=#800000
+Tooltip=#ffffe1
+TooltipText=black
 
 [Metrics]
 TitleButtonWidth=17

+ 2 - 0
Base/res/themes/Silver.ini

@@ -56,3 +56,5 @@ SyntaxControlKeyword=black
 SyntaxIdentifier=#092e64
 SyntaxPreprocessorStatement=#008080
 SyntaxPreprocessorValue=#800000
+Tooltip=#ffffe1
+TooltipText=black

+ 2 - 0
Base/res/themes/Sunshine.ini

@@ -56,3 +56,5 @@ SyntaxControlKeyword=black
 SyntaxIdentifier=#092e64
 SyntaxPreprocessorStatement=#008080
 SyntaxPreprocessorValue=#800000
+Tooltip=#ffffe1
+TooltipText=black

+ 2 - 1
Libraries/LibGUI/Application.cpp

@@ -125,7 +125,8 @@ private:
     {
         set_window_type(WindowType::Tooltip);
         m_label = set_main_widget<Label>();
-        m_label->set_background_color(Color::from_rgb(0xdac7b5));
+        m_label->set_background_role(Gfx::ColorRole::Tooltip);
+        m_label->set_foreground_role(Gfx::ColorRole::TooltipText);
         m_label->set_fill_with_background_color(true);
         m_label->set_frame_thickness(1);
         m_label->set_frame_shape(Gfx::FrameShape::Container);

+ 2 - 0
Libraries/LibGfx/SystemTheme.h

@@ -96,6 +96,8 @@ namespace Gfx {
     C(ThreedHighlight)             \
     C(ThreedShadow1)               \
     C(ThreedShadow2)               \
+    C(Tooltip)                     \
+    C(TooltipText)                 \
     C(VisitedLink)                 \
     C(Window)                      \
     C(WindowText)