diff options
author | Wu Xiaotian <[email protected]> | 2019-07-20 15:15:41 +0800 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-08-26 14:21:14 +0200 |
commit | 6589911b919b7ab44556c1966c5ab5befcd46688 (patch) | |
tree | 3005e762f7b2f9ec0bb5a468dba53a1aed613208 /src/caja-window.c | |
parent | 093aacfeccdb47b6b12b1978dd88243479626398 (diff) | |
download | caja-6589911b919b7ab44556c1966c5ab5befcd46688.tar.bz2 caja-6589911b919b7ab44556c1966c5ab5befcd46688.tar.xz |
hide menu and toolbutton when view is only one
Diffstat (limited to 'src/caja-window.c')
-rw-r--r-- | src/caja-window.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/caja-window.c b/src/caja-window.c index c9dc3f71..9710bb6f 100644 --- a/src/caja-window.c +++ b/src/caja-window.c @@ -1330,7 +1330,6 @@ static void load_view_as_menu (CajaWindow *window) { GList *node; - int index; guint merge_id; if (window->details->short_list_merge_id != 0) @@ -1364,19 +1363,21 @@ load_view_as_menu (CajaWindow *window) G_GNUC_END_IGNORE_DEPRECATIONS; window->details->view_as_radio_action = NULL; - /* Add a menu item for each view in the preferred list for this location. */ - /* Start on 1, because extra_viewer gets index 0 */ - for (node = window->details->short_list_viewers, index = 1; - node != NULL; - node = node->next, ++index) - { - /* Menu item in View menu. */ - /* TODO */ - add_view_as_menu_item (window, - CAJA_MENU_PATH_SHORT_LIST_PLACEHOLDER, - node->data, - index, - merge_id); + if (g_list_length (window->details->short_list_viewers) > 1) { + int index; + /* Add a menu item for each view in the preferred list for this location. */ + /* Start on 1, because extra_viewer gets index 0 */ + for (node = window->details->short_list_viewers, index = 1; + node != NULL; + node = node->next, ++index) + { + /* Menu item in View menu. */ + add_view_as_menu_item (window, + CAJA_MENU_PATH_SHORT_LIST_PLACEHOLDER, + node->data, + index, + merge_id); + } } gtk_ui_manager_insert_action_group (window->details->ui_manager, window->details->view_as_action_group, |