mirror of
https://github.com/seiichiro0185/sailotp.git
synced 2024-11-25 00:29:42 +00:00
Changed favourite switch to icon
This commit is contained in:
parent
40f53fc47a
commit
eb08a4eee1
1 changed files with 6 additions and 6 deletions
|
@ -142,18 +142,18 @@ Page {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
Switch {
|
IconButton {
|
||||||
checked: model.fav
|
icon.source: fav == 1 ? "image://theme/icon-m-favorite-selected" : "image://theme/icon-m-favorite"
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (checked) DB.setFav(title, secret)
|
DB.setFav(title, secret)
|
||||||
refreshOTPList();
|
|
||||||
/*model.fav = checked ? 1 : 0;
|
|
||||||
for (var i=0; i<otpListModel.count; i++) {
|
for (var i=0; i<otpListModel.count; i++) {
|
||||||
if (i != index) {
|
if (i != index) {
|
||||||
otpListModel.setProperty(i, "fav", 0);
|
otpListModel.setProperty(i, "fav", 0);
|
||||||
|
} else {
|
||||||
|
otpListModel.setProperty(i, "fav", 1);
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue