Revision: 2186 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=2186&view=re... Author: cesspit Date: 2011-08-31 19:52:27 +0000 (Wed, 31 Aug 2011) Log Message: ----------- debugger: several gui fixes
Modified Paths: -------------- trunk/geany-plugins/debugger/src/bptree.c trunk/geany-plugins/debugger/src/debug.c trunk/geany-plugins/debugger/src/stree.c trunk/geany-plugins/debugger/src/tpage.c trunk/geany-plugins/debugger/src/utils.c trunk/geany-plugins/debugger/src/vtree.c trunk/geany-plugins/debugger/src/watch_model.h
Modified: trunk/geany-plugins/debugger/src/bptree.c =================================================================== --- trunk/geany-plugins/debugger/src/bptree.c 2011-08-30 20:24:21 UTC (rev 2185) +++ trunk/geany-plugins/debugger/src/bptree.c 2011-08-31 19:52:27 UTC (rev 2186) @@ -331,7 +331,6 @@ /* set tree view properties */ gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree), 1); - gtk_tree_view_set_grid_lines (GTK_TREE_VIEW(tree), GTK_TREE_VIEW_GRID_LINES_VERTICAL); /* multiple selection */ GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)); gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
Modified: trunk/geany-plugins/debugger/src/debug.c =================================================================== --- trunk/geany-plugins/debugger/src/debug.c 2011-08-30 20:24:21 UTC (rev 2185) +++ trunk/geany-plugins/debugger/src/debug.c 2011-08-31 19:52:27 UTC (rev 2186) @@ -717,12 +717,10 @@ /* locals */ GList *locals = active_module->get_locals(); update_variables(GTK_TREE_VIEW(ltree), NULL, locals); - gtk_tree_view_columns_autosize (GTK_TREE_VIEW(ltree)); /* watches */ GList *watches = active_module->get_watches(); update_variables(GTK_TREE_VIEW(wtree), NULL, watches); - gtk_tree_view_columns_autosize (GTK_TREE_VIEW(wtree));
if (stack) { @@ -937,6 +935,7 @@ GtkWidget *scrollbar = gtk_vscrollbar_new(GTK_ADJUSTMENT(VTE_TERMINAL(terminal)->adjustment)); GTK_WIDGET_UNSET_FLAGS(scrollbar, GTK_CAN_FOCUS); GtkWidget *_frame = gtk_frame_new(NULL); + gtk_frame_set_shadow_type (GTK_FRAME(_frame), GTK_SHADOW_NONE); GtkWidget *hbox = gtk_hbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(_frame), hbox); gtk_box_pack_start(GTK_BOX(hbox), terminal, TRUE, TRUE, 0);
Modified: trunk/geany-plugins/debugger/src/stree.c =================================================================== --- trunk/geany-plugins/debugger/src/stree.c 2011-08-30 20:24:21 UTC (rev 2185) +++ trunk/geany-plugins/debugger/src/stree.c 2011-08-31 19:52:27 UTC (rev 2186) @@ -172,7 +172,6 @@ /* set tree view properties */ gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree), 1); - gtk_tree_view_set_grid_lines (GTK_TREE_VIEW(tree), GTK_TREE_VIEW_GRID_LINES_VERTICAL); g_object_set(tree, "rules-hint", TRUE, NULL);
/* connect signals */
Modified: trunk/geany-plugins/debugger/src/tpage.c =================================================================== --- trunk/geany-plugins/debugger/src/tpage.c 2011-08-30 20:24:21 UTC (rev 2185) +++ trunk/geany-plugins/debugger/src/tpage.c 2011-08-31 19:52:27 UTC (rev 2186) @@ -676,7 +676,6 @@ model = GTK_TREE_MODEL(store); envtree = gtk_tree_view_new_with_model (model); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(envtree), TRUE); - gtk_tree_view_set_grid_lines (GTK_TREE_VIEW(envtree), GTK_TREE_VIEW_GRID_LINES_VERTICAL); g_object_set(envtree, "rules-hint", TRUE, NULL); g_signal_connect(G_OBJECT(envtree), "key-press-event", G_CALLBACK (on_envtree_keypressed), NULL);
Modified: trunk/geany-plugins/debugger/src/utils.c =================================================================== --- trunk/geany-plugins/debugger/src/utils.c 2011-08-30 20:24:21 UTC (rev 2185) +++ trunk/geany-plugins/debugger/src/utils.c 2011-08-31 19:52:27 UTC (rev 2186) @@ -38,10 +38,6 @@ /* character to calculate width */ #define CHAR_TESTED "W"
-/* left / right paddings from the header text to the columns border */ -#define RENDERER_X_PADDING 5 -#define RENDERER_Y_PADDING 2 - /* * get character width in a widget */ @@ -74,14 +70,12 @@ */ GtkTreeViewColumn *create_column(const gchar *name, GtkCellRenderer *renderer, gboolean expandable, gint minwidth, const char *arg, int value) { - gtk_cell_renderer_set_padding(renderer, RENDERER_X_PADDING, RENDERER_Y_PADDING); - GtkTreeViewColumn *column = gtk_tree_view_column_new_with_attributes (name, renderer, arg, value, NULL);
if (expandable) gtk_tree_view_column_set_expand(column, expandable); - else + else if (minwidth) gtk_tree_view_column_set_min_width(column, minwidth); return column;
Modified: trunk/geany-plugins/debugger/src/vtree.c =================================================================== --- trunk/geany-plugins/debugger/src/vtree.c 2011-08-30 20:24:21 UTC (rev 2185) +++ trunk/geany-plugins/debugger/src/vtree.c 2011-08-31 19:52:27 UTC (rev 2186) @@ -34,20 +34,9 @@ #include "utils.h"
/* columns minumum width in characters */ -#define MW_NAME 20 -#define MW_VALUE 0 -#define MW_TYPE 10 +#define MIN_COLUMN_CHARS 15
/* - * on row collapsed handler - */ -void on_row_collapsed (GtkTreeView *tree_view, GtkTreeIter *iter, GtkTreePath *path, gpointer user_data) -{ - /* autosize tree view columns */ - gtk_tree_view_columns_autosize (GTK_TREE_VIEW(tree_view)); -} - -/* * key pressed event */ static gboolean on_key_pressed(GtkWidget *widget, GdkEvent *event, gpointer user_data) @@ -111,6 +100,7 @@ G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT); GtkWidget* tree = gtk_tree_view_new_with_model (GTK_TREE_MODEL(store)); @@ -118,11 +108,9 @@ /* set tree view parameters */ gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree), TRUE); gtk_tree_view_set_enable_tree_lines(GTK_TREE_VIEW(tree), TRUE); - gtk_tree_view_set_grid_lines (GTK_TREE_VIEW(tree), GTK_TREE_VIEW_GRID_LINES_VERTICAL); g_object_set(tree, "rules-hint", TRUE, NULL);
/* connect signals */ - g_signal_connect(G_OBJECT(tree), "row-collapsed", G_CALLBACK (on_row_collapsed), NULL); g_signal_connect(G_OBJECT(tree), "key-press-event", G_CALLBACK (on_key_pressed), NULL);
/* create columns */ @@ -130,14 +118,16 @@ GtkTreeViewColumn *column; const gchar *header; - int char_width = get_char_width(tree); + int min_column_with = MIN_COLUMN_CHARS * get_char_width(tree);
/* Name */ header = _("Name"); renderer = gtk_cell_renderer_text_new (); + g_object_set (renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL); column = create_column(header, renderer, FALSE, - get_header_string_width(header, MW_NAME, char_width), + min_column_with, "text", W_NAME); + gtk_tree_view_column_set_resizable (column, TRUE); if (on_render_name) gtk_tree_view_column_set_cell_data_func(column, renderer, on_render_name, NULL, NULL); if (on_expression_changed) @@ -150,20 +140,33 @@ /* Value */ header = _("Value"); renderer = gtk_cell_renderer_text_new (); + g_object_set (renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL); column = create_column(header, renderer, TRUE, - get_header_string_width(header, MW_VALUE, char_width), + min_column_with, "text", W_VALUE); gtk_tree_view_column_set_cell_data_func(column, renderer, render_value, NULL, NULL); + gtk_tree_view_column_set_resizable (column, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column);
/* Type */ header = _("Type"); renderer = gtk_cell_renderer_text_new (); + g_object_set (renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL); column = create_column(header, renderer, FALSE, - get_header_string_width(header, MW_TYPE, char_width), + min_column_with, "text", W_TYPE); + gtk_tree_view_column_set_resizable (column, TRUE); gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column);
+ /* Last invisible column */ + header = _(""); + renderer = gtk_cell_renderer_text_new (); + column = create_column(header, renderer, FALSE, + 0, + "text", W_LAST_VISIBLE); + gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column); + /* Internal (unvisible column) */ renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new_with_attributes ("Internal", renderer, "text", W_INTERNAL, NULL);
Modified: trunk/geany-plugins/debugger/src/watch_model.h =================================================================== --- trunk/geany-plugins/debugger/src/watch_model.h 2011-08-30 20:24:21 UTC (rev 2185) +++ trunk/geany-plugins/debugger/src/watch_model.h 2011-08-31 19:52:27 UTC (rev 2186) @@ -25,6 +25,7 @@ W_NAME, W_VALUE, W_TYPE, + W_LAST_VISIBLE, W_INTERNAL, W_EXPRESSION, W_STUB,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org