[gnome-flashback/wip/segeiger/gnome-3-18-inputmethods] More fixes
- From: Sebastian Geiger <segeiger src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback/wip/segeiger/gnome-3-18-inputmethods] More fixes
- Date: Wed, 13 Jan 2016 14:25:40 +0000 (UTC)
commit 23c29452370b6e244ba32aa7effc837bd6270b92
Author: Sebastian Geiger <sbastig gmx net>
Date: Wed Jan 13 14:55:44 2016 +0100
More fixes
.../libinput-sources/gf-candidate-area.c | 25 +++++++++++++++----
1 files changed, 19 insertions(+), 6 deletions(-)
---
diff --git a/gnome-flashback/libinput-sources/gf-candidate-area.c
b/gnome-flashback/libinput-sources/gf-candidate-area.c
index af585d0..8e53b24 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;
- guint orientation;
+ gint orientation;
int cursor_position;
};
@@ -108,7 +108,7 @@ void
gf_candidate_area_set_orientation (GfCandidateArea *area,
IBusOrientation orientation)
{
- if (area->orientation == orientation)
+ if (area->orientation == (gint) orientation)
return;
area->orientation = orientation;
@@ -220,25 +220,27 @@ gf_candidate_area_class_init (GfCandidateAreaClass *area_class)
static void
gf_candidate_area_init (GfCandidateArea *area)
{
+ GtkStyleContext *context;
int i;
area->box_layout = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
for (i = 0; i < MAX_CANDIDATES_PER_PAGE; i++)
{
- GtkStyleContext *context;
- GtkWidget *box;
+ GtkWidget *box,
+ *index_label,
+ *candidate_label;
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
context = gtk_widget_get_style_context (box);
gtk_style_context_add_class (context, "candidate-box");
gtk_container_add (GTK_CONTAINER (area->box_layout), box);
- GtkWidget *index_label = gtk_label_new ("");
+ index_label = gtk_label_new ("");
context = gtk_widget_get_style_context (index_label);
gtk_style_context_add_class (context, "candidate-index");
- GtkWidget *candidate_label = gtk_label_new ("");
+ candidate_label = gtk_label_new ("");
context = gtk_widget_get_style_context (candidate_label);
gtk_style_context_add_class (context, "candidate-label");
@@ -254,10 +256,18 @@ gf_candidate_area_init (GfCandidateArea *area)
}
area->button_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ context = gtk_widget_get_style_context (area->button_box);
+ gtk_style_context_add_class (context, "candidate-page-button-box");
+
gtk_container_add (GTK_CONTAINER (area->box_layout), area->button_box);
area->prev_button = gtk_button_new_with_label ("Prev");
+ context = gtk_widget_get_style_context (area->prev_button);
+ gtk_style_context_add_class (context, "candidate-page-button candidate-page-button-previous button");
+
area->next_button = gtk_button_new_with_label ("Next");
+ context = gtk_widget_get_style_context (area->next_button);
+ gtk_style_context_add_class (context, "candidate-page-button candidate-page-button-next button");
gtk_container_add (GTK_CONTAINER (area->button_box), area->prev_button);
gtk_container_add (GTK_CONTAINER (area->button_box), area->next_button);
@@ -268,6 +278,9 @@ gf_candidate_area_init (GfCandidateArea *area)
G_CALLBACK (prev_button_clicked_cb), area);
g_signal_connect (area->next_button, "clicked",
G_CALLBACK (next_button_clicked_cb), area);
+
+ area->orientation = -1;
+ area->cursor_position = 0;
}
GfCandidateArea*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]