diff --git a/lcl/interfaces/gtk2/gtk2wscomctrls.pp b/lcl/interfaces/gtk2/gtk2wscomctrls.pp index 68fe5be25a..3e592488b5 100644 --- a/lcl/interfaces/gtk2/gtk2wscomctrls.pp +++ b/lcl/interfaces/gtk2/gtk2wscomctrls.pp @@ -147,6 +147,7 @@ type class procedure SetAllocBy(const ALV: TCustomListView; const AValue: Integer); override; class procedure SetColor(const AWinControl: TWinControl); override; class procedure SetDefaultItemHeight(const ALV: TCustomListView; const AValue: Integer); override; + class procedure SetFont(const AWinControl: TWinControl; const AFont: TFont); override; class procedure SetHotTrackStyles(const ALV: TCustomListView; const AValue: TListHotTrackStyles); override; class procedure SetHoverTime(const ALV: TCustomListView; const AValue: Integer); override; // class procedure SetIconOptions(const ALV: TCustomListView; const AValue: TIconOptions); override; diff --git a/lcl/interfaces/gtk2/gtk2wscustomlistview.inc b/lcl/interfaces/gtk2/gtk2wscustomlistview.inc index a5d7b352dc..dd15eb4515 100644 --- a/lcl/interfaces/gtk2/gtk2wscustomlistview.inc +++ b/lcl/interfaces/gtk2/gtk2wscustomlistview.inc @@ -1815,6 +1815,22 @@ begin then Exit; end; +class procedure TGtk2WSCustomListView.SetFont(const AWinControl: TWinControl; + const AFont: TFont); +var + Widget: PGtkWidget; +begin + if not WSCheckHandleAllocated(AWinControl, 'SetFont') then + Exit; + Widget := PGtkWidget(AWinControl.Handle); + Widget := GetWidgetInfo(Widget, True)^.CoreWidget; + Gtk2WidgetSet.SetWidgetFont(Widget, AFont); + Gtk2WidgetSet.SetWidgetColor(Widget, AFont.Color, clNone, + [GTK_STATE_NORMAL,GTK_STATE_ACTIVE, + GTK_STATE_PRELIGHT,GTK_STATE_SELECTED, + GTK_STYLE_TEXT]); +end; + class procedure TGtk2WSCustomListView.SetHotTrackStyles(const ALV: TCustomListView; const AValue: TListHotTrackStyles); begin