mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-24 21:50:29 +01:00
Gtk2: implemented TCustomListView.GridLines for gtk2 >= 2.10, 2.8 still uses alternate coloring since there's no appropriate functions to fix it.
git-svn-id: trunk@35276 -
This commit is contained in:
parent
e52f4a0e0c
commit
3b2ff18b3e
@ -66,6 +66,8 @@ initialization
|
|||||||
if gtkhandle <> 0 then
|
if gtkhandle <> 0 then
|
||||||
begin
|
begin
|
||||||
pointer(gtk_window_set_opacity):=GetProcAddress(gtkhandle,'gtk_window_set_opacity');
|
pointer(gtk_window_set_opacity):=GetProcAddress(gtkhandle,'gtk_window_set_opacity');
|
||||||
|
pointer(gtk_tree_view_get_grid_lines):=GetProcAddress(gtkhandle,'gtk_tree_view_get_grid_lines');
|
||||||
|
pointer(gtk_tree_view_set_grid_lines):=GetProcAddress(gtkhandle,'gtk_tree_view_set_grid_lines');
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -225,11 +225,24 @@ function gtk_icon_view_get_visible_range(tree_view: PGtkTreeView; out start_path
|
|||||||
function gdk_screen_is_composited(screen: PGdkScreen): gboolean; cdecl; external gdklib;
|
function gdk_screen_is_composited(screen: PGdkScreen): gboolean; cdecl; external gdklib;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
|
type
|
||||||
|
TGtkTreeViewGridLines = cardinal;
|
||||||
|
|
||||||
|
const
|
||||||
|
GTK_TREE_VIEW_GRID_LINES_NONE = 0;
|
||||||
|
GTK_TREE_VIEW_GRID_LINES_HORIZONTAL = 1;
|
||||||
|
GTK_TREE_VIEW_GRID_LINES_VERTICAL = 2;
|
||||||
|
GTK_TREE_VIEW_GRID_LINES_BOTH = 3;
|
||||||
|
|
||||||
var
|
var
|
||||||
gtk_window_set_opacity: procedure(window: PGtkWindow; opacity: gdouble); cdecl;
|
gtk_window_set_opacity: procedure(window: PGtkWindow; opacity: gdouble); cdecl;
|
||||||
g_object_ref_sink: function(anObject: PGObject): gpointer; cdecl;
|
g_object_ref_sink: function(anObject: PGObject): gpointer; cdecl;
|
||||||
gdk_window_get_cursor: function(window: PGdkWindow): PGdkCursor; cdecl;
|
gdk_window_get_cursor: function(window: PGdkWindow): PGdkCursor; cdecl;
|
||||||
|
|
||||||
|
// since 2.10
|
||||||
|
gtk_tree_view_set_grid_lines: procedure(tree_view: PGtkTreeView; grid_lines: TGtkTreeViewGridLines); cdecl;
|
||||||
|
gtk_tree_view_get_grid_lines: function(tree_view: PGtkTreeView): TGtkTreeViewGridLines; cdecl;
|
||||||
|
|
||||||
{$ifdef ver2_2}
|
{$ifdef ver2_2}
|
||||||
{$ifdef darwin}
|
{$ifdef darwin}
|
||||||
// this linklib statement is not present in gtk2.pas
|
// this linklib statement is not present in gtk2.pas
|
||||||
|
|||||||
@ -475,7 +475,17 @@ begin
|
|||||||
// maybe possible with some cellwidget hacking
|
// maybe possible with some cellwidget hacking
|
||||||
// this create rows with alternating colors
|
// this create rows with alternating colors
|
||||||
if GTK_IS_TREE_VIEW(MainView) then
|
if GTK_IS_TREE_VIEW(MainView) then
|
||||||
gtk_tree_view_set_rules_hint(PGtkTreeView(MainView), AIsSet);
|
begin
|
||||||
|
if gtk_tree_view_set_grid_lines <> nil then
|
||||||
|
begin
|
||||||
|
if AIsSet then
|
||||||
|
gtk_tree_view_set_grid_lines(PGtkTreeView(MainView), GTK_TREE_VIEW_GRID_LINES_BOTH)
|
||||||
|
else
|
||||||
|
gtk_tree_view_set_grid_lines(PGtkTreeView(MainView), GTK_TREE_VIEW_GRID_LINES_NONE);
|
||||||
|
|
||||||
|
end else
|
||||||
|
gtk_tree_view_set_rules_hint(PGtkTreeView(MainView), AIsSet);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
lvpHideSelection: begin
|
lvpHideSelection: begin
|
||||||
// TODO: implement
|
// TODO: implement
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user