Skip to content

Commit f268b42

Browse files
committed
Improvements to various components
1 parent 7c4d86d commit f268b42

File tree

4 files changed

+164
-0
lines changed

4 files changed

+164
-0
lines changed

ListItems/qmldir

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module Material.ListItems
2+
BaseListItem 0.1 BaseListItem.qml
3+
Standard 0.1 Standard.qml
4+
Subtitled 0.1 Subtitled.qml

MainView.qml

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
/*
2+
* QML Air - A lightweight and mostly flat UI widget collection for QML
3+
* Copyright (C) 2014 Michael Spencer
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
import QtQuick 2.0
19+
import QtQuick.Window 2.0
20+
21+
Item {
22+
id: app
23+
24+
//opacity: 0.5
25+
26+
width: units.gu(120)
27+
height: units.gu(80)
28+
29+
default property alias content: contents.data
30+
31+
property alias theme: __theme
32+
33+
Theme {
34+
id: __theme
35+
}
36+
37+
property alias units: __units
38+
39+
property real scale: Screen.pixelDensity * 1.2// pixels/mm
40+
41+
property alias device: __device
42+
43+
QtObject {
44+
id: __device
45+
46+
property string mode: "desktop"
47+
}
48+
49+
property alias animations: __animations
50+
51+
QtObject {
52+
id: __animations
53+
54+
property int pageTransition: 250
55+
}
56+
57+
QtObject {
58+
id: __units
59+
60+
function mm(number) {
61+
return number * scale
62+
}
63+
64+
function dp(number) {
65+
return number * scale * 0.15
66+
}
67+
68+
function gu(number) {
69+
return dp(number * 8)
70+
}
71+
}
72+
73+
property alias i18n: __i18n
74+
75+
QtObject {
76+
id: __i18n
77+
78+
function tr(text) {
79+
return text
80+
}
81+
}
82+
83+
Rectangle {
84+
id: contents
85+
anchors {
86+
left: parent.left
87+
right: parent.right
88+
top: parent.top
89+
bottom: parent.bottom
90+
}
91+
92+
color: theme.defaultBackground
93+
94+
Rectangle {
95+
id: overlay
96+
anchors.fill: parent
97+
color: "black"
98+
opacity: drawer && drawer.showing ? 0.4 : 0
99+
visible: opacity > 0
100+
z: 10
101+
102+
MouseArea {
103+
anchors.fill: parent
104+
onClicked: drawer.close()
105+
}
106+
}
107+
}
108+
109+
property NavigationDrawer drawer
110+
}

ProgressBar.qml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* QML Air - A lightweight and mostly flat UI widget collection for QML
3+
* Copyright (C) 2014 Michael Spencer
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
import QtQuick 2.0
19+
import ".."
20+
21+
Item {
22+
23+
property real progress
24+
property alias color: bar.color
25+
26+
height: progress > 0 && progress < 1 ? units.dp(4) : 0
27+
28+
Behavior on height {
29+
NumberAnimation { duration: 200 }
30+
}
31+
32+
Rectangle {
33+
radius: units.dp(2)
34+
color: theme.secondary
35+
opacity: 0.2
36+
37+
anchors.fill: parent
38+
}
39+
40+
Rectangle {
41+
id: bar
42+
43+
radius: units.dp(2)
44+
height: parent.height
45+
width: parent.width * progress
46+
color: theme.secondary
47+
}
48+
}

qmldir

+2
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ Icon 0.1 Icon.qml
44
Label 0.1 Label.qml
55
Toolbar 0.1 Toolbar.qml
66
View 0.1 View.qml
7+
ProgressBar 0.1 ProgressBar.qml
8+
MainView 0.1 MainView.qml

0 commit comments

Comments
 (0)