Skip to content

Commit

Permalink
Use a property to track if Hotlist Format Help is visible
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBriza committed Apr 17, 2024
1 parent c1d08b0 commit 71aa0cb
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions modules/Lith/UI/SettingsHotlistFormatEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ import Lith.Style

Dialog {
id: root

property bool helpVisible: false

modal: true
anchors.centerIn: Overlay.overlay
width: Math.min(400, parent.width)
implicitHeight: Math.min(header.height + mainItem.implicitHeight + footer.height, (mainView ? mainView.height : 1000))
closePolicy: autocomplete.visible ? Popup.CloseOnPressOutside : (Popup.CloseOnEscape | Popup.CloseOnPressOutside)
onVisibleChanged: {
helpVisible = false
if (visible) {
formatSplitter.fromStringList(Lith.settings.hotlistFormat)
}
Expand Down Expand Up @@ -41,18 +45,18 @@ Dialog {

Button {
id: helpButton
text: help.visible ? qsTr("Back") : qsTr("Help")
text: root.helpVisible ? qsTr("Back") : qsTr("Help")
anchors.top: parent.top
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.margins: 6
onClicked: help.visible = !help.visible
onClicked: root.helpVisible = !root.helpVisible
}
}

footer: DialogButtons {
id: dialogButtons
enabled: !help.visible // disable the buttons so the user doesn't get confused
enabled: !root.helpVisible // disable the buttons so the user doesn't get confused
acceptable: formatSplitter.variablesValid && formatSplitter.formatValid
dialog: root
}
Expand Down Expand Up @@ -293,7 +297,7 @@ Dialog {
id: help
anchors.fill: parent
anchors.margins: 1
visible: false
visible: root.helpVisible
color: LithPalette.regular.window
ScrollView {
id: helpScrollView
Expand Down Expand Up @@ -356,16 +360,16 @@ Dialog {
}
RowLayout {
Layout.fillWidth: true
Item { Layout.fillWidth: true}
Item { Layout.fillWidth: true }
HotListItem {
text: "3 ABC #lith 3"
}
Item { Layout.fillWidth: true}
Item { Layout.fillWidth: true }
HotListItem {
hot: true
text: "3 ABC #lith 3"
}
Item { Layout.fillWidth: true}
Item { Layout.fillWidth: true }
}
Rectangle {
Layout.fillWidth: true
Expand Down

0 comments on commit 71aa0cb

Please sign in to comment.