-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
smith
committed
Nov 1, 2020
1 parent
66ea1d6
commit 2f12ce4
Showing
2 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import QtQuick 2.14 | ||
import QtGraphicalEffects 1.14 | ||
|
||
Item { | ||
id: pointer | ||
width: 5 | ||
height: 5 | ||
|
||
property color color: '#000000' | ||
property bool glow: false | ||
|
||
RectangularGlow { | ||
id: effect | ||
anchors.fill: rect | ||
glowRadius: 8 | ||
spread: 0.1 | ||
color: rect.color | ||
cornerRadius: rect.radius + glowRadius | ||
|
||
visible: scale > 0 | ||
scale: glow ? 1 : 0 | ||
Behavior on scale { | ||
NumberAnimation { | ||
target: effect | ||
property: 'scale' | ||
duration: store.state.animation.duration | ||
} | ||
} | ||
} | ||
|
||
Rectangle { | ||
id: rect | ||
anchors.fill: parent | ||
radius: width | ||
color: pointer.color | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import QtQuick 2.14 | ||
import org.muelle.extra 1.0 as Muelle | ||
|
||
Flow { | ||
id: indicator | ||
|
||
flow: $layout.isHorizontal ? Flow.LeftToRight : Flow.TopToBottom | ||
spacing: 2 | ||
padding: 2 | ||
|
||
property bool isActive: false | ||
property bool isGroupParent: false | ||
property bool isLauncher: false | ||
property bool isDemandingAttention: false | ||
|
||
visible: !isLauncher | ||
|
||
readonly property color colorNormal: '#828282' | ||
readonly property color colorAttention: '#F2994A' | ||
readonly property color colorActive: '#2D9CDB' | ||
|
||
readonly property color color: | ||
isDemandingAttention | ||
? colorAttention | ||
: isActive | ||
? colorActive | ||
: colorNormal | ||
|
||
Pointer { | ||
color: indicator.color | ||
glow: isActive || isDemandingAttention | ||
} | ||
Pointer { | ||
visible: isGroupParent | ||
color: indicator.color | ||
glow: isActive || isDemandingAttention | ||
} | ||
|
||
StateLayoutEdge { | ||
reset: AnchorChanges { | ||
target: indicator | ||
anchors { | ||
top: undefined | ||
right: undefined | ||
bottom: undefined | ||
left: undefined | ||
verticalCenter: undefined | ||
horizontalCenter: undefined | ||
} | ||
} | ||
top: AnchorChanges { | ||
target: indicator | ||
anchors { | ||
top: parent.top | ||
horizontalCenter: parent.horizontalCenter | ||
} | ||
} | ||
right: AnchorChanges { | ||
target: indicator | ||
anchors { | ||
right: parent.right | ||
verticalCenter: parent.verticalCenter | ||
} | ||
} | ||
bottom: AnchorChanges { | ||
target: indicator | ||
anchors { | ||
bottom: parent.bottom | ||
horizontalCenter: parent.horizontalCenter | ||
} | ||
} | ||
left: AnchorChanges { | ||
target: indicator | ||
anchors { | ||
left: parent.left | ||
verticalCenter: parent.verticalCenter | ||
} | ||
} | ||
} | ||
} |