projects
/
mdictionary
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add focus in qml
[mdictionary]
/
src
/
mdictionary
/
qml
/
Checkbox.qml
diff --git
a/src/mdictionary/qml/Checkbox.qml
b/src/mdictionary/qml/Checkbox.qml
index
7e96512
..
75046e3
100644
(file)
--- a/
src/mdictionary/qml/Checkbox.qml
+++ b/
src/mdictionary/qml/Checkbox.qml
@@
-32,6
+32,12
@@
Image {
property string pathToCheckedDicImage: "qrc:/button/checkboxCheckedDis.png"
property string pathToUncheckedDicImage: "qrc:/button/checkboxDis.png"
signal changed
property string pathToCheckedDicImage: "qrc:/button/checkboxCheckedDis.png"
property string pathToUncheckedDicImage: "qrc:/button/checkboxDis.png"
signal changed
+
+ Keys.onPressed: {
+ if (event.key == Qt.Key_Space)
+ selected=!selected
+ }
+
height: {
var aspectRatio = sourceSize.height / sourceSize.width
return checkbox.width * aspectRatio
height: {
var aspectRatio = sourceSize.height / sourceSize.width
return checkbox.width * aspectRatio
@@
-74,4
+80,21
@@
Image {
}
}
}
}
}
}
+
+ Rectangle{
+ id: focusRectangle
+ color: "#000000"
+ border.color: "#000000"
+ opacity: 0;
+ radius: 1
+ anchors.centerIn: parent
+ z:1;
+ }
+
+ onFocusChanged: {
+ if(focus)
+ focusRectangle.opacity=0.5;
+ else
+ focusRectangle.opacity=0;
+ }
}
}