mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 18:35:35 +08:00
refs #304, changed font settings
* QFontDialog is not working, as it is affected by the style sheets itself * Added font settings to the GUI settings tab * Added font color dialog for fonts * Several utility methods
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include <QMap>
|
||||
#include <QObject>
|
||||
#include <QFont>
|
||||
#include <QStringList>
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
@@ -40,6 +41,18 @@ namespace BlackGui
|
||||
//! Update the fonts
|
||||
bool updateFonts(const QFont &font);
|
||||
|
||||
//! Update the fonts
|
||||
bool updateFonts(const QString &fontFamily, const QString &fontSize, const QString &fontStyle, const QString &fontWeight, const QString &fontColor);
|
||||
|
||||
//! Current font color from style sheet
|
||||
QString fontColor();
|
||||
|
||||
//! Get the font style
|
||||
static QString fontStyle(const QString &combinedStyleAndWeight);
|
||||
|
||||
//! Get the font weight
|
||||
static QString fontWeight(const QString &combinedStyleAndWeight);
|
||||
|
||||
//! Central reader
|
||||
static CStyleSheetUtility &instance()
|
||||
{
|
||||
@@ -82,9 +95,32 @@ namespace BlackGui
|
||||
return f;
|
||||
}
|
||||
|
||||
//! Font weights
|
||||
static const QStringList &fontWeights()
|
||||
{
|
||||
static const QStringList w( {"bold", "semibold", "light", "black", "normal"});
|
||||
return w;
|
||||
}
|
||||
|
||||
//! Font styles
|
||||
static const QStringList &fontStyles()
|
||||
{
|
||||
static const QStringList s( {"italic", "oblique", "normal"});
|
||||
return s;
|
||||
}
|
||||
|
||||
//! qss directory
|
||||
static QString qssDirectory();
|
||||
|
||||
//! Font style as string
|
||||
static const QString &fontStyleAsString(const QFont &font);
|
||||
|
||||
//! Font weight as string
|
||||
static const QString &fontWeightAsString(const QFont &font);
|
||||
|
||||
//! Font as combined weight and style
|
||||
static QString fontAsCombinedWeightStyle(const QFont &font);
|
||||
|
||||
signals:
|
||||
//! Sheets have been changed
|
||||
void styleSheetsChanged();
|
||||
@@ -94,12 +130,6 @@ namespace BlackGui
|
||||
|
||||
//! Constructor
|
||||
explicit CStyleSheetUtility(QObject *parent = nullptr);
|
||||
|
||||
//! Font style as string
|
||||
static const QString &fontStyleAsString(const QFont &font);
|
||||
|
||||
//! Font weight as string
|
||||
static const QString &fontWeightAsString(const QFont &font);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user