~jocave/checkbox/hybrid-amd-gpu-mods

« back to all changes in this revision

Viewing changes to checkbox-touch/components/ProgressBox.qml

  • Committer: Tarmac
  • Author(s): Brendan Donegan
  • Date: 2013-06-03 11:12:58 UTC
  • mfrom: (2154.2.1 bug1185759)
  • Revision ID: tarmac-20130603111258-1b3m5ydvkf1accts
"[r=zkrynicki][bug=1185759][author=brendan-donegan] automatic merge by tarmac"

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * This file is part of Checkbox
3
 
 *
4
 
 * Copyright 2014 Canonical Ltd.
5
 
 *
6
 
 * Authors:
7
 
 * - Maciej Kisielewski <maciej.kisielewski@canonical.com>
8
 
 *
9
 
 * This program is free software; you can redistribute it and/or modify
10
 
 * it under the terms of the GNU General Public License as published by
11
 
 * the Free Software Foundation; version 3.
12
 
 *
13
 
 * This program is distributed in the hope that it will be useful,
14
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 
 * GNU General Public License for more details.
17
 
 *
18
 
 * You should have received a copy of the GNU General Public License
19
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
 
 */
21
 
 
22
 
import QtQuick 2.0
23
 
import Ubuntu.Components 1.1
24
 
import QtQuick.Layouts 1.1
25
 
 
26
 
/*! \brief Progress Box.
27
 
    \inherits Item
28
 
 
29
 
    This widget is a ProgressBar-like item with some changes compared to
30
 
    ProgressBar found in Ubuntu Components. This one uses layouts, so it can
31
 
    fills the width of the components it is placed in. ProgressBox can display
32
 
    an information about the progress prefixes by text set in `interlude` var.
33
 
    If the box is to be narrower then the space required by full text,
34
 
    interlude is ommited. The formatting of the text is as follows:
35
 
    "$interlude $vlaue / $maximumValue"
36
 
*/
37
 
 
38
 
Item {
39
 
    id: progressBox
40
 
 
41
 
    /*!
42
 
      Value to be used when filling progress bar.
43
 
      */
44
 
    property alias value: progressBar.value
45
 
 
46
 
    /*!
47
 
      Progress bar is entirely when value reaches maximumValue
48
 
     */
49
 
    property real maximumValue: 100
50
 
 
51
 
    implicitWidth: units.gu(38)
52
 
    implicitHeight: units.gu(0.3)
53
 
 
54
 
 
55
 
    StyledItem {
56
 
        id: progressBar
57
 
        anchors.fill: parent
58
 
 
59
 
        property real value: 50
60
 
        property real maximumValue: progressBox.maximumValue
61
 
        property real minimumValue: 0
62
 
        property bool showProgressPercentage: false // for compability with underlaying styling
63
 
        property bool indeterminate: false // for compability with underlaying styling
64
 
        style: Theme.createStyleComponent("ProgressBarStyle.qml", progressBar)
65
 
 
66
 
    }
67
 
}