diff options
author | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2016-03-29 16:38:51 -0300 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2018-03-22 22:34:20 +0100 |
commit | 73099351c4adbf1b83a8548372d6fbeb44e3e946 (patch) | |
tree | b483b55245e83524b4aeab8201df3d0b36b9f24d | |
parent | b66f0069a542173960b13ad89a3152fcac05c6e2 (diff) | |
download | nautilus-73099351c4adbf1b83a8548372d6fbeb44e3e946.tar.gz |
action-bar: review elements
-rw-r--r-- | src/nautilus-action-bar.c | 174 | ||||
-rw-r--r-- | src/nautilus-canvas-view.c | 7 | ||||
-rw-r--r-- | src/resources/ui/nautilus-action-bar.ui | 427 |
3 files changed, 225 insertions, 383 deletions
diff --git a/src/nautilus-action-bar.c b/src/nautilus-action-bar.c index 6a664c9cb..0450e1935 100644 --- a/src/nautilus-action-bar.c +++ b/src/nautilus-action-bar.c @@ -31,17 +31,13 @@ struct _NautilusActionBar { GtkFrame parent; - GtkWidget *file_name_label; - GtkWidget *file_size_label; GtkWidget *loading_label; - GtkWidget *multi_selection_label; GtkWidget *paste_button; - GtkWidget *preview_button; - GtkWidget *preview_icon; + GtkWidget *primary_label; + GtkWidget *secondary_label; GtkWidget *stack; NautilusView *view; - gboolean show_thumbnail; gint update_status_timeout_id; }; @@ -49,7 +45,6 @@ G_DEFINE_TYPE (NautilusActionBar, nautilus_action_bar, GTK_TYPE_FRAME) enum { PROP_0, - PROP_SHOW_THUMBNAIL, PROP_VIEW, N_PROPS }; @@ -97,8 +92,6 @@ update_paste_button (NautilusActionBar *self) monitor = nautilus_clipboard_monitor_get (); info = nautilus_clipboard_monitor_get_clipboard_info (monitor); - gtk_widget_set_visible (self->paste_button, info != NULL); - if (info) { gchar *label; @@ -111,7 +104,7 @@ update_paste_button (NautilusActionBar *self) else label = g_strdup_printf (g_dngettext(NULL, "Paste %d file", "Paste %d files", length), length); - gtk_button_set_label (GTK_BUTTON (self->paste_button), label); + gtk_widget_set_tooltip_text (self->paste_button, label); g_free (label); } @@ -134,7 +127,8 @@ setup_multiple_files_selection (NautilusActionBar *actionbar, char *non_folder_item_count_str; char *folder_count_str; char *folder_item_count_str; - char *status; + gchar *primary_text; + gchar *secondary_text; folder_item_count_known = TRUE; folder_count = 0; @@ -263,102 +257,48 @@ setup_multiple_files_selection (NautilusActionBar *actionbar, if (folder_count == 0 && non_folder_count == 0) { - status = NULL; + primary_text = secondary_text = NULL; } else if (folder_count == 0) { - status = g_strdup_printf ("%s, %s", non_folder_count_str, non_folder_item_count_str); + primary_text = g_strdup_printf ("%s, %s", non_folder_count_str, non_folder_item_count_str); + secondary_text = NULL; } else if (non_folder_count == 0) { - status = g_strdup_printf ("%s %s", folder_count_str, folder_item_count_str); + primary_text = g_strdup_printf ("%s %s", folder_count_str, folder_item_count_str); + secondary_text = NULL; + } + else + { + primary_text = g_strdup_printf ("%s %s", folder_count_str, folder_item_count_str); + secondary_text = g_strdup_printf ("%s, %s", non_folder_count_str, non_folder_item_count_str); } - else { - /* This is marked for translation in case a localizer - * needs to change ", " to something else. The comma - * is between the message about the number of folders - * and the number of items in those folders and the - * message about the number of other items and the - * total size of those items. - */ - status = g_strdup_printf (_("%s %s, %s %s"), - folder_count_str, - folder_item_count_str, - non_folder_count_str, - non_folder_item_count_str); - } - gtk_label_set_label (GTK_LABEL (actionbar->multi_selection_label), status); - gtk_stack_set_visible_child_name (GTK_STACK (actionbar->stack), "multi-selection"); + gtk_label_set_label (GTK_LABEL (actionbar->primary_label), primary_text ? primary_text : ""); + gtk_label_set_label (GTK_LABEL (actionbar->secondary_label), secondary_text ? secondary_text : ""); g_free (first_item_name); g_free (folder_count_str); g_free (folder_item_count_str); g_free (non_folder_count_str); g_free (non_folder_item_count_str); - g_free (status); + g_free (secondary_text); + g_free (primary_text); } static void setup_single_file_selection (NautilusActionBar *actionbar, NautilusFile *file) { - gboolean is_directory, sensitive; - gchar *thumbnail_path; + gboolean is_directory; gchar *description; description = NULL; is_directory = nautilus_file_is_directory (file); - /* Setup the thumbnail icon */ - thumbnail_path = nautilus_file_get_thumbnail_path (file); - - if (thumbnail_path && actionbar->show_thumbnail) - { - GtkStyleContext *context; - GdkPixbuf *thumbnail; - gint border_top, border_bottom; - gint height; - - context = gtk_widget_get_style_context (actionbar->preview_button); - - gtk_style_context_get (context, - gtk_style_context_get_state (context), - "border-top-width", &border_top, - "border-bottom-width", &border_bottom, - NULL); - - sensitive = TRUE; - height = gtk_widget_get_allocated_height (actionbar->preview_button) - border_top - border_bottom; - thumbnail = gdk_pixbuf_new_from_file_at_size (thumbnail_path, - -1, - height, - NULL); - - gtk_image_set_from_pixbuf (GTK_IMAGE (actionbar->preview_icon), thumbnail); - gtk_widget_set_margin_start (actionbar->preview_button, 0); - - g_clear_object (&thumbnail); - } - else - { - GIcon *icon; - - sensitive = FALSE; - icon = nautilus_file_get_gicon (file, 0); - - gtk_image_set_from_gicon (GTK_IMAGE (actionbar->preview_icon), icon, GTK_ICON_SIZE_DND); - gtk_widget_set_margin_start (actionbar->preview_button, 6); - - g_clear_object (&icon); - } - - - /* We don't want to preview folders */ - gtk_widget_set_sensitive (actionbar->preview_button, sensitive && !is_directory); - /* Primary label is the file name */ - gtk_label_set_label (GTK_LABEL (actionbar->file_name_label), nautilus_file_get_display_name (file)); + gtk_label_set_label (GTK_LABEL (actionbar->primary_label), nautilus_file_get_display_name (file)); /* * If the selected item is a folder, display the number of @@ -383,10 +323,8 @@ setup_single_file_selection (NautilusActionBar *actionbar, * If there is no description available, we hide the second label so * the filename is vertically centralized against the icon. */ - gtk_widget_set_visible (actionbar->file_size_label, description != NULL); - gtk_label_set_label (GTK_LABEL (actionbar->file_size_label), description ? description : ""); - - gtk_stack_set_visible_child_name (GTK_STACK (actionbar->stack), "single-selection"); + gtk_widget_set_visible (actionbar->secondary_label, description != NULL); + gtk_label_set_label (GTK_LABEL (actionbar->secondary_label), description ? description : ""); g_clear_pointer (&description, g_free); g_clear_pointer (&file, nautilus_file_unref); @@ -413,11 +351,20 @@ real_update_status (gpointer data) number_of_files = g_list_length (selection); if (number_of_files == 0) - gtk_stack_set_visible_child_name (GTK_STACK (actionbar->stack), "normal"); + { + gtk_label_set_label (GTK_LABEL (actionbar->primary_label), ""); + gtk_label_set_label (GTK_LABEL (actionbar->secondary_label), ""); + } else if (number_of_files == 1) - setup_single_file_selection (actionbar, selection->data); + { + setup_single_file_selection (actionbar, selection->data); + } else - setup_multiple_files_selection (actionbar, selection); + { + setup_multiple_files_selection (actionbar, selection); + } + + gtk_stack_set_visible_child_name (GTK_STACK (actionbar->stack), "main"); } actionbar->update_status_timeout_id = 0; @@ -468,10 +415,6 @@ nautilus_action_bar_get_property (GObject *object, switch (prop_id) { - case PROP_SHOW_THUMBNAIL: - g_value_set_boolean (value, self->show_thumbnail); - break; - case PROP_VIEW: g_value_set_object (value, self->view); break; @@ -491,10 +434,6 @@ nautilus_action_bar_set_property (GObject *object, switch (prop_id) { - case PROP_SHOW_THUMBNAIL: - nautilus_action_bar_set_show_thumbnail (self, g_value_get_boolean (value)); - break; - case PROP_VIEW: if (g_set_object (&self->view, g_value_get_object (value))) { @@ -522,19 +461,6 @@ nautilus_action_bar_class_init (NautilusActionBarClass *klass) object_class->set_property = nautilus_action_bar_set_property; /** - * NautilusActionBar::show-thumbnail: - * - * Whether the view shows the available thumbnails. - */ - g_object_class_install_property (object_class, - PROP_SHOW_THUMBNAIL, - g_param_spec_boolean ("show-thumbnail", - "Whether the view shows thumbnails", - "Whether the view shows thumbnails or not", - TRUE, - G_PARAM_READWRITE)); - - /** * NautilusActionBar::view: * * The view related to this actionbar. @@ -549,13 +475,10 @@ nautilus_action_bar_class_init (NautilusActionBarClass *klass) gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/nautilus/ui/nautilus-action-bar.ui"); - gtk_widget_class_bind_template_child (widget_class, NautilusActionBar, file_name_label); - gtk_widget_class_bind_template_child (widget_class, NautilusActionBar, file_size_label); gtk_widget_class_bind_template_child (widget_class, NautilusActionBar, loading_label); - gtk_widget_class_bind_template_child (widget_class, NautilusActionBar, multi_selection_label); gtk_widget_class_bind_template_child (widget_class, NautilusActionBar, paste_button); - gtk_widget_class_bind_template_child (widget_class, NautilusActionBar, preview_button); - gtk_widget_class_bind_template_child (widget_class, NautilusActionBar, preview_icon); + gtk_widget_class_bind_template_child (widget_class, NautilusActionBar, primary_label); + gtk_widget_class_bind_template_child (widget_class, NautilusActionBar, secondary_label); gtk_widget_class_bind_template_child (widget_class, NautilusActionBar, stack); gtk_widget_class_bind_template_callback (widget_class, open_preview_cb); @@ -566,8 +489,6 @@ nautilus_action_bar_class_init (NautilusActionBarClass *klass) static void nautilus_action_bar_init (NautilusActionBar *self) { - self->show_thumbnail = TRUE; - gtk_widget_init_template (GTK_WIDGET (self)); #if 0 @@ -593,24 +514,3 @@ nautilus_action_bar_new (NautilusView *view) "view", view, NULL); } - -/** - * nautilus_action_bar_set_show_thumbnail: - * @actionbar: a #NautilusActionBar - * @show_thumbnail: %TRUE if it shows available thumbnails, %FALSE otherwise - * - * Sets whether @actionbar should show the thumbnail or not. - */ -void -nautilus_action_bar_set_show_thumbnail (NautilusActionBar *actionbar, - gboolean show_thumbnail) -{ - g_return_if_fail (NAUTILUS_IS_ACTION_BAR (actionbar)); - - if (actionbar->show_thumbnail != show_thumbnail) - { - actionbar->show_thumbnail = show_thumbnail; - - g_object_notify (G_OBJECT (actionbar), "show-thumbnail"); - } -} diff --git a/src/nautilus-canvas-view.c b/src/nautilus-canvas-view.c index 636d6b38d..f99ddd9a6 100644 --- a/src/nautilus-canvas-view.c +++ b/src/nautilus-canvas-view.c @@ -23,7 +23,6 @@ #include "nautilus-canvas-view.h" -#include "nautilus-action-bar.h" #include "nautilus-canvas-view-container.h" #include "nautilus-error-reporting.h" #include "nautilus-files-view-dnd.h" @@ -1608,7 +1607,6 @@ nautilus_canvas_view_init (NautilusCanvasView *canvas_view) NautilusCanvasContainer *canvas_container; GActionGroup *view_action_group; GtkClipboard *clipboard; - NautilusView *view; canvas_view->sort = &sort_criteria[0]; canvas_view->destroyed = FALSE; @@ -1658,11 +1656,6 @@ nautilus_canvas_view_init (NautilusCanvasView *canvas_view) /* Keep the action synced with the actual value, so the toolbar can poll it */ g_action_group_change_action_state (nautilus_files_view_get_action_group (NAUTILUS_FILES_VIEW (canvas_view)), "zoom-to-level", g_variant_new_int32 (get_default_zoom_level (canvas_view))); - - /* Don't show thumbnails */ - view = NAUTILUS_VIEW (canvas_view); - nautilus_action_bar_set_show_thumbnail (NAUTILUS_ACTION_BAR (nautilus_view_get_action_bar (view)), - FALSE); } NautilusFilesView * diff --git a/src/resources/ui/nautilus-action-bar.ui b/src/resources/ui/nautilus-action-bar.ui index c296f2581..6be5cf11d 100644 --- a/src/resources/ui/nautilus-action-bar.ui +++ b/src/resources/ui/nautilus-action-bar.ui @@ -3,8 +3,8 @@ <requires lib="gtk+" version="3.18"/> <template class="NautilusActionBar" parent="GtkFrame"> <property name="visible">True</property> - <property name="vexpand">False</property> <property name="can_focus">False</property> + <property name="vexpand">False</property> <child> <object class="GtkStack" id="stack"> <property name="visible">True</property> @@ -17,209 +17,147 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">center</property> - <property name="hexpand">True</property> <property name="border_width">6</property> <property name="spacing">6</property> <child> - <object class="GtkButton" id="paste_button"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="action_name">view.paste</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton"> - <property name="label" translatable="yes">New Folder…</property> + <object class="GtkBox"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="action_name">view.new-folder</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkMenuButton"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="menu_model">no-selection-menu</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="orientation">vertical</property> + <property name="valign">center</property> <child> - <object class="GtkImage"> + <object class="GtkLabel" id="primary_label"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="icon_name">view-more-symbolic</property> + <property name="vexpand">True</property> + <property name="ellipsize">end</property> + <property name="xalign">0</property> </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> </child> - <style> - <class name="image-button"/> - </style> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">2</property> - </packing> - </child> - </object> - <packing> - <property name="name">normal</property> - </packing> - </child> - <child> - <object class="GtkGrid"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="column_spacing">6</property> - <child> - <object class="GtkButton" id="preview_button"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="vexpand">True</property> - <property name="relief">none</property> - <signal name="clicked" handler="open_preview_cb" object="NautilusActionBar" swapped="yes"/> <child> - <object class="GtkImage" id="preview_icon"> + <object class="GtkLabel" id="secondary_label"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="stock">gtk-missing-image</property> + <property name="ellipsize">end</property> + <property name="xalign">0</property> + <attributes> + <attribute name="scale" value="0.86"/> + </attributes> + <style> + <class name="dim-label"/> + </style> </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> </child> - <style> - <class name="thumbnail-button"/> - </style> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - <property name="height">2</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="file_name_label"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="valign">end</property> - <property name="hexpand">True</property> - <property name="ellipsize">end</property> - <property name="xalign">0</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> </packing> </child> <child> - <object class="GtkLabel" id="file_size_label"> + <object class="GtkBox"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="valign">start</property> - <property name="xalign">0</property> + <property name="hexpand">False</property> + <property name="valign">center</property> <style> - <class name="dim-label"/> + <class name="linked"/> </style> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkButton"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="valign">center</property> - <property name="action_name">view.move-to-trash</property> <child> - <object class="GtkImage"> + <object class="GtkButton" id="cut_button"> + <property name="visible" bind-source="cut_button" bind-property="sensitive" bind-flags="default" /> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Cut item</property> + <property name="action_name">view.cut</property> + <child> + <object class="GtkImage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="icon_name">edit-cut-symbolic</property> + </object> + </child> + <style> + <class name="image-button"/> + </style> + </object> + </child> + <child> + <object class="GtkButton" id="copy_button"> + <property name="visible" bind-source="copy_button" bind-property="sensitive" bind-flags="default" /> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="icon_name">user-trash-symbolic</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Copy item</property> + <property name="action_name">view.copy</property> + <child> + <object class="GtkImage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="icon_name">edit-copy-symbolic</property> + </object> + </child> + <style> + <class name="image-button"/> + </style> + </object> + </child> + <child> + <object class="GtkButton" id="paste_button"> + <property name="visible" bind-source="paste_button" bind-property="sensitive" bind-flags="default" /> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="action_name">view.paste</property> + <child> + <object class="GtkImage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="icon_name">edit-paste-symbolic</property> + </object> + </child> + <style> + <class name="image-button"/> + </style> + </object> + </child> + <child> + <object class="GtkButton" id="trash_button"> + <property name="visible" bind-source="trash_button" bind-property="sensitive" bind-flags="default" /> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Move to trash</property> + <property name="action_name">view.move-to-trash</property> + <child> + <object class="GtkImage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="icon_name">user-trash-symbolic</property> + </object> + </child> + <style> + <class name="image-button"/> + </style> </object> </child> - </object> - <packing> - <property name="left_attach">2</property> - <property name="top_attach">0</property> - <property name="height">2</property> - </packing> - </child> - <child> - <object class="GtkButton"> - <property name="label" translatable="yes">Move To…</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="valign">center</property> - <property name="action_name">view.move-to</property> - </object> - <packing> - <property name="left_attach">3</property> - <property name="top_attach">0</property> - <property name="height">2</property> - </packing> - </child> - <child> - <object class="GtkButton"> - <property name="label" translatable="yes">Open</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="valign">center</property> - <property name="margin_end">6</property> - <property name="action_name">view.open-with-default-application</property> - <style> - <class name="suggested-action"/> - </style> - </object> - <packing> - <property name="left_attach">4</property> - <property name="top_attach">0</property> - <property name="height">2</property> - </packing> - </child> - </object> - <packing> - <property name="name">single-selection</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkBox"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="valign">center</property> - <property name="hexpand">True</property> - <property name="border_width">6</property> - <property name="spacing">6</property> - <child> - <object class="GtkLabel" id="multi_selection_label"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="ellipsize">end</property> - <property name="lines">2</property> - <property name="xalign">0</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">0</property> + <property name="pack_type">end</property> + <property name="position">4</property> </packing> </child> <child> @@ -227,7 +165,8 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> - <property name="menu-model">multi-selection-menu</property> + <property name="menu_model">selection-menu</property> + <property name="valign">center</property> <child> <object class="GtkImage"> <property name="visible">True</property> @@ -243,79 +182,82 @@ <property name="expand">False</property> <property name="fill">True</property> <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton"> - <property name="label" translatable="yes">New Folder With Selection…</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="action_name">view.new-folder-with-selection</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> <property name="position">1</property> </packing> </child> <child> - <object class="GtkButton"> - <property name="label" translatable="yes">Move To…</property> + <object class="GtkBox"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="action_name">view.move-to</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">2</property> - </packing> - </child> - <child> - <object class="GtkButton"> - <property name="label" translatable="yes">Copy To…</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="action_name">view.copy-to</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">3</property> - </packing> - </child> - <child> - <object class="GtkButton"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="action_name">view.move-to-trash</property> + <property name="can_focus">False</property> + <property name="spacing">6</property> + <property name="valign">center</property> <child> - <object class="GtkImage"> + <object class="GtkButton" id="rename_button"> + <property name="visible" bind-source="rename_button" bind-property="sensitive" bind-flags="default" /> + <property name="label" translatable="yes">Rename</property> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="icon_name">user-trash-symbolic</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Rename the selected file</property> + <property name="action_name">view.rename</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + <child> + <object class="GtkButton"> + <property name="visible">True</property> + <property name="label" translatable="yes">Open</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Open the selected items</property> + <property name="action_name">view.open-with-default-application</property> + <style> + <class name="suggested-action"/> + </style> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + <child> + <object class="GtkButton"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Create a new folder</property> + <property name="action_name">view.new-folder</property> + <child> + <object class="GtkImage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="icon_name">folder-new-symbolic</property> + </object> + </child> + <style> + <class name="image-button"/> + </style> </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> </child> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> <property name="pack_type">end</property> - <property name="position">4</property> + <property name="position">2</property> </packing> </child> </object> <packing> - <property name="name">multi-selection</property> - <property name="position">2</property> + <property name="name">main</property> </packing> </child> <child> @@ -325,6 +267,7 @@ <property name="valign">center</property> <property name="border_width">6</property> <property name="spacing">6</property> + <property name="valign">center</property> <child> <object class="GtkSpinner"> <property name="visible">True</property> @@ -373,21 +316,13 @@ </object> <packing> <property name="name">loading</property> - <property name="position">3</property> + <property name="position">1</property> </packing> </child> </object> </child> </template> - <menu id="no-selection-menu"> - <section> - <item> - <attribute name="label" translatable="yes">Properties</attribute> - <attribute name="action">view.properties</attribute> - </item> - </section> - </menu> - <menu id="multi-selection-menu"> + <menu id="selection-menu"> <section> <item> <attribute name="label" translatable="yes">Open in New Window</attribute> @@ -400,6 +335,20 @@ </section> <section> <item> + <attribute name="label" translatable="yes">Copy To…</attribute> + <attribute name="action">view.copy-to</attribute> + </item> + <item> + <attribute name="label" translatable="yes">Move To…</attribute> + <attribute name="action">view.move-to</attribute> + </item> + <item> + <attribute name="label" translatable="yes">New Folder With Selection…</attribute> + <attribute name="action">view.new-folder-with-selection</attribute> + </item> + </section> + <section> + <item> <attribute name="label" translatable="yes">Properties</attribute> <attribute name="action">view.properties</attribute> </item> |