- // check that this min height is not less than minimal height for the
- // current font
- wxClientDC dc(this);
- wxCoord y;
- dc.GetTextExtent( _T("X"), NULL, &y );
+ int width, height;
+ GetClientSize(&width, &height);
+
+ GtkWidget* ancestor = gtk_widget_get_toplevel(m_widget);
+#ifdef __WXGTK3__
+ if (ancestor && gtk_window_get_has_resize_grip(GTK_WINDOW(ancestor)))
+ ancestor = NULL;
+#endif
+
+ if (ancestor && ShowsSizeGrip() && event.GetX() > width - height)
+ {
+ GdkWindow *source = GTKGetDrawingWindow();
+
+ int org_x = 0;
+ int org_y = 0;
+ gdk_window_get_origin( source, &org_x, &org_y );
+
+ if (GetLayoutDirection() == wxLayout_RightToLeft)
+ {
+ gtk_window_begin_resize_drag (GTK_WINDOW (ancestor),
+ GDK_WINDOW_EDGE_SOUTH_WEST,
+ 1,
+ org_x - event.GetX() + GetSize().x ,
+ org_y + event.GetY(),
+ 0);
+ }
+ else
+ {
+ gtk_window_begin_resize_drag (GTK_WINDOW (ancestor),
+ GDK_WINDOW_EDGE_SOUTH_EAST,
+ 1,
+ org_x + event.GetX(),
+ org_y + event.GetY(),
+ 0);
+ }
+ }
+ else
+ {
+ event.Skip( true );
+ }
+}
+
+void wxStatusBarGeneric::OnRightDown(wxMouseEvent& event)
+{
+ int width, height;
+ GetClientSize(&width, &height);
+
+ GtkWidget* ancestor = gtk_widget_get_toplevel(m_widget);
+#ifdef __WXGTK3__
+ if (ancestor && gtk_window_get_has_resize_grip(GTK_WINDOW(ancestor)))
+ ancestor = NULL;
+#endif