]> Pileus Git - ~andy/gtk/commitdiff
Implement RTL flipping for GtkViewport: Adjust the "gravity" when resizing
authorMatthias Clasen <maclas@gmx.de>
Fri, 5 Dec 2003 23:31:51 +0000 (23:31 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 5 Dec 2003 23:31:51 +0000 (23:31 +0000)
Sat Dec  6 00:23:46 2003  Matthias Clasen  <maclas@gmx.de>

* gtk/gtkviewport.c: Implement RTL flipping for
GtkViewport: Adjust the "gravity" when resizing
This is a bit flickery in RTL mode.  (#107526)

Sat Dec  6 00:22:14 2003  Matthias Clasen  <maclas@gmx.de>

* gtk/gtkscrolledwindow.c: Implement RTL flipping for
GtkScrolledWindow: the vertical scrollbar shows up on the left
side in RTL mode.  (#107526)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkscrolledwindow.c
gtk/gtkviewport.c

index 4a0e26ed35409542f893e3d7f09b57ea3fe1bde7..f4fd015fd19ce3751ca7f51844dfa3e6ed437967 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+Sat Dec  6 00:23:46 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkviewport.c: Implement RTL flipping for 
+       GtkViewport: Adjust the "gravity" when resizing
+       This is a bit flickery in RTL mode.  (#107526)
+
+Sat Dec  6 00:22:14 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkscrolledwindow.c: Implement RTL flipping for 
+       GtkScrolledWindow: the vertical scrollbar shows up on the left
+       side in RTL mode.  (#107526)
+
+Fri Dec  5 01:58:33 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtknotebook.c: Implement RTL flipping for GtkNotebook:
+       tabs displayed at the top/bottom are rearranged, and tabs on
+       the left/right are displayed at the opposite edge.  (#96630)
+
 2003-12-04  Mark McLoughlin  <mark@skynet.ie>
 
        * gtk/gtklabel.c: (gtk_label_set_attributes_internal): Allow
index 4a0e26ed35409542f893e3d7f09b57ea3fe1bde7..f4fd015fd19ce3751ca7f51844dfa3e6ed437967 100644 (file)
@@ -1,3 +1,21 @@
+Sat Dec  6 00:23:46 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkviewport.c: Implement RTL flipping for 
+       GtkViewport: Adjust the "gravity" when resizing
+       This is a bit flickery in RTL mode.  (#107526)
+
+Sat Dec  6 00:22:14 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkscrolledwindow.c: Implement RTL flipping for 
+       GtkScrolledWindow: the vertical scrollbar shows up on the left
+       side in RTL mode.  (#107526)
+
+Fri Dec  5 01:58:33 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtknotebook.c: Implement RTL flipping for GtkNotebook:
+       tabs displayed at the top/bottom are rearranged, and tabs on
+       the left/right are displayed at the opposite edge.  (#96630)
+
 2003-12-04  Mark McLoughlin  <mark@skynet.ie>
 
        * gtk/gtklabel.c: (gtk_label_set_attributes_internal): Allow
index 4a0e26ed35409542f893e3d7f09b57ea3fe1bde7..f4fd015fd19ce3751ca7f51844dfa3e6ed437967 100644 (file)
@@ -1,3 +1,21 @@
+Sat Dec  6 00:23:46 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkviewport.c: Implement RTL flipping for 
+       GtkViewport: Adjust the "gravity" when resizing
+       This is a bit flickery in RTL mode.  (#107526)
+
+Sat Dec  6 00:22:14 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkscrolledwindow.c: Implement RTL flipping for 
+       GtkScrolledWindow: the vertical scrollbar shows up on the left
+       side in RTL mode.  (#107526)
+
+Fri Dec  5 01:58:33 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtknotebook.c: Implement RTL flipping for GtkNotebook:
+       tabs displayed at the top/bottom are rearranged, and tabs on
+       the left/right are displayed at the opposite edge.  (#96630)
+
 2003-12-04  Mark McLoughlin  <mark@skynet.ie>
 
        * gtk/gtklabel.c: (gtk_label_set_attributes_internal): Allow
index 4a0e26ed35409542f893e3d7f09b57ea3fe1bde7..f4fd015fd19ce3751ca7f51844dfa3e6ed437967 100644 (file)
@@ -1,3 +1,21 @@
+Sat Dec  6 00:23:46 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkviewport.c: Implement RTL flipping for 
+       GtkViewport: Adjust the "gravity" when resizing
+       This is a bit flickery in RTL mode.  (#107526)
+
+Sat Dec  6 00:22:14 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkscrolledwindow.c: Implement RTL flipping for 
+       GtkScrolledWindow: the vertical scrollbar shows up on the left
+       side in RTL mode.  (#107526)
+
+Fri Dec  5 01:58:33 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtknotebook.c: Implement RTL flipping for GtkNotebook:
+       tabs displayed at the top/bottom are rearranged, and tabs on
+       the left/right are displayed at the opposite edge.  (#96630)
+
 2003-12-04  Mark McLoughlin  <mark@skynet.ie>
 
        * gtk/gtklabel.c: (gtk_label_set_attributes_internal): Allow
index 4a0e26ed35409542f893e3d7f09b57ea3fe1bde7..f4fd015fd19ce3751ca7f51844dfa3e6ed437967 100644 (file)
@@ -1,3 +1,21 @@
+Sat Dec  6 00:23:46 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkviewport.c: Implement RTL flipping for 
+       GtkViewport: Adjust the "gravity" when resizing
+       This is a bit flickery in RTL mode.  (#107526)
+
+Sat Dec  6 00:22:14 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkscrolledwindow.c: Implement RTL flipping for 
+       GtkScrolledWindow: the vertical scrollbar shows up on the left
+       side in RTL mode.  (#107526)
+
+Fri Dec  5 01:58:33 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtknotebook.c: Implement RTL flipping for GtkNotebook:
+       tabs displayed at the top/bottom are rearranged, and tabs on
+       the left/right are displayed at the opposite edge.  (#96630)
+
 2003-12-04  Mark McLoughlin  <mark@skynet.ie>
 
        * gtk/gtklabel.c: (gtk_label_set_attributes_internal): Allow
index 7a49d0df4363058481a645ef1ac97b3699829281..c2fbfc555a199886727ddf06134e10469273b803 100644 (file)
@@ -1029,11 +1029,18 @@ gtk_scrolled_window_relative_allocation (GtkWidget     *widget,
   if (scrolled_window->vscrollbar_visible)
     {
       GtkRequisition vscrollbar_requisition;
+      gboolean is_rtl;
+
       gtk_widget_get_child_requisition (scrolled_window->vscrollbar,
                                        &vscrollbar_requisition);
+      is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
   
-      if (scrolled_window->window_placement == GTK_CORNER_TOP_RIGHT ||
-         scrolled_window->window_placement == GTK_CORNER_BOTTOM_RIGHT)
+      if ((!is_rtl && 
+          (scrolled_window->window_placement == GTK_CORNER_TOP_RIGHT ||
+           scrolled_window->window_placement == GTK_CORNER_BOTTOM_RIGHT)) ||
+         (is_rtl && 
+          (scrolled_window->window_placement == GTK_CORNER_TOP_LEFT ||
+           scrolled_window->window_placement == GTK_CORNER_BOTTOM_LEFT)))
        allocation->x += (vscrollbar_requisition.width +  scrollbar_spacing);
 
       allocation->width = MAX (1, allocation->width - (vscrollbar_requisition.width + scrollbar_spacing));
@@ -1170,8 +1177,12 @@ gtk_scrolled_window_size_allocate (GtkWidget     *widget,
       gtk_widget_get_child_requisition (scrolled_window->vscrollbar,
                                        &vscrollbar_requisition);
 
-      if (scrolled_window->window_placement == GTK_CORNER_TOP_LEFT ||
-         scrolled_window->window_placement == GTK_CORNER_BOTTOM_LEFT)
+      if ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL && 
+          (scrolled_window->window_placement == GTK_CORNER_TOP_RIGHT ||
+           scrolled_window->window_placement == GTK_CORNER_BOTTOM_RIGHT)) ||
+         (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR && 
+          (scrolled_window->window_placement == GTK_CORNER_TOP_LEFT ||
+           scrolled_window->window_placement == GTK_CORNER_BOTTOM_LEFT)))
        child_allocation.x = (relative_allocation.x +
                              relative_allocation.width +
                              scrollbar_spacing +
index 2a63f4e1146fa3a8ad9169031d1a79cf1868ac65..4977865ff54c37309c801c233b643b52f241c305 100644 (file)
@@ -382,9 +382,11 @@ viewport_set_hadjustment_values (GtkViewport *viewport,
   GtkBin *bin = GTK_BIN (viewport);
   GtkAllocation view_allocation;
   GtkAdjustment *hadjustment = gtk_viewport_get_hadjustment (viewport);
-
+  gdouble old_page_size;
+  
   viewport_get_view_allocation (viewport, &view_allocation);  
 
+  old_page_size = hadjustment->page_size;
   hadjustment->page_size = view_allocation.width;
   hadjustment->step_increment = view_allocation.width * 0.1;
   hadjustment->page_increment = view_allocation.width * 0.9;
@@ -401,7 +403,15 @@ viewport_set_hadjustment_values (GtkViewport *viewport,
   else
     hadjustment->upper = view_allocation.width;
 
-  viewport_reclamp_adjustment (hadjustment, value_changed);
+  if (gtk_widget_get_direction (GTK_WIDGET (viewport)) == GTK_TEXT_DIR_RTL) 
+    {
+      gdouble old_value = hadjustment->value;
+      hadjustment->value = hadjustment->value + old_page_size - hadjustment->page_size;
+      viewport_reclamp_adjustment (hadjustment, value_changed);
+      *value_changed = (old_value != hadjustment->value);
+    }
+  else
+    viewport_reclamp_adjustment (hadjustment, value_changed);
 }
 
 static void