diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-06-27 14:37:43 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-06-27 14:37:43 -0700 |
commit | 1f0c9eec9640450f20449140244966e2b3a2ea13 (patch) | |
tree | f4e9edabf5204edf9926d01dc5d8789104afaab9 | |
parent | 485df96cf66132ae7f7d386331945fa2f5883120 (diff) | |
download | subsurface-1f0c9eec9640450f20449140244966e2b3a2ea13.tar.gz |
Preferences dialog: yet another attempt to make it fit
Designer is such an utter piece of crap I am at a lack for words.
After a few hours with a real UI tool (i.e., vim) I have the preferences
dialog reasonably close to where I want it. It's still not perfect, but at
least it no longer contains tons of unused space, it fits fine on a
1024x768 screen and it is visually consistent across the different pages.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/preferences.cpp | 4 | ||||
-rw-r--r-- | qt-ui/preferences.ui | 417 | ||||
-rw-r--r-- | qt-ui/socialnetworks.cpp | 5 |
3 files changed, 266 insertions, 160 deletions
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp index d9622d2a8..c93460f9a 100644 --- a/qt-ui/preferences.cpp +++ b/qt-ui/preferences.cpp @@ -82,7 +82,7 @@ void PreferencesDialog::facebookLoggedIn() #ifndef Q_OS_ANDROID // remove the login view and add the disconnect button ui.fbLayout->removeItem(ui.fbLayout->itemAt(1)); - ui.fbLayout->addWidget(ui.fbConnected); + ui.fbLayout->insertWidget(1, ui.fbConnected, 0); ui.fbConnected->show(); ui.FBLabel->setText(tr("To disconnect Subsurface from your Facebook account, use the button below")); if (facebookWebView) @@ -96,7 +96,7 @@ void PreferencesDialog::facebookDisconnect() // remove the connect/disconnect button // and instead add the login view ui.fbLayout->removeItem(ui.fbLayout->itemAt(1)); - ui.fbLayout->addWidget(facebookWebView); + ui.fbLayout->insertWidget(1, facebookWebView, 1); ui.fbConnected->hide(); ui.FBLabel->setText(tr("To connect to Facebook, please log in. This enables Subsurface to publish dives to your timeline")); if (facebookWebView) { diff --git a/qt-ui/preferences.ui b/qt-ui/preferences.ui index 980da4abd..1b59e77a5 100644 --- a/qt-ui/preferences.ui +++ b/qt-ui/preferences.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>868</width> - <height>853</height> + <width>711</width> + <height>662</height> </rect> </property> <property name="windowTitle"> @@ -32,7 +32,7 @@ <number>5</number> </property> <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> + <layout class="QHBoxLayout" name="mainHorizontalLayout"> <item> <widget class="QListWidget" name="listWidget"> <property name="sizePolicy"> @@ -168,9 +168,15 @@ </sizepolicy> </property> <property name="currentIndex"> - <number>6</number> + <number>0</number> </property> <widget class="QWidget" name="defaults_page"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <layout class="QVBoxLayout" name="verticalLayout_3"> <property name="spacing"> <number>5</number> @@ -192,13 +198,7 @@ <property name="title"> <string>Lists and tables</string> </property> - <layout class="QFormLayout" name="formLayout_2"> - <property name="horizontalSpacing"> - <number>5</number> - </property> - <property name="verticalSpacing"> - <number>5</number> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_11"> <property name="leftMargin"> <number>5</number> </property> @@ -211,24 +211,24 @@ <property name="bottomMargin"> <number>5</number> </property> - <item row="0" column="0"> + <item> <widget class="QLabel" name="label_7"> <property name="text"> <string>Font</string> </property> </widget> </item> - <item row="0" column="1"> + <item> <widget class="QFontComboBox" name="font"/> </item> - <item row="1" column="0"> + <item> <widget class="QLabel" name="label_8"> <property name="text"> <string>Font size</string> </property> </widget> </item> - <item row="1" column="1"> + <item> <widget class="QDoubleSpinBox" name="fontsize"/> </item> </layout> @@ -290,7 +290,7 @@ <item> <widget class="QRadioButton" name="cloudDefaultFile"> <property name="text"> - <string>Cloud storage default file</string> + <string>Clo&ud storage default file</string> </property> <attribute name="buttonGroup"> <string notr="true">defaultFileGroup</string> @@ -434,47 +434,6 @@ </widget> </item> <item> - <widget class="QGroupBox" name="groupBox_8"> - <property name="title"> - <string>Subsurface web service</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_7"> - <property name="spacing"> - <number>5</number> - </property> - <property name="leftMargin"> - <number>5</number> - </property> - <property name="topMargin"> - <number>5</number> - </property> - <property name="rightMargin"> - <number>5</number> - </property> - <property name="bottomMargin"> - <number>5</number> - </property> - <item> - <widget class="QLabel" name="label_16"> - <property name="text"> - <string>Default user ID</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="default_uid"/> - </item> - <item> - <widget class="QCheckBox" name="save_uid_local"> - <property name="text"> - <string>Save user ID locally?</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> <widget class="QGroupBox" name="groupBox_9"> <property name="title"> <string>Clear all settings</string> @@ -521,6 +480,12 @@ </layout> </widget> <widget class="QWidget" name="units_page"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <layout class="QVBoxLayout" name="verticalLayout"> <property name="spacing"> <number>5</number> @@ -538,50 +503,55 @@ <number>5</number> </property> <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QLabel" name="label_6"> - <property name="text"> - <string>System</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="metric"> - <property name="text"> - <string>&Metric</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup_6</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="imperial"> - <property name="text"> - <string>Imperial</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup_6</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="personalize"> - <property name="text"> - <string>Personali&ze</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup_6</string> - </attribute> - </widget> - </item> - </layout> + <widget class="QGroupBox" name="groupBox_units"> + <property name="title"> + <string>Unit system</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="label_6"> + <property name="text"> + <string>System</string> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="metric"> + <property name="text"> + <string>&Metric</string> + </property> + <attribute name="buttonGroup"> + <string notr="true">buttonGroup_6</string> + </attribute> + </widget> + </item> + <item> + <widget class="QRadioButton" name="imperial"> + <property name="text"> + <string>Imperial</string> + </property> + <attribute name="buttonGroup"> + <string notr="true">buttonGroup_6</string> + </attribute> + </widget> + </item> + <item> + <widget class="QRadioButton" name="personalize"> + <property name="text"> + <string>Personali&ze</string> + </property> + <attribute name="buttonGroup"> + <string notr="true">buttonGroup_6</string> + </attribute> + </widget> + </item> + </layout> + </widget> </item> <item> <widget class="QGroupBox" name="units_group"> <property name="title"> - <string/> + <string>Individual settings</string> </property> <property name="checkable"> <bool>false</bool> @@ -820,6 +790,12 @@ </layout> </widget> <widget class="QWidget" name="graph_page"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <layout class="QVBoxLayout" name="verticalLayout_5"> <property name="spacing"> <number>5</number> @@ -1114,10 +1090,19 @@ </layout> </widget> <widget class="QWidget" name="language_page"> - <layout class="QVBoxLayout" name="verticalLayout_6"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QVBoxLayout" name="verticalLayout_6" stretch="0,1,0"> <property name="spacing"> <number>5</number> </property> + <property name="sizeConstraint"> + <enum>QLayout::SetNoConstraint</enum> + </property> <property name="leftMargin"> <number>5</number> </property> @@ -1131,45 +1116,82 @@ <number>5</number> </property> <item> - <layout class="QHBoxLayout" name="horizontalLayout_6"> - <item> - <widget class="QCheckBox" name="languageSystemDefault"> - <property name="text"> - <string>System default</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="label_14"> - <property name="text"> - <string>Filter</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="languageFilter"/> - </item> - </layout> + <widget class="QGroupBox" name="language_group"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>UI language</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <item> + <widget class="QCheckBox" name="languageSystemDefault"> + <property name="text"> + <string>System default</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="label_14"> + <property name="text"> + <string>Filter</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="languageFilter"/> + </item> + </layout> + </widget> </item> <item> - <widget class="QListView" name="languageView"/> + <widget class="QListView" name="languageView"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_7"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>0</height> + </size> + </property> + </spacer> </item> </layout> </widget> <widget class="QWidget" name="network_page"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <layout class="QVBoxLayout" name="verticalLayout_15"> <property name="spacing"> <number>5</number> @@ -1387,6 +1409,47 @@ </widget> </item> <item> + <widget class="QGroupBox" name="groupBox_8"> + <property name="title"> + <string>Subsurface web service</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_7"> + <property name="spacing"> + <number>5</number> + </property> + <property name="leftMargin"> + <number>5</number> + </property> + <property name="topMargin"> + <number>5</number> + </property> + <property name="rightMargin"> + <number>5</number> + </property> + <property name="bottomMargin"> + <number>5</number> + </property> + <item> + <widget class="QLabel" name="label_16"> + <property name="text"> + <string>Default user ID</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="default_uid"/> + </item> + <item> + <widget class="QCheckBox" name="save_uid_local"> + <property name="text"> + <string>Save user ID locally?</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <spacer name="verticalSpacer_3"> <property name="orientation"> <enum>Qt::Vertical</enum> @@ -1402,7 +1465,13 @@ </layout> </widget> <widget class="QWidget" name="facebook_page"> - <layout class="QVBoxLayout" name="fbLayout"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QVBoxLayout" name="fbLayout" stretch="0,1,1"> <property name="spacing"> <number>5</number> </property> @@ -1420,6 +1489,12 @@ </property> <item> <widget class="QLabel" name="FBLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="wordWrap"> <bool>true</bool> </property> @@ -1457,27 +1532,57 @@ </item> </layout> </widget> - <widget class="QWidget" name="page"> - <layout class="QVBoxLayout" name="verticalLayout_8"> - <item> - <widget class="QCheckBox" name="enable_geocoding"> - <property name="text"> - <string>Enable geocoding for dive site management</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="parse_without_gps"> - <property name="text"> - <string>Parse site without GPS data</string> - </property> - </widget> - </item> + <widget class="QWidget" name="geolookup_page"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QVBoxLayout" name="verticalLayout_155"> + <property name="spacing"> + <number>5</number> + </property> + <property name="leftMargin"> + <number>5</number> + </property> + <property name="topMargin"> + <number>5</number> + </property> + <property name="rightMargin"> + <number>5</number> + </property> + <property name="bottomMargin"> + <number>5</number> + </property> <item> - <widget class="QCheckBox" name="tag_existing_dives"> - <property name="text"> - <string>Same format for existing dives</string> + <widget class="QGroupBox" name="groupBox_Geocoding"> + <property name="title"> + <string>Dive site geo lookup</string> </property> + <layout class="QVBoxLayout" name="verticalLayout_8"> + <item> + <widget class="QCheckBox" name="enable_geocoding"> + <property name="text"> + <string>Enable geocoding for dive site management</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="parse_without_gps"> + <property name="text"> + <string>Parse site without GPS data</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="tag_existing_dives"> + <property name="text"> + <string>Same format for existing dives</string> + </property> + </widget> + </item> + </layout> </widget> </item> <item> @@ -1547,7 +1652,7 @@ <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>495</height> + <height>0</height> </size> </property> </spacer> @@ -1911,13 +2016,13 @@ </connections> <buttongroups> <buttongroup name="buttonGroup_6"/> - <buttongroup name="defaultFileGroup"/> + <buttongroup name="buttonGroup_2"/> <buttongroup name="buttonGroup"/> - <buttongroup name="buttonGroup_3"/> + <buttongroup name="verticalSpeed"/> <buttongroup name="buttonGroup_7"/> + <buttongroup name="defaultFileGroup"/> <buttongroup name="buttonGroup_5"/> - <buttongroup name="buttonGroup_2"/> - <buttongroup name="verticalSpeed"/> + <buttongroup name="buttonGroup_3"/> <buttongroup name="buttonGroup_4"/> </buttongroups> </ui> diff --git a/qt-ui/socialnetworks.cpp b/qt-ui/socialnetworks.cpp index 6a81d5db7..c165043b6 100644 --- a/qt-ui/socialnetworks.cpp +++ b/qt-ui/socialnetworks.cpp @@ -269,8 +269,9 @@ void FacebookManager::sendDive() } } -SocialNetworkDialog::SocialNetworkDialog(QWidget *parent) : QDialog(parent) - , ui( new Ui::SocialnetworksDialog()) +SocialNetworkDialog::SocialNetworkDialog(QWidget *parent) : + QDialog(parent), + ui( new Ui::SocialnetworksDialog()) { ui->setupUi(this); ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); |