[nautilus/wip/antoniof/switch-to-gtk4: 12/36] general: GtkGestureMultiPress -> GtkGestureClick
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/switch-to-gtk4: 12/36] general: GtkGestureMultiPress -> GtkGestureClick
- Date: Fri, 7 Jan 2022 08:00:53 +0000 (UTC)
commit f05a2de86d4a533245b1f15870044f1a845e8896
Author: António Fernandes <antoniof gnome org>
Date: Sun Dec 19 21:43:08 2021 +0000
general: GtkGestureMultiPress -> GtkGestureClick
src/nautilus-list-view-private.h | 2 +-
src/nautilus-list-view.c | 30 ++++++++++++-------------
src/nautilus-pathbar.c | 22 +++++++++----------
src/nautilus-toolbar.c | 30 ++++++++++++-------------
src/nautilus-view-icon-controller.c | 40 ++++++++++++++++-----------------
src/nautilus-window.c | 44 ++++++++++++++++++-------------------
6 files changed, 84 insertions(+), 84 deletions(-)
---
diff --git a/src/nautilus-list-view-private.h b/src/nautilus-list-view-private.h
index de9fa5635..cd95c868e 100644
--- a/src/nautilus-list-view-private.h
+++ b/src/nautilus-list-view-private.h
@@ -79,7 +79,7 @@ struct NautilusListViewDetails {
GCancellable *starred_cancellable;
GtkGesture *tree_view_drag_gesture;
- GtkGesture *tree_view_multi_press_gesture;
+ GtkGesture *tree_view_click_gesture;
GtkEventController *motion_controller;
GtkEventController *key_controller;
GtkGesture *long_press_gesture;
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index a372d24c1..f27962527 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -448,11 +448,11 @@ on_star_cell_renderer_clicked (GtkTreePath *path,
}
static void
-on_tree_view_multi_press_gesture_pressed (GtkGestureMultiPress *gesture,
- gint n_press,
- gdouble x,
- gdouble y,
- gpointer callback_data)
+on_tree_view_click_gesture_pressed (GtkGestureClick *gesture,
+ gint n_press,
+ gdouble x,
+ gdouble y,
+ gpointer callback_data)
{
NautilusListView *view;
GtkWidget *widget;
@@ -713,11 +713,11 @@ on_tree_view_multi_press_gesture_pressed (GtkGestureMultiPress *gesture,
}
static void
-on_tree_view_multi_press_gesture_released (GtkGestureMultiPress *gesture,
- gint n_press,
- gdouble x,
- gdouble y,
- gpointer callback_data)
+on_tree_view_click_gesture_released (GtkGestureClick *gesture,
+ gint n_press,
+ gdouble x,
+ gdouble y,
+ gpointer callback_data)
{
NautilusListView *view;
guint button;
@@ -2051,17 +2051,17 @@ create_and_set_up_tree_view (NautilusListView *view)
g_signal_connect (gesture, "drag-update",
G_CALLBACK (on_tree_view_drag_gesture_drag_update), view);
- gesture = gtk_gesture_multi_press_new (GTK_WIDGET (view->details->tree_view));
- view->details->tree_view_multi_press_gesture = gesture;
+ gesture = gtk_gesture_click_new (GTK_WIDGET (view->details->tree_view));
+ view->details->tree_view_click_gesture = gesture;
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture),
GTK_PHASE_CAPTURE);
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0);
g_signal_connect (gesture, "pressed",
- G_CALLBACK (on_tree_view_multi_press_gesture_pressed), view);
+ G_CALLBACK (on_tree_view_click_gesture_pressed), view);
g_signal_connect (gesture, "released",
- G_CALLBACK (on_tree_view_multi_press_gesture_released), view);
+ G_CALLBACK (on_tree_view_click_gesture_released), view);
controller = gtk_event_controller_motion_new (GTK_WIDGET (view->details->tree_view));
view->details->motion_controller = controller;
@@ -3577,7 +3577,7 @@ nautilus_list_view_dispose (GObject *object)
list_view);
g_clear_object (&list_view->details->tree_view_drag_gesture);
- g_clear_object (&list_view->details->tree_view_multi_press_gesture);
+ g_clear_object (&list_view->details->tree_view_click_gesture);
g_clear_object (&list_view->details->motion_controller);
g_clear_object (&list_view->details->key_controller);
g_clear_object (&list_view->details->long_press_gesture);
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index 480b537ea..9ed162530 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -77,7 +77,7 @@ typedef struct
NautilusPathBar *path_bar;
- GtkGesture *multi_press_gesture;
+ GtkGesture *click_gesture;
guint ignore_changes : 1;
guint is_root : 1;
@@ -376,7 +376,7 @@ button_data_free (ButtonData *button_data)
nautilus_file_unref (button_data->file);
}
- g_clear_object (&button_data->multi_press_gesture);
+ g_clear_object (&button_data->click_gesture);
g_free (button_data);
}
@@ -558,11 +558,11 @@ pop_up_pathbar_context_menu (NautilusPathBar *self,
static void
-on_multi_press_gesture_pressed (GtkGestureMultiPress *gesture,
- gint n_press,
- gdouble x,
- gdouble y,
- gpointer user_data)
+on_click_gesture_pressed (GtkGestureClick *gesture,
+ gint n_press,
+ gdouble x,
+ gdouble y,
+ gpointer user_data)
{
ButtonData *button_data;
NautilusPathBar *self;
@@ -1093,12 +1093,12 @@ make_button_data (NautilusPathBar *self,
/* A gesture is needed here, because GtkButton doesn’t react to middle- or
* secondary-clicking.
*/
- button_data->multi_press_gesture = gtk_gesture_multi_press_new (button_data->button);
+ button_data->click_gesture = gtk_gesture_click_new (button_data->button);
- gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (button_data->multi_press_gesture), 0);
+ gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (button_data->click_gesture), 0);
- g_signal_connect (button_data->multi_press_gesture, "pressed",
- G_CALLBACK (on_multi_press_gesture_pressed), button_data);
+ g_signal_connect (button_data->click_gesture, "pressed",
+ G_CALLBACK (on_click_gesture_pressed), button_data);
#if 0 && NAUTILUS_DND_NEEDS_GTK4_REIMPLEMENTATION
nautilus_drag_slot_proxy_init (button_data->button, button_data->file, NULL);
diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c
index ce783d4d7..83d511b63 100644
--- a/src/nautilus-toolbar.c
+++ b/src/nautilus-toolbar.c
@@ -89,12 +89,12 @@ struct _NautilusToolbar
GtkWidget *forward_button;
GtkWidget *forward_menu;
GtkGesture *forward_button_longpress_gesture;
- GtkGesture *forward_button_multi_press_gesture;
+ GtkGesture *forward_button_click_gesture;
GtkWidget *back_button;
GtkWidget *back_menu;
GtkGesture *back_button_longpress_gesture;
- GtkGesture *back_button_multi_press_gesture;
+ GtkGesture *back_button_click_gesture;
GtkWidget *search_button;
@@ -220,11 +220,11 @@ show_menu (NautilusToolbar *self,
}
static void
-navigation_button_press_cb (GtkGestureMultiPress *gesture,
- gint n_press,
- gdouble x,
- gdouble y,
- gpointer user_data)
+navigation_button_press_cb (GtkGestureClick *gesture,
+ gint n_press,
+ gdouble x,
+ gdouble y,
+ gpointer user_data)
{
NautilusToolbar *self;
GtkWidget *widget;
@@ -839,16 +839,16 @@ nautilus_toolbar_constructed (GObject *object)
GUINT_TO_POINTER (NAUTILUS_NAVIGATION_DIRECTION_FORWARD));
- self->back_button_multi_press_gesture = gtk_gesture_multi_press_new (self->back_button);
- gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (self->back_button_multi_press_gesture),
+ self->back_button_click_gesture = gtk_gesture_click_new (self->back_button);
+ gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (self->back_button_click_gesture),
GDK_BUTTON_SECONDARY);
- g_signal_connect (self->back_button_multi_press_gesture, "pressed",
+ g_signal_connect (self->back_button_click_gesture, "pressed",
G_CALLBACK (navigation_button_press_cb), self);
- self->forward_button_multi_press_gesture = gtk_gesture_multi_press_new (self->forward_button);
- gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (self->forward_button_multi_press_gesture),
+ self->forward_button_click_gesture = gtk_gesture_click_new (self->forward_button);
+ gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (self->forward_button_click_gesture),
GDK_BUTTON_SECONDARY);
- g_signal_connect (self->forward_button_multi_press_gesture, "pressed",
+ g_signal_connect (self->forward_button_click_gesture, "pressed",
G_CALLBACK (navigation_button_press_cb), self);
g_signal_connect (self->operations_popover, "show",
@@ -1035,8 +1035,8 @@ nautilus_toolbar_dispose (GObject *object)
self = NAUTILUS_TOOLBAR (object);
- g_clear_object (&self->forward_button_multi_press_gesture);
- g_clear_object (&self->back_button_multi_press_gesture);
+ g_clear_object (&self->forward_button_click_gesture);
+ g_clear_object (&self->back_button_click_gesture);
g_clear_pointer (&self->icon_binding, g_binding_unbind);
g_clear_pointer (&self->search_binding, g_binding_unbind);
g_clear_pointer (&self->back_menu, gtk_widget_unparent);
diff --git a/src/nautilus-view-icon-controller.c b/src/nautilus-view-icon-controller.c
index 3e3e8ad20..867301026 100644
--- a/src/nautilus-view-icon-controller.c
+++ b/src/nautilus-view-icon-controller.c
@@ -24,7 +24,7 @@ struct _NautilusViewIconController
gboolean single_click_mode;
gboolean activate_on_release;
- GtkGesture *multi_press_gesture;
+ GtkGesture *click_gesture;
guint scroll_to_file_handle_id;
guint prioritize_thumbnailing_handle_id;
@@ -768,11 +768,11 @@ activate_selection_on_click (NautilusViewIconController *self,
}
static void
-on_button_press_event (GtkGestureMultiPress *gesture,
- gint n_press,
- gdouble x,
- gdouble y,
- gpointer user_data)
+on_button_press_event (GtkGestureClick *gesture,
+ gint n_press,
+ gdouble x,
+ gdouble y,
+ gpointer user_data)
{
NautilusViewIconController *self;
guint button;
@@ -855,11 +855,11 @@ on_button_press_event (GtkGestureMultiPress *gesture,
}
static void
-on_click_released (GtkGestureMultiPress *gesture,
- gint n_press,
- gdouble x,
- gdouble y,
- gpointer user_data)
+on_click_released (GtkGestureClick *gesture,
+ gint n_press,
+ gdouble x,
+ gdouble y,
+ gpointer user_data)
{
NautilusViewIconController *self = NAUTILUS_VIEW_ICON_CONTROLLER (user_data);
@@ -872,8 +872,8 @@ on_click_released (GtkGestureMultiPress *gesture,
}
static void
-on_click_stopped (GtkGestureMultiPress *gesture,
- gpointer user_data)
+on_click_stopped (GtkGestureClick *gesture,
+ gpointer user_data)
{
NautilusViewIconController *self = NAUTILUS_VIEW_ICON_CONTROLLER (user_data);
@@ -1190,7 +1190,7 @@ dispose (GObject *object)
self = NAUTILUS_VIEW_ICON_CONTROLLER (object);
- g_clear_object (&self->multi_press_gesture);
+ g_clear_object (&self->click_gesture);
g_clear_handle_id (&self->scroll_to_file_handle_id, g_source_remove);
g_clear_handle_id (&self->prioritize_thumbnailing_handle_id, g_source_remove);
@@ -1390,16 +1390,16 @@ constructed (GObject *object)
self->view_icon = g_themed_icon_new ("view-grid-symbolic");
/* Compensating for the lack of event boxen to allow clicks outside the flow box. */
- self->multi_press_gesture = gtk_gesture_multi_press_new (GTK_WIDGET (content_widget));
- gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (self->multi_press_gesture),
+ self->click_gesture = gtk_gesture_click_new (GTK_WIDGET (content_widget));
+ gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (self->click_gesture),
GTK_PHASE_CAPTURE);
- gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (self->multi_press_gesture),
+ gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (self->click_gesture),
0);
- g_signal_connect (self->multi_press_gesture, "pressed",
+ g_signal_connect (self->click_gesture, "pressed",
G_CALLBACK (on_button_press_event), self);
- g_signal_connect (self->multi_press_gesture, "stopped",
+ g_signal_connect (self->click_gesture, "stopped",
G_CALLBACK (on_click_stopped), self);
- g_signal_connect (self->multi_press_gesture, "released",
+ g_signal_connect (self->click_gesture, "released",
G_CALLBACK (on_click_released), self);
longpress_gesture = gtk_gesture_long_press_new (GTK_WIDGET (self->view_ui));
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 4a738fa87..6d2a8ffc5 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -153,8 +153,8 @@ struct _NautilusWindow
GtkPadController *pad_controller;
- GtkGesture *multi_press_gesture;
- GtkGesture *notebook_multi_press_gesture;
+ GtkGesture *click_gesture;
+ GtkGesture *notebook_click_gesture;
GtkEventController *key_capture_controller;
GtkEventController *key_bubble_controller;
};
@@ -1778,11 +1778,11 @@ notebook_popup_menu_show (NautilusWindow *window,
}
static void
-notebook_button_press_cb (GtkGestureMultiPress *gesture,
- gint n_press,
- gdouble x,
- gdouble y,
- gpointer user_data)
+notebook_button_press_cb (GtkGestureClick *gesture,
+ gint n_press,
+ gdouble x,
+ gdouble y,
+ gpointer user_data)
{
NautilusWindow *window;
GtkNotebook *notebook;
@@ -1956,7 +1956,7 @@ setup_notebook (NautilusWindow *window)
G_CALLBACK (notebook_page_removed_cb),
window);
- g_signal_connect (window->notebook_multi_press_gesture, "pressed",
+ g_signal_connect (window->notebook_click_gesture, "pressed",
G_CALLBACK (notebook_button_press_cb),
window);
}
@@ -2171,7 +2171,7 @@ nautilus_window_dispose (GObject *object)
nautilus_window_unexport_handle (window);
- g_clear_object (&window->notebook_multi_press_gesture);
+ g_clear_object (&window->notebook_click_gesture);
g_clear_object (&window->key_capture_controller);
g_clear_object (&window->key_bubble_controller);
@@ -2539,11 +2539,11 @@ nautilus_window_back_or_forward (NautilusWindow *window,
}
static void
-on_multi_press_gesture_pressed (GtkGestureMultiPress *gesture,
- gint n_press,
- gdouble x,
- gdouble y,
- gpointer user_data)
+on_click_gesture_pressed (GtkGestureClick *gesture,
+ gint n_press,
+ gdouble x,
+ gdouble y,
+ gpointer user_data)
{
GtkWidget *widget;
NautilusWindow *window;
@@ -2660,20 +2660,20 @@ nautilus_window_init (NautilusWindow *window)
gtk_pad_controller_set_action_entries (window->pad_controller,
pad_actions, G_N_ELEMENTS (pad_actions));
- window->multi_press_gesture = gtk_gesture_multi_press_new (GTK_WIDGET (window));
+ window->click_gesture = gtk_gesture_click_new (GTK_WIDGET (window));
- gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (window->multi_press_gesture),
+ gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (window->click_gesture),
GTK_PHASE_CAPTURE);
- gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (window->multi_press_gesture), 0);
+ gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (window->click_gesture), 0);
- g_signal_connect (window->multi_press_gesture, "pressed",
- G_CALLBACK (on_multi_press_gesture_pressed), NULL);
+ g_signal_connect (window->click_gesture, "pressed",
+ G_CALLBACK (on_click_gesture_pressed), NULL);
- window->notebook_multi_press_gesture = gtk_gesture_multi_press_new (window->notebook);
+ window->notebook_click_gesture = gtk_gesture_click_new (window->notebook);
- gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (window->notebook_multi_press_gesture),
+ gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (window->notebook_click_gesture),
GTK_PHASE_CAPTURE);
- gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (window->notebook_multi_press_gesture),
+ gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (window->notebook_click_gesture),
0);
window->key_capture_controller = gtk_event_controller_key_new (GTK_WIDGET (window));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]