Merge pull request #465 from monich/appearance
Hide appearance settings that are not applicable
This commit is contained in:
commit
f6d6352879
1 changed files with 28 additions and 3 deletions
|
@ -22,17 +22,31 @@ import Sailfish.Silica 1.0
|
||||||
|
|
||||||
AccordionItem {
|
AccordionItem {
|
||||||
text: qsTr("Appearance")
|
text: qsTr("Appearance")
|
||||||
|
clip: heightBehavior.enabled || heightAnimation.running
|
||||||
|
|
||||||
|
// One-shot behavior
|
||||||
|
Behavior on height {
|
||||||
|
id: heightBehavior
|
||||||
|
enabled: false
|
||||||
|
SequentialAnimation {
|
||||||
|
id: heightAnimation
|
||||||
|
SmoothedAnimation { duration: 200 }
|
||||||
|
ScriptAction { script: heightBehavior.enabled = false }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
ResponsiveGrid {
|
ResponsiveGrid {
|
||||||
bottomPadding: Theme.paddingMedium
|
bottomPadding: Theme.paddingMedium
|
||||||
|
|
||||||
TextSwitch {
|
TextSwitch {
|
||||||
id: stickersAsEmojisTextSwitch
|
|
||||||
width: parent.columnWidth
|
width: parent.columnWidth
|
||||||
checked: appSettings.showStickersAsEmojis
|
checked: appSettings.showStickersAsEmojis
|
||||||
text: qsTr("Show stickers as emojis")
|
text: qsTr("Show stickers as emojis")
|
||||||
description: qsTr("Only display emojis instead of the actual stickers")
|
description: qsTr("Only display emojis instead of the actual stickers")
|
||||||
automaticCheck: false
|
automaticCheck: false
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
heightBehavior.enabled = true
|
||||||
appSettings.showStickersAsEmojis = !checked
|
appSettings.showStickersAsEmojis = !checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,7 +60,16 @@ AccordionItem {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
appSettings.showStickersAsImages = !checked
|
appSettings.showStickersAsImages = !checked
|
||||||
}
|
}
|
||||||
enabled: !stickersAsEmojisTextSwitch.checked
|
visible: !appSettings.showStickersAsEmojis
|
||||||
|
opacity: visible ? 1 : 0
|
||||||
|
Behavior on opacity { FadeAnimation { } }
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
// Placeholder to move the next switch to the second column
|
||||||
|
visible: parent.columns === 2
|
||||||
|
width: 1
|
||||||
|
height: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
TextSwitch {
|
TextSwitch {
|
||||||
|
@ -57,7 +80,9 @@ AccordionItem {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
appSettings.animateStickers = !checked
|
appSettings.animateStickers = !checked
|
||||||
}
|
}
|
||||||
enabled: !stickersAsEmojisTextSwitch.checked
|
visible: !appSettings.showStickersAsEmojis
|
||||||
|
opacity: visible ? 1 : 0
|
||||||
|
Behavior on opacity { FadeAnimation { } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue