[gimp/gtk3-port: 221/235] Use GTK+3 gtk_get_locale_direction() function instead of current hack.
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 221/235] Use GTK+3 gtk_get_locale_direction() function instead of current hack.
- Date: Mon, 22 May 2017 21:55:15 +0000 (UTC)
commit f9037d29084d7137b7033dbef239702b2a7d4c67
Author: Jehan <jehan girinstud io>
Date: Thu Jan 16 15:50:58 2014 +1300
Use GTK+3 gtk_get_locale_direction() function instead of current hack.
This new function is available from the released dev version 3.11.4. But
we don't want to require GTK+ master for the gtk3-port branch, so I
leave the old hack in a GTK_CHECK_VERSION() macro, to be removed later
when we update GTK+ required version.
app/gui/gui.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/app/gui/gui.c b/app/gui/gui.c
index 40df7be..0bd67a4 100644
--- a/app/gui/gui.c
+++ b/app/gui/gui.c
@@ -227,21 +227,27 @@ gui_init (Gimp *gimp,
the_gui_gimp = gimp;
+ /* Normally this should have been taken care of during command line
+ * parsing as a post-parse hook of gtk_get_option_group(), using the
+ * system locales.
+ * But user config may have overriden the language, therefore we must
+ * check the widget directions again.
+ */
+#if GTK_CHECK_VERSION (3, 11, 4)
+ gtk_widget_set_default_direction (gtk_get_locale_direction ());
+ /* TODO: remove the below hack once the GTK+ required version is
+ * 3.11.4 or higher. */
+#else
/* TRANSLATORS: there is no need to translate this in GIMP. This uses
* "gtk20" domain as a special trick to determine language direction,
* but xgettext extracts it anyway mistakenly into GIMP po files.
* Leave an empty string as translation. It does not matter.
*/
if (g_strcmp0 (dgettext ("gtk20", "default:LTR"), "default:RTL") == 0)
- /* Normally this should have been taken care of during command line
- * parsing as a post-parse hook of gtk_get_option_group(), using the
- * system locales.
- * But user config may have overriden the language, therefore we must
- * check the widget directions again.
- */
gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL);
else
gtk_widget_set_default_direction (GTK_TEXT_DIR_LTR);
+#endif
gui_unique_init (gimp);
gimp_language_store_parser_init ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]