mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 17:00:57 +02:00
improve gtk2 themed header drawing (used in THeaderControl, build lazarus dialog is nicer now)
git-svn-id: trunk@12921 -
This commit is contained in:
parent
0dd71dc759
commit
20cd4d14f7
@ -8206,6 +8206,7 @@ begin
|
||||
If CompareText(WName,LazGtkStyleNames[lgsTreeView])=0 then begin
|
||||
lgs:=lgsTreeView;
|
||||
StyleObject^.Widget := gtk_tree_view_new;
|
||||
gtk_tree_view_append_column(PGtkTreeView(StyleObject^.Widget), gtk_tree_view_column_new);
|
||||
end
|
||||
{$endif}
|
||||
else
|
||||
@ -8281,9 +8282,9 @@ begin
|
||||
end
|
||||
else
|
||||
{$endif}
|
||||
if lgs=lgsToolButton then
|
||||
if lgs = lgsToolButton then
|
||||
begin
|
||||
/// already on a toolbar => nothing to do
|
||||
// already on a parent => nothing to do
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
@ -26,6 +26,20 @@ type
|
||||
|
||||
implementation
|
||||
|
||||
function GetColumnButtonFromTreeView(AWidget: PGtkWidget): PGtkWidget;
|
||||
var
|
||||
AColumn: PGtkTreeViewColumn;
|
||||
begin
|
||||
Result := nil;
|
||||
if not GTK_IS_TREE_VIEW(AWidget) then
|
||||
exit;
|
||||
|
||||
AColumn := gtk_tree_view_get_column(PGtkTreeView(AWidget), 0);
|
||||
if AColumn = nil then
|
||||
Exit;
|
||||
Result := AColumn^.button;
|
||||
end;
|
||||
|
||||
{ TGtk2ThemeServices }
|
||||
|
||||
function TGtk2ThemeServices.GetGtkStyleParams(DC: HDC;
|
||||
@ -38,7 +52,9 @@ begin
|
||||
case Details.Element of
|
||||
teHeader:
|
||||
begin
|
||||
Result.Widget := GetStyleWidget(lgsTreeView);
|
||||
Result.Widget := GetColumnButtonFromTreeView(GetStyleWidget(lgsTreeView));
|
||||
if Result.Widget = nil then
|
||||
Result.Widget := GetStyleWidget(lgsTreeView);
|
||||
Result.State := GtkButtonMap[Details.State];
|
||||
if Details.State = PBS_PRESSED then
|
||||
Result.Shadow := GTK_SHADOW_IN
|
||||
@ -47,7 +63,7 @@ begin
|
||||
|
||||
Result.IsHot:= Result.State = GTK_STATE_PRELIGHT;
|
||||
|
||||
Result.Detail := 'treeview';
|
||||
Result.Detail := 'button';
|
||||
Result.Painter := gptBox;
|
||||
end;
|
||||
teRebar:
|
||||
|
Loading…
Reference in New Issue
Block a user