@@ -1628,8 +1628,10 @@ package body Gtkada.MDI is
1628
1628
MDI.Title_Bar_Height :=
1629
1629
2 + Get_Size (MDI.Title_Font) / Pango.Enums.Pango_Scale;
1630
1630
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)
1633
1635
then
1634
1636
MDI.Focus_Title_Color := Focus_Title_Color;
1635
1637
MDI.Title_Bar_Color := Title_Bar_Color;
@@ -8799,7 +8801,6 @@ package body Gtkada.MDI is
8799
8801
8800
8802
procedure Do_Draw (Cr : Cairo_Context; Draw : Boolean);
8801
8803
procedure Do_Draw (Cr : Cairo_Context; Draw : Boolean) is
8802
- Base_Color : Gdk_RGBA;
8803
8804
Color : Gdk_RGBA;
8804
8805
Layout : Pango_Layout;
8805
8806
Ink_Rect, Logical_Rect : Pango_Rectangle;
@@ -8816,18 +8817,10 @@ package body Gtkada.MDI is
8816
8817
return ;
8817
8818
end if ;
8818
8819
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 );
8829
8822
8830
- Color.Alpha := 0.2 ;
8823
+ Color.Alpha := 0.5 ;
8831
8824
Set_Source_RGBA (Cr, Color);
8832
8825
Cairo.Rectangle
8833
8826
(Cr,
@@ -8887,7 +8880,7 @@ package body Gtkada.MDI is
8887
8880
-- Slightly lighter (and non-transparent) background for the msg.
8888
8881
Set_Line_Width (Cr, 1.0 );
8889
8882
Set_Source_RGBA
8890
- (Cr, Gtkada.Style.Lighten (Base_Color , 0.3 ));
8883
+ (Cr, Gtkada.Style.Shade_Or_Lighten (Color , 0.2 ));
8891
8884
Gtkada.Style.Rounded_Rectangle
8892
8885
(Cr, X - 2.0 , Y - 2.0 , W + 4.0 , H + 4.0 , 4.0 );
8893
8886
Cairo.Fill (Cr);
0 commit comments