]> spindle.queued.net Git - midori/commitdiff
Ellipsize panel treeviews instead of scrolling
authorChristian Dywan <christian@twotoasts.de>
Fri, 3 Aug 2012 19:45:16 +0000 (21:45 +0200)
committerChristian Dywan <christian@twotoasts.de>
Fri, 3 Aug 2012 19:45:16 +0000 (21:45 +0200)
Fixes: https://bugs.launchpad.net/midori/+bug/1020353
extensions/cookie-manager/cookie-manager-page.c
midori/midori-panel.c
panels/midori-bookmarks.c
panels/midori-extensions.c
panels/midori-history.c
panels/midori-transfers.c

index fb450b8c39e8e43e0ccb903e1efeb288c44648fe..d8a71add86562e4c24487c7a7e77949e461b6cc5 100644 (file)
@@ -1002,6 +1002,7 @@ static void cm_tree_render_text_cb(GtkTreeViewColumn *column, GtkCellRenderer *r
        }
        else
                g_object_set(renderer, "text", name, NULL);
+       g_object_set (renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
 
        g_free(name);
 }
@@ -1022,6 +1023,7 @@ static GtkWidget *cm_tree_prepare(CookieManagerPage *cmp)
        renderer = gtk_cell_renderer_text_new();
        column = gtk_tree_view_column_new_with_attributes(
                _("Name"), renderer, "text", COOKIE_MANAGER_COL_NAME, NULL);
+       gtk_tree_view_column_set_expand (column, TRUE);
        gtk_tree_view_column_set_sort_indicator(column, TRUE);
        gtk_tree_view_column_set_sort_column_id(column, COOKIE_MANAGER_COL_NAME);
        gtk_tree_view_column_set_resizable(column, TRUE);
index 7685f5cb91c2187c5ce1bccdc28f8e8b1e42229c..22ec10c7a491782b1086fc0b953e1e77229a6c56 100644 (file)
@@ -618,7 +618,7 @@ midori_panel_append_page (MidoriPanel*    panel,
     {
         scrolled = gtk_scrolled_window_new (NULL, NULL);
         gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
-                                        GTK_POLICY_AUTOMATIC,
+                                        GTK_POLICY_NEVER,
                                         GTK_POLICY_AUTOMATIC);
         gtk_widget_set_can_focus (scrolled, TRUE);
         gtk_widget_show (scrolled);
index 8ef87c3a9dbfb6863f625dacdffa4e72bf03b1a3..0a7b88083f6f5e446ff24ce857a8e53661cb0140 100644 (file)
@@ -688,8 +688,11 @@ midori_bookmarks_treeview_render_text_cb (GtkTreeViewColumn* column,
     gtk_tree_model_get (model, iter, 0, &item, -1);
 
     if (item && katze_item_get_name (item))
+    {
         g_object_set (renderer, "markup", NULL,
+                      "ellipsize", PANGO_ELLIPSIZE_END,
                       "text", katze_item_get_name (item), NULL);
+    }
     else
         g_object_set (renderer, "markup", _("<i>Separator</i>"), NULL);
 
@@ -1052,14 +1055,14 @@ midori_bookmarks_init (MidoriBookmarks* bookmarks)
     gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE);
     gtk_tree_view_set_tooltip_column (GTK_TREE_VIEW (treeview), 1);
     column = gtk_tree_view_column_new ();
-    gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
+    gtk_tree_view_column_set_expand (column, TRUE);
     renderer_pixbuf = gtk_cell_renderer_pixbuf_new ();
     gtk_tree_view_column_pack_start (column, renderer_pixbuf, FALSE);
     gtk_tree_view_column_set_cell_data_func (column, renderer_pixbuf,
         (GtkTreeCellDataFunc)midori_bookmarks_treeview_render_icon_cb,
         treeview, NULL);
     renderer_text = gtk_cell_renderer_text_new ();
-    gtk_tree_view_column_pack_start (column, renderer_text, FALSE);
+    gtk_tree_view_column_pack_start (column, renderer_text, TRUE);
     gtk_tree_view_column_set_cell_data_func (column, renderer_text,
         (GtkTreeCellDataFunc)midori_bookmarks_treeview_render_text_cb,
         treeview, NULL);
index 8121fbc0adf2ab8c6a192ae091e16f4e8f142f92..f9100d1c7e31f746d1eb032042f93b4e1c5a5231 100644 (file)
@@ -284,6 +284,7 @@ midori_extensions_treeview_render_text_cb (GtkTreeViewColumn* column,
 
     g_object_set (renderer,
         "markup", text,
+        "ellipsize", PANGO_ELLIPSIZE_END,
         "sensitive", midori_extension_is_prepared (extension),
         NULL);
 
@@ -461,10 +462,9 @@ midori_extensions_init (MidoriExtensions* extensions)
         extensions->treeview, NULL);
     gtk_tree_view_append_column (GTK_TREE_VIEW (extensions->treeview), column);
     column = gtk_tree_view_column_new ();
-    gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
-    renderer_text = gtk_cell_renderer_text_new ();
-    gtk_tree_view_column_pack_start (column, renderer_text, FALSE);
     gtk_tree_view_column_set_expand (column, TRUE);
+    renderer_text = gtk_cell_renderer_text_new ();
+    gtk_tree_view_column_pack_start (column, renderer_text, TRUE);
     gtk_tree_view_column_set_cell_data_func (column, renderer_text,
         (GtkTreeCellDataFunc)midori_extensions_treeview_render_text_cb,
         extensions->treeview, NULL);
index b5d6af38e8715ea85eb27a13a1df8873b6b23f50..8c6edfd17b439f45c3afcbd6795fc7dabd85d949 100644 (file)
@@ -624,11 +624,14 @@ midori_history_treeview_render_text_cb (GtkTreeViewColumn* column,
 
     if (KATZE_ITEM_IS_BOOKMARK (item))
         g_object_set (renderer, "markup", NULL,
+                      "ellipsize", PANGO_ELLIPSIZE_END,
                       "text", katze_item_get_name (item), NULL);
     else if (KATZE_ITEM_IS_FOLDER (item))
     {
         gchar* formatted = midori_history_format_date (item);
-        g_object_set (renderer, "markup", NULL, "text", formatted, NULL);
+        g_object_set (renderer, "markup", NULL, "text", formatted,
+                      "ellipsize", PANGO_ELLIPSIZE_END,
+                      NULL);
         g_free (formatted);
     }
     else
@@ -1022,14 +1025,14 @@ midori_history_init (MidoriHistory* history)
     gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE);
     gtk_tree_view_set_tooltip_column (GTK_TREE_VIEW (treeview), 1);
     column = gtk_tree_view_column_new ();
-    gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
+    gtk_tree_view_column_set_expand (column, TRUE);
     renderer_pixbuf = gtk_cell_renderer_pixbuf_new ();
     gtk_tree_view_column_pack_start (column, renderer_pixbuf, FALSE);
     gtk_tree_view_column_set_cell_data_func (column, renderer_pixbuf,
         (GtkTreeCellDataFunc)midori_history_treeview_render_icon_cb,
         treeview, NULL);
     renderer_text = gtk_cell_renderer_text_new ();
-    gtk_tree_view_column_pack_start (column, renderer_text, FALSE);
+    gtk_tree_view_column_pack_start (column, renderer_text, TRUE);
     gtk_tree_view_column_set_cell_data_func (column, renderer_text,
         (GtkTreeCellDataFunc)midori_history_treeview_render_text_cb,
         treeview, NULL);
index 1c90fe2189a47d82fd1f0cbc0b04774182fed1cf..ea73f3a12a4a3b3f55422f88bda79f9146f2dc4f 100644 (file)
@@ -531,6 +531,7 @@ midori_transfers_init (MidoriTransfers* transfers)
     transfers->treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (treestore));
     gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (transfers->treeview), FALSE);
     column = gtk_tree_view_column_new ();
+    gtk_tree_view_column_set_expand (column, TRUE);
     gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
     renderer_pixbuf = gtk_cell_renderer_pixbuf_new ();
     gtk_tree_view_column_pack_start (column, renderer_pixbuf, FALSE);