[gnome-builder/wip/slaf/spellcheck-sidebar: 9/33] spellchecker: rework the UI to be a sidebar



commit b109354dbf9f61e81ffc2cc4373c98a973a47799
Author: Sébastien Lafargue <slafargue gnome org>
Date:   Sun Jan 1 17:47:58 2017 +0100

    spellchecker: rework the UI to be a sidebar

 libide/editor/ide-editor-spell-widget.c  |  178 ++++++-----
 libide/editor/ide-editor-spell-widget.ui |  534 +++++++++++++-----------------
 2 files changed, 334 insertions(+), 378 deletions(-)
---
diff --git a/libide/editor/ide-editor-spell-widget.c b/libide/editor/ide-editor-spell-widget.c
index c0e5766..86cfd5a 100644
--- a/libide/editor/ide-editor-spell-widget.c
+++ b/libide/editor/ide-editor-spell-widget.c
@@ -25,6 +25,13 @@
 
 #include "ide-editor-spell-widget.h"
 
+typedef enum
+{
+  CHECK_WORD_NONE,
+  CHECK_WORD_CHECKING,
+  CHECK_WORD_IDLE
+} CheckWordState;
+
 struct _IdeEditorSpellWidget
 {
   GtkBin                 parent_instance;
@@ -36,30 +43,39 @@ struct _IdeEditorSpellWidget
   IdeEditorDictWidget   *dict_widget;
   const GspellLanguage  *spellchecker_language;
 
+  GtkLabel              *misspelled_label;
+  GtkLabel              *change_to_label;
+  GtkLabel              *suggestions_label;
+  GtkLabel              *language_label;
   GtkLabel              *word_label;
   GtkLabel              *count_label;
   GtkEntry              *word_entry;
-  GtkButton             *check_button;
-  GtkButton             *add_dict_button;
   GtkButton             *ignore_button;
   GtkButton             *ignore_all_button;
   GtkButton             *change_button;
   GtkButton             *change_all_button;
-  GtkButton             *close_button;
   GtkListBox            *suggestions_box;
-  GtkRevealer           *dict_revealer;
 
   GtkButton             *highlight_checkbutton;
   GtkButton             *language_chooser_button;
+  GtkWidget             *dict_box;
 
   GtkWidget             *placeholder;
   GAction               *view_spellchecking_action;
 
+  guint                  check_word_timeout_id;
+  CheckWordState         check_word_state;
+
   guint                  view_spellchecker_set : 1;
+  guint                  is_checking_word : 1;
+  guint                  is_check_word_invalid : 1;
+  guint                  is_check_word_idle : 1;
 };
 
 G_DEFINE_TYPE (IdeEditorSpellWidget, ide_editor_spell_widget, GTK_TYPE_BIN)
 
+#define CHECK_WORD_INTERVAL_MIN 100
+
 enum {
   PROP_0,
   PROP_VIEW,
@@ -89,12 +105,10 @@ set_sensiblility (IdeEditorSpellWidget *self,
   clear_suggestions_box (self);
 
   gtk_widget_set_sensitive (GTK_WIDGET (self->word_entry), sensibility);
-  gtk_widget_set_sensitive (GTK_WIDGET (self->check_button), sensibility);
   gtk_widget_set_sensitive (GTK_WIDGET (self->ignore_button), sensibility);
   gtk_widget_set_sensitive (GTK_WIDGET (self->ignore_all_button), sensibility);
   gtk_widget_set_sensitive (GTK_WIDGET (self->change_button), sensibility);
   gtk_widget_set_sensitive (GTK_WIDGET (self->change_all_button), sensibility);
-  gtk_widget_set_sensitive (GTK_WIDGET (self->add_dict_button), sensibility);
   gtk_widget_set_sensitive (GTK_WIDGET (self->suggestions_box), sensibility);
 }
 
@@ -141,6 +155,7 @@ fill_suggestions_box (IdeEditorSpellWidget *self,
   if (NULL == (suggestions = gspell_checker_get_suggestions (self->checker, word, -1)))
     {
       *first_result = NULL;
+      gtk_label_set_text (GTK_LABEL (self->placeholder), _("No suggestioons"));
       gtk_widget_set_sensitive (GTK_WIDGET (self->suggestions_box), FALSE);
     }
   else
@@ -249,72 +264,84 @@ ide_editor_spell_widget_set_view (IdeEditorSpellWidget *self,
   self->navigator = ide_editor_spell_navigator_new (GTK_TEXT_VIEW (view));
 }
 
-static void
-ide_editor_spell_widget__word_entry_changed_cb (IdeEditorSpellWidget *self,
-                                                GtkEntry             *entry)
-{
-  gboolean sensitive;
-
-  g_assert (IDE_IS_EDITOR_SPELL_WIDGET (self));
-  g_assert (GTK_IS_ENTRY (entry));
-
-  sensitive = (gtk_entry_get_text_length (entry) > 0);
-
-  gtk_widget_set_sensitive (GTK_WIDGET (self->check_button), sensitive);
-  gtk_widget_set_sensitive (GTK_WIDGET (self->change_button), sensitive);
-  gtk_widget_set_sensitive (GTK_WIDGET (self->change_all_button), sensitive);
-}
-
-static void
-ide_editor_spell_widget__check_button_clicked_cb (IdeEditorSpellWidget *self,
-                                                  GtkButton            *button)
+static gboolean
+check_word_timeout_cb (IdeEditorSpellWidget *self)
 {
   const gchar *word;
   g_autofree gchar *first_result = NULL;
-  GError *error = NULL;
-  gboolean ret = FALSE;
+  g_autoptr(GError) error = NULL;
+  gchar *icon_name;
+  gboolean ret = TRUE;
 
   g_assert (IDE_IS_EDITOR_SPELL_WIDGET (self));
-  g_assert (GTK_IS_BUTTON (button));
 
-  word = gtk_entry_get_text (self->word_entry);
-  g_assert (!ide_str_empty0 (word));
+  self->check_word_state = CHECK_WORD_CHECKING;
 
-  ret = gspell_checker_check_word (self->checker, word, -1, &error);
-  if (error != NULL)
+  word = gtk_entry_get_text (self->word_entry);
+  if (!ide_str_empty0 (word))
     {
-      printf ("check error:%s\n", error->message);
+      /* FIXME: suggestions can give a multiple-words suggestion that failed to the checkword test, ex: auto 
tools */
+      ret = gspell_checker_check_word (self->checker, word, -1, &error);
+      if (error != NULL)
+        {
+          printf ("check error:%s\n", error->message);
+        }
     }
 
-  if (ret)
+  icon_name = ret ? "" : "dialog-warning-symbolic";
+  gtk_entry_set_icon_from_icon_name (self->word_entry,
+                                     GTK_ENTRY_ICON_SECONDARY,
+                                     icon_name);
+
+  self->check_word_state = CHECK_WORD_NONE;
+
+  self->check_word_timeout_id = 0;
+  if (self->is_check_word_invalid == TRUE)
     {
-      gtk_label_set_text (GTK_LABEL (self->placeholder), _("Correct spelling"));
-      fill_suggestions_box (self, NULL, NULL);
-    }
-  else
-    {
-      fill_suggestions_box (self, word, &first_result);
-      if (!ide_str_empty0 (first_result))
-        gtk_entry_set_text (self->word_entry, first_result);
-      else
-        gtk_label_set_text (GTK_LABEL (self->placeholder), _("No suggestioons"));
+      self->check_word_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT,
+                                                        CHECK_WORD_INTERVAL_MIN,
+                                                        (GSourceFunc)check_word_timeout_cb,
+                                                        self,
+                                                        NULL);
+      self->check_word_state = CHECK_WORD_IDLE;
+      self->is_check_word_invalid = FALSE;
     }
+
+  return G_SOURCE_REMOVE;
 }
 
 static void
-ide_editor_spell_widget__add_dict_button_clicked_cb (IdeEditorSpellWidget *self,
-                                                     GtkButton            *button)
+ide_editor_spell_widget__word_entry_changed_cb (IdeEditorSpellWidget *self,
+                                                GtkEntry             *entry)
 {
-  const gchar *word;
+  gboolean sensitive;
 
   g_assert (IDE_IS_EDITOR_SPELL_WIDGET (self));
-  g_assert (GTK_IS_BUTTON (button));
+  g_assert (GTK_IS_ENTRY (entry));
 
-  word = gtk_label_get_text (self->word_label);
-  g_assert (!ide_str_empty0 (word));
+  sensitive = (gtk_entry_get_text_length (entry) > 0);
 
-  gspell_checker_add_word_to_personal (self->checker, word, -1);
-  jump_to_next_misspelled_word (self);
+  gtk_widget_set_sensitive (GTK_WIDGET (self->change_button), sensitive);
+  gtk_widget_set_sensitive (GTK_WIDGET (self->change_all_button), sensitive);
+
+  if (self->check_word_state == CHECK_WORD_CHECKING)
+    {
+      self->is_check_word_invalid = TRUE;
+      return;
+    }
+
+  if (self->check_word_state == CHECK_WORD_IDLE)
+    {
+      g_source_remove (self->check_word_timeout_id);
+      self->check_word_timeout_id = 0;
+    }
+
+  self->check_word_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT,
+                                                    CHECK_WORD_INTERVAL_MIN,
+                                                    (GSourceFunc)check_word_timeout_cb,
+                                                    self,
+                                                    NULL);
+  self->check_word_state = CHECK_WORD_IDLE;
 }
 
 static void
@@ -428,7 +455,7 @@ ide_editor_spell_widget__key_press_event_cb (IdeEditorSpellWidget *self,
 }
 
 static void
-ide_editor_frame_spell_widget_mapped_cb (IdeEditorSpellWidget *self)
+ide_editor_frame_spell__widget_mapped_cb (IdeEditorSpellWidget *self)
 {
   GActionGroup *group = NULL;
   GtkWidget *widget = GTK_WIDGET (self);
@@ -497,9 +524,9 @@ ide_editor_spell_widget__language_notify_cb (IdeEditorSpellWidget *self,
 }
 
 static void
-ide_editor_spell_widget_words_counted_cb (IdeEditorSpellWidget *self,
-                                          GParamSpec           *pspec,
-                                          GspellNavigator      *navigator)
+ide_editor_spell_widget__words_counted_cb (IdeEditorSpellWidget *self,
+                                           GParamSpec           *pspec,
+                                           GspellNavigator      *navigator)
 {
   g_assert (IDE_IS_EDITOR_SPELL_WIDGET (self));
 
@@ -527,7 +554,7 @@ ide_editor_spell_widget_constructed (GObject *object)
 
   g_signal_connect_swapped (self->navigator,
                             "notify::words-counted",
-                            G_CALLBACK (ide_editor_spell_widget_words_counted_cb),
+                            G_CALLBACK (ide_editor_spell_widget__words_counted_cb),
                             self);
 
   g_signal_connect_swapped (self->word_entry,
@@ -535,16 +562,6 @@ ide_editor_spell_widget_constructed (GObject *object)
                             G_CALLBACK (ide_editor_spell_widget__word_entry_changed_cb),
                             self);
 
-  g_signal_connect_swapped (self->check_button,
-                            "clicked",
-                            G_CALLBACK (ide_editor_spell_widget__check_button_clicked_cb),
-                            self);
-
-  g_signal_connect_swapped (self->add_dict_button,
-                            "clicked",
-                            G_CALLBACK (ide_editor_spell_widget__add_dict_button_clicked_cb),
-                            self);
-
   g_signal_connect_swapped (self->ignore_button,
                             "clicked",
                             G_CALLBACK (ide_editor_spell_widget__ignore_button_clicked_cb),
@@ -601,7 +618,7 @@ ide_editor_spell_widget_constructed (GObject *object)
    */
   g_signal_connect_object (self,
                            "map",
-                           G_CALLBACK (ide_editor_frame_spell_widget_mapped_cb),
+                           G_CALLBACK (ide_editor_frame_spell__widget_mapped_cb),
                            NULL,
                            G_CONNECT_AFTER);
 }
@@ -616,6 +633,9 @@ ide_editor_spell_widget_finalize (GObject *object)
 
   g_clear_object (&self->navigator);
 
+  if (self->check_word_timeout_id > 0)
+    g_source_remove (self->check_word_timeout_id);
+
   /* Set back the view spellchecking previous state */
   spell_text_view = gspell_text_view_get_from_gtk_text_view (GTK_TEXT_VIEW (self->view));
   if (self->view_spellchecker_set)
@@ -696,33 +716,37 @@ ide_editor_spell_widget_class_init (IdeEditorSpellWidgetClass *klass)
   g_object_class_install_properties (object_class, N_PROPS, properties);
 
   gtk_widget_class_set_template_from_resource (widget_class, 
"/org/gnome/builder/ui/ide-editor-spell-widget.ui");
+  gtk_widget_class_bind_template_child (widget_class, IdeEditorSpellWidget, misspelled_label);
+  gtk_widget_class_bind_template_child (widget_class, IdeEditorSpellWidget, change_to_label);
+  gtk_widget_class_bind_template_child (widget_class, IdeEditorSpellWidget, suggestions_label);
+  gtk_widget_class_bind_template_child (widget_class, IdeEditorSpellWidget, language_label);
+
   gtk_widget_class_bind_template_child (widget_class, IdeEditorSpellWidget, word_label);
   gtk_widget_class_bind_template_child (widget_class, IdeEditorSpellWidget, count_label);
   gtk_widget_class_bind_template_child (widget_class, IdeEditorSpellWidget, word_entry);
-  gtk_widget_class_bind_template_child (widget_class, IdeEditorSpellWidget, check_button);
-  gtk_widget_class_bind_template_child (widget_class, IdeEditorSpellWidget, add_dict_button);
   gtk_widget_class_bind_template_child (widget_class, IdeEditorSpellWidget, ignore_button);
   gtk_widget_class_bind_template_child (widget_class, IdeEditorSpellWidget, ignore_all_button);
   gtk_widget_class_bind_template_child (widget_class, IdeEditorSpellWidget, change_button);
   gtk_widget_class_bind_template_child (widget_class, IdeEditorSpellWidget, change_all_button);
-  gtk_widget_class_bind_template_child (widget_class, IdeEditorSpellWidget, close_button);
   gtk_widget_class_bind_template_child (widget_class, IdeEditorSpellWidget, highlight_checkbutton);
   gtk_widget_class_bind_template_child (widget_class, IdeEditorSpellWidget, language_chooser_button);
   gtk_widget_class_bind_template_child (widget_class, IdeEditorSpellWidget, suggestions_box);
-  gtk_widget_class_bind_template_child (widget_class, IdeEditorSpellWidget, dict_revealer);
+  gtk_widget_class_bind_template_child (widget_class, IdeEditorSpellWidget, dict_box);
 }
 
 static void
 ide_editor_spell_widget_init (IdeEditorSpellWidget *self)
 {
-  gtk_widget_init_template (GTK_WIDGET (self));
 
+  gtk_widget_init_template (GTK_WIDGET (self));
   self->dict_widget = ide_editor_dict_widget_new (NULL);
-  gtk_widget_show (GTK_WIDGET (self->dict_widget));
-  gtk_container_add (GTK_CONTAINER (self->dict_revealer), GTK_WIDGET (self->dict_widget));
 
-  /* TODO: plumb the revealing action */
-  gtk_revealer_set_reveal_child (self->dict_revealer, TRUE);
+  gtk_widget_show (GTK_WIDGET (self->dict_widget));
+  gtk_container_add (GTK_CONTAINER (self->dict_box), GTK_WIDGET (self->dict_widget));
 
   self->view_spellchecker_set = FALSE;
+  /* FIXME: do not work, Gtk+ bug */
+  gtk_entry_set_icon_tooltip_text (self->word_entry,
+                                   GTK_ENTRY_ICON_SECONDARY,
+                                   _("The word is not in the dictionary"));
 }
diff --git a/libide/editor/ide-editor-spell-widget.ui b/libide/editor/ide-editor-spell-widget.ui
index 394d25d..408a994 100644
--- a/libide/editor/ide-editor-spell-widget.ui
+++ b/libide/editor/ide-editor-spell-widget.ui
@@ -3,316 +3,248 @@
   <!-- interface-requires gtk+ 3.15 -->
   <template class="IdeEditorSpellWidget" parent="GtkBin">
     <child>
-      <object class="GtkFrame" id="spell_frame">
+      <object class="GtkGrid">
         <property name="visible">true</property>
-        <property name="margin-end">12</property>
-        <style>
-          <class name="gb-spell-frame"/>
-        </style>
+        <property name="row_spacing">6</property>
+        <property name="column_spacing">6</property>
+        <child>
+          <object class="GtkLabel" id="misspelled_label">
+            <property name="visible">true</property>
+            <property name="label" translatable="yes">Misspelled</property>
+            <property name="xalign">0</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">0</property>
+          </packing>
+        </child>
         <child>
           <object class="GtkBox">
             <property name="visible">true</property>
-            <property name="orientation">vertical</property>
-            <property name="spacing">7</property>
+            <property name="orientation">horizontal</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkLabel" id="word_label">
+                <property name="visible">true</property>
+                <property name="halign">start</property>
+                <property name="hexpand">true</property>
+                <property name="margin_left">10</property>
+                <property name="selectable">True</property>
+                <property name="use_markup">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkLabel" id="count_label">
+                <property name="visible">true</property>
+                <property name="halign">end</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">0</property>
+            <property name="width">2</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="ignore_button">
+            <property name="label" translatable="yes">_Ignore</property>
+            <property name="visible">true</property>
+            <property name="can_focus">true</property>
+            <property name="use_underline">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="ignore_all_button">
+            <property name="label" translatable="yes">Ignore _All</property>
+            <property name="visible">true</property>
+            <property name="can_focus">true</property>
+            <property name="use_underline">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">2</property>
+            <property name="top_attach">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="change_to_label">
+            <property name="visible">true</property>
+            <property name="label" translatable="yes">Change _to</property>
+            <property name="xalign">0</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">word_entry</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">2</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkEntry" id="word_entry">
+            <property name="visible">true</property>
+            <property name="can_focus">true</property>
+            <property name="width-chars">20</property>
+            <property name="max-width-chars">30</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">2</property>
+            <property name="width">2</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="change_button">
+            <property name="label" translatable="yes">Cha_nge</property>
+            <property name="visible">true</property>
+            <property name="can_focus">true</property>
+            <property name="use_underline">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">3</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="change_all_button">
+            <property name="label" translatable="yes">Change A_ll</property>
+            <property name="visible">true</property>
+            <property name="can_focus">true</property>
+            <property name="use_underline">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">2</property>
+            <property name="top_attach">3</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="suggestions_label">
+            <property name="visible">true</property>
+            <property name="label" translatable="yes">_Suggestions</property>
+            <property name="xalign">0</property>
+            <property name="valign">start</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">suggestions_box</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">4</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkScrolledWindow">
+            <property name="visible">true</property>
+            <property name="expand">true</property>
+            <property name="shadow_type">in</property>
+            <property name="min-content-height">110</property>
+            <property name="max-content-height">110</property>
+            <property name="propagate-natural-height">true</property>
             <child>
-              <object class="GtkGrid">
+              <object class="GtkListBox" id="suggestions_box">
                 <property name="visible">true</property>
-                <property name="row_spacing">6</property>
-                <property name="column_spacing">6</property>
-                <child>
-                  <object class="GtkLabel">
-                    <property name="visible">true</property>
-                    <property name="label" translatable="yes">Misspelled</property>
-                    <property name="halign">end</property>
-                    <style>
-                      <class name="dim-label"/>
-                    </style>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel">
-                    <property name="visible">true</property>
-                    <property name="label" translatable="yes">Change _to</property>
-                    <property name="halign">end</property>
-                    <property name="use_underline">True</property>
-                    <property name="mnemonic_widget">word_entry</property>
-                    <style>
-                      <class name="dim-label"/>
-                    </style>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel">
-                    <property name="visible">true</property>
-                    <property name="label" translatable="yes">_Suggestions</property>
-                    <property name="halign">end</property>
-                    <property name="valign">start</property>
-                    <property name="use_underline">True</property>
-                    <property name="mnemonic_widget">suggestions_box</property>
-                    <style>
-                      <class name="dim-label"/>
-                    </style>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">2</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkBox">
-                    <property name="visible">true</property>
-                    <property name="orientation">horizontal</property>
-                    <property name="spacing">6</property>
-                    <child>
-                      <object class="GtkLabel" id="word_label">
-                        <property name="visible">true</property>
-                        <property name="halign">start</property>
-                        <property name="margin_left">10</property>
-                        <property name="selectable">True</property>
-                        <property name="use_markup">True</property>
-                        <property name="wrap">True</property>
-                      </object>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="count_label">
-                        <property name="visible">true</property>
-                        <property name="halign">end</property>
-                        <property name="expand">true</property>
-                      </object>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="top_attach">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkEntry" id="word_entry">
-                    <property name="visible">true</property>
-                    <property name="can_focus">true</property>
-                    <property name="width-chars">20</property>
-                    <property name="max-width-chars">30</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="top_attach">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkScrolledWindow">
-                    <property name="visible">true</property>
-                    <property name="expand">true</property>
-                    <property name="shadow_type">in</property>
-                    <property name="min-content-height">110</property>
-                    <property name="max-content-height">110</property>
-                    <property name="propagate-natural-height">true</property>
-                    <child>
-                      <object class="GtkListBox" id="suggestions_box">
-                        <property name="visible">true</property>
-                        <property name="can_focus">true</property>
-                        <property name="activate-on-single-click">false</property>
-                      </object>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="top_attach">2</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkButton" id="add_dict_button">
-                    <property name="label" translatable="yes">Add w_ord</property>
-                    <property name="visible">true</property>
-                    <property name="can_focus">true</property>
-                    <property name="use_underline">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">2</property>
-                    <property name="top_attach">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkButton" id="check_button">
-                    <property name="label" translatable="yes">Check _word</property>
-                    <property name="visible">true</property>
-                    <property name="can_focus">true</property>
-                    <property name="use_underline">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">2</property>
-                    <property name="top_attach">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkButton" id="ignore_button">
-                    <property name="label" translatable="yes">_Ignore</property>
-                    <property name="visible">true</property>
-                    <property name="can_focus">true</property>
-                    <property name="use_underline">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">3</property>
-                    <property name="top_attach">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkButton" id="change_button">
-                    <property name="label" translatable="yes">Cha_nge</property>
-                    <property name="visible">true</property>
-                    <property name="can_focus">true</property>
-                    <property name="use_underline">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">3</property>
-                    <property name="top_attach">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkButton" id="ignore_all_button">
-                    <property name="label" translatable="yes">Ignore _All</property>
-                    <property name="visible">true</property>
-                    <property name="can_focus">true</property>
-                    <property name="use_underline">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">4</property>
-                    <property name="top_attach">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkButton" id="change_all_button">
-                    <property name="label" translatable="yes">Change A_ll</property>
-                    <property name="visible">true</property>
-                    <property name="can_focus">true</property>
-                    <property name="use_underline">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">4</property>
-                    <property name="top_attach">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkButton" id="close_button">
-                    <property name="visible">true</property>
-                    <property name="halign">center</property>
-                    <property name="valign">center</property>
-                    <property name="focus_on_click">false</property>
-                    <property name="action-name">spell-entry.exit-spell</property>
-                    <style>
-                      <class name="close"/>
-                    </style>
-                    <child>
-                      <object class="GtkImage">
-                        <property name="visible">true</property>
-                        <property name="icon_name">window-close-symbolic</property>
-                      </object>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="left_attach">5</property>
-                    <property name="top_attach">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkFrame" id="option_frame">
-                    <property name="visible">true</property>
-                    <property name="label" translatable="yes">Options</property>
-                    <property name="shadow_type">in</property>
-                    <property name="halign">fill</property>
-                    <property name="valign">fill</property>
-                    <child>
-                      <object class="GtkGrid">
-                        <property name="visible">true</property>
-                        <property name="can_focus">false</property>
-                        <property name="row_spacing">6</property>
-                        <property name="column_spacing">6</property>
-                        <property name="margin">6</property>
-                        <child>
-                          <object class="GtkLabel">
-                            <property name="visible">true</property>
-                            <property name="label" translatable="yes">_Language</property>
-                            <property name="halign">end</property>
-                            <property name="expand">true</property>
-                            <property name="use_underline">True</property>
-                            <property name="mnemonic_widget">language_chooser_button</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkCheckButton" id="highlight_checkbutton">
-                            <property name="visible">true</property>
-                            <property name="can_focus">true</property>
-                            <property name="halign">end</property>
-                            <property name="expand">true</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GspellLanguageChooserButton" id="language_chooser_button">
-                            <property name="visible">true</property>
-                            <property name="can_focus">true</property>
-                            <property name="expand">true</property>
-                            <property name="valign">center</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="top_attach">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel">
-                            <property name="visible">true</property>
-                            <property name="label" translatable="yes">_Highlight in the view</property>
-                            <property name="expand">true</property>
-                            <property name="halign">start</property>
-                            <property name="margin-start">6</property>
-                            <property name="use_underline">True</property>
-                            <property name="mnemonic_widget">highlight_checkbutton</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="top_attach">1</property>
-                          </packing>
-                        </child>
-                      </object>
-                    </child>
-                    <style>
-                      <class name="gb-spell-option-frame"/>
-                    </style>
-                  </object>
-                  <packing>
-                    <property name="left_attach">2</property>
-                    <property name="top_attach">2</property>
-                    <property name="width">3</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkRevealer" id="dict_revealer">
-                    <property name="visible">true</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">3</property>
-                    <property name="width">5</property>
-                  </packing>
-                </child>
+                <property name="can_focus">true</property>
+                <property name="activate-on-single-click">false</property>
               </object>
             </child>
           </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">4</property>
+            <property name="width">2</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="dict_box">
+            <property name="orientation">horizontal</property>
+            <property name="visible">true</property>
+            <property name="spacing">6</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">5</property>
+            <property name="width">3</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel">
+            <property name="visible">true</property>
+            <property name="label" translatable="yes">Options</property>
+            <property name="xalign">0</property>
+            <property name="expand">false</property>
+            <property name="use_underline">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">6</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkSeparator">
+            <property name="visible">true</property>
+            <property name="hexpand">true</property>
+            <property name="orientation">horizontal</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">7</property>
+            <property name="width">3</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="language_label">
+            <property name="visible">true</property>
+            <property name="label" translatable="yes">_Language</property>
+            <property name="xalign">0</property>
+            <property name="expand">false</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">language_chooser_button</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">8</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GspellLanguageChooserButton" id="language_chooser_button">
+            <property name="visible">true</property>
+            <property name="can_focus">true</property>
+            <property name="hexpand">true</property>
+            <property name="valign">fill</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">8</property>
+            <property name="width">2</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel">
+            <property name="visible">true</property>
+            <property name="label" translatable="yes">_Highlight</property>
+            <property name="xalign">0</property>
+            <property name="expand">false</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">highlight_checkbutton</property>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">9</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkCheckButton" id="highlight_checkbutton">
+            <property name="visible">true</property>
+            <property name="can_focus">true</property>
+            <property name="halign">start</property>
+            <property name="expand">false</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">9</property>
+          </packing>
         </child>
       </object>
     </child>



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