[gnome-flashback/wip/segeiger/gnome-3-18-inputmethods] Add orientation and update buttons



commit a1b24cd3898c16025e8b5be6cb5f2489967ced85
Author: Sebastian Geiger <sbastig gmx net>
Date:   Wed Jan 13 15:44:24 2016 +0100

    Add orientation and update buttons

 .../libinput-sources/gf-candidate-popup.c          |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/gnome-flashback/libinput-sources/gf-candidate-popup.c 
b/gnome-flashback/libinput-sources/gf-candidate-popup.c
index a7efe1a..8c419c0 100644
--- a/gnome-flashback/libinput-sources/gf-candidate-popup.c
+++ b/gnome-flashback/libinput-sources/gf-candidate-popup.c
@@ -215,6 +215,7 @@ update_lookup_table_cb (IBusPanelService *service,
         i;
   GList *indexes, *candidates;
   IBusText *index_label;
+  gint orientation;
 
   popup = GF_CANDIDATE_POPUP (user_data);
   indexes = NULL;
@@ -224,6 +225,7 @@ update_lookup_table_cb (IBusPanelService *service,
   n_candidates = ibus_lookup_table_get_number_of_candidates (lookup_table);
   cursor_position = ibus_lookup_table_get_cursor_pos (lookup_table);
   page_size = ibus_lookup_table_get_page_size (lookup_table);
+  n_pages = (guint) ceil (n_candidates / page_size);
   page = ((cursor_position == 0) ? 0 :
           (guint) floor (cursor_position / page_size));
   start_index = page * page_size;
@@ -251,6 +253,15 @@ update_lookup_table_cb (IBusPanelService *service,
                                     indexes, candidates, cursor_position,
                                     visible);
 
+  orientation = ibus_lookup_table_get_orientation (lookup_table);
+
+  gf_candidate_area_set_orientation (GF_CANDIDATE_AREA (popup->candidate_area),
+                                     (IBusOrientation) orientation);
+
+  gf_candidate_area_update_buttons (GF_CANDIDATE_AREA (popup->candidate_area),
+                                    ibus_lookup_table_is_round (lookup_table),
+                                    page, n_pages);
+
   g_list_free (indexes);
   g_list_free (candidates);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]