Misc. smaller UI adjustments/style

This commit is contained in:
Klaus Basan
2019-01-02 06:43:26 +01:00
committed by Mat Sutcliffe
parent e85680f1b0
commit cd095dbb3f
11 changed files with 130 additions and 138 deletions

View File

@@ -2,14 +2,6 @@
<ui version="4.0"> <ui version="4.0">
<class>CColorSelector</class> <class>CColorSelector</class>
<widget class="QFrame" name="CColorSelector"> <widget class="QFrame" name="CColorSelector">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>136</width>
<height>24</height>
</rect>
</property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>140</width> <width>140</width>
@@ -22,12 +14,6 @@
<property name="whatsThis"> <property name="whatsThis">
<string>select a color</string> <string>select a color</string>
</property> </property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="hl_ColorSelector"> <layout class="QHBoxLayout" name="hl_ColorSelector">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
@@ -77,19 +63,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="hs_ColorSelector">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>

View File

@@ -2,14 +2,6 @@
<ui version="4.0"> <ui version="4.0">
<class>CDbAircraftIcaoComponent</class> <class>CDbAircraftIcaoComponent</class>
<widget class="QFrame" name="CDbAircraftIcaoComponent"> <widget class="QFrame" name="CDbAircraftIcaoComponent">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Search and find aircraft ICAO codes</string> <string>Search and find aircraft ICAO codes</string>
</property> </property>
@@ -46,11 +38,8 @@
<height>100</height> <height>100</height>
</size> </size>
</property> </property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Plain</enum>
</property> </property>
</widget> </widget>
</item> </item>

View File

@@ -20,6 +20,7 @@
using namespace BlackCore; using namespace BlackCore;
using namespace BlackGui::Views; using namespace BlackGui::Views;
using namespace BlackMisc::Aviation;
using namespace BlackMisc::Network; using namespace BlackMisc::Network;
namespace BlackGui namespace BlackGui
@@ -57,7 +58,7 @@ namespace BlackGui
ui->filter_Livery->filter(livery); ui->filter_Livery->filter(livery);
} }
void CDbLiveryComponent::filterByAirline(const BlackMisc::Aviation::CAirlineIcaoCode &icao) void CDbLiveryComponent::filterByAirline(const CAirlineIcaoCode &icao)
{ {
ui->filter_Livery->filter(icao); ui->filter_Livery->filter(icao);
} }

View File

@@ -41,8 +41,14 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item> <item alignment="Qt::AlignLeft">
<widget class="BlackGui::Filters::CLiveryFilterBar" name="filter_Livery"> <widget class="BlackGui::Filters::CLiveryFilterBar" name="filter_Livery">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::StyledPanel</enum> <enum>QFrame::StyledPanel</enum>
</property> </property>

View File

@@ -16,6 +16,7 @@
#include "blackgui/views/distributorview.h" #include "blackgui/views/distributorview.h"
#include "blackgui/uppercasevalidator.h" #include "blackgui/uppercasevalidator.h"
#include "blackgui/guiapplication.h" #include "blackgui/guiapplication.h"
#include "blackgui/guiutility.h"
#include "blackcore/webdataservices.h" #include "blackcore/webdataservices.h"
#include "blackcore/db/databasewriter.h" #include "blackcore/db/databasewriter.h"
@@ -44,6 +45,8 @@ namespace BlackGui
ui->selector_AirlineIcaoCode->displayWithIcaoDescription(false); ui->selector_AirlineIcaoCode->displayWithIcaoDescription(false);
ui->editor_AircraftModel->allowDrop(false); ui->editor_AircraftModel->allowDrop(false);
ui->editor_AircraftModel->setReadOnly(true); ui->editor_AircraftModel->setReadOnly(true);
CGuiUtility::checkBoxReadOnly(ui->cb_Military, true);
CGuiUtility::checkBoxReadOnly(ui->cb_VirtualAirline, true);
connect(sGui->getWebDataServices(), &CWebDataServices::swiftDbAllDataRead, this, &CDbQuickMappingWizard::onWebDataRead, Qt::QueuedConnection); connect(sGui->getWebDataServices(), &CWebDataServices::swiftDbAllDataRead, this, &CDbQuickMappingWizard::onWebDataRead, Qt::QueuedConnection);
connect(sGui->getWebDataServices()->getDatabaseWriter(), &CDatabaseWriter::publishedModels, this, &CDbQuickMappingWizard::onPublishedModels, Qt::QueuedConnection); connect(sGui->getWebDataServices()->getDatabaseWriter(), &CDatabaseWriter::publishedModels, this, &CDbQuickMappingWizard::onPublishedModels, Qt::QueuedConnection);
@@ -118,12 +121,12 @@ namespace BlackGui
ui->rb_ColorLivery->setChecked(true); ui->rb_ColorLivery->setChecked(true);
} }
this->m_model = model; m_model = model;
} }
void CDbQuickMappingWizard::clear() void CDbQuickMappingWizard::clear()
{ {
this->m_lastId = 0; m_lastId = 0;
ui->editor_AircraftModel->clear(); ui->editor_AircraftModel->clear();
ui->comp_Log->clear(); ui->comp_Log->clear();
this->restart(); this->restart();
@@ -201,9 +204,9 @@ namespace BlackGui
void CDbQuickMappingWizard::currentWizardPageChanged(int id) void CDbQuickMappingWizard::currentWizardPageChanged(int id)
{ {
const bool forward = id > this->m_lastId; const bool forward = id > m_lastId;
const bool colorMode = ui->rb_ColorLivery->isChecked(); const bool colorMode = ui->rb_ColorLivery->isChecked();
this->m_lastId = id; m_lastId = id;
const Pages page = static_cast<Pages>(id); const Pages page = static_cast<Pages>(id);
switch (page) switch (page)
@@ -251,9 +254,15 @@ namespace BlackGui
ui->comp_Log->clear(); ui->comp_Log->clear();
} }
break; break;
case PageLastConfirmation:
{
// void
}
break;
case PageSendStatus: case PageSendStatus:
{ {
this->writeModelToDb(); this->writeModelToDb();
this->button(BackButton)->hide();
} }
break; break;
default: default:
@@ -301,17 +310,17 @@ namespace BlackGui
void CDbQuickMappingWizard::consolidateModel() void CDbQuickMappingWizard::consolidateModel()
{ {
CAircraftModel model = this->m_model; CAircraftModel model = m_model;
model.setAircraftIcaoCode(ui->editor_AircraftModel->getAircraftIcao()); model.setAircraftIcaoCode(ui->editor_AircraftModel->getAircraftIcao());
model.setDistributor(ui->editor_AircraftModel->getDistributor()); model.setDistributor(ui->editor_AircraftModel->getDistributor());
model.setLivery(ui->editor_AircraftModel->getLivery()); model.setLivery(ui->editor_AircraftModel->getLivery());
this->m_model = model; m_model = model;
} }
void CDbQuickMappingWizard::writeModelToDb() void CDbQuickMappingWizard::writeModelToDb()
{ {
this->consolidateModel(); this->consolidateModel();
const CStatusMessageList msgs = sGui->getWebDataServices()->getDatabaseWriter()->asyncPublishModel(this->m_model); const CStatusMessageList msgs = sGui->getWebDataServices()->getDatabaseWriter()->asyncPublishModel(m_model);
ui->comp_Log->appendStatusMessagesToList(msgs); ui->comp_Log->appendStatusMessagesToList(msgs);
} }

View File

@@ -38,8 +38,9 @@ namespace BlackGui
PageColor, PageColor,
PageLiverySelect, PageLiverySelect,
PageDistributorSelect, PageDistributorSelect,
PageConfirmation, PageConfirmation, //!< model from and validation
PageCredentials, PageCredentials,
PageLastConfirmation, //!< just info to say data will be send
PageSendStatus PageSendStatus
}; };
@@ -102,9 +103,9 @@ namespace BlackGui
//! Models published //! Models published
void onPublishedModels(const BlackMisc::Simulation::CAircraftModelList &modelsPublished, void onPublishedModels(const BlackMisc::Simulation::CAircraftModelList &modelsPublished,
const BlackMisc::Simulation::CAircraftModelList &modelsSkipped, const BlackMisc::Simulation::CAircraftModelList &modelsSkipped,
const BlackMisc::CStatusMessageList &messages, const BlackMisc::CStatusMessageList &messages,
bool requestSuccessful, bool directWrite); bool requestSuccessful, bool directWrite);
//! Web data have been read //! Web data have been read
void onWebDataRead(); void onWebDataRead();

View File

@@ -188,6 +188,47 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<widget class="QWidget" name="wi_HintAirlineIcao" native="true">
<layout class="QHBoxLayout" name="hl_HintAirlineIcao">
<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="QLabel" name="lbl_HintIconAirlineIcao">
<property name="maximumSize">
<size>
<width>20</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../blackmisc/blackmisc.qrc">:/pastel/icons/pastel/16/infomation.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lbl_HintAirlineIcao">
<property name="text">
<string>Hint: Start virtual airlines with &quot;V&quot;, e.g. &quot;VLHA&quot;</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item> <item>
<widget class="QFrame" name="fr_IntroAirlineSelection"> <widget class="QFrame" name="fr_IntroAirlineSelection">
<layout class="QFormLayout" name="fl_AircraftIcaoIntro"> <layout class="QFormLayout" name="fl_AircraftIcaoIntro">
@@ -242,7 +283,14 @@
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="4" column="1">
<widget class="QCheckBox" name="cb_VirtualAirline"/> <widget class="QCheckBox" name="cb_VirtualAirline">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
</widget>
</item> </item>
<item row="5" column="0"> <item row="5" column="0">
<widget class="QLabel" name="lbl_Military"> <widget class="QLabel" name="lbl_Military">
@@ -252,47 +300,13 @@
</widget> </widget>
</item> </item>
<item row="5" column="1"> <item row="5" column="1">
<widget class="QCheckBox" name="cb_Military"/> <widget class="QCheckBox" name="cb_Military">
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="wi_HintAirlineIcao" native="true">
<layout class="QHBoxLayout" name="hl_HintAirlineIcao">
<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="QLabel" name="lbl_HintIconAirlineIcao">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>20</width> <width>50</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../blackmisc/blackmisc.qrc">:/pastel/icons/pastel/16/infomation.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lbl_HintAirlineIcao">
<property name="text">
<string>Hint: Start virtual airlines with &quot;V&quot;, e.g. &quot;VLHA&quot;</string>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
@@ -356,25 +370,34 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="BlackGui::Components::CDbLiveryColorSearch" name="comp_ColorSearch"> <widget class="QGroupBox" name="gb_ColorSearch">
<property name="minimumSize"> <property name="title">
<size> <string>Select color</string>
<width>0</width>
<height>60</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>16777215</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property> </property>
<layout class="QVBoxLayout" name="vl_ColorSearch">
<item>
<widget class="BlackGui::Components::CDbLiveryColorSearch" name="comp_ColorSearch">
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>16777215</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
</layout>
</widget> </widget>
</item> </item>
</layout> </layout>
@@ -408,7 +431,14 @@
</property> </property>
<layout class="QVBoxLayout" name="vl_DistributorPage"> <layout class="QVBoxLayout" name="vl_DistributorPage">
<item> <item>
<widget class="BlackGui::Components::CDbDistributorComponent" name="comp_Distributor"/> <widget class="BlackGui::Components::CDbDistributorComponent" name="comp_Distributor">
<property name="minimumSize">
<size>
<width>0</width>
<height>250</height>
</size>
</property>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>

View File

@@ -11,7 +11,7 @@
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Frame</string> <string>Aircraft model form</string>
</property> </property>
<layout class="QHBoxLayout" name="vl_AircraftModelForm" stretch="1,1"> <layout class="QHBoxLayout" name="vl_AircraftModelForm" stretch="1,1">
<property name="leftMargin"> <property name="leftMargin">
@@ -28,12 +28,6 @@
</property> </property>
<item> <item>
<widget class="QFrame" name="fr_AircraftModelLeft"> <widget class="QFrame" name="fr_AircraftModelLeft">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<layout class="QVBoxLayout" name="vl_AircraftModelFormLeft"> <layout class="QVBoxLayout" name="vl_AircraftModelFormLeft">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
@@ -125,12 +119,6 @@
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::StrongFocus</enum> <enum>Qt::StrongFocus</enum>
</property> </property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>

View File

@@ -32,10 +32,10 @@ namespace BlackGui
this->setFrameStyle(QFrame::StyledPanel); this->setFrameStyle(QFrame::StyledPanel);
this->setFrameShadow(QFrame::Raised); this->setFrameShadow(QFrame::Raised);
this->setAutoFillBackground(true); this->setAutoFillBackground(true);
this->m_originalStyleSheet = this->styleSheet(); m_originalStyleSheet = this->styleSheet();
connect(&this->m_resetTimer, &QTimer::timeout, this, &CValidationIndicator::clear); connect(&m_resetTimer, &QTimer::timeout, this, &CValidationIndicator::clear);
this->m_resetTimer.setObjectName(this->objectName().append(":").append("resetTimer")); m_resetTimer.setObjectName(this->objectName().append(":").append("resetTimer"));
this->m_resetTimer.start(ResetInterval); m_resetTimer.start(ResetInterval);
} }
CValidationIndicator::~CValidationIndicator() CValidationIndicator::~CValidationIndicator()
@@ -44,27 +44,27 @@ namespace BlackGui
void CValidationIndicator::passed() void CValidationIndicator::passed()
{ {
this->show(); this->show();
setBackgroundColor("green"); this->setBackgroundColor("green");
ui->lbl_Icon->setPixmap(CIcons::tick16()); ui->lbl_Icon->setPixmap(CIcons::tick16());
} }
void CValidationIndicator::failed() void CValidationIndicator::failed()
{ {
this->show(); this->show();
setBackgroundColor("red"); this->setBackgroundColor("red");
ui->lbl_Icon->setPixmap(CStatusMessage::convertToIcon(CStatusMessage::SeverityError)); ui->lbl_Icon->setPixmap(CStatusMessage::convertToIcon(CStatusMessage::SeverityError));
} }
void CValidationIndicator::warnings() void CValidationIndicator::warnings()
{ {
this->show(); this->show();
setBackgroundColor("yellow"); this->setBackgroundColor("yellow");
ui->lbl_Icon->setPixmap(CStatusMessage::convertToIcon(CStatusMessage::SeverityWarning)); ui->lbl_Icon->setPixmap(CStatusMessage::convertToIcon(CStatusMessage::SeverityWarning));
} }
void CValidationIndicator::clear() void CValidationIndicator::clear()
{ {
setBackgroundColor(""); this->setBackgroundColor("");
ui->lbl_Icon->clear(); ui->lbl_Icon->clear();
this->hide(); this->hide();
} }
@@ -107,7 +107,7 @@ namespace BlackGui
{ {
if (colorName.isEmpty()) if (colorName.isEmpty())
{ {
this->setStyleSheet(this->m_originalStyleSheet); this->setStyleSheet(m_originalStyleSheet);
} }
else else
{ {

View File

@@ -20,8 +20,7 @@
#include <QScopedPointer> #include <QScopedPointer>
#include <memory> #include <memory>
class QWidget; namespace Ui { class CAircraftIcaoFilterBar; }
namespace BlackMisc namespace BlackMisc
{ {
namespace Aviation namespace Aviation
@@ -30,7 +29,6 @@ namespace BlackMisc
class CAircraftIcaoCodeList; class CAircraftIcaoCodeList;
} }
} }
namespace Ui { class CAircraftIcaoFilterBar; }
namespace BlackGui namespace BlackGui
{ {
namespace Filters namespace Filters
@@ -40,7 +38,7 @@ namespace BlackGui
*/ */
class BLACKGUI_EXPORT CAircraftIcaoFilterBar : class BLACKGUI_EXPORT CAircraftIcaoFilterBar :
public CFilterWidget, public CFilterWidget,
public BlackGui::Models::IModelFilterProvider<BlackMisc::Aviation::CAircraftIcaoCodeList> public Models::IModelFilterProvider<BlackMisc::Aviation::CAircraftIcaoCodeList>
{ {
Q_OBJECT Q_OBJECT

View File

@@ -278,10 +278,7 @@ namespace BlackGui
const QString c = combinedStyleAndWeight.toLower(); const QString c = combinedStyleAndWeight.toLower();
for (const QString &w : fontWeights()) for (const QString &w : fontWeights())
{ {
if (c.contains(w)) if (c.contains(w)) { return w; }
{
return w;
}
} }
return n; return n;
} }