Some minor UI improvements

* buttons right aligned
* min-height in qss
* removed "public slots" where not needed
* QMessageBox when changing widget style (because it is so slow)
This commit is contained in:
Klaus Basan
2018-01-18 03:06:42 +01:00
parent 8273a9881f
commit b574ede2e2
8 changed files with 187 additions and 115 deletions

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>712</width>
<height>273</height>
<width>644</width>
<height>253</height>
</rect>
</property>
<property name="windowTitle">

View File

@@ -466,20 +466,20 @@
<number>1</number>
</property>
<property name="bottomMargin">
<number>1</number>
<number>15</number>
</property>
<item>
<widget class="QScrollArea" name="sa_DataLoad">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="wi_DataLoadOverview">
<widget class="QWidget" name="wi_DataLoadScrollable">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>228</width>
<height>306</height>
<height>295</height>
</rect>
</property>
<layout class="QVBoxLayout" name="vl_DataLoadOverview">
@@ -498,8 +498,15 @@
<property name="bottomMargin">
<number>1</number>
</property>
<item>
<widget class="BlackGui::Components::CDbLoadOverviewComponent" name="comp_DataLoadOverview"/>
<item alignment="Qt::AlignTop">
<widget class="BlackGui::Components::CDbLoadOverviewComponent" name="comp_DataLoadOverview">
<property name="minimumSize">
<size>
<width>0</width>
<height>250</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>326</width>
<height>84</height>
<width>280</width>
<height>80</height>
</rect>
</property>
<property name="windowTitle">
@@ -128,44 +128,6 @@
</property>
</widget>
</item>
<item row="2" column="1" colspan="5">
<widget class="QWidget" name="wi_Buttons" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<layout class="QHBoxLayout" name="vl_Buttons">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="pb_Ok">
<property name="text">
<string>ok</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pb_CancelOrReset">
<property name="text">
<string>cancel</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="2">
<widget class="QComboBox" name="cb_SettingsGuiFontStyle">
<property name="maximumSize">
@@ -196,6 +158,57 @@
</item>
</widget>
</item>
<item row="2" column="0" colspan="6">
<widget class="QWidget" name="wi_Buttons" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<layout class="QHBoxLayout" name="vl_Buttons">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<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="QPushButton" name="pb_Ok">
<property name="text">
<string>ok</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pb_CancelOrReset">
<property name="text">
<string>cancel</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>

View File

@@ -16,6 +16,7 @@
#include <QFont>
#include <QFontComboBox>
#include <QStyleFactory>
#include <QMessageBox>
using namespace BlackMisc;
using namespace BlackGui::Settings;
@@ -98,6 +99,17 @@ namespace BlackGui
{
const CGeneralGuiSettings settings = m_guiSettings.getThreadLocal();
if (!settings.isDifferentValidWidgetStyle(widgetStyle)) { return; }
const int ret = QMessageBox::information(this,
tr("Change style?"),
tr("Changing style is slow.\nThe GUI will hang for some seconds.\nDo you want to save your changes?"),
QMessageBox::Ok | QMessageBox::Cancel);
if (ret != QMessageBox::Ok)
{
ui->cb_SettingsGuiWidgetStyle->setCurrentText(settings.getWidgetStyle());
return;
}
if (sGui->getIContextNetwork() && sGui->getIContextNetwork()->isConnected())
{
// Style changes freeze the GUI, must not be done in flight mode

View File

@@ -41,7 +41,6 @@ namespace BlackGui
//! Hide opacity elements
void hideOpacity(bool hide);
public slots:
//! GUI Opacity 0-100%
void setGuiOpacity(double value);

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>250</width>
<height>235</height>
<width>220</width>
<height>225</height>
</rect>
</property>
<property name="windowTitle">
@@ -93,7 +93,7 @@
<string>0-100%</string>
</property>
<property name="text">
<string>Opacity</string>
<string>Opacity:</string>
</property>
</widget>
</item>
@@ -125,7 +125,7 @@
<item row="2" column="0">
<widget class="QLabel" name="lbl_SettingsGuiWidgetStyle">
<property name="text">
<string>Widget style</string>
<string>Widget style:</string>
</property>
</widget>
</item>
@@ -135,7 +135,7 @@
<item row="3" column="0">
<widget class="QLabel" name="lbl_PreferredMultiSelect">
<property name="text">
<string>Selection</string>
<string>Selection:</string>
</property>
</widget>
</item>

View File

@@ -6,66 +6,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>262</width>
<height>242</height>
<width>228</width>
<height>212</height>
</rect>
</property>
<property name="windowTitle">
<string>Frame</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0" colspan="2">
<widget class="QGroupBox" name="gb_TechnicalMessages">
<property name="title">
<string>Technical messages</string>
</property>
<layout class="QGridLayout" name="gl_TechnicalMessages">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item row="0" column="1">
<widget class="QRadioButton" name="rb_ErrorsOnly">
<property name="text">
<string>errors</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QRadioButton" name="rb_NoTechnicalMessages">
<property name="text">
<string>none</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QRadioButton" name="rb_ErrorWarningsInfo">
<property name="text">
<string>all</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="rb_ErrorsAndWarnings">
<property name="text">
<string>warnings</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lbl_Messages">
<property name="text">
@@ -141,18 +89,107 @@
</layout>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="pb_Cancel">
<property name="text">
<string>cancel</string>
<item row="1" column="0" colspan="2">
<widget class="QGroupBox" name="gb_TechnicalMessages">
<property name="title">
<string>Technical messages</string>
</property>
<layout class="QGridLayout" name="gl_TechnicalMessages">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item row="0" column="1">
<widget class="QRadioButton" name="rb_ErrorsOnly">
<property name="text">
<string>errors</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QRadioButton" name="rb_NoTechnicalMessages">
<property name="text">
<string>none</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QRadioButton" name="rb_ErrorWarningsInfo">
<property name="text">
<string>all</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="rb_ErrorsAndWarnings">
<property name="text">
<string>warnings</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="pb_Save">
<property name="text">
<string>save</string>
<item row="3" column="0" colspan="2">
<widget class="QFrame" name="fr_Buttons">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="hl_Buttons">
<property name="leftMargin">
<number>1</number>
</property>
<property name="topMargin">
<number>1</number>
</property>
<property name="rightMargin">
<number>1</number>
</property>
<property name="bottomMargin">
<number>1</number>
</property>
<item>
<spacer name="hs_Buttons">
<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="QPushButton" name="pb_Cancel">
<property name="text">
<string>cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pb_Save">
<property name="text">
<string>save</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>

View File

@@ -607,6 +607,10 @@ QTreeView::branch:closed:has-children {
image: url(:/diagona/icons/diagona/icons/toggle-expand.png);
}
QSlider {
min-height: 2em;
}
QSlider::groove:horizontal {
border: 1px solid gray;
height: 4px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */