[gnome-flashback/wip/segeiger/gnome-3-18-inputmethods] A few more fixes
- From: Sebastian Geiger <segeiger src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback/wip/segeiger/gnome-3-18-inputmethods] A few more fixes
- Date: Wed, 13 Jan 2016 09:40:19 +0000 (UTC)
commit be60a011e6a98eaf32a8cb3eb4e33538f5db8ae8
Author: Sebastian Geiger <sbastig gmx net>
Date: Wed Jan 13 10:38:59 2016 +0100
A few more fixes
.../libinput-sources/gf-candidate-area.c | 18 ++++++++-------
.../libinput-sources/gf-candidate-popup.c | 23 +++++++++++++++----
2 files changed, 28 insertions(+), 13 deletions(-)
---
diff --git a/gnome-flashback/libinput-sources/gf-candidate-area.c
b/gnome-flashback/libinput-sources/gf-candidate-area.c
index e79060b..97abf6d 100644
--- a/gnome-flashback/libinput-sources/gf-candidate-area.c
+++ b/gnome-flashback/libinput-sources/gf-candidate-area.c
@@ -33,7 +33,7 @@ struct _GfCandidateArea
GList *candidate_boxes;
- int orientation;
+ guint orientation;
int cursor_position;
};
@@ -69,8 +69,11 @@ button_clicked_cb (GtkWidget *widget,
if (list->data == widget) {
index = i;
}
+ list = g_list_next (list);
}
- g_signal_emit (area, signals[SIGNAL_CANDIDATE_CLICKED], 0, index, event);
+
+ if (index != -1)
+ g_signal_emit (area, signals[SIGNAL_CANDIDATE_CLICKED], 0, index, event);
return GDK_EVENT_PROPAGATE;
}
@@ -135,7 +138,7 @@ gf_candidate_area_set_candidates (GfCandidateArea *area,
GList *children;
GtkWidget *index_label;
GtkWidget *candidate_label;
- gchar *index_text;
+ const gchar *index_text;
visible = i < g_list_length (candidates);
box = g_list_nth (area->candidate_boxes, i)->data;
@@ -150,18 +153,16 @@ gf_candidate_area_set_candidates (GfCandidateArea *area,
if (indexes && g_list_nth (indexes, i)->data)
{
- index_text = g_strdup (g_list_nth (indexes, i)->data);
+ index_text = g_list_nth (indexes, i)->data;
}
else
{
- index_text = g_strdup (DEFAULT_INDEX_LABELS [i]);
+ index_text = DEFAULT_INDEX_LABELS [i];
}
gtk_label_set_text (GTK_LABEL(index_label), index_text);
gtk_label_set_text (GTK_LABEL (candidate_label),
- g_strdup (g_list_nth (candidates, i)->data));
-
- g_free (index_text);
+ g_list_nth (candidates, i)->data);
}
//TODO: Remove 'selected' pseudo-class
@@ -250,6 +251,7 @@ gf_candidate_area_init (GfCandidateArea *area)
gtk_container_add (GTK_CONTAINER (area->button_box), area->prev_button);
gtk_container_add (GTK_CONTAINER (area->button_box), area->next_button);
+ gtk_widget_show_all (area->box_layout);
g_signal_connect (area->prev_button, "clicked",
G_CALLBACK (prev_button_clicked_cb), area);
diff --git a/gnome-flashback/libinput-sources/gf-candidate-popup.c
b/gnome-flashback/libinput-sources/gf-candidate-popup.c
index c99aab9..7bd0735 100644
--- a/gnome-flashback/libinput-sources/gf-candidate-popup.c
+++ b/gnome-flashback/libinput-sources/gf-candidate-popup.c
@@ -90,6 +90,8 @@ update_preedit_text_cb (IBusPanelService *service,
popup = GF_CANDIDATE_POPUP (user_data);
+ gtk_widget_set_visible (popup->pre_edit_text, visible);
+
gtk_label_set_text (GTK_LABEL (popup->pre_edit_text),
ibus_text_get_text (text));
@@ -134,7 +136,15 @@ update_auxiliary_text_cb (IBusPanelService *service,
gboolean visible,
gpointer user_data)
{
+ GfCandidatePopup *popup;
+
g_message ("update_auxiliary_text_cb");
+
+ popup = GF_CANDIDATE_POPUP (user_data);
+
+ gtk_widget_set_visible (popup->aux_text, visible);
+
+ gtk_label_set_text (GTK_LABEL (popup->aux_text), ibus_text_get_text (text));
}
static void
@@ -182,7 +192,6 @@ update_lookup_table_cb (IBusPanelService *service,
indexes = NULL;
candidates = NULL;
- popup->candidate_area_visible = visible;
gtk_widget_set_visible (popup->window, visible);
n_candidates = ibus_lookup_table_get_number_of_candidates (lookup_table);
cursor_position = ibus_lookup_table_get_cursor_pos (lookup_table);
@@ -233,7 +242,6 @@ hide_lookup_table_cb (IBusPanelService *service,
gpointer user_data)
{
GfCandidatePopup *popup;
- GtkWidget *box_layout;
g_message ("hide_lookup_table_cb");
@@ -318,9 +326,11 @@ gf_candidate_popup_class_init (GfCandidatePopupClass *popup_class)
static void
gf_candidate_popup_init (GfCandidatePopup *popup)
{
+ GtkWidget *candidate_area_widget;
+
popup->candidateArea = gf_candidate_area_new();
- popup->box_layout = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ popup->box_layout = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
popup->window = gtk_window_new (GTK_WINDOW_POPUP);
gtk_window_set_position (GTK_WINDOW (popup->window), GTK_WIN_POS_CENTER);
@@ -333,10 +343,13 @@ gf_candidate_popup_init (GfCandidatePopup *popup)
gtk_container_add (GTK_CONTAINER (popup->box_layout), popup->pre_edit_text);
gtk_container_add (GTK_CONTAINER (popup->box_layout), popup->aux_text);
+ candidate_area_widget = gf_candidate_area_get_box_layout (popup->candidateArea);
+
gtk_container_add (GTK_CONTAINER (popup->box_layout),
- gf_candidate_area_get_box_layout (popup->candidateArea));
+ candidate_area_widget);
- gtk_widget_show_all (popup->box_layout);
+ gtk_widget_show (popup->box_layout);
+ gtk_widget_show (candidate_area_widget);
g_signal_connect (popup->candidateArea, "previous-page",
G_CALLBACK (area_page_prev_cb), popup);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]