summaryrefslogtreecommitdiff
path: root/gtk/gtkcellview.c
diff options
context:
space:
mode:
authorKristian Rietveld <kris@gtk.org>2003-12-12 20:08:58 +0000
committerKristian Rietveld <kristian@src.gnome.org>2003-12-12 20:08:58 +0000
commit375ccb28b329d28453b9cf8de66be7d000640736 (patch)
tree000313160f2f1cdfe42d8d2afe9aded378944bed /gtk/gtkcellview.c
parentf0293295db45b2088ac2ab8ad9f6039f59be0ff9 (diff)
downloadgtk+-375ccb28b329d28453b9cf8de66be7d000640736.tar.gz
Combo box flipping support.
Fri Dec 12 21:00:12 2003 Kristian Rietveld <kris@gtk.org> Combo box flipping support. * gtk/gtkcombobox.c (gtk_combo_box_menu_position), (gtk_combo_box_size_allocate): support RTL flipping (#126518, patch from Matthias Clasen), (gtk_combo_box_popup): fix popup window alignment if there's a cell view frame visible (#126518, patch from Semion Chichelnitsky). * gtk/gtkcellview.c (gtk_cell_view_expose): support RTL flipping (#128348, patch from Semion Chichelnitsky).
Diffstat (limited to 'gtk/gtkcellview.c')
-rw-r--r--gtk/gtkcellview.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gtk/gtkcellview.c b/gtk/gtkcellview.c
index cf3933442e..b307573d60 100644
--- a/gtk/gtkcellview.c
+++ b/gtk/gtkcellview.c
@@ -403,6 +403,7 @@ gtk_cell_view_expose (GtkWidget *widget,
GList *i;
GtkCellView *cellview;
GdkRectangle area;
+ gboolean rtl = (gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL);
cellview = GTK_CELL_VIEW (widget);
@@ -439,7 +440,7 @@ gtk_cell_view_expose (GtkWidget *widget,
area = widget->allocation;
/* we draw on our very own window, initialize x and y to zero */
- area.x = widget->allocation.x;
+ area.x = widget->allocation.x + (rtl ? widget->allocation.width : 0);
area.y = widget->allocation.y;
/* PACK_START */
@@ -454,6 +455,8 @@ gtk_cell_view_expose (GtkWidget *widget,
continue;
area.width = info->real_width;
+ if (rtl)
+ area.x -= area.width;
gtk_cell_renderer_render (info->cell,
event->window,
@@ -461,9 +464,12 @@ gtk_cell_view_expose (GtkWidget *widget,
/* FIXME! */
&area, &area, &event->area, 0);
- area.x += info->real_width;
+ if (!rtl)
+ area.x += info->real_width;
}
+ area.x = rtl ? widget->allocation.x : (widget->allocation.x + widget->allocation.width);
+
/* PACK_END */
for (i = cellview->priv->cell_list; i; i = i->next)
{
@@ -476,13 +482,16 @@ gtk_cell_view_expose (GtkWidget *widget,
continue;
area.width = info->real_width;
+ if (!rtl)
+ area.x -= area.width;
gtk_cell_renderer_render (info->cell,
widget->window,
widget,
/* FIXME ! */
&area, &area, &event->area, 0);
- area.x += info->real_width;
+ if (rtl)
+ area.x += info->real_width;
}
return FALSE;