summaryrefslogtreecommitdiff
path: root/gtk/gtkviewport.c
diff options
context:
space:
mode:
authorMatthias Clasen <maclas@gmx.de>2003-12-05 23:31:51 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2003-12-05 23:31:51 +0000
commit8ad788e914492cd1a48861550e99b010bfa6e24f (patch)
treea2fb970c08633075bebd5b512136b2e961b36826 /gtk/gtkviewport.c
parentd861261bc2f4f3a6cfebe783bc2cab726e014102 (diff)
downloadgtk+-8ad788e914492cd1a48861550e99b010bfa6e24f.tar.gz
Implement RTL flipping for GtkViewport: Adjust the "gravity" when resizing
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)
Diffstat (limited to 'gtk/gtkviewport.c')
-rw-r--r--gtk/gtkviewport.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index 2a63f4e114..4977865ff5 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -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