Add forgotten backport for grid flipping

This commit is contained in:
Matthias Clasen 2011-04-04 12:04:16 -04:00
parent 8674ab16a1
commit f7570ff5d3
2 changed files with 51 additions and 1 deletions

View File

@ -0,0 +1,43 @@
From 20ab58d79910d1829dadfbb717c354cf74a043b1 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Wed, 30 Mar 2011 02:24:00 -0400
Subject: [PATCH] GtkGrid: Add forgotten RTL flipping
How did we manage to add a non-RTL savy container in GTK+ 3.0 ?
---
gtk/gtkgrid.c | 4 ++++
tests/testgrid.c | 3 +++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/gtk/gtkgrid.c b/gtk/gtkgrid.c
index bd305f6..56f6c16 100644
--- a/gtk/gtkgrid.c
+++ b/gtk/gtkgrid.c
@@ -1207,6 +1207,10 @@ gtk_grid_request_allocate_children (GtkGridRequest *request)
child_allocation.width = MAX (1, width);
child_allocation.height = MAX (1, height);
+ if (gtk_widget_get_direction (GTK_WIDGET (request->grid)) == GTK_TEXT_DIR_RTL)
+ child_allocation.x = allocation.x + allocation.width
+ - (child_allocation.x - allocation.x) - child_allocation.width;
+
gtk_widget_size_allocate (child->widget, &child_allocation);
}
}
diff --git a/tests/testgrid.c b/tests/testgrid.c
index a59aefe..f9e85bb 100644
--- a/tests/testgrid.c
+++ b/tests/testgrid.c
@@ -252,6 +252,9 @@ main (int argc, char *argv[])
{
gtk_init (NULL, NULL);
+ if (g_getenv ("RTL"))
+ gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL);
+
simple_grid ();
text_grid ();
box_comparison ();
--
1.7.4.2

View File

@ -11,7 +11,7 @@
Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X
Name: gtk3 Name: gtk3
Version: 3.0.8 Version: 3.0.8
Release: 1%{?dist} Release: 2%{?dist}
License: LGPLv2+ License: LGPLv2+
Group: System Environment/Libraries Group: System Environment/Libraries
URL: http://www.gtk.org URL: http://www.gtk.org
@ -19,6 +19,9 @@ URL: http://www.gtk.org
Source: http://download.gnome.org/sources/gtk+/3.0/gtk+-%{version}.tar.bz2 Source: http://download.gnome.org/sources/gtk+/3.0/gtk+-%{version}.tar.bz2
Source1: im-cedilla.conf Source1: im-cedilla.conf
# upstream fix
Patch0: 0001-GtkGrid-Add-forgotten-RTL-flipping.patch
BuildRequires: gnome-common autoconf automake intltool gettext BuildRequires: gnome-common autoconf automake intltool gettext
BuildRequires: atk-devel >= %{atk_version} BuildRequires: atk-devel >= %{atk_version}
BuildRequires: glib2-devel >= %{glib2_version} BuildRequires: glib2-devel >= %{glib2_version}
@ -110,6 +113,7 @@ widget toolkit.
%prep %prep
%setup -q -n gtk+-%{version} %setup -q -n gtk+-%{version}
%patch0 -p1 -b .grid-flipping
%build %build
@ -239,6 +243,9 @@ gtk-query-immodules-3.0-%{__isa_bits} --update-cache
%{_datadir}/gtk-doc %{_datadir}/gtk-doc
%changelog %changelog
* Mon Apr 4 2011 Matthias Clasen <mclasen@redhat.com> - 3.0.8-2
- Add a missed backport
* Sun Apr 3 2011 Matthias Clasen <mclasen@redhat.com> - 3.0.8-1 * Sun Apr 3 2011 Matthias Clasen <mclasen@redhat.com> - 3.0.8-1
- Update to 3.0.8 - Update to 3.0.8