Changeset View
Changeset View
Standalone View
Standalone View
liblatte2/qml/indicators/UnityIndicator.qml
Show All 34 Lines | 33 | Item{ | |||
---|---|---|---|---|---|
35 | height: rootItem.isTask ? width : parent.height | 35 | height: rootItem.isTask ? width : parent.height | ||
36 | anchors.centerIn: parent | 36 | anchors.centerIn: parent | ||
37 | 37 | | |||
38 | property bool isActive: rootItem.isActive || (rootItem.isWindow && rootItem.hasActive) | 38 | property bool isActive: rootItem.isActive || (rootItem.isWindow && rootItem.hasActive) | ||
39 | 39 | | |||
40 | Rectangle { | 40 | Rectangle { | ||
41 | id: unityRect | 41 | id: unityRect | ||
42 | anchors.fill: parent | 42 | anchors.fill: parent | ||
43 | anchors.margins: 4 | | |||
44 | visible: rootItem.isActive || (rootItem.isWindow && rootItem.hasShown) | 43 | visible: rootItem.isActive || (rootItem.isWindow && rootItem.hasShown) | ||
45 | 44 | | |||
46 | radius: rootItem.iconSize / 12 | 45 | radius: rootItem.iconSize / 12 | ||
47 | color: { | 46 | color: rootItem.backgroundColor | ||
48 | if (rootItem.inAttention) { | | |||
49 | return theme.negativeTextColor; | | |||
50 | } | | |||
51 | | ||||
52 | if (isActive) { | | |||
53 | return theme.buttonFocusColor; | | |||
54 | } | | |||
55 | | ||||
56 | return rootItem.backgroundColor; | | |||
57 | } | | |||
58 | clip: true | 47 | clip: true | ||
59 | } | 48 | } | ||
60 | 49 | | |||
61 | RadialGradient{ | 50 | RadialGradient{ | ||
62 | id: glowGradient | 51 | id: glowGradient | ||
63 | anchors.verticalCenter: parent.top | 52 | anchors.verticalCenter: parent.top | ||
64 | anchors.horizontalCenter: parent.horizontalCenter | 53 | anchors.horizontalCenter: parent.horizontalCenter | ||
65 | width: parent.width - unityRect.anchors.margins * 2 - 1 | 54 | width: parent.width - unityRect.anchors.margins * 2 - 1 | ||
66 | height: (width * 0.85) - unityRect.anchors.margins * 2 - 1 | 55 | height: (width * 0.85) - unityRect.anchors.margins * 2 - 1 | ||
67 | visible: false | 56 | visible: false | ||
68 | 57 | | |||
69 | gradient: Gradient { | 58 | gradient: Gradient { | ||
70 | GradientStop { position: 0.0; | 59 | GradientStop { position: 0.0; | ||
71 | color: { | 60 | color: { | ||
72 | if (rootItem.inAttention) { | | |||
73 | return Qt.lighter(theme.negativeTextColor, 1.5) | | |||
74 | } | | |||
75 | | ||||
76 | if (isActive) { | | |||
77 | return Qt.lighter(theme.buttonFocusColor, 1.5) | | |||
78 | } | | |||
79 | | ||||
80 | if (rootItem.isMinimized) { | 61 | if (rootItem.isMinimized) { | ||
81 | return "#aafcfcfc"; | 62 | return "#aafcfcfc"; | ||
82 | } | 63 | } | ||
83 | 64 | | |||
84 | return rootItem.glowColor; | 65 | return rootItem.glowColor; | ||
85 | } | 66 | } | ||
86 | } | 67 | } | ||
87 | GradientStop { position: 0.6; color: "transparent" } | 68 | GradientStop { position: 0.6; color: "transparent" } | ||
Show All 20 Lines | 87 | OpacityMask { | |||
108 | source: glowGradient | 89 | source: glowGradient | ||
109 | maskSource: gradientMask | 90 | maskSource: gradientMask | ||
110 | visible: unityRect.visible || borderRectangle.visible | 91 | visible: unityRect.visible || borderRectangle.visible | ||
111 | } | 92 | } | ||
112 | 93 | | |||
113 | Rectangle { | 94 | Rectangle { | ||
114 | id: borderRectangle | 95 | id: borderRectangle | ||
115 | anchors.fill: parent | 96 | anchors.fill: parent | ||
116 | anchors.margins: 4 | | |||
117 | visible: (rootItem.isTask && rootItem.isWindow) || (rootItem.isApplet && rootItem.isActive) | 97 | visible: (rootItem.isTask && rootItem.isWindow) || (rootItem.isApplet && rootItem.isActive) | ||
118 | color: "transparent" | 98 | color: "transparent" | ||
119 | border.width: Math.max(1, rootItem.iconSize / 64) | 99 | border.width: Math.max(1, rootItem.iconSize / 64) | ||
120 | border.color: "#606060" | 100 | border.color: "#606060" | ||
121 | radius: unityRect.radius | 101 | radius: unityRect.radius | ||
122 | clip: true | 102 | clip: true | ||
123 | 103 | | |||
124 | Rectangle { | 104 | Rectangle { | ||
Show All 10 Lines |