diff options
| author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-04-12 22:48:29 +0800 |
|---|---|---|
| committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-04-12 22:48:29 +0800 |
| commit | b5f8ec99fd8e79871b2a5df0966f29bcf244632f (patch) | |
| tree | d66b2c9b749c85bbf5e6affad00fadbc79eb567a /Bootstrap.hxx | |
| parent | 6188a0034cb971f71a1683450b1bc4dce8d45d4c (diff) | |
Headings support
Diffstat (limited to 'Bootstrap.hxx')
| -rw-r--r-- | Bootstrap.hxx | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/Bootstrap.hxx b/Bootstrap.hxx index 6d27d07..320f76c 100644 --- a/Bootstrap.hxx +++ b/Bootstrap.hxx @@ -22,10 +22,13 @@ 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) + Q_PROPERTY(int heading READ heading WRITE setHeading + NOTIFY headingChanged) + Q_PROPERTY(QFont headingFont READ headingFont NOTIFY headingFontChanged) + Q_PROPERTY(QColor headingColor READ headingColor + NOTIFY headingColorChanged) QML_ELEMENT QML_UNCREATABLE("Bootstrap is an attached property") @@ -61,9 +64,14 @@ class Bootstrap : public QObject QFont bodyFont() const; QColor bodyColor() const; QColor bodyBg() const; - QColor headingColor() const; QColor borderColor() const; + int heading() const; + void setHeading(int heading); + QFont headingFont() const; + Q_INVOKABLE qreal headingFontSize(const qreal parentWidth = .0); + QColor headingColor() const; + signals: void themeChanged(); void modeChanged(); @@ -71,8 +79,10 @@ class Bootstrap : public QObject void bodyFontChanged(); void bodyColorChanged(); void bodyBgChanged(); - void headingColorChanged(); void borderColorChanged(); + void headingChanged(); + void headingFontChanged(); + void headingColorChanged(); private: Mode bsMode; @@ -81,8 +91,16 @@ class Bootstrap : public QObject QFont bsBodyFont; QVector<QColor> bodyColors; QVector<QColor> bodyBgs; - QVector<QColor> headingColors; QVector<QColor> borderColors; + int htmlHeading; + QFont bsHeadingFont; + QVector<QColor> headingColors; + QVector<qreal> h1FontSize; + QVector<qreal> h2FontSize; + QVector<qreal> h3FontSize; + QVector<qreal> h4FontSize; + QVector<qreal> h5FontSize; + QVector<qreal> h6FontSize; }; QML_DECLARE_TYPEINFO(Bootstrap, QML_HAS_ATTACHED_PROPERTIES) |