mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 05:16:48 +02:00
Gtk2: fixed font color changing on TCheckBox when caption is empty. issue #23373
git-svn-id: trunk@39371 -
This commit is contained in:
parent
f1869b2f37
commit
a1a464b0e2
@ -964,7 +964,6 @@ begin
|
|||||||
|
|
||||||
Widget := {%H-}PGtkWidget(AWinControl.Handle);
|
Widget := {%H-}PGtkWidget(AWinControl.Handle);
|
||||||
LblWidget := (pGtkBin(Widget)^.Child);
|
LblWidget := (pGtkBin(Widget)^.Child);
|
||||||
|
|
||||||
if LblWidget <> nil then
|
if LblWidget <> nil then
|
||||||
begin
|
begin
|
||||||
Gtk2WidgetSet.SetWidgetFont(LblWidget, AFont);
|
Gtk2WidgetSet.SetWidgetFont(LblWidget, AFont);
|
||||||
@ -977,6 +976,7 @@ class procedure TGtk2WSCustomCheckBox.SetText(const AWinControl: TWinControl;
|
|||||||
const AText: String);
|
const AText: String);
|
||||||
var
|
var
|
||||||
BoxWidget: PGtkWidget;
|
BoxWidget: PGtkWidget;
|
||||||
|
B: Boolean;
|
||||||
begin
|
begin
|
||||||
if not WSCheckHandleAllocated(AWincontrol, 'SetText') then Exit;
|
if not WSCheckHandleAllocated(AWincontrol, 'SetText') then Exit;
|
||||||
BoxWidget := {%H-}PGtkWidget(AWinControl.Handle);
|
BoxWidget := {%H-}PGtkWidget(AWinControl.Handle);
|
||||||
@ -986,9 +986,15 @@ begin
|
|||||||
gtk_widget_hide(PGtkBin(BoxWidget)^.child);
|
gtk_widget_hide(PGtkBin(BoxWidget)^.child);
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
|
B := gtk_label_get_text(PGtkLabel(PGtkBin(BoxWidget)^.child)) = '';
|
||||||
gtk_widget_show(PGtkBin(BoxWidget)^.child);
|
gtk_widget_show(PGtkBin(BoxWidget)^.child);
|
||||||
gtk_button_set_label(PGtkButton(BoxWidget), PChar(Ampersands2Underscore(AText)));
|
gtk_button_set_label(PGtkButton(BoxWidget), PChar(Ampersands2Underscore(AText)));
|
||||||
gtk_button_set_use_underline(PGtkButton(BoxWidget), True);
|
gtk_button_set_use_underline(PGtkButton(BoxWidget), True);
|
||||||
|
if B then
|
||||||
|
begin
|
||||||
|
SetColor(AWinControl);
|
||||||
|
SetFont(AWinControl, AWinControl.Font);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user