From d3e823448497e6ef54dbabb6a638fbb3f96ddde8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Tue, 6 Aug 2024 01:32:59 +0100 Subject: [PATCH 1/3] Revert "touch: Change long-press propagation phase" This reverts commit 14dec6d0b3c0c3a7cceab45b08ffe3d9758224d2. Using the CAPTURE fase is incorrect, so much that this solution tries to reimplement the "bubble" logic by letting the event pass through to children. Iterating the whole list model linearly is also costly. --- src/nautilus-list-base.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/nautilus-list-base.c b/src/nautilus-list-base.c index 12fa838b34..043bbb2fcf 100644 --- a/src/nautilus-list-base.c +++ b/src/nautilus-list-base.c @@ -407,20 +407,6 @@ on_view_longpress_pressed (GtkGestureLongPress *gesture, { NautilusListBase *self = NAUTILUS_LIST_BASE (user_data); NautilusListBasePrivate *priv = nautilus_list_base_get_instance_private (self); - graphene_point_t view_point = GRAPHENE_POINT_INIT (x, y); - graphene_point_t file_point = GRAPHENE_POINT_INIT (0, 0); - - /* Ignore this long-press if we are hovering over an item */ - for (guint i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (priv->model)); i++) - { - g_autoptr (NautilusViewItem) item = get_view_item (G_LIST_MODEL (priv->model), i); - GtkWidget *file = nautilus_view_item_get_item_ui (item); - if (file && gtk_widget_compute_point (GTK_WIDGET (self), file, &view_point, &file_point) && - gtk_widget_contains (file, file_point.x, file_point.y)) - { - return; - } - } gtk_selection_model_unselect_all (GTK_SELECTION_MODEL (priv->model)); @@ -1384,7 +1370,6 @@ nautilus_list_base_setup_gestures (NautilusListBase *self) controller = GTK_EVENT_CONTROLLER (gtk_gesture_long_press_new ()); gtk_widget_add_controller (GTK_WIDGET (self), controller); - gtk_event_controller_set_propagation_phase (controller, GTK_PHASE_CAPTURE); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (controller), TRUE); g_signal_connect (controller, "pressed", G_CALLBACK (on_view_longpress_pressed), self); -- GitLab From acc8c0074ead2886eff890a8c16b990768cc32e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Tue, 6 Aug 2024 01:36:48 +0100 Subject: [PATCH 2/3] portal: Appease uncrustify uncrustify was wrong with the indentation. Let's try another approach. --- src/nautilus-portal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nautilus-portal.c b/src/nautilus-portal.c index 987f5b9690..623c62370b 100644 --- a/src/nautilus-portal.c +++ b/src/nautilus-portal.c @@ -245,10 +245,10 @@ handle_file_chooser_methods (XdpImplFileChooser *object, (void) g_variant_lookup (arg_options, "multiple", "b", &open_multiple); (void) g_variant_lookup (arg_options, "directory", "b", &open_directory); - mode = (open_directory ? (open_multiple ? NAUTILUS_MODE_OPEN_FOLDERS : - NAUTILUS_MODE_OPEN_FOLDER) : - (open_multiple ? NAUTILUS_MODE_OPEN_FILES : - NAUTILUS_MODE_OPEN_FILE)); + mode = (open_directory ? (open_multiple ? NAUTILUS_MODE_OPEN_FOLDERS + : NAUTILUS_MODE_OPEN_FOLDER) + : (open_multiple ? NAUTILUS_MODE_OPEN_FILES + : NAUTILUS_MODE_OPEN_FILE)); } else if (strcmp (method_name, "SaveFile") == 0) { -- GitLab From 79f70f70137c44f85600244c5bd175955f492a18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Tue, 6 Aug 2024 02:01:53 +0100 Subject: [PATCH 3/3] new-folder-dialog: Actually modernize it As a follow-up to https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/1395 Use the new forming design pattern for action dialogs with a close button and the suggested action centered at the bottom. In order not to move the button at the bottom, the revealer no longer uses a slide animation, but a crossefade instead, which means the dialog content has a fixed height. As such, there is no need to hardcode a dialog height to fit the releaver content anymore. --- .../ui/nautilus-new-folder-dialog.ui | 39 ++++++++----------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/src/resources/ui/nautilus-new-folder-dialog.ui b/src/resources/ui/nautilus-new-folder-dialog.ui index 4e1761fbd6..9ef2410902 100644 --- a/src/resources/ui/nautilus-new-folder-dialog.ui +++ b/src/resources/ui/nautilus-new-folder-dialog.ui @@ -4,32 +4,10 @@