[seahorse/wip/nielsdg/keymanager-ui-tweaks] KeyManger: various UI tweaks
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [seahorse/wip/nielsdg/keymanager-ui-tweaks] KeyManger: various UI tweaks
- Date: Tue, 8 Jan 2019 22:14:38 +0000 (UTC)
commit 5d8f17c93690867cb57310d6d84129d50f998674
Author: Niels De Graef <nielsdegraef gmail com>
Date: Tue Jan 8 23:05:32 2019 +0100
KeyManger: various UI tweaks
* Add some more padding to the rows
* Make sure Seahorse doesn't resize below the list of passwords/keys
* Naturally increase width with the resizing of the windows
common/key-manager-store.vala | 11 +++++-----
gkr/gkr-item.vala | 24 +++++++++++----------
src/key-manager.vala | 3 ---
src/seahorse-key-manager.ui | 49 ++++++++++++++++++++++++++++++++++++-------
4 files changed, 60 insertions(+), 27 deletions(-)
---
diff --git a/common/key-manager-store.vala b/common/key-manager-store.vala
index d7e7aa9a..827c582b 100644
--- a/common/key-manager-store.vala
+++ b/common/key-manager-store.vala
@@ -132,7 +132,8 @@ public class Seahorse.KeyManagerStore : Gcr.CollectionModel {
// add the icon column
Gtk.CellRendererPixbuf icon_renderer = new Gtk.CellRendererPixbuf();
icon_renderer.stock_size = Gtk.IconSize.DND;
- icon_renderer.ypad = 6;
+ icon_renderer.ypad = 12;
+ icon_renderer.xpad = 12;
icon_renderer.yalign = 0.0f;
Gtk.TreeViewColumn? col = new Gtk.TreeViewColumn.with_attributes ("", icon_renderer, "gicon",
Column.ICON, null);
col.set_resizable(false);
@@ -142,15 +143,16 @@ public class Seahorse.KeyManagerStore : Gcr.CollectionModel {
col = new Gtk.TreeViewColumn();
Gtk.CellRendererText text_renderer = new Gtk.CellRendererText();
- text_renderer.ypad = 6;
+ text_renderer.ypad = 12;
text_renderer.yalign = 0.0f;
+ text_renderer.width_chars = 30;
text_renderer.ellipsize = Pango.EllipsizeMode.END;
col.pack_start(text_renderer, true);
col.set_attributes(text_renderer, "markup", Column.MARKUP, null);
text_renderer = new Gtk.CellRendererText();
- text_renderer.ypad = 6;
- text_renderer.xpad = 3;
+ text_renderer.ypad = 12;
+ text_renderer.xpad = 12;
text_renderer.yalign = 0.0f;
text_renderer.xalign = 1.0f;
text_renderer.scale = Pango.Scale.SMALL;
@@ -158,7 +160,6 @@ public class Seahorse.KeyManagerStore : Gcr.CollectionModel {
col.pack_start(text_renderer, false);
col.set_attributes(text_renderer, "markup", Column.DESCRIPTION, null);
col.set_resizable(true);
- col.set_expand(true);
view.append_column(col);
col.set_sort_column_id(Column.LABEL);
diff --git a/gkr/gkr-item.vala b/gkr/gkr-item.vala
index bdcf14d1..f68a0d18 100644
--- a/gkr/gkr-item.vala
+++ b/gkr/gkr-item.vala
@@ -87,17 +87,19 @@ public class Item : Secret.Item, Deletable, Viewable {
}
}
- public string markup {
- owned get {
- ensure_display_info ();
- var result = new GLib.StringBuilder("");
- result.append(GLib.Markup.escape_text(this._info.label));
- result.append("<span size='small' rise='0' foreground='#555555'>\n");
- result.append(this._info.details);
- result.append("</span>");
- return result.str;
- }
- }
+ public string markup {
+ owned get {
+ ensure_display_info ();
+ var result = new StringBuilder("");
+ result.append(Markup.escape_text(this._info.label));
+ if (this._info.details != null && this._info.details != "") {
+ result.append("<span size='small' rise='0' foreground='#555555'>\n");
+ result.append(this._info.details);
+ result.append("</span>");
+ }
+ return result.str;
+ }
+ }
public Usage usage {
get { return Usage.CREDENTIALS; }
diff --git a/src/key-manager.vala b/src/key-manager.vala
index 959effea..56a3d66a 100644
--- a/src/key-manager.vala
+++ b/src/key-manager.vala
@@ -363,9 +363,6 @@ public class Seahorse.KeyManager : Catalog {
this.sidebar_panes.realize.connect(() => { this.sidebar_panes.position =
this.settings.get_int("sidebar-width"); });
this.sidebar_panes.unrealize.connect(() => { this.settings.set_int("sidebar-width",
this.sidebar_panes.position); });
- this.sidebar_panes.get_child1().set_size_request(50, -1);
- this.sidebar_panes.get_child2().set_size_request(150, -1);
-
foreach (weak Backend backend in get_backends()) {
ActionGroup actions = backend.actions;
actions.catalog = this;
diff --git a/src/seahorse-key-manager.ui b/src/seahorse-key-manager.ui
index 8b0f1f82..5660b3f4 100644
--- a/src/seahorse-key-manager.ui
+++ b/src/seahorse-key-manager.ui
@@ -335,10 +335,14 @@
<object class="GtkBox" id="sidebar_area">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="width-request">170</property>
<child>
<placeholder/>
</child>
</object>
+ <packing>
+ <property name="shrink">False</property>
+ </packing>
</child>
<child>
<object class="GtkBox">
@@ -363,20 +367,46 @@
<object class="GtkScrolledWindow" id="key-list-scroll-area">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="hscrollbar-policy">never</property>
<child>
- <object class="GtkFrame">
+ <object class="GtkBox">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">horizontal</property>
<property name="margin-top">24</property>
<property name="margin-bottom">24</property>
- <property name="margin-left">48</property>
- <property name="margin-right">48</property>
<child>
- <object class="GtkTreeView" id="key_list">
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="pack_type">end</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="enable-grid-lines">horizontal</property>
- <child internal-child="selection">
- <object class="GtkTreeSelection" id="treeview-selection"/>
+ <property name="hexpand">True</property>
+ <property name="margin-start">18</property>
+ <property name="margin-end">18</property>
+ <child>
+ <object class="GtkTreeView" id="key_list">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="enable-grid-lines">horizontal</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="treeview-selection"/>
+ </child>
+ </object>
</child>
</object>
</child>
@@ -571,6 +601,9 @@
</object>
</child>
</object>
+ <packing>
+ <property name="shrink">False</property>
+ </packing>
</child>
</object>
</child>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]