aboutsummaryrefslogtreecommitdiff
path: root/src/widget/Highlighter.qml
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-08-15 16:06:00 +0200
committerAdrian Kummerlaender2015-08-15 16:06:00 +0200
commitd8431223d34476a17835a05d9508e92447f22479 (patch)
tree91b42009fc464be238f9afab569f62cfdf355179 /src/widget/Highlighter.qml
parent566e635cd798ef558f4d57fc319f0ee857869378 (diff)
downloadMetaTerm-d8431223d34476a17835a05d9508e92447f22479.tar
MetaTerm-d8431223d34476a17835a05d9508e92447f22479.tar.gz
MetaTerm-d8431223d34476a17835a05d9508e92447f22479.tar.bz2
MetaTerm-d8431223d34476a17835a05d9508e92447f22479.tar.lz
MetaTerm-d8431223d34476a17835a05d9508e92447f22479.tar.xz
MetaTerm-d8431223d34476a17835a05d9508e92447f22479.tar.zst
MetaTerm-d8431223d34476a17835a05d9508e92447f22479.zip
Restructure QML and JS sources
`list` holds the components of the central list UI element. `command` holds the UI and implementation parts of the command mode. `widget` holds more or less general purpose elements that may also be of use in other circumstances.
Diffstat (limited to 'src/widget/Highlighter.qml')
-rw-r--r--src/widget/Highlighter.qml33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/widget/Highlighter.qml b/src/widget/Highlighter.qml
new file mode 100644
index 0000000..e42aeb1
--- /dev/null
+++ b/src/widget/Highlighter.qml
@@ -0,0 +1,33 @@
+import QtQuick 2.0
+import Qt.labs.settings 1.0
+
+Item {
+ Settings {
+ id: settings
+ category: "highlighter"
+
+ property string defaultColor : "#909636"
+ property string focusColor : "#352F6A"
+ }
+
+ function select() { bar.opacity = 1 }
+ function deselect() { bar.opacity = 0 }
+ function focus() { bar.color = settings.focusColor }
+ function unfocus() { bar.color = settings.defaultColor }
+
+ Rectangle {
+ id: bar
+
+ anchors.fill: parent
+
+ opacity: 0
+ color: settings.defaultColor
+
+ Behavior on opacity {
+ NumberAnimation {
+ duration: 300
+ easing.type: Easing.OutCubic
+ }
+ }
+ }
+}