[nautilus/wip/oholy/compress-dialog-dropdown: 5/5] compress-dialog: Use GtkDropDown for format selection
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/oholy/compress-dialog-dropdown: 5/5] compress-dialog: Use GtkDropDown for format selection
- Date: Wed, 9 Feb 2022 16:15:18 +0000 (UTC)
commit 48664d01cc828101f094a19a54349ff4db20ee79
Author: Ondrej Holy <oholy redhat com>
Date: Mon Jan 17 15:59:13 2022 +0100
compress-dialog: Use GtkDropDown for format selection
The `system-lock-screen-symbolic` icon is misplaced in the `AdwActionRow`
widget after the GTK 4 port and there is no easy way to fix this. Let's
port the whole `GtkPopover` for format selection to `GtkDropDown` instead.
This also allows adopting the originally intended design.
Related: https://gitlab.gnome.org/GNOME/nautilus/-/issues/822
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2084
src/nautilus-compress-dialog-controller.c | 432 +++++++++++++++------------
src/resources/css/nautilus.css | 5 +-
src/resources/ui/nautilus-compress-dialog.ui | 121 +-------
3 files changed, 251 insertions(+), 307 deletions(-)
---
diff --git a/src/nautilus-compress-dialog-controller.c b/src/nautilus-compress-dialog-controller.c
index 13ac2548b..9937bebe9 100644
--- a/src/nautilus-compress-dialog-controller.c
+++ b/src/nautilus-compress-dialog-controller.c
@@ -35,20 +35,8 @@ struct _NautilusCompressDialogController
GtkWidget *activate_button;
GtkWidget *error_label;
GtkWidget *name_entry;
- GtkWidget *extension_stack;
- GtkWidget *zip_row;
- GtkWidget *zip_label;
- GtkWidget *encrypted_zip_row;
- GtkWidget *encrypted_zip_label;
- GtkWidget *tar_xz_row;
- GtkWidget *tar_xz_label;
- GtkWidget *seven_zip_row;
- GtkWidget *seven_zip_label;
- GtkWidget *extension_popover;
- GtkWidget *zip_checkmark;
- GtkWidget *encrypted_zip_checkmark;
- GtkWidget *tar_xz_checkmark;
- GtkWidget *seven_zip_checkmark;
+ GtkWidget *extension_dropdown;
+ GtkSizeGroup *extension_sizegroup;
GtkWidget *passphrase_label;
GtkWidget *passphrase_entry;
@@ -60,6 +48,57 @@ struct _NautilusCompressDialogController
G_DEFINE_TYPE (NautilusCompressDialogController, nautilus_compress_dialog_controller,
NAUTILUS_TYPE_FILE_NAME_WIDGET_CONTROLLER);
+#define NAUTILUS_TYPE_COMPRESS_ITEM (nautilus_compress_item_get_type ())
+G_DECLARE_FINAL_TYPE (NautilusCompressItem, nautilus_compress_item, NAUTILUS, COMPRESS_ITEM, GObject)
+
+struct _NautilusCompressItem
+{
+ GObject parent_instance;
+ NautilusCompressionFormat format;
+ char *extension;
+ char *description;
+};
+
+G_DEFINE_TYPE (NautilusCompressItem, nautilus_compress_item, G_TYPE_OBJECT);
+
+static void
+nautilus_compress_item_init (NautilusCompressItem *item)
+{
+}
+
+static void
+nautilus_compress_item_finalize (GObject *object)
+{
+ NautilusCompressItem *item = NAUTILUS_COMPRESS_ITEM (object);
+
+ g_free (item->extension);
+ g_free (item->description);
+
+ G_OBJECT_CLASS (nautilus_compress_item_parent_class)->finalize (object);
+}
+
+static void
+nautilus_compress_item_class_init (NautilusCompressItemClass *class)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
+
+ object_class->finalize = nautilus_compress_item_finalize;
+}
+
+static NautilusCompressItem *
+nautilus_compress_item_new (NautilusCompressionFormat format,
+ const char *extension,
+ const char *description)
+{
+ NautilusCompressItem *item = g_object_new (NAUTILUS_TYPE_COMPRESS_ITEM, NULL);
+
+ item->format = format;
+ item->extension = g_strdup (extension);
+ item->description = g_strdup (description);
+
+ return item;
+}
+
static gboolean
nautilus_compress_dialog_controller_name_is_valid (NautilusFileNameWidgetController *self,
gchar *name,
@@ -147,57 +186,32 @@ compress_dialog_controller_on_response (GtkDialog *dialog,
}
static void
-update_selected_format (NautilusCompressDialogController *self,
- NautilusCompressionFormat format)
+update_selected_format (NautilusCompressDialogController *self)
{
- const char *extension;
- GtkWidget *active_label;
- GtkWidget *active_checkmark;
gboolean show_passphrase = FALSE;
+ guint selected;
+ GListModel *model;
+ NautilusCompressItem *item;
- switch (format)
+ selected = gtk_drop_down_get_selected (GTK_DROP_DOWN (self->extension_dropdown));
+ if (selected == GTK_INVALID_LIST_POSITION)
{
- case NAUTILUS_COMPRESSION_ZIP:
- {
- extension = ".zip";
- active_label = self->zip_label;
- active_checkmark = self->zip_checkmark;
- }
- break;
-
- case NAUTILUS_COMPRESSION_ENCRYPTED_ZIP:
- {
- extension = ".zip";
- active_label = self->encrypted_zip_label;
- active_checkmark = self->encrypted_zip_checkmark;
- show_passphrase = TRUE;
- }
- break;
-
- case NAUTILUS_COMPRESSION_TAR_XZ:
- {
- extension = ".tar.xz";
- active_label = self->tar_xz_label;
- active_checkmark = self->tar_xz_checkmark;
- }
- break;
+ return;
+ }
- case NAUTILUS_COMPRESSION_7ZIP:
- {
- extension = ".7z";
- active_label = self->seven_zip_label;
- active_checkmark = self->seven_zip_checkmark;
- }
- break;
+ model = gtk_drop_down_get_model (GTK_DROP_DOWN (self->extension_dropdown));
+ item = g_list_model_get_item (model, selected);
+ if (item == NULL)
+ {
+ return;
+ }
- default:
- {
- g_assert_not_reached ();
- }
- break;
+ if (item->format == NAUTILUS_COMPRESSION_ENCRYPTED_ZIP)
+ {
+ show_passphrase = TRUE;
}
- self->extension = extension;
+ self->extension = item->extension;
gtk_widget_set_visible (self->passphrase_label, show_passphrase);
gtk_widget_set_visible (self->passphrase_entry, show_passphrase);
@@ -210,18 +224,10 @@ update_selected_format (NautilusCompressDialogController *self,
"view-conceal");
}
- gtk_stack_set_visible_child (GTK_STACK (self->extension_stack),
- active_label);
-
- gtk_image_set_from_icon_name (GTK_IMAGE (self->zip_checkmark), NULL);
- gtk_image_set_from_icon_name (GTK_IMAGE (self->encrypted_zip_checkmark), NULL);
- gtk_image_set_from_icon_name (GTK_IMAGE (self->tar_xz_checkmark), NULL);
- gtk_image_set_from_icon_name (GTK_IMAGE (self->seven_zip_checkmark), NULL);
- gtk_image_set_from_icon_name (GTK_IMAGE (active_checkmark), "object-select-symbolic");
-
g_settings_set_enum (nautilus_compression_preferences,
NAUTILUS_PREFERENCES_DEFAULT_COMPRESSION_FORMAT,
- format);
+ item->format);
+
/* Since the extension changes when the button is toggled, force a
* verification of the new file name by simulating an entry change
*/
@@ -230,55 +236,132 @@ update_selected_format (NautilusCompressDialogController *self,
}
static void
-zip_row_on_activated (AdwActionRow *row,
- gpointer user_data)
+extension_dropdown_setup_item (GtkSignalListItemFactory *factory,
+ GtkListItem *item,
+ gpointer user_data)
{
- NautilusCompressDialogController *controller;
+ GtkWidget *title;
- controller = NAUTILUS_COMPRESS_DIALOG_CONTROLLER (user_data);
+ title = gtk_label_new ("");
+ gtk_label_set_xalign (GTK_LABEL (title), 0.0);
- gtk_popover_popdown (GTK_POPOVER (controller->extension_popover));
- update_selected_format (controller,
- NAUTILUS_COMPRESSION_ZIP);
+ g_object_set_data (G_OBJECT (item), "title", title);
+ gtk_list_item_set_child (item, title);
}
+
static void
-encrypted_zip_row_on_activated (AdwActionRow *row,
- gpointer user_data)
+extension_dropdown_setup_item_full (GtkSignalListItemFactory *factory,
+ GtkListItem *item,
+ gpointer user_data)
{
- NautilusCompressDialogController *controller;
+ GtkWidget *hbox, *vbox, *title, *subtitle, *checkmark;
- controller = NAUTILUS_COMPRESS_DIALOG_CONTROLLER (user_data);
+ title = gtk_label_new ("");
+ gtk_label_set_xalign (GTK_LABEL (title), 0.0);
+ gtk_widget_set_halign (title, GTK_ALIGN_START);
+
+ subtitle = gtk_label_new ("");
+ gtk_label_set_xalign (GTK_LABEL (subtitle), 0.0);
+ gtk_widget_add_css_class (subtitle, "dim-label");
+ gtk_widget_add_css_class (subtitle, "caption");
+
+ checkmark = gtk_image_new_from_icon_name ("object-select-symbolic");
+
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
+ gtk_widget_set_hexpand (vbox, TRUE);
- gtk_popover_popdown (GTK_POPOVER (controller->extension_popover));
- update_selected_format (controller,
- NAUTILUS_COMPRESSION_ENCRYPTED_ZIP);
+ gtk_box_append (GTK_BOX (hbox), vbox);
+ gtk_box_append (GTK_BOX (vbox), title);
+ gtk_box_append (GTK_BOX (vbox), subtitle);
+ gtk_box_append (GTK_BOX (hbox), checkmark);
+
+ g_object_set_data (G_OBJECT (item), "title", title);
+ g_object_set_data (G_OBJECT (item), "subtitle", subtitle);
+ g_object_set_data (G_OBJECT (item), "checkmark", checkmark);
+
+ gtk_list_item_set_child (item, hbox);
}
static void
-tar_xz_row_on_activated (AdwActionRow *row,
- gpointer user_data)
+extension_dropdown_on_selected_item_notify (GtkDropDown *dropdown,
+ GParamSpec *pspec,
+ GtkListItem *item)
{
- NautilusCompressDialogController *controller;
+ GtkWidget *checkmark;
- controller = NAUTILUS_COMPRESS_DIALOG_CONTROLLER (user_data);
+ checkmark = g_object_get_data (G_OBJECT (item), "checkmark");
- gtk_popover_popdown (GTK_POPOVER (controller->extension_popover));
- update_selected_format (controller,
- NAUTILUS_COMPRESSION_TAR_XZ);
+ if (gtk_drop_down_get_selected_item (dropdown) == gtk_list_item_get_item (item))
+ {
+ gtk_widget_set_opacity (checkmark, 1.0);
+ }
+ else
+ {
+ gtk_widget_set_opacity (checkmark, 0.0);
+ }
}
static void
-seven_zip_row_on_activated (AdwActionRow *row,
- gpointer user_data)
+extension_dropdown_bind (GtkSignalListItemFactory *factory,
+ GtkListItem *list_item,
+ gpointer user_data)
{
- NautilusCompressDialogController *controller;
+ NautilusCompressDialogController *self;
+ GtkWidget *title, *subtitle, *checkmark;
+ NautilusCompressItem *item;
- controller = NAUTILUS_COMPRESS_DIALOG_CONTROLLER (user_data);
+ self = NAUTILUS_COMPRESS_DIALOG_CONTROLLER (user_data);
+ item = gtk_list_item_get_item (list_item);
+
+ title = g_object_get_data (G_OBJECT (list_item), "title");
+ subtitle = g_object_get_data (G_OBJECT (list_item), "subtitle");
+ checkmark = g_object_get_data (G_OBJECT (list_item), "checkmark");
+
+ gtk_label_set_label (GTK_LABEL (title), item->extension);
+ gtk_size_group_add_widget (self->extension_sizegroup, title);
- gtk_popover_popdown (GTK_POPOVER (controller->extension_popover));
- update_selected_format (controller,
- NAUTILUS_COMPRESSION_7ZIP);
+ if (item->format == NAUTILUS_COMPRESSION_ENCRYPTED_ZIP)
+ {
+ gtk_widget_add_css_class (title, "encrypted_zip");
+ }
+
+ if (subtitle)
+ {
+ gtk_label_set_label (GTK_LABEL (subtitle), item->description);
+ }
+
+ if (checkmark)
+ {
+ g_signal_connect (self->extension_dropdown,
+ "notify::selected-item",
+ G_CALLBACK (extension_dropdown_on_selected_item_notify),
+ list_item);
+ extension_dropdown_on_selected_item_notify (GTK_DROP_DOWN (self->extension_dropdown),
+ NULL,
+ list_item);
+ }
+}
+
+static void
+extension_dropdown_unbind (GtkSignalListItemFactory *factory,
+ GtkListItem *item,
+ gpointer user_data)
+{
+ NautilusCompressDialogController *self;
+ GtkWidget *title;
+
+ self = NAUTILUS_COMPRESS_DIALOG_CONTROLLER (user_data);
+ g_signal_handlers_disconnect_by_func (self->extension_dropdown,
+ extension_dropdown_on_selected_item_notify,
+ item);
+
+ title = g_object_get_data (G_OBJECT (item), "title");
+ if (title)
+ {
+ gtk_widget_remove_css_class (title, "encrypted_zip");
+ }
}
static void
@@ -342,47 +425,75 @@ activate_button_on_sensitive_notify (GObject *gobject,
}
static void
-popover_on_show (GtkWidget *widget,
- gpointer user_data)
+extension_dropdown_setup (NautilusCompressDialogController *self)
{
- NautilusCompressDialogController *self;
+ GtkListItemFactory *factory, *list_factory;
+ GListStore *store;
+ NautilusCompressItem *item;
NautilusCompressionFormat format;
+ gint i;
+
+ store = g_list_store_new (NAUTILUS_TYPE_COMPRESS_ITEM);
+ item = nautilus_compress_item_new (NAUTILUS_COMPRESSION_ZIP,
+ ".zip",
+ _("Compatible with all operating systems."));
+ g_list_store_append (store, item);
+ g_object_unref (item);
+ item = nautilus_compress_item_new (NAUTILUS_COMPRESSION_ENCRYPTED_ZIP,
+ ".zip",
+ _("Password protected .zip, must be installed on Windows and Mac."));
+ g_list_store_append (store, item);
+ g_object_unref (item);
+ item = nautilus_compress_item_new (NAUTILUS_COMPRESSION_TAR_XZ,
+ ".tar.xz",
+ _("Smaller archives but Linux and Mac only."));
+ g_list_store_append (store, item);
+ g_object_unref (item);
+ item = nautilus_compress_item_new (NAUTILUS_COMPRESSION_7ZIP,
+ ".7z",
+ _("Smaller archives but must be installed on Windows and Mac."));
+ g_list_store_append (store, item);
+ g_object_unref (item);
+
+ factory = gtk_signal_list_item_factory_new ();
+ g_signal_connect_object (factory, "setup",
+ G_CALLBACK (extension_dropdown_setup_item), self, 0);
+ g_signal_connect_object (factory, "bind",
+ G_CALLBACK (extension_dropdown_bind), self, 0);
+ g_signal_connect_object (factory, "unbind",
+ G_CALLBACK (extension_dropdown_unbind), self, 0);
+
+ list_factory = gtk_signal_list_item_factory_new ();
+ g_signal_connect_object (list_factory, "setup",
+ G_CALLBACK (extension_dropdown_setup_item_full), self, 0);
+ g_signal_connect_object (list_factory, "bind",
+ G_CALLBACK (extension_dropdown_bind), self, 0);
+ g_signal_connect_object (list_factory, "unbind",
+ G_CALLBACK (extension_dropdown_unbind), self, 0);
+
+ gtk_drop_down_set_factory (GTK_DROP_DOWN (self->extension_dropdown), factory);
+ gtk_drop_down_set_list_factory (GTK_DROP_DOWN (self->extension_dropdown), list_factory);
+ gtk_drop_down_set_model (GTK_DROP_DOWN (self->extension_dropdown), G_LIST_MODEL (store));
- self = NAUTILUS_COMPRESS_DIALOG_CONTROLLER (user_data);
format = g_settings_get_enum (nautilus_compression_preferences,
NAUTILUS_PREFERENCES_DEFAULT_COMPRESSION_FORMAT);
- switch (format)
+ for (i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (store)); i++)
{
- case NAUTILUS_COMPRESSION_ZIP:
- {
- gtk_widget_grab_focus (self->zip_row);
- }
- break;
-
- case NAUTILUS_COMPRESSION_ENCRYPTED_ZIP:
- {
- gtk_widget_grab_focus (self->encrypted_zip_row);
- }
- break;
-
- case NAUTILUS_COMPRESSION_TAR_XZ:
+ item = g_list_model_get_item (G_LIST_MODEL (store), i);
+ if (item->format == format)
{
- gtk_widget_grab_focus (self->tar_xz_row);
+ gtk_drop_down_set_selected (GTK_DROP_DOWN (self->extension_dropdown), i);
+ update_selected_format (self);
+ g_object_unref (item);
+ break;
}
- break;
- case NAUTILUS_COMPRESSION_7ZIP:
- {
- gtk_widget_grab_focus (self->seven_zip_row);
- }
- break;
-
- default:
- {
- g_assert_not_reached ();
- }
- break;
+ g_object_unref (item);
}
+
+ g_object_unref (store);
+ g_object_unref (factory);
+ g_object_unref (list_factory);
}
NautilusCompressDialogController *
@@ -397,23 +508,10 @@ nautilus_compress_dialog_controller_new (GtkWindow *parent_window,
GtkWidget *error_label;
GtkWidget *name_entry;
GtkWidget *activate_button;
- GtkWidget *extension_stack;
- GtkWidget *zip_row;
- GtkWidget *zip_label;
- GtkWidget *encrypted_zip_row;
- GtkWidget *encrypted_zip_label;
- GtkWidget *tar_xz_row;
- GtkWidget *tar_xz_label;
- GtkWidget *seven_zip_row;
- GtkWidget *seven_zip_label;
- GtkWidget *extension_popover;
- GtkWidget *zip_checkmark;
- GtkWidget *encrypted_zip_checkmark;
- GtkWidget *tar_xz_checkmark;
- GtkWidget *seven_zip_checkmark;
+ GtkWidget *extension_dropdown;
+ GtkSizeGroup *extension_sizegroup;
GtkWidget *passphrase_label;
GtkWidget *passphrase_entry;
- NautilusCompressionFormat format;
builder = gtk_builder_new_from_resource ("/org/gnome/nautilus/ui/nautilus-compress-dialog.ui");
compress_dialog = GTK_WIDGET (gtk_builder_get_object (builder, "compress_dialog"));
@@ -421,22 +519,10 @@ nautilus_compress_dialog_controller_new (GtkWindow *parent_window,
error_label = GTK_WIDGET (gtk_builder_get_object (builder, "error_label"));
name_entry = GTK_WIDGET (gtk_builder_get_object (builder, "name_entry"));
activate_button = GTK_WIDGET (gtk_builder_get_object (builder, "activate_button"));
- extension_stack = GTK_WIDGET (gtk_builder_get_object (builder, "extension_stack"));
- zip_label = GTK_WIDGET (gtk_builder_get_object (builder, "zip_label"));
- encrypted_zip_label = GTK_WIDGET (gtk_builder_get_object (builder, "encrypted_zip_label"));
- tar_xz_label = GTK_WIDGET (gtk_builder_get_object (builder, "tar_xz_label"));
- seven_zip_label = GTK_WIDGET (gtk_builder_get_object (builder, "seven_zip_label"));
- extension_popover = GTK_WIDGET (gtk_builder_get_object (builder, "extension_popover"));
- zip_checkmark = GTK_WIDGET (gtk_builder_get_object (builder, "zip_checkmark"));
- encrypted_zip_checkmark = GTK_WIDGET (gtk_builder_get_object (builder, "encrypted_zip_checkmark"));
- tar_xz_checkmark = GTK_WIDGET (gtk_builder_get_object (builder, "tar_xz_checkmark"));
- seven_zip_checkmark = GTK_WIDGET (gtk_builder_get_object (builder, "seven_zip_checkmark"));
+ extension_dropdown = GTK_WIDGET (gtk_builder_get_object (builder, "extension_dropdown"));
+ extension_sizegroup = GTK_SIZE_GROUP (gtk_builder_get_object (builder, "extension_sizegroup"));
passphrase_label = GTK_WIDGET (gtk_builder_get_object (builder, "passphrase_label"));
passphrase_entry = GTK_WIDGET (gtk_builder_get_object (builder, "passphrase_entry"));
- zip_row = GTK_WIDGET (gtk_builder_get_object (builder, "zip_row"));
- encrypted_zip_row = GTK_WIDGET (gtk_builder_get_object (builder, "encrypted_zip_row"));
- tar_xz_row = GTK_WIDGET (gtk_builder_get_object (builder, "tar_xz_row"));
- seven_zip_row = GTK_WIDGET (gtk_builder_get_object (builder, "seven_zip_row"));
gtk_window_set_transient_for (GTK_WINDOW (compress_dialog),
parent_window);
@@ -451,49 +537,27 @@ nautilus_compress_dialog_controller_new (GtkWindow *parent_window,
self->compress_dialog = compress_dialog;
self->activate_button = activate_button;
self->error_label = error_label;
- self->extension_stack = extension_stack;
- self->zip_label = zip_label;
- self->encrypted_zip_label = encrypted_zip_label;
- self->tar_xz_label = tar_xz_label;
- self->seven_zip_label = seven_zip_label;
- self->name_entry = name_entry;
- self->extension_popover = extension_popover;
- self->zip_checkmark = zip_checkmark;
- self->encrypted_zip_checkmark = encrypted_zip_checkmark;
- self->tar_xz_checkmark = tar_xz_checkmark;
- self->seven_zip_checkmark = seven_zip_checkmark;
self->name_entry = name_entry;
+ self->extension_dropdown = extension_dropdown;
+ self->extension_sizegroup = extension_sizegroup;
self->passphrase_label = passphrase_label;
self->passphrase_entry = passphrase_entry;
- self->zip_row = zip_row;
- self->encrypted_zip_row = encrypted_zip_row;
- self->tar_xz_row = tar_xz_row;
- self->seven_zip_row = seven_zip_row;
+
+ extension_dropdown_setup (self);
self->response_handler_id = g_signal_connect (compress_dialog,
"response",
(GCallback) compress_dialog_controller_on_response,
self);
- g_signal_connect (self->zip_row, "activated",
- G_CALLBACK (zip_row_on_activated), self);
- g_signal_connect (self->encrypted_zip_row, "activated",
- G_CALLBACK (encrypted_zip_row_on_activated), self);
- g_signal_connect (self->tar_xz_row, "activated",
- G_CALLBACK (tar_xz_row_on_activated), self);
- g_signal_connect (self->seven_zip_row, "activated",
- G_CALLBACK (seven_zip_row_on_activated), self);
g_signal_connect (self->passphrase_entry, "changed",
G_CALLBACK (passphrase_entry_on_changed), self);
g_signal_connect (self->passphrase_entry, "icon-press",
G_CALLBACK (passphrase_entry_on_icon_press), self);
g_signal_connect (self->activate_button, "notify::sensitive",
G_CALLBACK (activate_button_on_sensitive_notify), self);
- g_signal_connect (self->extension_popover, "show",
- G_CALLBACK (popover_on_show), self);
-
- format = g_settings_get_enum (nautilus_compression_preferences,
- NAUTILUS_PREFERENCES_DEFAULT_COMPRESSION_FORMAT);
+ g_signal_connect_swapped (self->extension_dropdown, "notify::selected-item",
+ G_CALLBACK (update_selected_format), self);
if (initial_name != NULL)
{
@@ -502,8 +566,6 @@ nautilus_compress_dialog_controller_new (GtkWindow *parent_window,
gtk_widget_show (compress_dialog);
- update_selected_format (self, format);
-
return self;
}
diff --git a/src/resources/css/nautilus.css b/src/resources/css/nautilus.css
index 82dc1d4a2..fd47a9c81 100644
--- a/src/resources/css/nautilus.css
+++ b/src/resources/css/nautilus.css
@@ -1,8 +1,7 @@
-label.encrypted_zip,
-row.encrypted_zip label.title {
+label.encrypted_zip {
background-image: -gtk-icontheme('system-lock-screen-symbolic');
background-position: right center;
background-repeat: no-repeat;
background-size: 16px 16px;
- padding-right: 24px;
+ padding-right: 22px;
}
diff --git a/src/resources/ui/nautilus-compress-dialog.ui b/src/resources/ui/nautilus-compress-dialog.ui
index ce2e6760c..665864d6f 100644
--- a/src/resources/ui/nautilus-compress-dialog.ui
+++ b/src/resources/ui/nautilus-compress-dialog.ui
@@ -1,80 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
- <object class="GtkPopover" id="extension_popover">
- <child>
- <object class="AdwPreferencesGroup">
- <property name="visible">True</property>
- <property name="margin-top">12</property>
- <property name="margin-bottom">12</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <child>
- <object class="AdwActionRow" id="zip_row">
- <property name="visible">True</property>
- <property name="activatable">True</property>
- <property name="title" translatable="no">.zip</property>
- <property name="subtitle" translatable="yes">Compatible with all operating systems.</property>
- <child>
- <object class="GtkImage" id="zip_checkmark">
- <property name="width-request">16</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="AdwActionRow" id="encrypted_zip_row">
- <property name="visible">True</property>
- <property name="activatable">True</property>
- <property name="title" translatable="no">.zip</property>
- <property name="subtitle" translatable="yes">Password protected .zip, must be installed on
Windows and Mac.</property>
- <style>
- <class name="encrypted_zip"/>
- </style>
- <child>
- <object class="GtkImage" id="encrypted_zip_checkmark">
- <property name="width-request">16</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="AdwActionRow" id="tar_xz_row">
- <property name="visible">True</property>
- <property name="activatable">True</property>
- <property name="title" translatable="no">.tar.xz</property>
- <property name="subtitle" translatable="yes">Smaller archives but Linux and Mac only.</property>
- <child>
- <object class="GtkImage" id="tar_xz_checkmark">
- <property name="width-request">16</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="AdwActionRow" id="seven_zip_row">
- <property name="visible">True</property>
- <property name="activatable">True</property>
- <property name="title" translatable="no">.7z</property>
- <property name="subtitle" translatable="yes">Smaller archives but must be installed on Windows
and Mac.</property>
- <child>
- <object class="GtkImage" id="seven_zip_checkmark">
- <property name="width-request">16</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
<object class="GtkDialog" id="compress_dialog">
<property name="title" translatable="yes">Create Archive</property>
<property name="resizable">False</property>
@@ -113,51 +39,7 @@
</object>
</child>
<child>
- <object class="GtkMenuButton" id="extension_button">
- <property name="popover">extension_popover</property>
- <child>
- <object class="GtkBox">
- <property name="spacing">6</property>
- <child>
- <object class="GtkStack" id="extension_stack">
- <property name="hexpand">True</property>
- <child>
- <object class="GtkLabel" id="zip_label">
- <property name="label" translatable="no">.zip</property>
- <property name="xalign">0</property>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="encrypted_zip_label">
- <property name="label" translatable="no">.zip</property>
- <property name="xalign">0</property>
- <style>
- <class name="encrypted_zip"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="tar_xz_label">
- <property name="label" translatable="no">.tar.xz</property>
- <property name="xalign">0</property>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="seven_zip_label">
- <property name="label" translatable="no">.7z</property>
- <property name="xalign">0</property>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkImage">
- <property name="icon-name">pan-down-symbolic</property>
- </object>
- </child>
- </object>
- </child>
- </object>
+ <object class="GtkDropDown" id="extension_dropdown"/>
</child>
</object>
</child>
@@ -211,4 +93,5 @@
<action-widget response="cancel">cancel_button</action-widget>
</action-widgets>
</object>
+ <object class="GtkSizeGroup" id="extension_sizegroup"/>
</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]