X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/45d66f592c35e902e4aa98a3b19300f1eafaa358..11a23db53128bf244a089123b7fd27deb577a889:/src/gtk/window.cpp?ds=inline diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 3f5d2adf95..81b957556c 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1693,13 +1693,29 @@ window_scroll_event(GtkWidget*, GdkEventScroll* gdk_event, wxWindow* win) if (win->GTKProcessEvent(event)) return TRUE; - GtkRange *range = win->m_scrollBar[wxWindow::ScrollDir_Vert]; + GtkRange *range; + switch (gdk_event->direction) + { + case GDK_SCROLL_UP: + case GDK_SCROLL_DOWN: + range = win->m_scrollBar[wxWindow::ScrollDir_Vert]; + break; + + case GDK_SCROLL_LEFT: + case GDK_SCROLL_RIGHT: + range = win->m_scrollBar[wxWindow::ScrollDir_Horz]; + break; + + default: + return false; + } if (range && gtk_widget_get_visible(GTK_WIDGET(range))) { GtkAdjustment* adj = gtk_range_get_adjustment(range); double delta = gtk_adjustment_get_step_increment(adj) * 3; - if (gdk_event->direction == GDK_SCROLL_UP) + if (gdk_event->direction == GDK_SCROLL_UP || + gdk_event->direction == GDK_SCROLL_LEFT) delta = -delta; gtk_range_set_value(range, gtk_adjustment_get_value(adj) + delta); @@ -1927,9 +1943,11 @@ size_allocate(GtkWidget*, GtkAllocation* alloc, wxWindow* win) GtkAllocation a; gtk_widget_get_allocation(win->m_widget, &a); // update position for widgets in native containers, such as wxToolBar - // (for widgets in a wxPizza, the values should already be the same) - win->m_x = a.x; - win->m_y = a.y; + if (!WX_IS_PIZZA(gtk_widget_get_parent(win->m_widget))) + { + win->m_x = a.x; + win->m_y = a.y; + } win->m_useCachedClientSize = true; if (win->m_clientWidth != w || win->m_clientHeight != h) {