[epiphany] Fix blank space in bookmark row and add tooltip



commit 2d51ae294dcc6071c12b8be83e0f011b2487c789
Author: Jan-Michael Brummer <jan brummer tabos org>
Date:   Sat Feb 29 12:38:54 2020 +0100

    Fix blank space in bookmark row and add tooltip
    
    Fixes: https://gitlab.gnome.org/GNOME/epiphany/issues/1119

 src/bookmarks/ephy-bookmark-row.c | 7 +++++--
 src/resources/gtk/bookmark-row.ui | 6 +++---
 2 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/bookmarks/ephy-bookmark-row.c b/src/bookmarks/ephy-bookmark-row.c
index db79b4d5e..f360fa717 100644
--- a/src/bookmarks/ephy-bookmark-row.c
+++ b/src/bookmarks/ephy-bookmark-row.c
@@ -159,6 +159,7 @@ transform_bookmark_title (GBinding     *binding,
                           GValue       *to_value,
                           gpointer      user_data)
 {
+  EphyBookmarkRow *row = EPHY_BOOKMARK_ROW (user_data);
   const char *title;
 
   title = g_value_get_string (from_value);
@@ -167,12 +168,14 @@ transform_bookmark_title (GBinding     *binding,
     EphyBookmark *bookmark;
     const char *url;
 
-    bookmark = EPHY_BOOKMARK (user_data);
+    bookmark = EPHY_BOOKMARK (row->bookmark);
     url = ephy_bookmark_get_url (bookmark);
 
     g_value_set_string (to_value, url);
+    gtk_widget_set_tooltip_text (GTK_WIDGET (row), url);
   } else {
     g_value_set_string (to_value, title);
+    gtk_widget_set_tooltip_text (GTK_WIDGET (row), title);
   }
 
   return TRUE;
@@ -192,7 +195,7 @@ ephy_bookmark_row_constructed (GObject *object)
                                G_BINDING_SYNC_CREATE,
                                transform_bookmark_title,
                                NULL,
-                               self->bookmark, NULL);
+                               self, NULL);
 
   database = webkit_web_context_get_favicon_database (ephy_embed_shell_get_web_context (shell));
   webkit_favicon_database_get_favicon (database,
diff --git a/src/resources/gtk/bookmark-row.ui b/src/resources/gtk/bookmark-row.ui
index f08679d31..1b82a5352 100644
--- a/src/resources/gtk/bookmark-row.ui
+++ b/src/resources/gtk/bookmark-row.ui
@@ -26,10 +26,10 @@
           <object class="GtkLabel" id="title_label">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="halign">start</property>
+            <property name="halign">fill</property>
+            <property name="hexpand">True</property>
             <property name="ellipsize">end</property>
-            <property name="width_chars">20</property>
-            <property name="max_width_chars">20</property>
+            <property name="max_width_chars">1</property>
             <property name="xalign">0</property>
           </object>
           <packing>


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