Skip to content

Instantly share code, notes, and snippets.

@andreldm
Created July 10, 2017 23:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreldm/50da0abddf24d3e1f80c6edc2077077c to your computer and use it in GitHub Desktop.
Save andreldm/50da0abddf24d3e1f80c6edc2077077c to your computer and use it in GitHub Desktop.
Thunar shortcut pane hack
diff --git a/thunar/thunar-shortcuts-view.c b/thunar/thunar-shortcuts-view.c
index ca370cd5..4f8d4f98 100644
--- a/thunar/thunar-shortcuts-view.c
+++ b/thunar/thunar-shortcuts-view.c
@@ -340,6 +340,9 @@ thunar_shortcuts_view_init (ThunarShortcutsView *view)
/* allocate the text renderer (ellipsizing as required, but "File System" must fit) */
renderer = g_object_new (GTK_TYPE_CELL_RENDERER_TEXT,
"ellipsize", PANGO_ELLIPSIZE_END,
+ /*"width-chars", 20,*/
+ "cell-background", "lightblue",
+ "cell-background-set", TRUE,
NULL);
g_signal_connect (G_OBJECT (renderer), "edited", G_CALLBACK (thunar_shortcuts_view_renamed), view);
gtk_tree_view_column_pack_start (column, renderer, TRUE);
@@ -356,6 +359,7 @@ thunar_shortcuts_view_init (ThunarShortcutsView *view)
"active", THUNAR_SHORTCUTS_MODEL_COLUMN_BUSY,
"pulse", THUNAR_SHORTCUTS_MODEL_COLUMN_BUSY_PULSE,
NULL);
+ g_object_set (renderer, "cell-background", "red", "cell-background-set", TRUE, NULL);
/* allocate icon renderer for the eject symbol */
renderer = gtk_cell_renderer_pixbuf_new ();
@@ -365,6 +369,14 @@ thunar_shortcuts_view_init (ThunarShortcutsView *view)
"visible", THUNAR_SHORTCUTS_MODEL_COLUMN_CAN_EJECT,
NULL);
+ renderer = g_object_new (GTK_TYPE_CELL_RENDERER_TEXT,
+ "ellipsize", PANGO_ELLIPSIZE_END,
+ "cell-background", "lightgreen",
+ "cell-background-set", TRUE,
+ "text", "Foo",
+ NULL);
+ gtk_tree_view_column_pack_start (column, renderer, FALSE);
+
/* enable drag support for the shortcuts view (actually used to support reordering) */
gtk_tree_view_enable_model_drag_source (GTK_TREE_VIEW (view), GDK_BUTTON1_MASK, drag_targets,
G_N_ELEMENTS (drag_targets), GDK_ACTION_MOVE);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment