[gnome-characters/wip/properties: 11/14] character: Ellipsize detail labels



commit 2a0ec9441e3f349e944a5249605ee4fb5891c80c
Author: Daiki Ueno <dueno src gnome org>
Date:   Tue Feb 10 11:40:19 2015 +0900

    character: Ellipsize detail labels

 data/character.ui |    4 ++++
 src/character.js  |   12 ++++++------
 2 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/data/character.ui b/data/character.ui
index acf441d..df717f2 100644
--- a/data/character.ui
+++ b/data/character.ui
@@ -59,6 +59,7 @@
                    <child>
                      <object class="GtkLabel" id="codepoint-label">
                        <property name="halign">start</property>
+                       <property name="ellipsize">end</property>
                      </object>
                      <packing>
                        <property name="left_attach">1</property>
@@ -78,6 +79,7 @@
                    <child>
                      <object class="GtkLabel" id="category-label">
                        <property name="halign">start</property>
+                       <property name="ellipsize">end</property>
                      </object>
                      <packing>
                        <property name="left_attach">1</property>
@@ -97,6 +99,7 @@
                    <child>
                      <object class="GtkLabel" id="script-label">
                        <property name="halign">start</property>
+                       <property name="ellipsize">end</property>
                      </object>
                      <packing>
                        <property name="left_attach">1</property>
@@ -116,6 +119,7 @@
                    <child>
                      <object class="GtkLabel" id="block-label">
                        <property name="halign">start</property>
+                       <property name="ellipsize">end</property>
                      </object>
                      <packing>
                        <property name="left_attach">1</property>
diff --git a/src/character.js b/src/character.js
index 8b2092b..a834e87 100644
--- a/src/character.js
+++ b/src/character.js
@@ -127,7 +127,7 @@ const CharacterDialog = new Lang.Class({
     },
 
     _activateLink: function(label, uri) {
-        let match = uri.match(/^character:([0-9A-F]+)/);
+        let match = uri.match(/^character:\/\/([0-9A-F]+)/);
         if (match) {
             let uc = String.fromCharCode(parseInt(match[1], 16));
             this._setCharacter(uc);
@@ -162,14 +162,14 @@ const CharacterDialog = new Lang.Class({
                                         label: _("Decomposition: ") });
             this._detail_grid.attach(title, 0, 4, 1, 1);
             let label = new Gtk.Label({ halign: Gtk.Align.START,
-                                        wrap: true,
                                         max_width_chars: 30,
-                                        use_markup: true });
+                                        use_markup: true,
+                                        ellipsize: Pango.EllipsizeMode.END });
             label.label = decomposition.map(function(d) {
                 let hex = Util.hexCodepoint(d);
-                return _("<a href=\"character:%s\">U+%04s %s</a>").format(
-                    hex, hex, Gc.character_name(d));
-            }).join(', ');
+                return _("<a href=\"character://%s\">%s</a>").format(
+                    hex, Util.capitalize(Gc.character_name(d)));
+            }).join('\n');
             label.connect('activate-link', Lang.bind(this, this._activateLink));
             this._detail_grid.attach_next_to(label,
                                             title,


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