[latexila] Various UI improvements



commit fc14cd24106f8f8101e445fed44615bf46d2e605
Author: SÃbastien Wilmet <swilmet src gnome org>
Date:   Fri Jul 8 08:47:52 2011 +0200

    Various UIÂimprovements
    
    Build Tools list: the columns now have a title: active, and label.
    Double-click on the active column (with the checkbutton) won't open the
    properties.
    
    The Structure have tree lines and there are two vertical separators in
    the mini toolbar.
    
    And the editor font button in the preferences dialog doesn't expand (the
    window becomes quite large, so it was a bit ugly).

 src/preferences_dialog.vala  |   38 +++++++++++++++++++++++++-------------
 src/structure.vala           |   12 +++++++++++-
 src/ui/preferences_dialog.ui |    8 ++++----
 3 files changed, 40 insertions(+), 18 deletions(-)
---
diff --git a/src/preferences_dialog.vala b/src/preferences_dialog.vala
index ed06764..6d57436 100644
--- a/src/preferences_dialog.vala
+++ b/src/preferences_dialog.vala
@@ -544,23 +544,31 @@ public class PreferencesDialog : Dialog
             typeof (string), typeof (string), typeof (string));
         build_tools_view.set_model (build_tools_store);
 
-        TreeViewColumn column = new TreeViewColumn ();
-        build_tools_view.append_column (column);
+        TreeViewColumn active_column = new TreeViewColumn ();
+        active_column.set_title (_("Active"));
+        build_tools_view.append_column (active_column);
 
         CellRendererToggle toggle_renderer = new CellRendererToggle ();
-        column.pack_start (toggle_renderer, false);
-        column.set_attributes (toggle_renderer, "active", BuildToolColumn.SHOW, null);
+        active_column.pack_start (toggle_renderer, false);
+        active_column.set_attributes (toggle_renderer,
+          "active", BuildToolColumn.SHOW,
+          null);
 
-        column = new TreeViewColumn ();
-        build_tools_view.append_column (column);
+        TreeViewColumn label_column = new TreeViewColumn ();
+        label_column.set_title (_("Label"));
+        build_tools_view.append_column (label_column);
 
         CellRendererPixbuf pixbuf_renderer = new CellRendererPixbuf ();
-        column.pack_start (pixbuf_renderer, false);
-        column.set_attributes (pixbuf_renderer, "stock-id", BuildToolColumn.PIXBUF, null);
+        label_column.pack_start (pixbuf_renderer, false);
+        label_column.set_attributes (pixbuf_renderer,
+          "stock-id", BuildToolColumn.PIXBUF,
+          null);
 
         CellRendererText text_renderer = new CellRendererText ();
-        column.pack_start (text_renderer, true);
-        column.set_attributes (text_renderer, "text", BuildToolColumn.LABEL, null);
+        label_column.pack_start (text_renderer, true);
+        label_column.set_attributes (text_renderer,
+          "text", BuildToolColumn.LABEL,
+          null);
 
         build_tools_view.set_tooltip_column (BuildToolColumn.DESCRIPTION);
 
@@ -590,10 +598,14 @@ public class PreferencesDialog : Dialog
             build_tools.update (num, build_tool);
         });
 
-        build_tools_view.row_activated.connect ((path) =>
+        /* double-click */
+        build_tools_view.row_activated.connect ((path, column) =>
         {
-            int num = path.get_indices ()[0];
-            run_build_tool_dialog (num);
+            if (column == label_column)
+            {
+                int num = path.get_indices ()[0];
+                run_build_tool_dialog (num);
+            }
         });
     }
 
diff --git a/src/structure.vala b/src/structure.vala
index cc3910b..6dc76b7 100644
--- a/src/structure.vala
+++ b/src/structure.vala
@@ -120,7 +120,7 @@ public class Structure : VBox
 
     private void init_toolbar ()
     {
-        HBox hbox = new HBox (true, 0);
+        HBox hbox = new HBox (false, 0);
         pack_start (hbox, false, false);
 
         // refresh button
@@ -133,6 +133,10 @@ public class Structure : VBox
             show_document (_main_window.active_document, true);
         });
 
+        // separator
+        SeparatorToolItem sep = new SeparatorToolItem ();
+        hbox.pack_start (sep, false);
+
         // expand all button
         Button expand_button = Utils.get_toolbar_button (Stock.ZOOM_IN);
         expand_button.tooltip_text = _("Expand All");
@@ -147,6 +151,10 @@ public class Structure : VBox
 
         collapse_button.clicked.connect (() => _tree_view.collapse_all ());
 
+        // separator
+        sep = new SeparatorToolItem ();
+        hbox.pack_start (sep, false);
+
         // simple list buttons
         ToggleButton toggle_button = create_simple_list_button ({ StructType.LABEL },
             _("Show labels"));
@@ -291,6 +299,8 @@ public class Structure : VBox
         _tree_view = get_new_tree_view (StructColumn.PIXBUF, StructColumn.TEXT,
             StructColumn.TOOLTIP);
 
+        _tree_view.enable_tree_lines = true;
+
         // selection
         TreeSelection tree_select = _tree_view.get_selection ();
         tree_select.set_select_function ((select, model, path, path_currently_selected) =>
diff --git a/src/ui/preferences_dialog.ui b/src/ui/preferences_dialog.ui
index a8327ba..42c668a 100644
--- a/src/ui/preferences_dialog.ui
+++ b/src/ui/preferences_dialog.ui
@@ -345,8 +345,8 @@
                             <property name="use_font">True</property>
                           </object>
                           <packing>
-                            <property name="expand">True</property>
-                            <property name="fill">True</property>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
                             <property name="position">1</property>
                           </packing>
                         </child>
@@ -734,11 +734,11 @@
                             <property name="vscrollbar_policy">automatic</property>
                             <child>
                               <object class="GtkTreeView" id="build_tools_treeview">
-                                <property name="width_request">340</property>
+                                <property name="width_request">360</property>
                                 <property name="height_request">300</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="headers_visible">False</property>
+                                <property name="headers_clickable">False</property>
                                 <property name="rules_hint">True</property>
                               </object>
                             </child>



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