diff options
| author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-04-12 20:10:51 +0800 | 
|---|---|---|
| committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-04-12 20:10:51 +0800 | 
| commit | 6188a0034cb971f71a1683450b1bc4dce8d45d4c (patch) | |
| tree | 36991105acf3444b5657fc0214db6b0b27fae2e4 | |
| parent | 81a72b6eeb0614d2f8139314cf5d3948faa467b0 (diff) | |
Heading colours
| -rw-r--r-- | Bootstrap.cxx | 8 | ||||
| -rw-r--r-- | Bootstrap.hxx | 9 | 
2 files changed, 15 insertions, 2 deletions
diff --git a/Bootstrap.cxx b/Bootstrap.cxx index 99a8639..e550725 100644 --- a/Bootstrap.cxx +++ b/Bootstrap.cxx @@ -29,6 +29,7 @@ Bootstrap::Bootstrap(QObject *parent):  	bsBodyFont{bsFontSansSerif},  	bodyColors{{"#212529", "#adb5bd"}},  	bodyBgs{{"#fff", "#212529"}}, +	headingColors{{bodyColors.at(0), bodyColors.at(1)}},  	borderColors{{"#dee2e6", "#495057"}}  {  	bsBodyFont.setStyleHint(QFont::SansSerif); @@ -63,6 +64,7 @@ Bootstrap::Bootstrap(QObject *parent):  	toml_array_t *colors;  	OVERRIDE_COLORS("BodyColors", bodyColors);  	OVERRIDE_COLORS("BodyBgs", bodyBgs); +	OVERRIDE_COLORS("HeadingColors", headingColors);  	OVERRIDE_COLORS("BorderColors", borderColors);  	toml_free(toml); @@ -85,6 +87,7 @@ void Bootstrap::setMode(Mode mode)  	emit modeChanged();  	emit bodyColorChanged();  	emit bodyBgChanged(); +	emit headingColorChanged();  	emit borderColorChanged();  } @@ -120,6 +123,11 @@ QColor Bootstrap::bodyBg() const  	return bodyBgs.at(static_cast<int>(bsMode));  } +QColor Bootstrap::headingColor() const +{ +	return headingColors.at(static_cast<int>(bsMode)); +} +  QColor Bootstrap::borderColor() const  {  	return borderColors.at(static_cast<int>(bsMode)); diff --git a/Bootstrap.hxx b/Bootstrap.hxx index 37b5870..6d27d07 100644 --- a/Bootstrap.hxx +++ b/Bootstrap.hxx @@ -22,6 +22,8 @@ class Bootstrap : public QObject  	Q_PROPERTY(QFont bodyFont READ bodyFont NOTIFY bodyFontChanged)  	Q_PROPERTY(QColor bodyColor READ bodyColor NOTIFY bodyColorChanged)  	Q_PROPERTY(QColor bodyBg READ bodyBg NOTIFY bodyBgChanged) +	Q_PROPERTY(QColor headingColor READ headingColor +			NOTIFY headingColorChanged)  	Q_PROPERTY(QColor borderColor READ borderColor  			NOTIFY borderColorChanged)  	QML_ELEMENT @@ -59,16 +61,18 @@ class Bootstrap : public QObject  		QFont bodyFont() const;  		QColor bodyColor() const;  		QColor bodyBg() const; +		QColor headingColor() const;  		QColor borderColor() const;  	signals:  		void themeChanged();  		void modeChanged(); +		void fontSansSerifChanged(); +		void bodyFontChanged();  		void bodyColorChanged();  		void bodyBgChanged(); +		void headingColorChanged();  		void borderColorChanged(); -		void fontSansSerifChanged(); -		void bodyFontChanged();  	private:  		Mode bsMode; @@ -77,6 +81,7 @@ class Bootstrap : public QObject  		QFont bsBodyFont;  		QVector<QColor> bodyColors;  		QVector<QColor> bodyBgs; +		QVector<QColor> headingColors;  		QVector<QColor> borderColors;  };  |