Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 342954 Details for
Bug 449144
Scroll doesn't switch tab after upgrade from gnome-light 3.4 to 3.6
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Switch tabs by scrolling in gtk+
gtk+_tab_scroll_switch.patch (text/plain), 2.83 KB, created by
pingoo
on 2013-03-23 09:21:29 UTC
(
hide
)
Description:
Switch tabs by scrolling in gtk+
Filename:
MIME Type:
Creator:
pingoo
Created:
2013-03-23 09:21:29 UTC
Size:
2.83 KB
patch
obsolete
>--- a/gtk/gtknotebook.c >+++ b/gtk/gtknotebook.c >@@ -344,6 +344,8 @@ > cairo_t *cr); > static gint gtk_notebook_button_press (GtkWidget *widget, > GdkEventButton *event); >+static gboolean gtk_notebook_scroll (GtkWidget *widget, >+ GdkEventScroll *event); > static gint gtk_notebook_button_release (GtkWidget *widget, > GdkEventButton *event); > static gboolean gtk_notebook_popup_menu (GtkWidget *widget); >@@ -646,6 +648,7 @@ > widget_class->get_preferred_height_for_width = gtk_notebook_get_preferred_height_for_width; > widget_class->size_allocate = gtk_notebook_size_allocate; > widget_class->draw = gtk_notebook_draw; >+ widget_class->scroll_event = gtk_notebook_scroll; > widget_class->button_press_event = gtk_notebook_button_press; > widget_class->button_release_event = gtk_notebook_button_release; > widget_class->popup_menu = gtk_notebook_popup_menu; >@@ -1894,7 +1897,8 @@ > attributes.event_mask = gtk_widget_get_events (widget); > attributes.event_mask |= (GDK_BUTTON_PRESS_MASK | > GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | >- GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK); >+ GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK | >+ GDK_SCROLL_MASK); > attributes_mask = GDK_WA_X | GDK_WA_Y; > > priv->event_window = gdk_window_new (gtk_widget_get_parent_window (widget), >@@ -2863,6 +2867,50 @@ > return FALSE; > } > >+static gboolean >+gtk_notebook_scroll (GtkWidget *widget, >+ GdkEventScroll *event) >+{ >+ GtkNotebook *notebook = GTK_NOTEBOOK (widget); >+ GtkNotebookPrivate *priv = notebook->priv; >+ GtkWidget *child, *event_widget; >+ gint i; >+ >+ if (!priv->cur_page) >+ return FALSE; >+ >+ child = priv->cur_page->child; >+ event_widget = gtk_get_event_widget ((GdkEvent *)event); >+ >+ /* ignore scroll events from the content of the page */ >+ if (!event_widget || gtk_widget_is_ancestor (event_widget, child) || event_widget == child) >+ return FALSE; >+ >+ /* nor from the action area */ >+ for (i = 0; i < 2; i++) >+ { >+ if (event_widget == priv->action_widget[i] || >+ (priv->action_widget[i] && >+ gtk_widget_is_ancestor (event_widget, priv->action_widget[i]))) >+ return FALSE; >+ } >+ >+ switch (event->direction) >+ { >+ case GDK_SCROLL_RIGHT: >+ case GDK_SCROLL_DOWN: >+ gtk_notebook_next_page (notebook); >+ break; >+ case GDK_SCROLL_LEFT: >+ case GDK_SCROLL_UP: >+ gtk_notebook_prev_page (notebook); >+ break; >+ } >+ >+ return TRUE; >+} >+ >+ > static GList* > get_tab_at_pos (GtkNotebook *notebook, gint x, gint y) > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 449144
: 342954