mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-19 20:25:29 +08:00
Style sheet improvements
* button clicked shown in different style (better user experience) * menu toopen main style sheet
This commit is contained in:
@@ -426,12 +426,19 @@ namespace BlackGui
|
|||||||
void CGuiApplication::addMenuForStyleSheets(QMenu &menu)
|
void CGuiApplication::addMenuForStyleSheets(QMenu &menu)
|
||||||
{
|
{
|
||||||
QMenu *sm = menu.addMenu("Style sheet");
|
QMenu *sm = menu.addMenu("Style sheet");
|
||||||
QAction *a = sm->addAction(CIcons::refresh16(), "Reload");
|
QAction *aReload = sm->addAction(CIcons::refresh16(), "Reload");
|
||||||
bool c = connect(a, &QAction::triggered, this, [a, this]()
|
bool c = connect(aReload, &QAction::triggered, this, [aReload, this]()
|
||||||
{
|
{
|
||||||
this->reloadStyleSheets();
|
this->reloadStyleSheets();
|
||||||
});
|
});
|
||||||
Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed");
|
Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed");
|
||||||
|
|
||||||
|
QAction *aOpen = sm->addAction(CIcons::text16(), "Open qss file");
|
||||||
|
c = connect(aOpen, &QAction::triggered, this, [aOpen, this]()
|
||||||
|
{
|
||||||
|
this->openStandardWidgetStyleSheet();
|
||||||
|
});
|
||||||
|
Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed");
|
||||||
Q_UNUSED(c);
|
Q_UNUSED(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -610,6 +617,12 @@ namespace BlackGui
|
|||||||
return m_styleSheetUtility.read();
|
return m_styleSheetUtility.read();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CGuiApplication::openStandardWidgetStyleSheet()
|
||||||
|
{
|
||||||
|
const QString fn = CStyleSheetUtility::fileNameAndPathStandardWidget();
|
||||||
|
return QDesktopServices::openUrl(QUrl::fromLocalFile(fn));
|
||||||
|
}
|
||||||
|
|
||||||
bool CGuiApplication::updateFont(const QString &fontFamily, const QString &fontSize, const QString &fontStyle, const QString &fontWeight, const QString &fontColor)
|
bool CGuiApplication::updateFont(const QString &fontFamily, const QString &fontSize, const QString &fontStyle, const QString &fontWeight, const QString &fontColor)
|
||||||
{
|
{
|
||||||
return m_styleSheetUtility.updateFont(fontFamily, fontSize, fontStyle, fontWeight, fontColor);
|
return m_styleSheetUtility.updateFont(fontFamily, fontSize, fontStyle, fontWeight, fontColor);
|
||||||
|
|||||||
@@ -160,6 +160,9 @@ namespace BlackGui
|
|||||||
//! Reload style sheets
|
//! Reload style sheets
|
||||||
bool reloadStyleSheets();
|
bool reloadStyleSheets();
|
||||||
|
|
||||||
|
//! Opens the standard stylesheet
|
||||||
|
bool openStandardWidgetStyleSheet();
|
||||||
|
|
||||||
//! Update the fonts
|
//! Update the fonts
|
||||||
bool updateFont(const QString &fontFamily, const QString &fontSize, const QString &fontStyle, const QString &fontWeight, const QString &fontColor);
|
bool updateFont(const QString &fontFamily, const QString &fontSize, const QString &fontStyle, const QString &fontWeight, const QString &fontColor);
|
||||||
|
|
||||||
@@ -231,12 +234,12 @@ namespace BlackGui
|
|||||||
QPixmap m_windowIcon;
|
QPixmap m_windowIcon;
|
||||||
QCommandLineOption m_cmdWindowStateMinimized { "empty" }; //!< window state (minimized)
|
QCommandLineOption m_cmdWindowStateMinimized { "empty" }; //!< window state (minimized)
|
||||||
QCommandLineOption m_cmdWindowMode { "empty" }; //!< window mode (flags: frameless ...)
|
QCommandLineOption m_cmdWindowMode { "empty" }; //!< window mode (flags: frameless ...)
|
||||||
CStyleSheetUtility m_styleSheetUtility{{}, this}; //!< style sheet utility
|
CStyleSheetUtility m_styleSheetUtility {{}, this}; //!< style sheet utility
|
||||||
bool m_uiSetupCompleted = false; //!< ui setup completed
|
bool m_uiSetupCompleted = false; //!< ui setup completed
|
||||||
QScopedPointer<QSplashScreen> m_splashScreen; //!< splash screen
|
QScopedPointer<QSplashScreen> m_splashScreen; //!< splash screen
|
||||||
Components::CDownloadAndInstallDialog *m_installDialog = nullptr; //!< software installation dialog
|
Components::CDownloadAndInstallDialog *m_installDialog = nullptr; //!< software installation dialog
|
||||||
Components::CApplicationCloseDialog *m_closeDialog = nullptr; //!< close dialog (no QScopedPointer because I need to set parent)
|
Components::CApplicationCloseDialog *m_closeDialog = nullptr; //!< close dialog (no QScopedPointer because I need to set parent)
|
||||||
BlackMisc::CSettingReadOnly<Settings::TGeneralGui> m_guiSettings{ this, &CGuiApplication::settingsChanged };
|
BlackMisc::CSettingReadOnly<Settings::TGeneralGui> m_guiSettings { this, &CGuiApplication::settingsChanged };
|
||||||
BlackMisc::CSettingReadOnly<Settings::TUpdateNotificationSettings> m_updateSetting { this }; //!< update notification settings
|
BlackMisc::CSettingReadOnly<Settings::TUpdateNotificationSettings> m_updateSetting { this }; //!< update notification settings
|
||||||
|
|
||||||
//! Qt help message to formatted HTML
|
//! Qt help message to formatted HTML
|
||||||
|
|||||||
@@ -176,6 +176,14 @@ QPushButton::disabled {
|
|||||||
qproperty-textElideMode: ElideMiddle;
|
qproperty-textElideMode: ElideMiddle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPushButton:pressed{ background-color: lightblue; }
|
||||||
|
/**
|
||||||
|
QPushButton:focus:pressed{ background-color: black; }
|
||||||
|
QPushButton:focus{ background-color: green; }
|
||||||
|
QPushButton:hover{ background-color: red; }
|
||||||
|
QPushButton:checked{ background-color: pink; }
|
||||||
|
**/
|
||||||
|
|
||||||
QProgressBar {
|
QProgressBar {
|
||||||
border: 1px solid green;
|
border: 1px solid green;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ QAbstractScrollArea #qw_RemarksGenerator { background-color: transparent; backg
|
|||||||
/* in log component */
|
/* in log component */
|
||||||
/**
|
/**
|
||||||
QAbstractScrollArea #pg_StatusPageMessages { background-color: black; }
|
QAbstractScrollArea #pg_StatusPageMessages { background-color: black; }
|
||||||
QAbstractScrollArea #pg_StatusPageCons ole { background-color: black; }
|
QAbstractScrollArea #pg_StatusPageConsole { background-color: black; }
|
||||||
**/
|
**/
|
||||||
|
|
||||||
/* main GUI parts */
|
/* main GUI parts */
|
||||||
@@ -92,6 +92,10 @@ QAbstractScrollArea #pg_StatusPageCons ole { background-color: black; }
|
|||||||
color: yellow;
|
color: yellow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#wi_MainKeypadArea QPushButton::pressed {
|
||||||
|
background-color: lightblue;
|
||||||
|
}
|
||||||
|
|
||||||
/* cockpit needs to come after sw_MainMiddle */
|
/* cockpit needs to come after sw_MainMiddle */
|
||||||
#comp_CockpitComComponent QPushButton {
|
#comp_CockpitComComponent QPushButton {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
|||||||
@@ -315,6 +315,12 @@ namespace BlackGui
|
|||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QString &CStyleSheetUtility::fileNameAndPathSwiftStandardGui()
|
||||||
|
{
|
||||||
|
static const QString fn = CFileUtils::appendFilePaths(CDirectoryUtils::stylesheetsDirectory(), CStyleSheetUtility::fileNameSwiftStandardGui());
|
||||||
|
return fn;
|
||||||
|
}
|
||||||
|
|
||||||
const QString &CStyleSheetUtility::fileNameInfoBar()
|
const QString &CStyleSheetUtility::fileNameInfoBar()
|
||||||
{
|
{
|
||||||
static const QString f(getQssFileName("infobar"));
|
static const QString f(getQssFileName("infobar"));
|
||||||
@@ -339,6 +345,12 @@ namespace BlackGui
|
|||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QString &CStyleSheetUtility::fileNameAndPathStandardWidget()
|
||||||
|
{
|
||||||
|
static const QString fn = CFileUtils::appendFilePaths(CDirectoryUtils::stylesheetsDirectory(), CStyleSheetUtility::fileNameStandardWidget());
|
||||||
|
return fn;
|
||||||
|
}
|
||||||
|
|
||||||
const QString &CStyleSheetUtility::fileNameTextMessage()
|
const QString &CStyleSheetUtility::fileNameTextMessage()
|
||||||
{
|
{
|
||||||
static const QString f("textmessage.css");
|
static const QString f("textmessage.css");
|
||||||
|
|||||||
@@ -95,6 +95,9 @@ namespace BlackGui
|
|||||||
//! File name for standard widgets
|
//! File name for standard widgets
|
||||||
static const QString &fileNameStandardWidget();
|
static const QString &fileNameStandardWidget();
|
||||||
|
|
||||||
|
//! Full file path and name for standard widgets
|
||||||
|
static const QString &fileNameAndPathStandardWidget();
|
||||||
|
|
||||||
//! File name textmessage.qss
|
//! File name textmessage.qss
|
||||||
static const QString &fileNameTextMessage();
|
static const QString &fileNameTextMessage();
|
||||||
|
|
||||||
@@ -104,6 +107,9 @@ namespace BlackGui
|
|||||||
//! File name swift standard GUI
|
//! File name swift standard GUI
|
||||||
static const QString &fileNameSwiftStandardGui();
|
static const QString &fileNameSwiftStandardGui();
|
||||||
|
|
||||||
|
//! Full file path and name for swift standard GUI
|
||||||
|
static const QString &fileNameAndPathSwiftStandardGui();
|
||||||
|
|
||||||
//! File name swiftcore.qss
|
//! File name swiftcore.qss
|
||||||
static const QString &fileNameSwiftCore();
|
static const QString &fileNameSwiftCore();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user