1
0
Fork 0
mirror of https://github.com/seiichiro0185/sailotp.git synced 2024-05-16 23:50:54 +00:00

Changed favourite switch to icon

This commit is contained in:
seiichiro 2014-01-10 06:38:38 +01:00
parent 40f53fc47a
commit eb08a4eee1

View file

@ -142,18 +142,18 @@ Page {
width: parent.width
anchors.horizontalCenter: parent.horizontalCenter
Switch {
checked: model.fav
IconButton {
icon.source: fav == 1 ? "image://theme/icon-m-favorite-selected" : "image://theme/icon-m-favorite"
anchors.left: parent.left
onClicked: {
if (checked) DB.setFav(title, secret)
refreshOTPList();
/*model.fav = checked ? 1 : 0;
DB.setFav(title, secret)
for (var i=0; i<otpListModel.count; i++) {
if (i != index) {
otpListModel.setProperty(i, "fav", 0);
} else {
otpListModel.setProperty(i, "fav", 1);
}
}*/
}
}
}