Move construction to glade file
authorPhilip Chimento <philip.chimento@gmail.com>
Sun, 13 Mar 2011 00:02:22 +0000 (01:02 +0100)
committerPhilip Chimento <philip.chimento@gmail.com>
Sun, 13 Mar 2011 00:02:22 +0000 (01:02 +0100)
Do as much construction as possible in the glade file, instead of in
hand-written code. Removed use of GtkFixed widget.

player/chimara.ui
player/preferences.c

index 6ef2c9a1dca91b980d93083a4401e4146ed316ca..1e0b9a4f6f9f70b725dbe54c1b8182ee48b9570e 100644 (file)
@@ -225,6 +225,12 @@ Philip Chimento</property>
       </object>
     </child>
   </object>
+  <object class="GtkListStore" id="available_interpreters">
+    <columns>
+      <!-- column-name Interpreter -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
   <object class="GtkWindow" id="chimara">
     <property name="can_focus">False</property>
     <property name="title" translatable="yes">Chimara</property>
@@ -249,12 +255,6 @@ Philip Chimento</property>
       <column type="gchararray"/>
     </columns>
   </object>
-  <object class="GtkListStore" id="available_interpreters">
-    <columns>
-      <!-- column-name Interpreter -->
-      <column type="gchararray"/>
-    </columns>
-  </object>
   <object class="GtkDialog" id="prefswindow">
     <property name="can_focus">False</property>
     <property name="border_width">5</property>
@@ -441,6 +441,7 @@ Philip Chimento</property>
                       <object class="GtkHBox" id="hbox1">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="spacing">12</property>
                         <child>
                           <object class="GtkScrolledWindow" id="scrolledwindow1">
                             <property name="width_request">163</property>
@@ -452,8 +453,21 @@ Philip Chimento</property>
                               <object class="GtkTreeView" id="style-treeview">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
+                                <property name="model">style-list</property>
                                 <property name="headers_visible">False</property>
                                 <property name="headers_clickable">False</property>
+                                <child>
+                                  <object class="GtkTreeViewColumn" id="style-name-column">
+                                    <property name="title" translatable="yes">Style Name</property>
+                                    <property name="expand">True</property>
+                                    <child>
+                                      <object class="GtkCellRendererText" id="style-name-renderer"/>
+                                      <attributes>
+                                        <attribute name="text">0</attribute>
+                                      </attributes>
+                                    </child>
+                                  </object>
+                                </child>
                               </object>
                             </child>
                           </object>
@@ -467,21 +481,24 @@ Philip Chimento</property>
                           <object class="GtkVBox" id="vbox4">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
+                            <property name="spacing">6</property>
                             <child>
-                              <object class="GtkHBox" id="hbox2">
+                              <object class="GtkTable" id="table2">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
+                                <property name="n_rows">3</property>
+                                <property name="n_columns">2</property>
+                                <property name="column_spacing">6</property>
+                                <property name="row_spacing">6</property>
                                 <child>
                                   <object class="GtkLabel" id="label6">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
+                                    <property name="xalign">0</property>
                                     <property name="label" translatable="yes">Font:</property>
                                   </object>
                                   <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">True</property>
-                                    <property name="padding">5</property>
-                                    <property name="position">0</property>
+                                    <property name="x_options">GTK_FILL</property>
                                   </packing>
                                 </child>
                                 <child>
@@ -493,23 +510,24 @@ Philip Chimento</property>
                                     <signal name="font-set" handler="on_font_set" swapped="no"/>
                                   </object>
                                   <packing>
-                                    <property name="expand">True</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">1</property>
+                                    <property name="left_attach">1</property>
+                                    <property name="right_attach">2</property>
+                                    <property name="x_options">GTK_FILL</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label7">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Foreground color:</property>
+                                  </object>
+                                  <packing>
+                                    <property name="top_attach">1</property>
+                                    <property name="bottom_attach">2</property>
+                                    <property name="x_options">GTK_FILL</property>
                                   </packing>
                                 </child>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkFixed" id="fixed2">
-                                <property name="height_request">130</property>
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <child>
                                   <object class="GtkColorButton" id="colorbutton1">
                                     <property name="width_request">40</property>
@@ -522,31 +540,24 @@ Philip Chimento</property>
                                     <signal name="color-set" handler="on_foreground_color_set" swapped="no"/>
                                   </object>
                                   <packing>
-                                    <property name="x">125</property>
-                                    <property name="y">10</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkLabel" id="label7">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="xpad">5</property>
-                                    <property name="label" translatable="yes">Foreground color:</property>
-                                  </object>
-                                  <packing>
-                                    <property name="x">4</property>
-                                    <property name="y">17</property>
+                                    <property name="left_attach">1</property>
+                                    <property name="right_attach">2</property>
+                                    <property name="top_attach">1</property>
+                                    <property name="bottom_attach">2</property>
+                                    <property name="x_options">GTK_FILL</property>
                                   </packing>
                                 </child>
                                 <child>
                                   <object class="GtkLabel" id="label8">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
+                                    <property name="xalign">0</property>
                                     <property name="label" translatable="yes">Background color:</property>
                                   </object>
                                   <packing>
-                                    <property name="x">6</property>
-                                    <property name="y">52</property>
+                                    <property name="top_attach">2</property>
+                                    <property name="bottom_attach">3</property>
+                                    <property name="x_options">GTK_FILL</property>
                                   </packing>
                                 </child>
                                 <child>
@@ -561,135 +572,100 @@ Philip Chimento</property>
                                     <signal name="color-set" handler="on_background_color_set" swapped="no"/>
                                   </object>
                                   <packing>
-                                    <property name="x">125</property>
-                                    <property name="y">45</property>
+                                    <property name="left_attach">1</property>
+                                    <property name="right_attach">2</property>
+                                    <property name="top_attach">2</property>
+                                    <property name="bottom_attach">3</property>
+                                    <property name="x_options">GTK_FILL</property>
                                   </packing>
                                 </child>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkHButtonBox" id="hbuttonbox1">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="spacing">6</property>
+                                <property name="layout_style">start</property>
                                 <child>
-                                  <object class="GtkToolbar" id="style-toolbar">
-                                    <property name="width_request">283</property>
-                                    <property name="height_request">50</property>
+                                  <object class="GtkRadioButton" id="left">
+                                    <property name="label">gtk-justify-left</property>
                                     <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="toolbar_style">icons</property>
-                                    <child>
-                                      <object class="GtkToggleToolButton" id="toolbutton-left">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <property name="use_action_appearance">False</property>
-                                        <property name="label" translatable="yes">Align _left</property>
-                                        <property name="use_underline">True</property>
-                                        <property name="stock_id">gtk-justify-left</property>
-                                        <signal name="toggled" handler="on_toggle_left" swapped="no"/>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="homogeneous">True</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <object class="GtkToggleToolButton" id="toolbutton-center">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <property name="use_action_appearance">False</property>
-                                        <property name="label" translatable="yes">Align _center</property>
-                                        <property name="use_underline">True</property>
-                                        <property name="stock_id">gtk-justify-center</property>
-                                        <signal name="toggled" handler="on_toggle_center" swapped="no"/>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="homogeneous">True</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <object class="GtkToggleToolButton" id="toolbutton-right">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <property name="use_action_appearance">False</property>
-                                        <property name="label" translatable="yes">Align _right</property>
-                                        <property name="use_underline">True</property>
-                                        <property name="stock_id">gtk-justify-right</property>
-                                        <signal name="toggled" handler="on_toggle_right" swapped="no"/>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="homogeneous">True</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <object class="GtkToggleToolButton" id="toolbutton-justify">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <property name="use_action_appearance">False</property>
-                                        <property name="label" translatable="yes">Align _justify</property>
-                                        <property name="use_underline">True</property>
-                                        <property name="stock_id">gtk-justify-fill</property>
-                                        <signal name="toggled" handler="on_toggle_justify" swapped="no"/>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="homogeneous">True</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <object class="GtkSeparatorToolItem" id="toolbutton4">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="homogeneous">True</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <object class="GtkToggleToolButton" id="toolbutton-bold">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <property name="use_action_appearance">False</property>
-                                        <property name="label" translatable="yes">_Bold</property>
-                                        <property name="use_underline">True</property>
-                                        <property name="stock_id">gtk-bold</property>
-                                        <signal name="toggled" handler="on_toggle_bold" swapped="no"/>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="homogeneous">True</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <object class="GtkToggleToolButton" id="toolbutton-italic">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <property name="use_action_appearance">False</property>
-                                        <property name="label" translatable="yes">_Italic</property>
-                                        <property name="use_underline">True</property>
-                                        <property name="stock_id">gtk-italic</property>
-                                        <signal name="toggled" handler="on_toggle_italic" swapped="no"/>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="homogeneous">True</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <object class="GtkToggleToolButton" id="toolbutton-underline">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <property name="use_action_appearance">False</property>
-                                        <property name="label" translatable="yes">_Underline</property>
-                                        <property name="use_underline">True</property>
-                                        <property name="stock_id">gtk-underline</property>
-                                        <signal name="toggled" handler="on_toggle_underline" swapped="no"/>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="homogeneous">True</property>
-                                      </packing>
-                                    </child>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
+                                    <property name="use_stock">True</property>
+                                    <property name="image_position">top</property>
+                                    <property name="active">True</property>
+                                    <property name="draw_indicator">False</property>
+                                    <signal name="toggled" handler="on_toggle_left" swapped="no"/>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkRadioButton" id="center">
+                                    <property name="label">gtk-justify-center</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
+                                    <property name="use_stock">True</property>
+                                    <property name="image_position">top</property>
+                                    <property name="draw_indicator">False</property>
+                                    <property name="group">left</property>
+                                    <signal name="toggled" handler="on_toggle_center" swapped="no"/>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkRadioButton" id="right">
+                                    <property name="label">gtk-justify-right</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
+                                    <property name="use_stock">True</property>
+                                    <property name="image_position">top</property>
+                                    <property name="draw_indicator">False</property>
+                                    <property name="group">left</property>
+                                    <signal name="toggled" handler="on_toggle_right" swapped="no"/>
                                   </object>
                                   <packing>
-                                    <property name="y">86</property>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">2</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkRadioButton" id="justify">
+                                    <property name="label">gtk-justify-fill</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
+                                    <property name="use_stock">True</property>
+                                    <property name="image_position">top</property>
+                                    <property name="draw_indicator">False</property>
+                                    <property name="group">left</property>
+                                    <signal name="toggled" handler="on_toggle_justify" swapped="no"/>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">3</property>
                                   </packing>
                                 </child>
                               </object>
@@ -699,6 +675,73 @@ Philip Chimento</property>
                                 <property name="position">1</property>
                               </packing>
                             </child>
+                            <child>
+                              <object class="GtkHButtonBox" id="hbuttonbox2">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="spacing">6</property>
+                                <property name="layout_style">start</property>
+                                <child>
+                                  <object class="GtkCheckButton" id="checkbutton1">
+                                    <property name="label">gtk-bold</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
+                                    <property name="use_stock">True</property>
+                                    <property name="image_position">top</property>
+                                    <property name="draw_indicator">False</property>
+                                    <signal name="toggled" handler="on_toggle_bold" swapped="no"/>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkCheckButton" id="checkbutton2">
+                                    <property name="label">gtk-italic</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
+                                    <property name="use_stock">True</property>
+                                    <property name="image_position">top</property>
+                                    <property name="draw_indicator">False</property>
+                                    <signal name="toggled" handler="on_toggle_italic" swapped="no"/>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkCheckButton" id="underline">
+                                    <property name="label">gtk-underline</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
+                                    <property name="use_stock">True</property>
+                                    <property name="image_position">top</property>
+                                    <property name="draw_indicator">False</property>
+                                    <signal name="toggled" handler="on_toggle_underline" swapped="no"/>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">2</property>
+                                  </packing>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
                           </object>
                           <packing>
                             <property name="expand">True</property>
@@ -799,7 +842,6 @@ Philip Chimento</property>
                                 <property name="can_focus">True</property>
                                 <property name="tooltip_text" translatable="yes">Which interpreter to use by default for each story format</property>
                                 <property name="model">interpreters</property>
-                                <property name="headers_visible">True</property>
                                 <property name="headers_clickable">False</property>
                                 <property name="rules_hint">True</property>
                                 <child>
@@ -818,10 +860,10 @@ Philip Chimento</property>
                                     <property name="title">Interpreter</property>
                                     <child>
                                       <object class="GtkCellRendererCombo" id="interpreter_renderer">
-                                        <property name="model">available_interpreters</property>
+                                        <property name="editable">True</property>
                                         <property name="has_entry">False</property>
+                                        <property name="model">available_interpreters</property>
                                         <property name="text_column">0</property>
-                                        <property name="editable">True</property>
                                         <signal name="changed" handler="on_interpreter_cell_changed" swapped="no"/>
                                       </object>
                                       <attributes>
@@ -920,4 +962,10 @@ Philip Chimento</property>
       <action-widget response="0">button-close</action-widget>
     </action-widgets>
   </object>
+  <object class="GtkTreeStore" id="style-list">
+    <columns>
+      <!-- column-name Text -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
 </interface>
index 9626516b8d85298a78b6e77da8c642738f9fe577..ad77ee6b8b63b2810d21569d6159c3457c823208 100644 (file)
@@ -139,7 +139,7 @@ void
 preferences_create(ChimaraGlk *glk)
 {
        /* Initialize the tree of style names */
-       GtkTreeStore *style_list = gtk_tree_store_new(1, G_TYPE_STRING);
+       GtkTreeStore *style_list = GTK_TREE_STORE( load_object("style-list") );
        GtkTreeIter buffer, grid, buffer_child, grid_child;
 
        gtk_tree_store_append(style_list, &buffer, NULL);
@@ -157,25 +157,10 @@ preferences_create(ChimaraGlk *glk)
                gtk_tree_store_set(style_list, &grid_child, 0, tag_names[i], -1);
        }
 
-       /* Attach the model to the treeview */
-       GtkTreeView *view = GTK_TREE_VIEW( load_object("style-treeview") );
-       gtk_tree_view_set_model(view, GTK_TREE_MODEL(style_list));
-       g_object_unref(style_list);
-
-       /* Set the columns */
-       GtkTreeViewColumn *column = gtk_tree_view_column_new();
-       gtk_tree_view_column_set_title(column, "Style Name");
-       gtk_tree_view_append_column(view, column);
-
-       /* Set the renderers */
-       GtkCellRenderer *renderer = gtk_cell_renderer_text_new();
-       gtk_tree_view_column_pack_start(column, renderer, TRUE);
-       gtk_tree_view_column_add_attribute(column, renderer, "text", 0);
-
        /* Set selection mode to single select */
+       GtkTreeView *view = GTK_TREE_VIEW( load_object("style-treeview") );
        GtkTreeSelection *selection = gtk_tree_view_get_selection(view);
        gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
-
        g_signal_connect(selection, "changed", G_CALLBACK(style_tree_select_callback), glk);
 
        /* Bind the preferences to the entries in the preferences file */
@@ -250,77 +235,41 @@ style_tree_select_callback(GtkTreeSelection *selection, ChimaraGlk *glk)
 }
 
 void
-on_toggle_left(GtkToggleToolButton *button, ChimaraGlk *glk) {
+on_toggle_left(GtkToggleButton *button, ChimaraGlk *glk) {
        /* No nothing if the button is deactivated */
-       if( !gtk_toggle_tool_button_get_active(button) )
+       if( !gtk_toggle_button_get_active(button) )
                return;
-
-       /* Untoggle other alignment options */
-       GtkToggleToolButton *center = GTK_TOGGLE_TOOL_BUTTON(load_object("toolbutton-center"));
-       GtkToggleToolButton *right = GTK_TOGGLE_TOOL_BUTTON(load_object("toolbutton-right"));
-       GtkToggleToolButton *justify = GTK_TOGGLE_TOOL_BUTTON(load_object("toolbutton-justify"));
-       gtk_toggle_tool_button_set_active(center, FALSE);
-       gtk_toggle_tool_button_set_active(right, FALSE);
-       gtk_toggle_tool_button_set_active(justify, FALSE);
-
        g_object_set(current_tag, "justification", GTK_JUSTIFY_LEFT, "justification-set", TRUE, NULL);
        chimara_glk_update_style(glk);
 }
 
 void
-on_toggle_center(GtkToggleToolButton *button, ChimaraGlk *glk) {
-       if( !gtk_toggle_tool_button_get_active(button) )
+on_toggle_center(GtkToggleButton *button, ChimaraGlk *glk) {
+       if( !gtk_toggle_button_get_active(button) )
                return;
-
-       /* Untoggle other alignment options */
-       GtkToggleToolButton *left = GTK_TOGGLE_TOOL_BUTTON(load_object("toolbutton-left"));
-       GtkToggleToolButton *right = GTK_TOGGLE_TOOL_BUTTON(load_object("toolbutton-right"));
-       GtkToggleToolButton *justify = GTK_TOGGLE_TOOL_BUTTON(load_object("toolbutton-justify"));
-       gtk_toggle_tool_button_set_active(left, FALSE);
-       gtk_toggle_tool_button_set_active(right, FALSE);
-       gtk_toggle_tool_button_set_active(justify, FALSE);
-
        g_object_set(current_tag, "justification", GTK_JUSTIFY_CENTER, "justification-set", TRUE, NULL);
        chimara_glk_update_style(glk);
 }
 
 void
-on_toggle_right(GtkToggleToolButton *button, ChimaraGlk *glk) {
-       if( !gtk_toggle_tool_button_get_active(button) )
+on_toggle_right(GtkToggleButton *button, ChimaraGlk *glk) {
+       if( !gtk_toggle_button_get_active(button) )
                return;
-
-       /* Untoggle other alignment options */
-       GtkToggleToolButton *left = GTK_TOGGLE_TOOL_BUTTON(load_object("toolbutton-left"));
-       GtkToggleToolButton *center = GTK_TOGGLE_TOOL_BUTTON(load_object("toolbutton-center"));
-       GtkToggleToolButton *justify = GTK_TOGGLE_TOOL_BUTTON(load_object("toolbutton-justify"));
-       gtk_toggle_tool_button_set_active(left, FALSE);
-       gtk_toggle_tool_button_set_active(center, FALSE);
-       gtk_toggle_tool_button_set_active(justify, FALSE);
-
        g_object_set(current_tag, "justification", GTK_JUSTIFY_RIGHT, "justification-set", TRUE, NULL);
        chimara_glk_update_style(glk);
 }
 
 void
-on_toggle_justify(GtkToggleToolButton *button, ChimaraGlk *glk) {
-       if( !gtk_toggle_tool_button_get_active(button) )
+on_toggle_justify(GtkToggleButton *button, ChimaraGlk *glk) {
+       if( !gtk_toggle_button_get_active(button) )
                return;
-
-       /* Untoggle other alignment options */
-       GtkToggleToolButton *left = GTK_TOGGLE_TOOL_BUTTON(load_object("toolbutton-left"));
-       GtkToggleToolButton *center = GTK_TOGGLE_TOOL_BUTTON(load_object("toolbutton-center"));
-       GtkToggleToolButton *right = GTK_TOGGLE_TOOL_BUTTON(load_object("toolbutton-right"));
-       gtk_toggle_tool_button_set_active(left, FALSE);
-       gtk_toggle_tool_button_set_active(center, FALSE);
-       gtk_toggle_tool_button_set_active(right, FALSE);
-
        g_object_set(current_tag, "justification", GTK_JUSTIFY_FILL, "justification-set", TRUE, NULL);
        chimara_glk_update_style(glk);
 }
 
 void
-on_toggle_bold(GtkToggleToolButton *button, ChimaraGlk *glk) {
-       if( gtk_toggle_tool_button_get_active(button) )
+on_toggle_bold(GtkToggleButton *button, ChimaraGlk *glk) {
+       if( gtk_toggle_button_get_active(button) )
                g_object_set(current_tag, "weight", PANGO_WEIGHT_BOLD, "weight-set", TRUE, NULL);
        else
                g_object_set(current_tag, "weight", PANGO_WEIGHT_NORMAL, "weight-set", TRUE, NULL);
@@ -329,8 +278,8 @@ on_toggle_bold(GtkToggleToolButton *button, ChimaraGlk *glk) {
 }
 
 void
-on_toggle_italic(GtkToggleToolButton *button, ChimaraGlk *glk) {
-       if( gtk_toggle_tool_button_get_active(button) )
+on_toggle_italic(GtkToggleButton *button, ChimaraGlk *glk) {
+       if( gtk_toggle_button_get_active(button) )
                g_object_set(current_tag, "style", PANGO_STYLE_ITALIC, "style-set", TRUE, NULL);
        else
                g_object_set(current_tag, "style", PANGO_STYLE_NORMAL, "style-set", TRUE, NULL);
@@ -339,8 +288,8 @@ on_toggle_italic(GtkToggleToolButton *button, ChimaraGlk *glk) {
 }
 
 void
-on_toggle_underline(GtkToggleToolButton *button, ChimaraGlk *glk) {
-       if( gtk_toggle_tool_button_get_active(button) )
+on_toggle_underline(GtkToggleButton *button, ChimaraGlk *glk) {
+       if( gtk_toggle_button_get_active(button) )
                g_object_set(current_tag, "underline", PANGO_UNDERLINE_SINGLE, "underline-set", TRUE, NULL);
        else
                g_object_set(current_tag, "underline", PANGO_UNDERLINE_NONE, "underline-set", TRUE, NULL);