Skip to content

Commit

Permalink
Add ellipsis to menu items requiring further user input
Browse files Browse the repository at this point in the history
This is a very common paradigm used by GNOME, KDE, MacOSX, Windows,
etc., and following it makes our UI more consistent with these and
easier to use by their users.

https://developer.gnome.org/hig-book/stable/menus-design.html.en#menu-item-type-command

Closes #3613494.
  • Loading branch information
b4n committed May 19, 2013
1 parent 4807ba6 commit 9652a34
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 31 deletions.
66 changes: 47 additions & 19 deletions data/geany.glade
Expand Up @@ -458,6 +458,30 @@
<property name="stock">gtk-select-color</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-open</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-save-as</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-print</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-find</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image4060">
<property name="visible">True</property>
<property name="can_focus">False</property>
Expand Down Expand Up @@ -7346,12 +7370,13 @@
</child>
<child>
<object class="GtkImageMenuItem" id="menu_open1">
<property name="label">gtk-open</property>
<property name="label" translatable="yes">_Open...</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<property name="image">image3</property>
<property name="use_stock">False</property>
<signal name="activate" handler="on_open1_activate" swapped="no"/>
</object>
</child>
Expand Down Expand Up @@ -7393,12 +7418,13 @@
</child>
<child>
<object class="GtkImageMenuItem" id="menu_save_as1">
<property name="label">gtk-save-as</property>
<property name="label" translatable="yes">Save _As...</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<property name="image">image4</property>
<property name="use_stock">False</property>
<signal name="activate" handler="on_save_as1_activate" swapped="no"/>
</object>
</child>
Expand Down Expand Up @@ -7485,12 +7511,13 @@
</child>
<child>
<object class="GtkImageMenuItem" id="print1">
<property name="label">gtk-print</property>
<property name="label" translatable="yes">_Print...</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<property name="image">image5</property>
<property name="use_stock">False</property>
<signal name="activate" handler="on_print1_activate" swapped="no"/>
</object>
</child>
Expand Down Expand Up @@ -8119,12 +8146,13 @@
<property name="can_focus">False</property>
<child>
<object class="GtkImageMenuItem" id="find1">
<property name="label">gtk-find</property>
<property name="label" translatable="yes">_Find...</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<property name="image">image6</property>
<property name="use_stock">False</property>
<signal name="activate" handler="on_find1_activate" swapped="no"/>
</object>
</child>
Expand Down Expand Up @@ -8156,7 +8184,7 @@
</child>
<child>
<object class="GtkImageMenuItem" id="find_in_files1">
<property name="label" translatable="yes">Find in F_iles</property>
<property name="label" translatable="yes">Find in F_iles...</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
Expand All @@ -8168,7 +8196,7 @@
</child>
<child>
<object class="GtkImageMenuItem" id="replace1">
<property name="label" translatable="yes">_Replace</property>
<property name="label" translatable="yes">_Replace...</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
Expand Down Expand Up @@ -8242,7 +8270,7 @@
</child>
<child>
<object class="GtkImageMenuItem" id="go_to_line1">
<property name="label" translatable="yes">_Go to Line</property>
<property name="label" translatable="yes">_Go to Line...</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
Expand Down Expand Up @@ -8370,7 +8398,7 @@
<property name="can_focus">False</property>
<child>
<object class="GtkImageMenuItem" id="menu_change_font1">
<property name="label" translatable="yes">Change _Font</property>
<property name="label" translatable="yes">Change _Font...</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
Expand All @@ -8382,7 +8410,7 @@
</child>
<child>
<object class="GtkImageMenuItem" id="menu_color_schemes">
<property name="label" translatable="yes">Change _Color Scheme</property>
<property name="label" translatable="yes">Change _Color Scheme...</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
Expand Down Expand Up @@ -8940,7 +8968,7 @@
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Replace Spaces b_y Tabs</property>
<property name="label" translatable="yes">Replace Spaces b_y Tabs...</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_replace_spaces_activate" swapped="no"/>
</object>
Expand Down Expand Up @@ -9014,7 +9042,7 @@
<property name="can_focus">False</property>
<child>
<object class="GtkImageMenuItem" id="project_new1">
<property name="label" translatable="yes">_New</property>
<property name="label" translatable="yes">_New...</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
Expand All @@ -9026,7 +9054,7 @@
</child>
<child>
<object class="GtkImageMenuItem" id="project_open1">
<property name="label" translatable="yes">_Open</property>
<property name="label" translatable="yes">_Open...</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
Expand Down Expand Up @@ -9170,7 +9198,7 @@
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Load Ta_gs</property>
<property name="label" translatable="yes">Load Ta_gs...</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_load_tags1_activate" swapped="no"/>
</object>
Expand Down Expand Up @@ -9253,7 +9281,7 @@
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Report a _Bug</property>
<property name="label" translatable="yes">Report a _Bug...</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_help_menu_item_bug_report_activate" swapped="no"/>
</object>
Expand All @@ -9263,7 +9291,7 @@
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Donate</property>
<property name="label" translatable="yes">_Donate...</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_help_menu_item_donate_activate" swapped="no"/>
</object>
Expand Down
6 changes: 3 additions & 3 deletions plugins/classbuilder.c
Expand Up @@ -1094,13 +1094,13 @@ void plugin_init(GeanyData *data)
menu_create_class1_menu = gtk_menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_create_class1), menu_create_class1_menu);

menu_create_cpp_class = gtk_menu_item_new_with_mnemonic (_("_C++ Class"));
menu_create_cpp_class = gtk_menu_item_new_with_mnemonic (_("_C++ Class..."));
gtk_container_add (GTK_CONTAINER (menu_create_class1_menu), menu_create_cpp_class);

menu_create_gtk_class = gtk_menu_item_new_with_mnemonic (_("_GTK+ Class"));
menu_create_gtk_class = gtk_menu_item_new_with_mnemonic (_("_GTK+ Class..."));
gtk_container_add (GTK_CONTAINER (menu_create_class1_menu), menu_create_gtk_class);

menu_create_php_class = gtk_menu_item_new_with_mnemonic (_("_PHP Class"));
menu_create_php_class = gtk_menu_item_new_with_mnemonic (_("_PHP Class..."));
gtk_container_add (GTK_CONTAINER (menu_create_class1_menu), menu_create_php_class);

g_signal_connect(menu_create_cpp_class, "activate",
Expand Down
4 changes: 2 additions & 2 deletions plugins/export.c
Expand Up @@ -784,13 +784,13 @@ void plugin_init(GeanyData *data)
gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_export), menu_export_menu);

/* HTML */
menu_create_html = gtk_menu_item_new_with_mnemonic(_("As _HTML"));
menu_create_html = gtk_menu_item_new_with_mnemonic(_("As _HTML..."));
gtk_container_add(GTK_CONTAINER (menu_export_menu), menu_create_html);

g_signal_connect(menu_create_html, "activate", G_CALLBACK(on_menu_create_html_activate), NULL);

/* LaTeX */
menu_create_latex = gtk_menu_item_new_with_mnemonic(_("As _LaTeX"));
menu_create_latex = gtk_menu_item_new_with_mnemonic(_("As _LaTeX..."));
gtk_container_add(GTK_CONTAINER (menu_export_menu), menu_create_latex);

g_signal_connect(menu_create_latex, "activate",
Expand Down
2 changes: 1 addition & 1 deletion plugins/filebrowser.c
Expand Up @@ -627,7 +627,7 @@ static GtkWidget *create_popup_menu(void)
gtk_container_add(GTK_CONTAINER(menu), item);
g_signal_connect(item, "activate", G_CALLBACK(refresh), NULL);

item = ui_image_menu_item_new(GTK_STOCK_FIND, _("_Find in Files"));
item = ui_image_menu_item_new(GTK_STOCK_FIND, _("_Find in Files..."));
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item);
g_signal_connect(item, "activate", G_CALLBACK(on_find_in_files), NULL);
Expand Down
2 changes: 1 addition & 1 deletion plugins/htmlchars.c
Expand Up @@ -736,7 +736,7 @@ static void init_configuration(void)
void plugin_init(GeanyData *data)
{
GtkWidget *menu_item;
const gchar *menu_text = _("_Insert Special HTML Characters");
const gchar *menu_text = _("_Insert Special HTML Characters...");

/* First we catch the configuration and initialize them */
init_configuration();
Expand Down
6 changes: 3 additions & 3 deletions src/build.c
Expand Up @@ -2601,7 +2601,7 @@ void build_load_menu(GKeyFile *config, GeanyBuildSource src, gpointer p)
{
if (non_ft_pref == NULL)
non_ft_pref = g_new0(GeanyBuildCommand, build_groups_count[GEANY_GBG_NON_FT]);
ASSIGNIF(non_ft_pref, GEANY_GBO_CUSTOM, _("Make Custom _Target"),
ASSIGNIF(non_ft_pref, GEANY_GBO_CUSTOM, _("Make Custom _Target..."),
g_strdup_printf("%s ", value));
ASSIGNIF(non_ft_pref, GEANY_GBO_MAKE_OBJECT, _("Make _Object"),
g_strdup_printf("%s %%e.o",value));
Expand Down Expand Up @@ -2792,7 +2792,7 @@ static struct
gint index;
} default_cmds[] = {
{ N_("_Make"), "make", NULL, &non_ft_def, GBO_TO_CMD(GEANY_GBO_MAKE_ALL)},
{ N_("Make Custom _Target"), "make ", NULL, &non_ft_def, GBO_TO_CMD(GEANY_GBO_CUSTOM)},
{ N_("Make Custom _Target..."), "make ", NULL, &non_ft_def, GBO_TO_CMD(GEANY_GBO_CUSTOM)},
{ N_("Make _Object"), "make %e.o", NULL, &non_ft_def, GBO_TO_CMD(GEANY_GBO_MAKE_OBJECT)},
{ N_("_Execute"), "./%e", NULL, &exec_def, GBO_TO_CMD(GEANY_GBO_EXEC)},
{ NULL, NULL, NULL, NULL, 0 }
Expand Down Expand Up @@ -2846,7 +2846,7 @@ void build_init(void)
widgets.toolitem_make_all = item;

/* build the code with make custom */
item = gtk_image_menu_item_new_with_mnemonic(_("Make Custom _Target"));
item = gtk_image_menu_item_new_with_mnemonic(_("Make Custom _Target..."));
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(toolmenu), item);
g_signal_connect(item, "activate", G_CALLBACK(on_toolbutton_make_activate),
Expand Down
2 changes: 1 addition & 1 deletion src/sidebar.c
Expand Up @@ -715,7 +715,7 @@ static void create_openfiles_popup_menu(void)
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(openfiles_popup_menu), item);

item = ui_image_menu_item_new(GTK_STOCK_FIND, _("_Find in Files"));
item = ui_image_menu_item_new(GTK_STOCK_FIND, _("_Find in Files..."));
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(openfiles_popup_menu), item);
g_signal_connect(item, "activate", G_CALLBACK(on_find_in_files), NULL);
Expand Down
2 changes: 1 addition & 1 deletion src/symbols.c
Expand Up @@ -2394,7 +2394,7 @@ static void create_taglist_popup_menu(void)
gtk_container_add(GTK_CONTAINER(menu), item);
g_signal_connect(item, "activate", G_CALLBACK(on_find_usage), symbol_menu.find_doc_usage);

symbol_menu.find_in_files = item = ui_image_menu_item_new(GTK_STOCK_FIND, _("Find in F_iles"));
symbol_menu.find_in_files = item = ui_image_menu_item_new(GTK_STOCK_FIND, _("Find in F_iles..."));
gtk_widget_show(item);
gtk_container_add(GTK_CONTAINER(menu), item);
g_signal_connect(item, "activate", G_CALLBACK(on_find_usage), NULL);
Expand Down

0 comments on commit 9652a34

Please sign in to comment.