Commit 059c1325 authored by Timothée Giet's avatar Timothée Giet
Browse files

add textSize property to GCButtonStyle

used in baby wordprocessor activity
parent 1a12ea43
......@@ -48,7 +48,7 @@ ActivityBase {
Column {
id: controls
width: 200 * ApplicationInfo.ratio
width: 120 * ApplicationInfo.ratio
anchors {
right: parent.right
top: parent.top
......@@ -58,22 +58,19 @@ ActivityBase {
spacing: 10
Button {
style: GCButtonStyle {}
height: 30 * ApplicationInfo.ratio
width: parent.width
style: GCButtonStyle { textSize: "title"}
text: qsTr("Title")
width: parent.width
onClicked: edit.formatLineWith('h2')
}
Button {
style: GCButtonStyle {}
height: 30 * ApplicationInfo.ratio
width: parent.width
style: GCButtonStyle { textSize: "subtitle"}
text: qsTr("Subtitle")
width: parent.width
onClicked: edit.formatLineWith('h3')
}
Button {
style: GCButtonStyle {}
height: 30 * ApplicationInfo.ratio
style: GCButtonStyle { textSize: "regular"}
width: parent.width
text: qsTr("Paragraph")
onClicked: edit.formatLineWith('p')
......
......@@ -76,6 +76,23 @@ ButtonStyle {
}
}
property string textSize: "regular"
property variant textSizes: {
"regular": {
fontSize: 14,
fontBold: false
},
"subtitle": {
fontSize: 16,
fontBold: true
},
"title": {
fontSize: 24,
fontBold: true
}
}
background: Rectangle {
border.width: control.activeFocus ? 4 : 2
border.color: themes[theme].borderColor
......@@ -95,7 +112,8 @@ ButtonStyle {
id: labelText
color: themes[theme].textColor
text: control.text
fontSize: regularSize
fontSize: textSizes[textSize].fontSize
font.bold: textSizes[textSize].fontBold
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
wrapMode: Text.WordWrap
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment