Browse Source

More UI civic beautification.

Adam Ierymenko 11 years ago
parent
commit
4ddf97be4e
4 changed files with 88 additions and 59 deletions
  1. 32 36
      ZeroTierUI/mainwindow.ui
  2. 3 4
      ZeroTierUI/networkwidget.cpp
  3. 2 2
      ZeroTierUI/networkwidget.h
  4. 51 17
      ZeroTierUI/networkwidget.ui

+ 32 - 36
ZeroTierUI/mainwindow.ui

@@ -39,6 +39,11 @@
       <property name="focusPolicy">
       <property name="focusPolicy">
        <enum>Qt::NoFocus</enum>
        <enum>Qt::NoFocus</enum>
       </property>
       </property>
+      <property name="styleSheet">
+       <string notr="true">QListWidget#networkListWidget::Item {
+	background-color: rgba(0,0,0,10);
+}s</string>
+      </property>
       <property name="frameShape">
       <property name="frameShape">
        <enum>QFrame::NoFrame</enum>
        <enum>QFrame::NoFrame</enum>
       </property>
       </property>
@@ -52,14 +57,17 @@
        <set>QAbstractItemView::NoEditTriggers</set>
        <set>QAbstractItemView::NoEditTriggers</set>
       </property>
       </property>
       <property name="selectionMode">
       <property name="selectionMode">
-       <enum>QAbstractItemView::SingleSelection</enum>
-      </property>
-      <property name="selectionBehavior">
-       <enum>QAbstractItemView::SelectItems</enum>
+       <enum>QAbstractItemView::NoSelection</enum>
       </property>
       </property>
       <property name="verticalScrollMode">
       <property name="verticalScrollMode">
        <enum>QAbstractItemView::ScrollPerPixel</enum>
        <enum>QAbstractItemView::ScrollPerPixel</enum>
       </property>
       </property>
+      <property name="spacing">
+       <number>5</number>
+      </property>
+      <property name="uniformItemSizes">
+       <bool>true</bool>
+      </property>
      </widget>
      </widget>
     </item>
     </item>
     <item>
     <item>
@@ -70,12 +78,9 @@
         <verstretch>0</verstretch>
         <verstretch>0</verstretch>
        </sizepolicy>
        </sizepolicy>
       </property>
       </property>
-      <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0">
+      <layout class="QHBoxLayout" name="horizontalLayout">
        <property name="spacing">
        <property name="spacing">
-        <number>6</number>
-       </property>
-       <property name="sizeConstraint">
-        <enum>QLayout::SetDefaultConstraint</enum>
+        <number>5</number>
        </property>
        </property>
        <property name="leftMargin">
        <property name="leftMargin">
         <number>0</number>
         <number>0</number>
@@ -90,7 +95,7 @@
         <number>0</number>
         <number>0</number>
        </property>
        </property>
        <item>
        <item>
-        <widget class="QToolButton" name="statusAndAddressButton">
+        <widget class="QPushButton" name="statusAndAddressButton">
          <property name="sizePolicy">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
           <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
            <horstretch>0</horstretch>
            <horstretch>0</horstretch>
@@ -104,16 +109,28 @@
           </font>
           </font>
          </property>
          </property>
          <property name="toolTip">
          <property name="toolTip">
-          <string>Click to Copy Address to Clipboard</string>
+          <string>Click to copy your address to clipboard.</string>
          </property>
          </property>
          <property name="styleSheet">
          <property name="styleSheet">
-          <string notr="true">border: 0;</string>
+          <string notr="true">QPushButton {
+	border: 0;
+	background-color: transparent;
+}
+
+QPushButton:focus {
+	background-color: rgba(0,0,0,25);
+}
+
+QPushButton:hover {
+	background-color: rgba(0,0,0,25);
+}
+</string>
          </property>
          </property>
          <property name="text">
          <property name="text">
           <string>0000000000    (OFFLINE, v0.0.0, 0 peers)     </string>
           <string>0000000000    (OFFLINE, v0.0.0, 0 peers)     </string>
          </property>
          </property>
-         <property name="toolButtonStyle">
-          <enum>Qt::ToolButtonTextOnly</enum>
+         <property name="flat">
+          <bool>true</bool>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
@@ -137,40 +154,19 @@
          <property name="maxLength">
          <property name="maxLength">
           <number>16</number>
           <number>16</number>
          </property>
          </property>
-         <property name="frame">
-          <bool>false</bool>
-         </property>
          <property name="placeholderText">
          <property name="placeholderText">
           <string>(Numeric ID of Network to Join)</string>
           <string>(Numeric ID of Network to Join)</string>
          </property>
          </property>
         </widget>
         </widget>
        </item>
        </item>
        <item>
        <item>
-        <widget class="QToolButton" name="joinNetworkButton">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="font">
-          <font>
-           <family>Courier</family>
-           <pointsize>12</pointsize>
-           <weight>50</weight>
-           <bold>false</bold>
-           <underline>false</underline>
-          </font>
-         </property>
+        <widget class="QPushButton" name="joinNetworkButton">
          <property name="toolTip">
          <property name="toolTip">
           <string>Join Network</string>
           <string>Join Network</string>
          </property>
          </property>
          <property name="text">
          <property name="text">
           <string>Join</string>
           <string>Join</string>
          </property>
          </property>
-         <property name="toolButtonStyle">
-          <enum>Qt::ToolButtonTextOnly</enum>
-         </property>
         </widget>
         </widget>
        </item>
        </item>
       </layout>
       </layout>

+ 3 - 4
ZeroTierUI/networkwidget.cpp

@@ -105,9 +105,8 @@ void NetworkWidget::on_networkIdPushButton_clicked()
 	QApplication::clipboard()->setText(ui->networkIdPushButton->text());
 	QApplication::clipboard()->setText(ui->networkIdPushButton->text());
 }
 }
 
 
-void NetworkWidget::on_ipListWidget_doubleClicked(const QModelIndex &index)
+void NetworkWidget::on_ipListWidget_itemActivated(QListWidgetItem *item)
 {
 {
-	QListWidgetItem *ci = ui->ipListWidget->currentItem();
-	if (ci)
-		QApplication::clipboard()->setText(ci->text());
+		if (item)
+			QApplication::clipboard()->setText(item->text());
 }
 }

+ 2 - 2
ZeroTierUI/networkwidget.h

@@ -4,6 +4,7 @@
 #include <string>
 #include <string>
 
 
 #include <QWidget>
 #include <QWidget>
+#include <QListWidgetItem>
 
 
 namespace Ui {
 namespace Ui {
 class NetworkWidget;
 class NetworkWidget;
@@ -28,8 +29,7 @@ public:
 private slots:
 private slots:
 	void on_leaveNetworkButton_clicked();
 	void on_leaveNetworkButton_clicked();
 	void on_networkIdPushButton_clicked();
 	void on_networkIdPushButton_clicked();
-
-	void on_ipListWidget_doubleClicked(const QModelIndex &index);
+	void on_ipListWidget_itemActivated(QListWidgetItem *item);
 
 
 private:
 private:
 	Ui::NetworkWidget *ui;
 	Ui::NetworkWidget *ui;

+ 51 - 17
ZeroTierUI/networkwidget.ui

@@ -19,6 +19,9 @@
   <property name="windowTitle">
   <property name="windowTitle">
    <string>Network</string>
    <string>Network</string>
   </property>
   </property>
+  <property name="class" stdset="0">
+   <string>NetworkWidget</string>
+  </property>
   <layout class="QHBoxLayout" name="horizontalLayout">
   <layout class="QHBoxLayout" name="horizontalLayout">
    <property name="spacing">
    <property name="spacing">
     <number>6</number>
     <number>6</number>
@@ -83,12 +86,6 @@
       </item>
       </item>
       <item row="2" column="1">
       <item row="2" column="1">
        <widget class="QPushButton" name="networkIdPushButton">
        <widget class="QPushButton" name="networkIdPushButton">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
         <property name="font">
         <property name="font">
          <font>
          <font>
           <weight>75</weight>
           <weight>75</weight>
@@ -96,10 +93,25 @@
          </font>
          </font>
         </property>
         </property>
         <property name="toolTip">
         <property name="toolTip">
-         <string>Click to Copy Network ID to Clipboard</string>
+         <string>Click to copy network ID to clipboard.</string>
         </property>
         </property>
         <property name="styleSheet">
         <property name="styleSheet">
-         <string notr="true">border: 0; padding: 0; margin: 0; text-align: left;</string>
+         <string notr="true">QPushButton {
+	border: 0;
+	padding: 0;
+	margin: 0;
+	text-align: left;
+	background-color: transparent;
+}
+
+QPushButton:focus {
+	background-color: rgba(0,0,0,25);
+}
+
+QPushButton:hover {
+	background-color: rgba(0,0,0,25);
+}
+</string>
         </property>
         </property>
         <property name="text">
         <property name="text">
          <string>0000000000000000</string>
          <string>0000000000000000</string>
@@ -253,7 +265,7 @@
            </property>
            </property>
            <property name="font">
            <property name="font">
             <font>
             <font>
-             <pointsize>10</pointsize>
+             <pointsize>8</pointsize>
             </font>
             </font>
            </property>
            </property>
            <property name="text">
            <property name="text">
@@ -264,6 +276,19 @@
            </property>
            </property>
           </widget>
           </widget>
          </item>
          </item>
+         <item>
+          <spacer name="horizontalSpacer_2">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>1</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
         </layout>
         </layout>
        </widget>
        </widget>
       </item>
       </item>
@@ -332,11 +357,18 @@
           <pointsize>12</pointsize>
           <pointsize>12</pointsize>
          </font>
          </font>
         </property>
         </property>
-        <property name="focusPolicy">
-         <enum>Qt::NoFocus</enum>
-        </property>
         <property name="toolTip">
         <property name="toolTip">
-         <string>Double-click to Copy IP Address to Clipboard.</string>
+         <string>Double-click IP to copy to clipboard.</string>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">QListWidget {
+	background-color: rgba(0,0,0,10);
+}
+
+QListWidget:hover {
+	background-color: rgba(0,0,0,25);
+}
+</string>
         </property>
         </property>
         <property name="frameShape">
         <property name="frameShape">
          <enum>QFrame::NoFrame</enum>
          <enum>QFrame::NoFrame</enum>
@@ -402,16 +434,13 @@
           </spacer>
           </spacer>
          </item>
          </item>
          <item>
          <item>
-          <widget class="QToolButton" name="leaveNetworkButton">
+          <widget class="QPushButton" name="leaveNetworkButton">
            <property name="font">
            <property name="font">
             <font>
             <font>
              <pointsize>10</pointsize>
              <pointsize>10</pointsize>
              <underline>false</underline>
              <underline>false</underline>
             </font>
             </font>
            </property>
            </property>
-           <property name="styleSheet">
-            <string notr="true">padding: 0.1em; margin:0;</string>
-           </property>
            <property name="text">
            <property name="text">
             <string>Leave Network</string>
             <string>Leave Network</string>
            </property>
            </property>
@@ -425,6 +454,11 @@
    </item>
    </item>
   </layout>
   </layout>
  </widget>
  </widget>
+ <tabstops>
+  <tabstop>networkIdPushButton</tabstop>
+  <tabstop>ipListWidget</tabstop>
+  <tabstop>leaveNetworkButton</tabstop>
+ </tabstops>
  <resources/>
  <resources/>
  <connections/>
  <connections/>
 </ui>
 </ui>