[clutter/clutter-1.18] text: Use the keymap direction when focused
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/clutter-1.18] text: Use the keymap direction when focused
- Date: Tue, 4 Mar 2014 01:36:32 +0000 (UTC)
commit c73f45ca7c90af622e604e1edd8e27f4bdd9acc8
Author: Emmanuele Bassi <ebassi gnome org>
Date: Mon Mar 3 23:25:08 2014 +0000
text: Use the keymap direction when focused
If the ClutterText actor has key focus then we should ask for the
direction of the key map, instead of the direction of the actor.
https://bugzilla.gnome.org/show_bug.cgi?id=705779
clutter/clutter-text.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/clutter/clutter-text.c b/clutter/clutter-text.c
index 66fff83..2ce8319 100644
--- a/clutter/clutter-text.c
+++ b/clutter/clutter-text.c
@@ -49,6 +49,7 @@
#include "clutter-actor-private.h"
#include "clutter-animatable.h"
+#include "clutter-backend-private.h"
#include "clutter-binding-pool.h"
#include "clutter-color.h"
#include "clutter-debug.h"
@@ -539,14 +540,20 @@ clutter_text_create_layout_no_cache (ClutterText *text,
if (pango_dir == PANGO_DIRECTION_NEUTRAL)
{
+ ClutterBackend *backend = clutter_get_default_backend ();
ClutterTextDirection text_dir;
- text_dir = clutter_actor_get_text_direction (CLUTTER_ACTOR (text));
-
- if (text_dir == CLUTTER_TEXT_DIRECTION_RTL)
- pango_dir = PANGO_DIRECTION_RTL;
+ if (clutter_actor_has_key_focus (CLUTTER_ACTOR (text)))
+ pango_dir = _clutter_backend_get_keymap_direction (backend);
else
- pango_dir = PANGO_DIRECTION_LTR;
+ {
+ text_dir = clutter_actor_get_text_direction (CLUTTER_ACTOR (text));
+
+ if (text_dir == CLUTTER_TEXT_DIRECTION_RTL)
+ pango_dir = PANGO_DIRECTION_RTL;
+ else
+ pango_dir = PANGO_DIRECTION_LTR;
+ }
}
pango_context_set_base_dir (clutter_actor_get_pango_context (CLUTTER_ACTOR (text)), pango_dir);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]