aboutsummaryrefslogtreecommitdiff
path: root/demos/widgetsgallery
diff options
context:
space:
mode:
authorThomas Moenicke <thomas.moenicke@nokia.com>2010-07-27 15:41:36 +0300
committerTomas Junnonen <tomas.junnonen@nokia.com>2010-08-04 16:53:09 +0300
commit87e81fb6f3293040ea5fe259062bed8bb07e2e78 (patch)
treef036226d95809e5cf45ad37b7387a094097017e3 /demos/widgetsgallery
parentec5e7a096e93c65bd64cce0a9ef6478be50c9c55 (diff)
Changes: re-enables right-to-left mode for progress bar, reorganized CSS structure, added unknown animation cache
RevBy: Sergiy Dubovik, Tomas Junnonen Details: fixed rtl mode, CSS structure holds texture for known and unknown progress bar, each texture can be tiled or stretched, one mask that describes the shape of the bar, unknown duration bar can have 100% width with animation, background.
Diffstat (limited to 'demos/widgetsgallery')
-rw-r--r--demos/widgetsgallery/progressbarpage.cpp19
-rw-r--r--demos/widgetsgallery/progressbarpage.h1
2 files changed, 10 insertions, 10 deletions
diff --git a/demos/widgetsgallery/progressbarpage.cpp b/demos/widgetsgallery/progressbarpage.cpp
index de34b1e2..c8f429ee 100644
--- a/demos/widgetsgallery/progressbarpage.cpp
+++ b/demos/widgetsgallery/progressbarpage.cpp
@@ -18,7 +18,7 @@
****************************************************************************/
#include "progressbarpage.h"
-#include <QPropertyAnimation>
+
#include <MButton>
#include <MLabel>
#include <MTheme>
@@ -27,13 +27,15 @@
#include <MGridLayoutPolicy>
#include <MProgressIndicator>
#include <MSceneManager>
+#include <QPropertyAnimation>
ProgressBarPage::ProgressBarPage() :
TemplatePage(TemplatePage::SimpleWidgets),
bar1(0),
bar2(0),
label1(0),
- label2(0)
+ label2(0),
+ position(0)
{
}
@@ -53,16 +55,16 @@ void ProgressBarPage::createContent()
label1 = new MLabel();
containerPolicy->addItem(label1);
- bar1 = new MProgressIndicator(centralWidget(), MProgressIndicator::barType);
+ bar1 = new MProgressIndicator(0, MProgressIndicator::barType);
// Since range's type is int, we want a fairly large number here, to get a smooth animation
- bar1->setRange(0, 400);
+ bar1->setRange(0, 1000);
bar1->setValue(0);
containerPolicy->addItem(bar1);
label2 = new MLabel();
containerPolicy->addItem(label2);
- bar2 = new MProgressIndicator(centralWidget(), MProgressIndicator::barType);
+ bar2 = new MProgressIndicator(0, MProgressIndicator::barType);
bar2->setRange(0, 9);
bar2->setUnknownDuration(true);
containerPolicy->addItem(bar2);
@@ -72,15 +74,12 @@ void ProgressBarPage::createContent()
animation->setLoopCount(-1);
// start and end value should match bar1's range
animation->setStartValue(0);
- animation->setEndValue(400);
- // 10 ms to fill the bar
+ animation->setEndValue(1000);
+ // 10 seconds to fill the bar
animation->setDuration(10000);
animation->start();
retranslateUi();
-
- connect(this, SIGNAL(displayEntered()), animation, SLOT(start()));
- connect(this, SIGNAL(displayExited()), animation, SLOT(stop()));
}
void ProgressBarPage::retranslateUi()
diff --git a/demos/widgetsgallery/progressbarpage.h b/demos/widgetsgallery/progressbarpage.h
index df6508bc..223c8a84 100644
--- a/demos/widgetsgallery/progressbarpage.h
+++ b/demos/widgetsgallery/progressbarpage.h
@@ -43,6 +43,7 @@ private:
MProgressIndicator *bar2;
MLabel *label1;
MLabel *label2;
+ int position;
};
#endif // PROGRESSBARPAGE_H