@b4n commented on this pull request.

I propose a few small fixes in 148fa9f. If you're OK with them (as I just amended the commit they are in your name), I'll merge that.

A better solution would be to update the items sensitivity in reaction to selection changes (e.g. enable them whenever they can work, disable them when they can't). That could also fix the statusbar items sensitivity. But unfortunately it's tricky because those need to work on a wide range of widgets, not only the main editing area, but also all entry and text fields. So your proposal looks reasonable enough to me.


In data/geany.glade:

> @@ -6321,6 +6321,7 @@
               <object class="GtkMenuBar" id="menubar1">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <signal name="deactivate" handler="on_menubar1_deactivate" after="yes" swapped="no"/>

Sad we can't really connect something on the menu item next to the "activate" signal. We could use "deselect", but I'm not sure is really correct.


In src/ui_utils.h:

> @@ -299,6 +299,8 @@ void ui_update_popup_goto_items(gboolean enable);
 
 void ui_update_menu_copy_items(GeanyDocument *doc);
 
+void ui_restore_menu_copy_items();

argument list should be (void) for a proper prototype


In src/ui_utils.c:

> @@ -533,9 +541,13 @@ void ui_update_menu_copy_items(GeanyDocument *doc)
 		enable = gtk_text_buffer_get_selection_bounds(buffer, NULL, NULL);
 	}
 
-	len = G_N_ELEMENTS(widgets.menu_copy_items);
-	for (i = 0; i < len; i++)
-		ui_widget_set_sensitive(widgets.menu_copy_items[i], enable);
+	set_menu_copy_items_sensitive(enable);
+}
+
+
+void ui_restore_menu_copy_items()

This function indirection doesn't add clarity to me, so I'd rather expose the set_sensitive() part directly.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.