From 6871f7d16945d6687f474c5ae2edf1783fa5f772 Mon Sep 17 00:00:00 2001 From: compudj Date: Tue, 7 Feb 2006 06:57:02 +0000 Subject: [PATCH] fix tree vertical separator git-svn-id: http://ltt.polymtl.ca/svn@1516 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/ChangeLog | 2 ++ ltt/branches/poly/configure.in | 2 +- .../lttv/modules/gui/controlflow/processlist.c | 11 +++++++++-- .../lttv/modules/gui/controlflow/processlist.h | 15 ++++++++++----- .../poly/lttv/modules/gui/detailedevents/events.c | 8 ++++++++ 5 files changed, 30 insertions(+), 8 deletions(-) diff --git a/ltt/branches/poly/ChangeLog b/ltt/branches/poly/ChangeLog index e0205719..3f920be7 100644 --- a/ltt/branches/poly/ChangeLog +++ b/ltt/branches/poly/ChangeLog @@ -1,5 +1,7 @@ LinuxTraceToolkit ChangeLog +06/02/2006 LTTV 0.8.11 + Fix GtkTreeView using "vertical-separator" style property. 06/02/2006 LTTV 0.8.10 Now handle correctly events with a 0xFFFF size (dynamically). Make lttd multithreaded. diff --git a/ltt/branches/poly/configure.in b/ltt/branches/poly/configure.in index a7aa9214..94ff42e4 100644 --- a/ltt/branches/poly/configure.in +++ b/ltt/branches/poly/configure.in @@ -23,7 +23,7 @@ AC_PREREQ(2.57) AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) #AC_WITH_LTDL # not needed ? -AM_INIT_AUTOMAKE(LinuxTraceToolkitViewer,0.8.10-06022006) +AM_INIT_AUTOMAKE(LinuxTraceToolkitViewer,0.8.11-06022006) AM_CONFIG_HEADER(config.h) AM_PROG_LIBTOOL diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c index ce4c0926..d231055d 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c @@ -21,6 +21,7 @@ #endif #include +#include #include #include #include @@ -366,6 +367,10 @@ ProcessList *processlist_construct(void) renderer = gtk_cell_renderer_text_new (); process_list->renderer = renderer; + gint vertical_separator; + gtk_widget_style_get (GTK_WIDGET (process_list->process_list_widget), + "vertical-separator", &vertical_separator, + NULL); gtk_cell_renderer_get_size(renderer, GTK_WIDGET(process_list->process_list_widget), NULL, @@ -373,12 +378,14 @@ ProcessList *processlist_construct(void) NULL, NULL, &process_list->cell_height); - + guint ypad; g_object_get(G_OBJECT(renderer), "ypad", &ypad, NULL); process_list->cell_height += ypad; - + process_list->cell_height += vertical_separator; + + column = gtk_tree_view_column_new_with_attributes ( "Process", renderer, "text", diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.h b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.h index 1e5f6e11..b2a6435a 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.h +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.h @@ -171,14 +171,20 @@ void copy_pixmap_to_screen(ProcessList *process_list, gint width, gint height); -static inline gint get_cell_height(ProcessList *process_list, - GtkTreeView *TreeView) +static inline gint get_cell_height(GtkTreeView *TreeView) { gint height; GtkTreeViewColumn *column = gtk_tree_view_get_column(TreeView, 0); gtk_tree_view_column_cell_get_size(column, NULL, NULL, NULL, NULL, &height); - + + gint vertical_separator; + gtk_widget_style_get (GTK_WIDGET (TreeView), + "vertical-separator", &vertical_separator, + NULL); + + height += vertical_separator; + return height; } @@ -220,8 +226,7 @@ static inline gint processlist_get_pixels_from_data( ProcessList *process_list, &hashed_process_data->y_iter); path_indices = gtk_tree_path_get_indices (tree_path); - *height = get_cell_height(process_list, - (GtkTreeView*)process_list->process_list_widget); + *height = get_cell_height((GtkTreeView*)process_list->process_list_widget); *y = *height * path_indices[0]; gtk_tree_path_free(tree_path); diff --git a/ltt/branches/poly/lttv/modules/gui/detailedevents/events.c b/ltt/branches/poly/lttv/modules/gui/detailedevents/events.c index 31ae4eb8..8a05d9c4 100644 --- a/ltt/branches/poly/lttv/modules/gui/detailedevents/events.c +++ b/ltt/branches/poly/lttv/modules/gui/detailedevents/events.c @@ -1077,6 +1077,14 @@ static __inline gint get_cell_height(GtkTreeView *TreeView) gtk_tree_view_column_cell_get_size(column, NULL, NULL, NULL, NULL, &height); + + gint vertical_separator; + gtk_widget_style_get (GTK_WIDGET (TreeView), + "vertical-separator", &vertical_separator, + NULL); + + height += vertical_separator; + return height; } -- 2.34.1