Revision: 2183 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=2183&view=re... Author: cesspit Date: 2011-08-28 20:12:29 +0000 (Sun, 28 Aug 2011) Log Message: ----------- debugger: small gui bugfixes
Modified Paths: -------------- trunk/geany-plugins/debugger/src/bptree.c trunk/geany-plugins/debugger/src/btnpanel.c trunk/geany-plugins/debugger/src/utils.c
Modified: trunk/geany-plugins/debugger/src/bptree.c =================================================================== --- trunk/geany-plugins/debugger/src/bptree.c 2011-08-28 16:07:34 UTC (rev 2182) +++ trunk/geany-plugins/debugger/src/bptree.c 2011-08-28 20:12:29 UTC (rev 2183) @@ -59,6 +59,7 @@ };
/* tree view and store handles */ +static GtkWidget *scrolled_window = NULL; static GtkWidget *tree = NULL; static GtkTreeModel *model = NULL; static GtkListStore *store = NULL; @@ -358,12 +359,12 @@ /* hits count */ header = _("Hit count"); hcount_renderer = gtk_cell_renderer_spin_new (); - GtkAdjustment* adj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 100000.0, 1.0, 2.0, 2.0)); - g_object_set (hcount_renderer, + GtkAdjustment* adj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 100000.0, 1.0, 2.0, 2.0)); + g_object_set (hcount_renderer, "editable", TRUE, "adjustment", adj, "digits", 0, NULL); - g_signal_connect (G_OBJECT (hcount_renderer), "edited", G_CALLBACK (on_hitscount_changed), NULL); + g_signal_connect (G_OBJECT (hcount_renderer), "edited", G_CALLBACK (on_hitscount_changed), NULL); column = create_column(header, hcount_renderer, FALSE, get_header_string_width(header, MW_HITSCOUNT, char_width), "text", HITSCOUNT); @@ -392,6 +393,13 @@ "text", LINE); gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column);
+ scrolled_window = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_show (scrolled_window); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_NONE); + + gtk_container_add (GTK_CONTAINER (scrolled_window), tree); + return TRUE; }
@@ -464,7 +472,7 @@ */ GtkWidget* bptree_get_widget() { - return tree; + return scrolled_window; }
/*
Modified: trunk/geany-plugins/debugger/src/btnpanel.c =================================================================== --- trunk/geany-plugins/debugger/src/btnpanel.c 2011-08-28 16:07:34 UTC (rev 2182) +++ trunk/geany-plugins/debugger/src/btnpanel.c 2011-08-28 20:12:29 UTC (rev 2183) @@ -257,5 +257,12 @@ gtk_widget_set_sensitive(stepoutbtn, DBS_STOPPED == state); gtk_widget_set_sensitive(runcursorbtn, DBS_STOPPED == state);
- gtk_widget_set_sensitive(loadbtn, DBS_IDLE == state); + if (DBS_IDLE == state) + { + btnpanel_on_document_activate(document_get_current()); + } + else + { + gtk_widget_set_sensitive(loadbtn, FALSE); + } }
Modified: trunk/geany-plugins/debugger/src/utils.c =================================================================== --- trunk/geany-plugins/debugger/src/utils.c 2011-08-28 16:07:34 UTC (rev 2182) +++ trunk/geany-plugins/debugger/src/utils.c 2011-08-28 20:12:29 UTC (rev 2183) @@ -64,7 +64,9 @@ */ int get_header_string_width(const gchar *header, int minchars, int char_width) { - return strlen(header) > minchars ? strlen(header) : minchars * char_width; + int header_length = strlen(header); + int width = (header_length > minchars ? header_length : minchars) * char_width; + return width; }
/*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.