Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SDK
Kirigami Gallery
Commits
970dec79
Verified
Commit
970dec79
authored
Sep 12, 2022
by
ivan tkachenko
Browse files
ProgressBarGallery: Fix layout, replace timer with smooth animation
parent
d97fd10e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/data/contents/ui/gallery/ProgressBarGallery.qml
View file @
970dec79
/*
* Copyright 2015 Marco Martin <mart@kde.org>
* Copyright 2022 ivan tkachenko <me@ratijas.tk>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
...
...
@@ -47,22 +48,15 @@ ScrollablePage {
ColumnLayout
{
width
:
page
.
width
Timer
{
id
:
timer
property
int
value
:
0
interval
:
80
repeat
:
true
running
:
true
onTriggered
:
{
value
=
(
value
+
1
)
%
100
}
}
GridLayout
{
anchors.centerIn
:
parent
Layout.alignment
:
Qt
.
AlignHCenter
Layout.fillWidth
:
true
Layout.leftMargin
:
Units
.
gridUnit
Layout.rightMargin
:
Units
.
gridUnit
rowSpacing
:
Units
.
largeSpacing
columns
:
2
width
:
parent
.
width
-
Units
.
gridUnit
*
2
Controls.Label
{
text
:
"
Determinate:
"
...
...
@@ -71,8 +65,22 @@ ScrollablePage {
Controls.ProgressBar
{
from
:
0
to
:
100
value
:
timer
.
value
Layout.maximumWidth
:
Units
.
gridUnit
*
10
SequentialAnimation
on
value
{
running
:
true
loops
:
Animation
.
Infinite
NumberAnimation
{
from
:
0
to
:
100
duration
:
8000
easing.type
:
Easing
.
Linear
}
PauseAnimation
{
duration
:
1000
}
}
}
Controls.Label
{
text
:
"
Indeterminate:
"
...
...
@@ -89,7 +97,7 @@ ScrollablePage {
Layout.alignment
:
Qt
.
AlignRight
}
Controls.BusyIndicator
{
}
Controls.Label
{
text
:
"
Inactive indicator:
"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment