Skip to content

Commit

Permalink
Updated Header item for Drawers. Added heading fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
iiLubos committed Dec 11, 2023
1 parent 969b0a4 commit d1a453b
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 3 deletions.
9 changes: 9 additions & 0 deletions app/mmstyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ class MMStyle: public QObject
// standard - font: __style.p5
// extended - font.pixelSize: __style.p5.pixelSize; font.italic: true

// Fonts - Heading
Q_PROPERTY( QFont h1 READ h1 CONSTANT )
Q_PROPERTY( QFont h2 READ h2 CONSTANT )
Q_PROPERTY( QFont h3 READ h3 CONSTANT )

// Fonts - Title
Q_PROPERTY( QFont t1 READ t1 CONSTANT )
Q_PROPERTY( QFont t2 READ t2 CONSTANT )
Expand Down Expand Up @@ -124,6 +129,10 @@ class MMStyle: public QObject
{}
~MMStyle() = default;

QFont h1() {return fontFactory( 48, true );}
QFont h2() {return fontFactory( 36, true );}
QFont h3() {return fontFactory( 24, true );}

QFont t1() {return fontFactory( 18, true );}
QFont t2() {return fontFactory( 16, true );}
QFont t3() {return fontFactory( 14, true );}
Expand Down
9 changes: 6 additions & 3 deletions app/qml/components/MMHeader.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ Row {
id: root

/* translate in parent! */
required property var headerTitle
required property string headerTitle
/* -1 no step bar shown; 1, 2, 3 */
property int step: -1
property bool backVisible: true
property color backColor: __style.whiteColor
property font titleFont: __style.t4

signal backClicked

Expand All @@ -30,7 +32,8 @@ Row {
width: 60 * __dp

MMBackButton {
visible: backVisible
visible: root.backVisible
color: root.backColor

onClicked: root.backClicked()
}
Expand All @@ -53,7 +56,7 @@ Row {
return root.width
}
text: root.headerTitle
font: __style.t4
font: root.titleFont
color: __style.forestColor
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
Expand Down
26 changes: 26 additions & 0 deletions gallery/qml/pages/MiscPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,32 @@ Column {
}
}

GroupBox {
title: "MMHeader (for Drawer)"
width: page.width - 2 * page.padding

background: Rectangle {
color: "white"
border.color: "gray"
}
label: Label {
color: "black"
text: parent.title
padding: 5
}

Column {
spacing: 20
anchors.fill: parent

MMHeader {
headerTitle: "Drawer title"
titleFont: __style.h3
backColor: __style.lightGreenColor
}
}
}

GroupBox {
title: "MMHlineText"
background: Rectangle {
Expand Down

1 comment on commit d1a453b

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS - version 23.12.495511 just submitted!

Please sign in to comment.