1
1
mirror of https://gitlab.gnome.org/GNOME/gimp.git synced 2025-10-06 01:12:40 +02:00

Compare commits

...

1 Commits

Author SHA1 Message Date
Alx Sa
d7a1ac5cec display: Close image tabs with middle mouse button
This adds a "button-press-event" to the ImageWindow's
image tabs. If the user has clicked with the middle mouse button,
it calls the same close code as if they had clicked on the "X"
button.
2024-09-23 11:08:37 -04:00

View File

@@ -265,6 +265,9 @@ static GtkWidget *
gimp_image_window_create_tab_label (GimpImageWindow *window,
GimpDisplayShell *shell);
static void gimp_image_window_update_tab_labels (GimpImageWindow *window);
gboolean gimp_image_window_tab_button_press (GtkWidget *widget,
GdkEventButton *event,
GimpDisplayShell *shell);
static void gimp_image_window_configure_pad (GimpImageWindow *window,
GimpDeviceInfo *info);
@@ -1320,6 +1323,9 @@ gimp_image_window_add_shell (GimpImageWindow *window,
private->shells = g_list_append (private->shells, shell);
tab_label = gimp_image_window_create_tab_label (window, shell);
g_signal_connect_object (tab_label, "button-press-event",
G_CALLBACK (gimp_image_window_tab_button_press),
shell, 0);
gtk_notebook_append_page (GTK_NOTEBOOK (private->notebook),
GTK_WIDGET (shell), tab_label);
@@ -2506,6 +2512,20 @@ gimp_image_window_update_tab_labels (GimpImageWindow *window)
g_list_free (children);
}
gboolean
gimp_image_window_tab_button_press (GtkWidget *widget,
GdkEventButton *event,
GimpDisplayShell *shell)
{
if (event->type == GDK_BUTTON_PRESS && event->button == 2)
{
if (shell)
gimp_display_shell_close (shell, FALSE);
}
return TRUE;
}
static void
gimp_image_window_configure_pad (GimpImageWindow *window,
GimpDeviceInfo *info)