[epiphany] Update bookmark dialogs



commit 9794d69057fc4a5b161438326444389935f9fc88
Author: Jan-Michael Brummer <jan brummer tabos org>
Date:   Sat Nov 23 17:10:49 2019 +0100

    Update bookmark dialogs
    
    Fit bookmark dialogs for smaller screen sizes
    
    Fixes: https://gitlab.gnome.org/GNOME/epiphany/issues/371

 src/bookmarks/ephy-bookmark-properties-grid.c |   6 +-
 src/resources/gtk/bookmark-properties-grid.ui | 204 ++++++++++++++------------
 src/resources/gtk/bookmark-row.ui             |  51 ++++---
 src/resources/gtk/bookmarks-popover.ui        |   2 +-
 4 files changed, 145 insertions(+), 118 deletions(-)
---
diff --git a/src/bookmarks/ephy-bookmark-properties-grid.c b/src/bookmarks/ephy-bookmark-properties-grid.c
index 87ddc09d3..9cc866db7 100644
--- a/src/bookmarks/ephy-bookmark-properties-grid.c
+++ b/src/bookmarks/ephy-bookmark-properties-grid.c
@@ -45,6 +45,7 @@ struct _EphyBookmarkPropertiesGrid {
 
   GtkWidget *popover_bookmark_label;
   GtkWidget *name_entry;
+  GtkWidget *address_label;
   GtkWidget *address_entry;
   GtkWidget *popover_tags_label;
   GtkWidget *tags_box;
@@ -187,6 +188,7 @@ ephy_bookmark_properties_grid_create_tag_widget (EphyBookmarkPropertiesGrid *sel
 
   label_text = default_tag ? EPHY_BOOKMARKS_FAVORITES_TAG : tag;
   label = gtk_label_new (label_text);
+  gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
   gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
 
   if (!default_tag) {
@@ -377,9 +379,8 @@ ephy_bookmark_properties_grid_constructed (GObject *object)
   /* Set appearance based on type */
   if (self->type == EPHY_BOOKMARK_PROPERTIES_GRID_TYPE_DIALOG) {
     gtk_container_remove (GTK_CONTAINER (self), self->popover_bookmark_label);
-    gtk_container_remove (GTK_CONTAINER (self), self->popover_tags_label);
   } else if (self->type == EPHY_BOOKMARK_PROPERTIES_GRID_TYPE_POPOVER) {
-    gtk_grid_remove_column (GTK_GRID (self), 0);
+    gtk_container_remove (GTK_CONTAINER (self), self->address_label);
     gtk_container_remove (GTK_CONTAINER (self), self->address_entry);
   }
 
@@ -485,6 +486,7 @@ ephy_bookmark_properties_grid_class_init (EphyBookmarkPropertiesGridClass *klass
   gtk_widget_class_set_template_from_resource (widget_class, 
"/org/gnome/epiphany/gtk/bookmark-properties-grid.ui");
   gtk_widget_class_bind_template_child (widget_class, EphyBookmarkPropertiesGrid, popover_bookmark_label);
   gtk_widget_class_bind_template_child (widget_class, EphyBookmarkPropertiesGrid, name_entry);
+  gtk_widget_class_bind_template_child (widget_class, EphyBookmarkPropertiesGrid, address_label);
   gtk_widget_class_bind_template_child (widget_class, EphyBookmarkPropertiesGrid, address_entry);
   gtk_widget_class_bind_template_child (widget_class, EphyBookmarkPropertiesGrid, popover_tags_label);
   gtk_widget_class_bind_template_child (widget_class, EphyBookmarkPropertiesGrid, tags_box);
diff --git a/src/resources/gtk/bookmark-properties-grid.ui b/src/resources/gtk/bookmark-properties-grid.ui
index 11d3d286d..ce1216837 100644
--- a/src/resources/gtk/bookmark-properties-grid.ui
+++ b/src/resources/gtk/bookmark-properties-grid.ui
@@ -1,180 +1,192 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
 <interface>
-  <!-- interface-requires gtk+ 3.18 -->
+  <requires lib="gtk+" version="3.18"/>
   <template class="EphyBookmarkPropertiesGrid" parent="GtkGrid">
-    <property name="border-width">18</property>
-    <property name="column-spacing">12</property>
-    <property name="row-spacing">12</property>
-    <property name="visible">true</property>
+    <property name="visible">True</property>
+    <property name="can_focus">True</property>
+    <property name="border_width">12</property>
+    <property name="orientation">vertical</property>
+    <property name="row_spacing">6</property>
+    <property name="column_spacing">6</property>
     <child>
       <object class="GtkLabel" id="popover_bookmark_label">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <property name="label" translatable="yes">Bookmark</property>
-        <property name="visible">true</property>
         <attributes>
           <attribute name="weight" value="bold"/>
         </attributes>
       </object>
       <packing>
-        <property name="left-attach">0</property>
-        <property name="width">2</property>
-        <property name="top-attach">0</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">0</property>
       </packing>
     </child>
     <child>
       <object class="GtkLabel">
-        <property name="halign">end</property>
-        <property name="valign">center</property>
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="halign">start</property>
         <property name="label" translatable="yes">Name</property>
-        <property name="visible">true</property>
         <style>
           <class name="dim-label"/>
         </style>
       </object>
       <packing>
-        <property name="left-attach">0</property>
-        <property name="top-attach">1</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">1</property>
       </packing>
     </child>
     <child>
       <object class="GtkEntry" id="name_entry">
-        <property name="max-width-chars">40</property>
-        <property name="visible">true</property>
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="max_width_chars">32</property>
       </object>
       <packing>
-        <property name="left-attach">1</property>
-        <property name="top-attach">1</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">2</property>
       </packing>
     </child>
     <child>
-      <object class="GtkLabel">
-        <property name="halign">end</property>
+      <object class="GtkLabel" id="address_label">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="halign">start</property>
         <property name="valign">center</property>
+        <property name="margin_top">6</property>
         <property name="label" translatable="yes">Address</property>
-        <property name="visible">true</property>
         <style>
           <class name="dim-label"/>
         </style>
       </object>
       <packing>
-        <property name="left-attach">0</property>
-        <property name="top-attach">2</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">3</property>
       </packing>
     </child>
     <child>
       <object class="GtkEntry" id="address_entry">
-        <property name="visible">true</property>
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
       </object>
       <packing>
-        <property name="left-attach">1</property>
-        <property name="top-attach">2</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">4</property>
       </packing>
     </child>
     <child>
       <object class="GtkLabel" id="popover_tags_label">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <property name="halign">start</property>
         <property name="valign">center</property>
+        <property name="margin_top">12</property>
         <property name="label" translatable="yes">Tags</property>
-        <property name="visible">true</property>
-        <attributes>
-          <attribute name="weight" value="bold"/>
-        </attributes>
         <style>
           <class name="dim-label"/>
         </style>
       </object>
       <packing>
-        <property name="left-attach">1</property>
-        <property name="top-attach">3</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">5</property>
       </packing>
     </child>
     <child>
-      <object class="GtkLabel">
-        <property name="halign">end</property>
-        <property name="valign">start</property>
-        <property name="label" translatable="yes">Tags</property>
-        <property name="visible">true</property>
-        <style>
-          <class name="dim-label"/>
-        </style>
-      </object>
-      <packing>
-        <property name="left-attach">0</property>
-        <property name="top-attach">4</property>
-      </packing>
-    </child>
-    <child>
-      <object class="GtkScrolledWindow" id="tags_scrolled_window">
-        <property name="expand">True</property>
-        <property name="max-content-height">132</property>
-        <property name="min-content-height">38</property>
-        <property name="hscrollbar-policy">never</property>
-        <property name="vscrollbar-policy">never</property>
-        <property name="propagate-natural-width">True</property>
-        <property name="propagate-natural-height">True</property>
-        <property name="visible">true</property>
+      <object class="GtkBox">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <child>
-          <object class="GtkFlowBox" id="tags_box">
-            <property name="column-spacing">6</property>
-            <property name="row-spacing">6</property>
-            <property name="selection-mode">none</property>
-            <property name="homogeneous">true</property>
-            <property name="valign">start</property>
-            <property name="min-children-per-line">3</property>
-            <property name="max-children-per-line">3</property>
-            <property name="visible">true</property>
+          <object class="GtkEntry" id="add_tag_entry">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="hexpand">True</property>
+            <property name="activates_default">True</property>
+            <property name="placeholder_text" translatable="yes">Add Tag…</property>
           </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
         </child>
+        <child>
+          <object class="GtkButton" id="add_tag_button">
+            <property name="label" translatable="yes">_Add</property>
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="can_default">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">grid.add-tag</property>
+            <property name="use_underline">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <style>
+          <class name="linked"/>
+        </style>
       </object>
       <packing>
-        <property name="left-attach">1</property>
-        <property name="top-attach">4</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">7</property>
       </packing>
     </child>
     <child>
-      <object class="GtkBox">
-        <property name="orientation">horizontal</property>
-        <property name="visible">true</property>
-        <style>
-          <class name="linked"/>
-        </style>
-        <child>
-          <object class="GtkEntry" id="add_tag_entry">
-            <property name="placeholder-text" translatable="yes">Add Tag…</property>
-            <property name="activates-default">true</property>
-            <property name="hexpand">true</property>
-            <property name="visible">true</property>
-          </object>
-        </child>
+      <object class="GtkScrolledWindow" id="tags_scrolled_window">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="vexpand">True</property>
+        <property name="min_content_height">38</property>
+        <property name="max_content_width">270</property>
+        <property name="max_content_height">182</property>
+        <property name="propagate_natural_width">True</property>
+        <property name="propagate_natural_height">True</property>
         <child>
-          <object class="GtkButton" id="add_tag_button">
-            <property name="label" translatable="yes">_Add</property>
-            <property name="action-name">grid.add-tag</property>
-            <property name="can-default">true</property>
-            <property name="use-underline">true</property>
-            <property name="visible">true</property>
+          <object class="GtkViewport">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkFlowBox" id="tags_box">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="homogeneous">True</property>
+                <property name="column_spacing">6</property>
+                <property name="row_spacing">6</property>
+                <property name="min_children_per_line">2</property>
+                <property name="max_children_per_line">3</property>
+                <property name="selection_mode">none</property>
+              </object>
+            </child>
           </object>
         </child>
       </object>
       <packing>
-        <property name="left-attach">1</property>
-        <property name="top-attach">5</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">6</property>
       </packing>
     </child>
     <child>
       <object class="GtkButton" id="remove_bookmark_button">
-        <property name="label" translatable="yes">_Remove Bookmark</property>
-        <property name="action-name">grid.remove-bookmark</property>
-        <property name="use-underline">true</property>
+        <property name="label" translatable="yes">_Remove</property>
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="receives_default">False</property>
         <property name="halign">end</property>
-        <property name="valign">end</property>
-        <property name="visible">true</property>
+        <property name="action_name">grid.remove-bookmark</property>
+        <property name="use_underline">True</property>
+        <property name="margin_top">6</property>
         <style>
           <class name="destructive-action"/>
         </style>
       </object>
       <packing>
-        <property name="left-attach">1</property>
-        <property name="top-attach">6</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">8</property>
       </packing>
     </child>
   </template>
diff --git a/src/resources/gtk/bookmark-row.ui b/src/resources/gtk/bookmark-row.ui
index 7abed9b89..f08679d31 100644
--- a/src/resources/gtk/bookmark-row.ui
+++ b/src/resources/gtk/bookmark-row.ui
@@ -1,55 +1,68 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
 <interface>
-  <!-- interface-requires gtk+ 3.18 -->
+  <requires lib="gtk+" version="3.18"/>
   <template class="EphyBookmarkRow" parent="GtkListBoxRow">
-    <property name="visible">true</property>
-    <style>
-      <class name="bookmarks-row"/>
-    </style>
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
     <child>
       <object class="GtkBox">
-        <property name="orientation">horizontal</property>
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <property name="spacing">6</property>
-        <property name="visible">true</property>
         <child>
           <object class="GtkImage" id="favicon_image">
-            <property name="visible">true</property>
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="margin_left">6</property>
           </object>
           <packing>
-            <property name="pack-type">start</property>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
           </packing>
         </child>
         <child>
           <object class="GtkLabel" id="title_label">
-            <property name="expand">true</property>
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="halign">start</property>
-            <property name="xalign">0</property>
-            <property name="max-width-chars">35</property>
-            <property name="width-chars">35</property>
             <property name="ellipsize">end</property>
-            <property name="visible">true</property>
+            <property name="width_chars">20</property>
+            <property name="max_width_chars">20</property>
+            <property name="xalign">0</property>
           </object>
           <packing>
-            <property name="pack-type">start</property>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
           </packing>
         </child>
         <child>
           <object class="GtkButton" id="properties_button">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="receives_default">False</property>
             <property name="relief">none</property>
-            <property name="visible">true</property>
             <child>
               <object class="GtkImage">
-                <property name="icon-name">emblem-system-symbolic</property>
-                <property name="visible">true</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="icon_name">emblem-system-symbolic</property>
               </object>
             </child>
           </object>
           <packing>
-            <property name="pack-type">end</property>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">2</property>
           </packing>
         </child>
       </object>
     </child>
+    <style>
+      <class name="bookmarks-row"/>
+    </style>
   </template>
 </interface>
diff --git a/src/resources/gtk/bookmarks-popover.ui b/src/resources/gtk/bookmarks-popover.ui
index bc5043921..6ee426cdd 100644
--- a/src/resources/gtk/bookmarks-popover.ui
+++ b/src/resources/gtk/bookmarks-popover.ui
@@ -4,7 +4,7 @@
   <template class="EphyBookmarksPopover" parent="GtkPopover">
     <child>
       <object class="GtkBox">
-        <property name="border-width">18</property>
+        <property name="border-width">12</property>
         <property name="orientation">vertical</property>
         <property name="spacing">6</property>
         <property name="visible">true</property>


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