refs #335, style sheet fixes / improvements and support methods

style sheets:
* style sheets with background textures
* scroll area / toolbox style sheet fix
* floating dock widgets
* kept 1st version of stylesheets in backup directory
* removed maininfoarea stylesheet, no longer needed with fixed style sheet

code
* central paintEvent method to enable style sheets in derived widgets
* detect frameless windows, dynamic properties
This commit is contained in:
Klaus Basan
2014-10-01 17:05:37 +02:00
committed by Roland Winklmeier
parent 65c2ed9db4
commit c965fbb785
27 changed files with 1056 additions and 156 deletions

View File

@@ -8,6 +8,7 @@
*/
#include "flightplancomponent.h"
#include "../stylesheetutility.h"
#include "ui_flightplancomponent.h"
#include "blackmisc/logmessage.h"
#include "blackcore/context_network.h"
@@ -16,6 +17,7 @@
using namespace BlackMisc;
using namespace BlackMisc::Aviation;
using namespace BlackMisc::PhysicalQuantities;
using namespace BlackGui;
namespace BlackGui
{
@@ -25,6 +27,8 @@ namespace BlackGui
QTabWidget(parent), CRuntimeBasedComponent(nullptr, false), ui(new Ui::CFlightPlanComponent)
{
ui->setupUi(this);
// fix style
this->tabBar()->setExpanding(false);
connect(this->ui->pb_Send, &QPushButton::pressed, this, &CFlightPlanComponent::sendFlightPlan);

View File

@@ -9,6 +9,7 @@
#include "infowindowcomponent.h"
#include "ui_infowindowcomponent.h"
#include "../stylesheetutility.h"
#include "blackmisc/icon.h"
#include <QTimer>
#include <QDesktopWidget>
@@ -16,6 +17,7 @@
using namespace BlackMisc;
using namespace BlackMisc::Network;
namespace BlackGui
{
namespace Components
@@ -31,8 +33,11 @@ namespace BlackGui
this->hide();
this->m_hideTimer = new QTimer(this);
this->m_hideTimer->setSingleShot(true);
this->onStyleSheetsChanged();
connect(this->m_hideTimer, &QTimer::timeout, this, &CInfoWindowComponent::hide);
connect(this->ui->pb_Close, &QPushButton::pressed, this, &CInfoWindowComponent::hide);
connect(&CStyleSheetUtility::instance(), &CStyleSheetUtility::styleSheetsChanged, this, &CInfoWindowComponent::onStyleSheetsChanged);
}
/*
@@ -145,5 +150,14 @@ namespace BlackGui
{
this->ui->sw_DifferentModes->setCurrentWidget(widget);
}
/*
* Style sheet changed
*/
void CInfoWindowComponent::onStyleSheetsChanged()
{
QString st = CStyleSheetUtility::instance().style(CStyleSheetUtility::fileNameInfoWindow());
this->setStyleSheet(st);
}
}
} // namespace

View File

@@ -68,6 +68,10 @@ namespace BlackGui
//! Current page
void setCurrentPage(QWidget *widget);
private slots:
//! Style sheet changed
void onStyleSheetsChanged();
};
}
}

View File

@@ -14,37 +14,7 @@
<string>WizardPage</string>
</property>
<property name="styleSheet">
<string notr="true">QFrame#fr_InfoWindow {
border-style: solid;
border-width: 2px;
border-radius: 10px;
border-color: white;
}
QStackedWidget {
font-family: arial-rounded;
font: bold 10px;
color: white; /** font not in text edit **/
}
QPushButton {
background-color: transparent;
border-style: solid;
border-width: 0px;
border-radius:3px;
border-color: green;
max-height:20px;
}
QTextEdit {
background-color: rgba(255, 255, 0, 240); /* transparent yellow */
border-style: solid;
border-width:1px;
border-radius:6px;
border-color: green;
opacity: 0.5;
color: black; /** font **/
}</string>
<string notr="true"/>
</property>
<property name="title">
<string>Information</string>
@@ -107,8 +77,8 @@ QTextEdit {
<string/>
</property>
<property name="icon">
<iconset>
<normaloff>:/blackgui/icons/close.png</normaloff>:/blackgui/icons/close.png</iconset>
<iconset resource="../../blackmisc/blackmisc.qrc">
<normaloff>:/diagona/icons/diagona/icons/cross-button.png</normaloff>:/diagona/icons/diagona/icons/cross-button.png</iconset>
</property>
</widget>
</item>
@@ -240,6 +210,8 @@ QTextEdit {
</item>
</layout>
</widget>
<resources/>
<resources>
<include location="../../blackmisc/blackmisc.qrc"/>
</resources>
<connections/>
</ui>

View File

@@ -9,6 +9,9 @@
#include "logcomponent.h"
#include "ui_logcomponent.h"
#include "../stylesheetutility.h"
using namespace BlackGui;
namespace BlackGui
{

View File

@@ -38,8 +38,8 @@
<property name="bottomMargin">
<number>0</number>
</property>
<property name="horizontalSpacing">
<number>3</number>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QToolBox" name="tb_StatusPage">
@@ -97,8 +97,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>98</width>
<height>71</height>
<width>398</width>
<height>250</height>
</rect>
</property>
<attribute name="label">