Skip to content

Commit

Permalink
Fixes #158
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLazarescu committed Mar 29, 2024
1 parent 6215abc commit c93d8bc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,13 @@ Item {
function setDefaultItem(itemName) {
for (var i = 0; i < selectionPopup.model.count; i++) {
if (selectionPopup.model.get(i)[contentPropertyName] === itemName) {
print("Found at index: " + i)
selectItem(i)
return
}
}

selectionPopup.listView.currentIndex = -1
selectionPopup.defaultIndex = -1
}

Expand Down
16 changes: 13 additions & 3 deletions src/presentation/readingPage/readingToolbar/MReadingToolBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,20 @@ Pane {
Component.onCompleted: zoomAssignment.start()
Timer {
id: zoomAssignment
property int firstTime: 0

interval: 5
onTriggered: zoomComboBox.text = Qt.binding(function () {
return Math.round(BookController.zoom * 100) + "%"
})
onTriggered: {
zoomComboBox.text = Qt.binding(function () {
return Math.round(BookController.zoom * 100) + "%"
})

// Only wanna do this the first time
if (firstTime == 0) {
zoomComboBox.setDefaultItem(zoomComboBox.text)
firstTime++
}
}
}

// Remove % sign from text
Expand Down

0 comments on commit c93d8bc

Please sign in to comment.