gtk_tree_model_get (model, iter, 0, &view, -1);
- g_object_set (renderer, "text", midori_view_get_display_title (view), NULL);
+ g_object_set (renderer, "text", midori_view_get_display_title (view),
+ "ellipsize", midori_view_get_label_ellipsize (view), NULL);
+ gtk_tree_store_set (GTK_TREE_STORE (model), iter,
+ 1, midori_view_get_display_title (view), -1);
g_object_unref (view);
}
treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE);
gtk_tree_view_set_show_expanders (GTK_TREE_VIEW (treeview), FALSE);
+ #if GTK_CHECK_VERSION (2, 12, 0)
+ gtk_tree_view_set_tooltip_column (GTK_TREE_VIEW (treeview), 1);
+ #endif
column = gtk_tree_view_column_new ();
renderer_pixbuf = gtk_cell_renderer_pixbuf_new ();
gtk_tree_view_column_pack_start (column, renderer_pixbuf, FALSE);
(GtkTreeCellDataFunc)midori_extension_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_extension_treeview_render_text_cb,
treeview, NULL);
MidoriBrowser* browser;
guint i;
- model = gtk_tree_store_new (1, MIDORI_TYPE_VIEW);
+ model = gtk_tree_store_new (2, MIDORI_TYPE_VIEW, G_TYPE_STRING);
g_object_set_data (G_OBJECT (extension), "treemodel", model);
browsers = katze_object_get_object (app, "browsers");
}
#endif
+/**
+ * midori_view_get_label_ellipsize:
+ * @view: a #MidoriView
+ *
+ * Determines how labels representing the view should be
+ * ellipsized, which is helpful for alternative labels.
+ *
+ * Return value: how to ellipsize the label
+ *
+ * Since: 0.1.9
+ **/
+PangoEllipsizeMode
+midori_view_get_label_ellipsize (MidoriView* view)
+{
+ g_return_val_if_fail (MIDORI_IS_VIEW (view), PANGO_ELLIPSIZE_END);
+
+ if (view->tab_label)
+ return gtk_label_get_ellipsize (GTK_LABEL (view->tab_title));
+ return PANGO_ELLIPSIZE_END;
+}
+
/**
* midori_view_get_proxy_tab_label:
* @view: a #MidoriView