]> Pileus Git - ~andy/gtk/commitdiff
RTL flipping for statusbars.
authorMatthias Clasen <matthiasc@src.gnome.org>
Tue, 3 Dec 2002 21:49:39 +0000 (21:49 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 3 Dec 2002 21:49:39 +0000 (21:49 +0000)
ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkstatusbar.c

index d940444954864a633ed314d805f7618c9128250c..b3373fbac1ce92f91aa1f0f3402c77c5a631c44f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2002-12-03  Matthias Clasen  <maclas@gmx.de>
+
+       RTL flipping for statusbars.  (#96832)
+       
+       * gtk/gtkstatusbar.c (get_grip_edge): New function returning the
+       appropriate grip edge for a statusbar.
+       (get_grip_rect): Do the right thing in RTL mode.
+       (gtk_statusbar_button_press): Initiate a resize drag on the
+       appropriate edge. 
+       (gtk_statusbar_expose_event): Paint the resize grip for the
+       appropriate edge.
+
 2002-12-03  Anders Carlsson  <andersca@gnu.org>
 
        * gtk/gtkstyle.c: Fix doc comment.
index d940444954864a633ed314d805f7618c9128250c..b3373fbac1ce92f91aa1f0f3402c77c5a631c44f 100644 (file)
@@ -1,3 +1,15 @@
+2002-12-03  Matthias Clasen  <maclas@gmx.de>
+
+       RTL flipping for statusbars.  (#96832)
+       
+       * gtk/gtkstatusbar.c (get_grip_edge): New function returning the
+       appropriate grip edge for a statusbar.
+       (get_grip_rect): Do the right thing in RTL mode.
+       (gtk_statusbar_button_press): Initiate a resize drag on the
+       appropriate edge. 
+       (gtk_statusbar_expose_event): Paint the resize grip for the
+       appropriate edge.
+
 2002-12-03  Anders Carlsson  <andersca@gnu.org>
 
        * gtk/gtkstyle.c: Fix doc comment.
index d940444954864a633ed314d805f7618c9128250c..b3373fbac1ce92f91aa1f0f3402c77c5a631c44f 100644 (file)
@@ -1,3 +1,15 @@
+2002-12-03  Matthias Clasen  <maclas@gmx.de>
+
+       RTL flipping for statusbars.  (#96832)
+       
+       * gtk/gtkstatusbar.c (get_grip_edge): New function returning the
+       appropriate grip edge for a statusbar.
+       (get_grip_rect): Do the right thing in RTL mode.
+       (gtk_statusbar_button_press): Initiate a resize drag on the
+       appropriate edge. 
+       (gtk_statusbar_expose_event): Paint the resize grip for the
+       appropriate edge.
+
 2002-12-03  Anders Carlsson  <andersca@gnu.org>
 
        * gtk/gtkstyle.c: Fix doc comment.
index d940444954864a633ed314d805f7618c9128250c..b3373fbac1ce92f91aa1f0f3402c77c5a631c44f 100644 (file)
@@ -1,3 +1,15 @@
+2002-12-03  Matthias Clasen  <maclas@gmx.de>
+
+       RTL flipping for statusbars.  (#96832)
+       
+       * gtk/gtkstatusbar.c (get_grip_edge): New function returning the
+       appropriate grip edge for a statusbar.
+       (get_grip_rect): Do the right thing in RTL mode.
+       (gtk_statusbar_button_press): Initiate a resize drag on the
+       appropriate edge. 
+       (gtk_statusbar_expose_event): Paint the resize grip for the
+       appropriate edge.
+
 2002-12-03  Anders Carlsson  <andersca@gnu.org>
 
        * gtk/gtkstyle.c: Fix doc comment.
index d940444954864a633ed314d805f7618c9128250c..b3373fbac1ce92f91aa1f0f3402c77c5a631c44f 100644 (file)
@@ -1,3 +1,15 @@
+2002-12-03  Matthias Clasen  <maclas@gmx.de>
+
+       RTL flipping for statusbars.  (#96832)
+       
+       * gtk/gtkstatusbar.c (get_grip_edge): New function returning the
+       appropriate grip edge for a statusbar.
+       (get_grip_rect): Do the right thing in RTL mode.
+       (gtk_statusbar_button_press): Initiate a resize drag on the
+       appropriate edge. 
+       (gtk_statusbar_expose_event): Paint the resize grip for the
+       appropriate edge.
+
 2002-12-03  Anders Carlsson  <andersca@gnu.org>
 
        * gtk/gtkstyle.c: Fix doc comment.
index d940444954864a633ed314d805f7618c9128250c..b3373fbac1ce92f91aa1f0f3402c77c5a631c44f 100644 (file)
@@ -1,3 +1,15 @@
+2002-12-03  Matthias Clasen  <maclas@gmx.de>
+
+       RTL flipping for statusbars.  (#96832)
+       
+       * gtk/gtkstatusbar.c (get_grip_edge): New function returning the
+       appropriate grip edge for a statusbar.
+       (get_grip_rect): Do the right thing in RTL mode.
+       (gtk_statusbar_button_press): Initiate a resize drag on the
+       appropriate edge. 
+       (gtk_statusbar_expose_event): Paint the resize grip for the
+       appropriate edge.
+
 2002-12-03  Anders Carlsson  <andersca@gnu.org>
 
        * gtk/gtkstyle.c: Fix doc comment.
index 023072d368318ec127edf006e2a159a52747be75..a118fe9bc3954c300c14a099560ad6829e1dc573 100644 (file)
@@ -421,6 +421,17 @@ gtk_statusbar_destroy (GtkObject *object)
   GTK_OBJECT_CLASS (parent_class)->destroy (object);
 }
 
+static GdkWindowEdge
+get_grip_edge (GtkStatusbar *statusbar)
+{
+  GtkWidget *widget = GTK_WIDGET (statusbar);
+
+  if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) 
+    return GDK_WINDOW_EDGE_SOUTH_EAST; 
+  else
+    return GDK_WINDOW_EDGE_SOUTH_WEST; 
+}
+
 static void
 get_grip_rect (GtkStatusbar *statusbar,
                GdkRectangle *rect)
@@ -440,10 +451,14 @@ get_grip_rect (GtkStatusbar *statusbar,
   if (h > (widget->allocation.height - widget->style->ythickness))
     h = widget->allocation.height - widget->style->ythickness;
   
-  rect->x = widget->allocation.x + widget->allocation.width - w;
-  rect->y = widget->allocation.y + widget->allocation.height - h;
   rect->width = w;
   rect->height = h;
+  rect->y = widget->allocation.y + widget->allocation.height - h;
+
+  if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) 
+      rect->x = widget->allocation.x + widget->allocation.width - w;
+  else 
+      rect->x = widget->allocation.x + widget->style->xthickness;
 }
 
 static void
@@ -543,6 +558,7 @@ gtk_statusbar_button_press (GtkWidget      *widget,
 {
   GtkStatusbar *statusbar;
   GtkWidget *ancestor;
+  GdkWindowEdge edge;
   
   statusbar = GTK_STATUSBAR (widget);
   
@@ -555,9 +571,11 @@ gtk_statusbar_button_press (GtkWidget      *widget,
   if (!GTK_IS_WINDOW (ancestor))
     return FALSE;
 
+  edge = get_grip_edge (statusbar);
+
   if (event->button == 1)
     gtk_window_begin_resize_drag (GTK_WINDOW (ancestor),
-                                  GDK_WINDOW_EDGE_SOUTH_EAST,
+                                  edge,
                                   event->button,
                                   event->x_root, event->y_root,
                                   event->time);
@@ -585,6 +603,10 @@ gtk_statusbar_expose_event (GtkWidget      *widget,
 
   if (statusbar->has_resize_grip)
     {
+      GdkWindowEdge edge;
+      
+      edge = get_grip_edge (statusbar);
+
       get_grip_rect (statusbar, &rect);
 
       gtk_paint_resize_grip (widget->style,
@@ -593,7 +615,7 @@ gtk_statusbar_expose_event (GtkWidget      *widget,
                              NULL,
                              widget,
                              "statusbar",
-                             GDK_WINDOW_EDGE_SOUTH_EAST,
+                             edge,
                              rect.x, rect.y,
                              /* don't draw grip over the frame, though you
                               * can click on the frame.