Skip to content

Commit e85c366

Browse files
TA05-008: Fix DND tooltips readability
Configure is triggered with Null_RGBA which was resulting into ignoring the current theme color. Change-Id: I490df8b0d185b13d49c7f8e389ae012560d969d0
1 parent 17feaac commit e85c366

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

src/gtkada-mdi.adb

+8-15
Original file line numberDiff line numberDiff line change
@@ -1628,8 +1628,10 @@ package body Gtkada.MDI is
16281628
MDI.Title_Bar_Height :=
16291629
2 + Get_Size (MDI.Title_Font) / Pango.Enums.Pango_Scale;
16301630

1631-
if MDI.Focus_Title_Color /= Focus_Title_Color
1632-
or MDI.Title_Bar_Color /= Title_Bar_Color
1631+
if (Focus_Title_Color /= Gdk.RGBA.Null_RGBA
1632+
and then MDI.Focus_Title_Color /= Focus_Title_Color)
1633+
or (Title_Bar_Color /= Gdk.RGBA.Null_RGBA
1634+
and then MDI.Title_Bar_Color /= Title_Bar_Color)
16331635
then
16341636
MDI.Focus_Title_Color := Focus_Title_Color;
16351637
MDI.Title_Bar_Color := Title_Bar_Color;
@@ -8799,7 +8801,6 @@ package body Gtkada.MDI is
87998801

88008802
procedure Do_Draw (Cr : Cairo_Context; Draw : Boolean);
88018803
procedure Do_Draw (Cr : Cairo_Context; Draw : Boolean) is
8802-
Base_Color : Gdk_RGBA;
88038804
Color : Gdk_RGBA;
88048805
Layout : Pango_Layout;
88058806
Ink_Rect, Logical_Rect : Pango_Rectangle;
@@ -8816,18 +8817,10 @@ package body Gtkada.MDI is
88168817
return;
88178818
end if;
88188819

8819-
if In_Central then
8820-
Base_Color := MDI.Focus_Title_Color;
8821-
else
8822-
Base_Color := (Red => 1.0 - MDI.Focus_Title_Color.Red,
8823-
Green => 1.0 - MDI.Focus_Title_Color.Green,
8824-
Blue => 1.0 - MDI.Focus_Title_Color.Blue,
8825-
Alpha => 1.0);
8826-
end if;
8827-
8828-
Color := Base_Color;
8820+
-- Adapt the color to make it more visible on the current theme
8821+
Color := Gtkada.Style.Shade_Or_Lighten (MDI.Title_Bar_Color, 0.1);
88298822

8830-
Color.Alpha := 0.2;
8823+
Color.Alpha := 0.5;
88318824
Set_Source_RGBA (Cr, Color);
88328825
Cairo.Rectangle
88338826
(Cr,
@@ -8887,7 +8880,7 @@ package body Gtkada.MDI is
88878880
-- Slightly lighter (and non-transparent) background for the msg.
88888881
Set_Line_Width (Cr, 1.0);
88898882
Set_Source_RGBA
8890-
(Cr, Gtkada.Style.Lighten (Base_Color, 0.3));
8883+
(Cr, Gtkada.Style.Shade_Or_Lighten (Color, 0.2));
88918884
Gtkada.Style.Rounded_Rectangle
88928885
(Cr, X - 2.0, Y - 2.0, W + 4.0, H + 4.0, 4.0);
88938886
Cairo.Fill (Cr);

0 commit comments

Comments
 (0)