Home
Phabricator
Search
Log In
Files
F6755221
TimeoutIndicator.qml
GB_2 (Björn Feber)
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Author
GB_2
Created
Apr 5 2019, 6:18 PM
Size
752 B
Mime Type
text/plain
Engine
blob
Format
Raw Data
Handle
4256843
Attached To
D20266: Add new notification plasmoid
TimeoutIndicator.qml
View Options
import
QtQuick
2.0
import
org
.
kde
.
plasma
.
core
2.0
Canvas
{
property
color
highlightColor:
theme
.
highlightColor
property
var
num:
0
NumberAnimation
on
num
{
to:
360
;
duration:
5000
}
onNumChanged:
{
requestPaint
()
}
anchors.fill:
parent
onPaint:
{
var
ctx
=
getContext
(
"2d"
);
ctx
.
reset
();
var
centerX
=
width
/
2
;
var
centerY
=
height
/
2
;
ctx
.
beginPath
();
ctx
.
fillStyle
=
highlightColor
;
ctx
.
moveTo
(
centerX
,
centerY
);
ctx
.
arc
(
centerX
,
centerY
,
units
.
iconSizes
.
tiny
,
toRadians
(
num
),
toRadians
(
360
));
ctx
.
lineTo
(
centerX
,
centerY
);
ctx
.
fill
();
}
function
toRadians
(
deg
)
{
return
(
deg
-
90
)
*
Math
.
PI
/
180
}
}
Log In to Comment