[PATCH] dark mode for tooltips

<[email protected]> Sat, 24 Aug 2024 22:39:21 +0200
Newsgroups gmane.comp.web.dillo.devel
Message-ID <[email protected]>
Hi, 

As part of an overall dark mode for Dillo, we could also consider the
tooltips. Here is an example which I think looks reasonable:

--- a/src/tipwin.cc	Sun Aug 11 22:21:59 2024
+++ b/src/tipwin.cc	Sat Aug 24 22:17:21 2024
@@ -40,7 +40,7 @@ static void recent_timeout(void*);
  */
 TipWin::TipWin() : Fl_Menu_Window(1, 1)     // will autosize
 {
-   bgcolor = fl_color_cube(FL_NUM_RED - 1, FL_NUM_GREEN - 1, FL_NUM_BLUE - 2);
+   bgcolor = FL_WHITE;
    recent = 0;
    tip[0] = '\0';
    cur_widget = NULL;
@@ -50,8 +50,8 @@ TipWin::TipWin() : Fl_Menu_Window(1, 1)     // will au
 
 void TipWin::draw()
 {
-   draw_box(FL_BORDER_BOX, 0, 0, w(), h(), bgcolor);
-   fl_color(FL_BLACK);
+   draw_box(FL_BORDER_FRAME, 0, 0, w(), h(), bgcolor);
+   fl_color(FL_WHITE);
    fl_font(labelfont(), labelsize());
    fl_draw(tip, 3, 3, w() - 6, h() - 6,
            //Fl_Align(FL_ALIGN_LEFT | FL_ALIGN_WRAP));

Note that 'ui_main_bg_color' needs to be set to the desired dark color
first. 

Regards,
Alex

_______________________________________________
Dillo-dev mailing list -- dillo-dev-lx9mn2B4QYRWk0Htik3J/[email protected]
To unsubscribe send an email to dillo-dev-leave-lx9mn2B4QYRWk0Htik3J/[email protected]
tooltip-dark.png (image/png, 19.4 KB) - not displayed
tooltip-darkmode.patch (text/x-patch, 768 B)
--- a/src/tipwin.cc	Sun Aug 11 22:21:59 2024
+++ b/src/tipwin.cc	Sat Aug 24 22:17:21 2024
@@ -40,7 +40,7 @@ static void recent_timeout(void*);
  */
 TipWin::TipWin() : Fl_Menu_Window(1, 1)     // will autosize
 {
-   bgcolor = fl_color_cube(FL_NUM_RED - 1, FL_NUM_GREEN - 1, FL_NUM_BLUE - 2);
+   bgcolor = FL_WHITE;
    recent = 0;
    tip[0] = '\0';
    cur_widget = NULL;
@@ -50,8 +50,8 @@ TipWin::TipWin() : Fl_Menu_Window(1, 1)     // will au
 
 void TipWin::draw()
 {
-   draw_box(FL_BORDER_BOX, 0, 0, w(), h(), bgcolor);
-   fl_color(FL_BLACK);
+   draw_box(FL_BORDER_FRAME, 0, 0, w(), h(), bgcolor);
+   fl_color(FL_WHITE);
    fl_font(labelfont(), labelsize());
    fl_draw(tip, 3, 3, w() - 6, h() - 6,
            //Fl_Align(FL_ALIGN_LEFT | FL_ALIGN_WRAP));