[polari] connections: Tweak the connection details UI a bit



commit b540e206ea1bc4ad342dc82f3cffb5325421b316
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Feb 3 03:24:19 2016 +0100

    connections: Tweak the connection details UI a bit
    
    Reduce whitespace a bit, which was a bit too generous. Rename "Description"
    to "Name" - that's what the setting is actually used for after all - and move
    it to the top as it servers as title of the connection (even when optional).

 data/resources/connection-details.ui |   42 +++++++++++++++------------------
 data/resources/join-room-dialog.ui   |    2 +-
 src/connections.js                   |   12 +++++-----
 3 files changed, 26 insertions(+), 30 deletions(-)
---
diff --git a/data/resources/connection-details.ui b/data/resources/connection-details.ui
index c1ac2ad..b7206aa 100644
--- a/data/resources/connection-details.ui
+++ b/data/resources/connection-details.ui
@@ -7,52 +7,46 @@
       <object class="GtkGrid" id="grid">
         <property name="visible">True</property>
         <property name="margin">24</property>
-        <property name="row-spacing">12</property>
+        <property name="row-spacing">6</property>
         <property name="column-spacing">12</property>
         <child>
-          <object class="GtkLabel" id="margin">
-            <property name="visible">True</property>
-            <property name="width-request">24</property>
-          </object>
-        </child>
-        <child>
-          <object class="GtkLabel" id="server_label">
+          <object class="GtkLabel" id="name_label">
             <property name="visible">True</property>
             <property name="halign">end</property>
-            <property name="label" translatable="yes">_Address</property>
+            <property name="label" translatable="yes">_Name</property>
             <property name="use-underline">True</property>
-            <property name="mnemonic-widget">serverEntry</property>
+            <property name="mnemonic-widget">nameEntry</property>
           </object>
         </child>
         <child>
-          <object class="GtkEntry" id="serverEntry">
+          <object class="GtkEntry" id="nameEntry">
             <property name="visible">True</property>
             <property name="hexpand">True</property>
             <property name="activates-default">True</property>
+            <property name="placeholder-text" translatable="yes">optional</property>
           </object>
         </child>
         <child>
-          <object class="GtkLabel" id="description_label">
+          <object class="GtkLabel" id="server_label">
             <property name="visible">True</property>
             <property name="halign">end</property>
-            <property name="label" translatable="yes">_Description</property>
+            <property name="label" translatable="yes">_Server</property>
             <property name="use-underline">True</property>
-            <property name="mnemonic-widget">descEntry</property>
+            <property name="mnemonic-widget">serverEntry</property>
           </object>
           <packing>
-            <property name="left-attach">1</property>
+            <property name="left-attach">0</property>
             <property name="top-attach">1</property>
           </packing>
         </child>
         <child>
-          <object class="GtkEntry" id="descEntry">
+          <object class="GtkEntry" id="serverEntry">
             <property name="visible">True</property>
             <property name="hexpand">True</property>
             <property name="activates-default">True</property>
-            <property name="placeholder-text" translatable="yes">optional</property>
           </object>
           <packing>
-            <property name="left-attach">2</property>
+            <property name="left-attach">1</property>
             <property name="top-attach">1</property>
           </packing>
         </child>
@@ -66,7 +60,7 @@
             <property name="mnemonic-widget">nickEntry</property>
           </object>
           <packing>
-            <property name="left-attach">1</property>
+            <property name="left-attach">0</property>
             <property name="top-attach">2</property>
           </packing>
         </child>
@@ -79,7 +73,7 @@
             <property name="activates-default">True</property>
           </object>
           <packing>
-            <property name="left-attach">2</property>
+            <property name="left-attach">1</property>
             <property name="top-attach">2</property>
           </packing>
         </child>
@@ -92,7 +86,7 @@
             <property name="mnemonic-widget">realnameEntry</property>
           </object>
           <packing>
-            <property name="left-attach">1</property>
+            <property name="left-attach">0</property>
             <property name="top-attach">3</property>
           </packing>
         </child>
@@ -101,10 +95,11 @@
             <property name="visible">True</property>
             <property name="hexpand">True</property>
             <property name="activates-default">True</property>
+            <property name="width-chars">30</property>
             <property name="placeholder-text" translatable="yes">optional</property>
           </object>
           <packing>
-            <property name="left-attach">2</property>
+            <property name="left-attach">1</property>
             <property name="top-attach">3</property>
           </packing>
         </child>
@@ -114,7 +109,6 @@
       <object class="GtkBox" id="errorBox">
         <property name="visible">False</property>
         <property name="orientation">horizontal</property>
-        <property name="spacing">12</property>
         <property name="sensitive">False</property>
         <property name="vexpand">True</property>
         <style>
@@ -126,6 +120,7 @@
             <property name="icon-name">dialog-error-symbolic</property>
             <property name="icon-size">5</property>
             <property name="margin">12</property>
+            <property name="margin-start">24</property>
           </object>
         </child>
         <child>
@@ -135,6 +130,7 @@
             <property name="wrap">true</property>
             <property name="vexpand">true</property>
             <property name="margin">12</property>
+            <property name="margin-end">24</property>
           </object>
         </child>
       </object>
diff --git a/data/resources/join-room-dialog.ui b/data/resources/join-room-dialog.ui
index 0b7970f..9b91332 100644
--- a/data/resources/join-room-dialog.ui
+++ b/data/resources/join-room-dialog.ui
@@ -52,7 +52,7 @@
               <object class="GtkGrid">
                 <property name="visible">True</property>
                 <property name="margin">24</property>
-                <property name="row-spacing">12</property>
+                <property name="row-spacing">6</property>
                 <property name="column-spacing">12</property>
                 <child>
                   <object class="GtkLabel" id="margin">
diff --git a/src/connections.js b/src/connections.js
index d765846..952d7d1 100644
--- a/src/connections.js
+++ b/src/connections.js
@@ -10,8 +10,8 @@ const ConnectionDetails = new Lang.Class({
     Name: 'ConnectionDetails',
     Extends: Gtk.Box,
     Template: 'resource:///org/gnome/Polari/ui/connection-details.ui',
-    InternalChildren: ['serverEntry',
-                       'descEntry',
+    InternalChildren: ['nameEntry',
+                       'serverEntry',
                        'nickEntry',
                        'realnameEntry',
                        'errorBox',
@@ -77,14 +77,14 @@ const ConnectionDetails = new Lang.Class({
     },
 
     _getParams: function() {
+        let nameText = this._nameEntry.text.trim();
         let serverText = this._serverEntry.text.trim();
-        let descText = this._descEntry.text.trim();
 
         let serverRegEx = /(.*?)(?::(\d{1,5}))?$/;
         let [, server, port] = serverText.match(serverRegEx);
 
         let params = {
-            name: descText.length ? descText : server,
+            name: nameText.length ? nameText : server,
             server: server,
             account: this._nickEntry.text.trim()
         };
@@ -98,8 +98,8 @@ const ConnectionDetails = new Lang.Class({
     },
 
     reset: function() {
+        this._nameEntry.text = '';
         this._serverEntry.text = '';
-        this._descEntry.text = '';
         this._nickEntry.text = GLib.get_user_name();
         this._realnameEntry.text = '';
 
@@ -128,7 +128,7 @@ const ConnectionDetails = new Lang.Class({
         this._realnameEntry.text = realname;
 
         if (server != account.display_name)
-            this._descEntry.text = account.display_name;
+            this._nameEntry.text = account.display_name;
     },
 
     get can_confirm() {


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