Skip to content

Commit

Permalink
Handle module header clicks on mouse button release
Browse files Browse the repository at this point in the history
Resolves #17973
  • Loading branch information
elstoc authored and TurboGit committed Dec 10, 2024
1 parent 77bed88 commit 41f0ef1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/develop/imageop.c
Original file line number Diff line number Diff line change
Expand Up @@ -2510,7 +2510,7 @@ static gboolean _iop_plugin_body_button_press(GtkWidget *w,
return FALSE;
}

static gboolean _iop_plugin_header_button_press(GtkWidget *w,
static gboolean _iop_plugin_header_button_release(GtkWidget *w,
GdkEventButton *e,
gpointer user_data)
{
Expand Down Expand Up @@ -2966,7 +2966,7 @@ GtkWidget *dt_iop_gui_header_button(dt_iop_module_t *module,
g_signal_connect(button, "enter-notify-event",
G_CALLBACK(_header_enter_notify_callback),
GINT_TO_POINTER(element));
g_signal_connect(button, "button-press-event", G_CALLBACK(callback), module);
g_signal_connect(button, "button-release-event", G_CALLBACK(callback), module);
dt_action_define(&module->so->actions, NULL, NULL, button, NULL);
gtk_widget_show(button);

Expand Down Expand Up @@ -3073,8 +3073,8 @@ void dt_iop_gui_set_expander(dt_iop_module_t *module)
module->header = header;

/* setup the header box */
g_signal_connect(G_OBJECT(header_evb), "button-press-event",
G_CALLBACK(_iop_plugin_header_button_press), module);
g_signal_connect(G_OBJECT(header_evb), "button-release-event",
G_CALLBACK(_iop_plugin_header_button_release), module);
gtk_widget_add_events(header_evb, GDK_POINTER_MOTION_MASK);
g_signal_connect(G_OBJECT(header_evb), "enter-notify-event",
G_CALLBACK(_header_motion_notify_show_callback), module);
Expand Down
10 changes: 5 additions & 5 deletions src/libs/lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ gboolean dt_lib_gui_get_expanded(dt_lib_module_t *module)
return dtgtk_expander_get_expanded(DTGTK_EXPANDER(module->expander));
}

static gboolean _lib_plugin_header_button_press(GtkWidget *w,
static gboolean _lib_plugin_header_button_release(GtkWidget *w,
GdkEventButton *e,
gpointer user_data)
{
Expand Down Expand Up @@ -1224,8 +1224,8 @@ GtkWidget *dt_lib_gui_get_expander(dt_lib_module_t *module)
}

/* setup the header box */
g_signal_connect(G_OBJECT(header_evb), "button-press-event",
G_CALLBACK(_lib_plugin_header_button_press),
g_signal_connect(G_OBJECT(header_evb), "button-release-event",
G_CALLBACK(_lib_plugin_header_button_release),
module);
g_signal_connect(G_OBJECT(header_evb), "enter-notify-event",
G_CALLBACK(_header_enter_notify_callback),
Expand All @@ -1244,8 +1244,8 @@ GtkWidget *dt_lib_gui_get_expander(dt_lib_module_t *module)
module->arrow = dtgtk_button_new(dtgtk_cairo_paint_solid_arrow, 0, NULL);

gtk_widget_set_tooltip_text(module->arrow, _("show module"));
g_signal_connect(G_OBJECT(module->arrow), "button-press-event",
G_CALLBACK(_lib_plugin_header_button_press), module);
g_signal_connect(G_OBJECT(module->arrow), "button-release-event",
G_CALLBACK(_lib_plugin_header_button_release), module);
dt_action_define(&module->actions, NULL, NULL, module->arrow, NULL);
gtk_box_pack_start(GTK_BOX(header), module->arrow, FALSE, FALSE, 0);

Expand Down

0 comments on commit 41f0ef1

Please sign in to comment.