aboutsummaryrefslogtreecommitdiff
path: root/src/widget/Highlighter.qml
blob: b2db7f6c97ed5243b3634e2c26a953bcdf020b10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import QtQuick 2.0
import Qt.labs.settings 1.0

Item {
	property Settings settings : 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
			}
		}
	}
}