From b5f8ec99fd8e79871b2a5df0966f29bcf244632f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Wed, 12 Apr 2023 22:48:29 +0800 Subject: Headings support --- Bootstrap.hxx | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'Bootstrap.hxx') 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 bodyColors; QVector bodyBgs; - QVector headingColors; QVector borderColors; + int htmlHeading; + QFont bsHeadingFont; + QVector headingColors; + QVector h1FontSize; + QVector h2FontSize; + QVector h3FontSize; + QVector h4FontSize; + QVector h5FontSize; + QVector h6FontSize; }; QML_DECLARE_TYPEINFO(Bootstrap, QML_HAS_ATTACHED_PROPERTIES) -- cgit v1.2.3