[Xfce4-commits] [panel-plugins/xfce4-clipman-plugin] 04/37: Show preview text instead of full clipboard buffer

noreply at xfce.org noreply at xfce.org
Mon Mar 23 23:29:59 CET 2020


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-clipman-plugin.

commit 4ef1782a403506e45e203b47e9ae7878fe0a43b0
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Mon Mar 16 01:35:22 2020 +0100

    Show preview text instead of full clipboard buffer
---
 panel-plugin/xfce4-clipman-history.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/xfce4-clipman-history.c b/panel-plugin/xfce4-clipman-history.c
index e6ea4aa..092b5e1 100644
--- a/panel-plugin/xfce4-clipman-history.c
+++ b/panel-plugin/xfce4-clipman-history.c
@@ -35,6 +35,7 @@
 
 enum
 {
+  COLUMN_PREVIEW,
   COLUMN_TEXT,
   N_COLUMNS
 };
@@ -148,7 +149,7 @@ clipman_history_treeview_init (MyPlugin *plugin)
   gtk_widget_show (scroll);
 
   /* create the store */
-  liststore = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING);
+  liststore = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING);
 
   /* create treemodel with filter */
   filter = gtk_tree_model_filter_new (GTK_TREE_MODEL (liststore), NULL);
@@ -172,6 +173,17 @@ clipman_history_treeview_init (MyPlugin *plugin)
   column = gtk_tree_view_column_new ();
   gtk_tree_view_column_pack_start (column, renderer, TRUE);
   gtk_tree_view_column_set_attributes (column, renderer,
+                                       "text", COLUMN_PREVIEW,
+                                       NULL);
+  g_object_set (G_OBJECT (renderer), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+  gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
+
+  /* text renderer */
+  renderer = gtk_cell_renderer_text_new ();
+  column = gtk_tree_view_column_new ();
+  gtk_tree_view_column_set_visible (column, FALSE);
+  gtk_tree_view_column_pack_start (column, renderer, TRUE);
+  gtk_tree_view_column_set_attributes (column, renderer,
                                        "text", COLUMN_TEXT,
                                        NULL);
   g_object_set (G_OBJECT (renderer), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
@@ -188,7 +200,10 @@ clipman_history_treeview_init (MyPlugin *plugin)
       switch (item->type)
         {
         case CLIPMAN_HISTORY_TYPE_TEXT:
-          gtk_list_store_insert_with_values (liststore, &iter, i, COLUMN_TEXT, item->content.text, -1);
+          gtk_list_store_insert_with_values (liststore, &iter, i,
+                                             COLUMN_PREVIEW, item->preview.text,
+                                             COLUMN_TEXT, item->content.text,
+                                             -1);
           break;
 
         case CLIPMAN_HISTORY_TYPE_IMAGE:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list