Commit 8ad788e9 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

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)
parent d861261b
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
......
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
......
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
......
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
......
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
......
......@@ -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 +
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment