Skip to content

Commit

Permalink
Rename units -> Units
Browse files Browse the repository at this point in the history
Updates the units singleton to use standard upper case naming. Using lower case singletons seems to cause issues in QT, specifically when the QML debugger is attached, as well as other oddities. This seems to take care of those issues.

- Closes papyros#129
  • Loading branch information
iBelieve committed May 4, 2015
1 parent bd6297a commit d195e13
Show file tree
Hide file tree
Showing 65 changed files with 396 additions and 396 deletions.
6 changes: 3 additions & 3 deletions demo/ButtonDemo.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Item {

Column {
anchors.centerIn: parent
spacing: units.dp(20)
spacing: Units.dp(20)

Button {
text: "Simple Button"
Expand All @@ -30,7 +30,7 @@ Item {
Button {
text: "Wide Button"

width: units.dp(200)
width: Units.dp(200)
elevation: 1
anchors.horizontalCenter: parent.horizontalCenter

Expand Down Expand Up @@ -70,7 +70,7 @@ Item {
anchors {
right: parent.right
bottom: parent.bottom
margins: units.dp(32)
margins: Units.dp(32)
}

iconName: "content/add"
Expand Down
4 changes: 2 additions & 2 deletions demo/CheckBoxDemo.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ ColumnLayout {
Rectangle {
Layout.fillHeight: true
Layout.fillWidth: true
Layout.minimumHeight: grid.height + units.dp(80)
Layout.minimumWidth: grid.width + units.dp(80)
Layout.minimumHeight: grid.height + Units.dp(80)
Layout.minimumWidth: grid.width + Units.dp(80)
color: index == 0 ? "#EEE" : "#333"

GridLayout {
Expand Down
34 changes: 17 additions & 17 deletions demo/ColorPaletteDemo.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Item {
id: palette
anchors.centerIn: parent
width: parent.width
columns: parseInt(parent.width / units.dp(300)) || 1
rowSpacing: units.dp(20)
columns: parseInt(parent.width / Units.dp(300)) || 1
rowSpacing: Units.dp(20)

Repeater {
model: [ "Red", "Pink", "Purple", "Deep Purple", "Indigo",
Expand All @@ -38,19 +38,19 @@ Item {

ColumnLayout {
Layout.alignment: Qt.AlignCenter
spacing: units.dp(5)
spacing: Units.dp(5)
property var currentColor: modelData.charAt(0).toLowerCase() +
modelData.slice(1).replace(" ", "")

Rectangle {
width: units.dp(300)
height: units.dp(126)
width: Units.dp(300)
height: Units.dp(126)
color: Palette.colors[currentColor]["500"]

Label {
anchors.top: parent.top
anchors.left: parent.left
anchors.margins: units.dp(16)
anchors.margins: Units.dp(16)
text: modelData
style: "body2"
color: Theme.lightDark(parent.color,
Expand All @@ -61,7 +61,7 @@ Item {
Label {
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.margins: units.dp(16)
anchors.margins: Units.dp(16)
text: "500"
style: "body2"
color: Theme.lightDark(parent.color,
Expand All @@ -72,7 +72,7 @@ Item {
Label {
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: units.dp(16)
anchors.margins: Units.dp(16)
text: Palette.colors[currentColor]["500"]
style: "body2"
color: Theme.lightDark(parent.color,
Expand All @@ -88,13 +88,13 @@ Item {
model: ["100", "200", "300", "400", "600", "700", "800", "900"]

Rectangle {
width: units.dp(300)
height: units.dp(46)
width: Units.dp(300)
height: Units.dp(46)
color: Palette.colors[currentColor][modelData]

Label {
anchors.left: parent.left
anchors.margins: units.dp(16)
anchors.margins: Units.dp(16)
anchors.verticalCenter: parent.verticalCenter
text: modelData
style: "body2"
Expand All @@ -105,7 +105,7 @@ Item {

Label {
anchors.right: parent.right
anchors.margins: units.dp(16)
anchors.margins: Units.dp(16)
anchors.verticalCenter: parent.verticalCenter
text: Palette.colors[currentColor][modelData]
style: "body2"
Expand All @@ -125,13 +125,13 @@ Item {
model: visible ? ["A100", "A200", "A400", "A700"] : 0

Rectangle {
width: units.dp(300)
height: units.dp(46)
width: Units.dp(300)
height: Units.dp(46)
color: Palette.colors[currentColor][modelData]

Label {
anchors.left: parent.left
anchors.margins: units.dp(16)
anchors.margins: Units.dp(16)
anchors.verticalCenter: parent.verticalCenter
text: modelData
style: "body2"
Expand All @@ -142,7 +142,7 @@ Item {

Label {
anchors.right: parent.right
anchors.margins: units.dp(16)
anchors.margins: Units.dp(16)
anchors.verticalCenter: parent.verticalCenter
text: Palette.colors[currentColor][modelData]
style: "body2"
Expand All @@ -156,4 +156,4 @@ Item {
}
}
}
}
}
34 changes: 17 additions & 17 deletions demo/CustomIconsDemo.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Column {

Row {
Item {
width: units.dp(56)
height: units.dp(56)
width: Units.dp(56)
height: Units.dp(56)

Icon {
anchors.centerIn: parent
Expand All @@ -41,8 +41,8 @@ Column {
}

Item {
width: units.dp(56)
height: units.dp(56)
width: Units.dp(56)
height: Units.dp(56)

Icon {
anchors.centerIn: parent
Expand All @@ -52,8 +52,8 @@ Column {
}

Rectangle {
width: units.dp(56)
height: units.dp(56)
width: Units.dp(56)
height: Units.dp(56)
color: "#333"
Icon {
anchors.centerIn: parent
Expand All @@ -63,8 +63,8 @@ Column {
}

Rectangle {
width: units.dp(56)
height: units.dp(56)
width: Units.dp(56)
height: Units.dp(56)
color: "#333"
Icon {
anchors.centerIn: parent
Expand All @@ -80,8 +80,8 @@ Column {

Row {
Item {
width: units.dp(56)
height: units.dp(40)
width: Units.dp(56)
height: Units.dp(40)

Icon {
anchors.centerIn: parent
Expand All @@ -91,8 +91,8 @@ Column {
}

Item {
width: units.dp(56)
height: units.dp(40)
width: Units.dp(56)
height: Units.dp(40)

Icon {
anchors.centerIn: parent
Expand All @@ -108,8 +108,8 @@ Column {

Row {
Item {
width: units.dp(56)
height: units.dp(40)
width: Units.dp(56)
height: Units.dp(40)

IconButton {
anchors.centerIn: parent
Expand All @@ -119,8 +119,8 @@ Column {
}

Item {
width: units.dp(56)
height: units.dp(40)
width: Units.dp(56)
height: Units.dp(40)

IconButton {
anchors.centerIn: parent
Expand All @@ -129,4 +129,4 @@ Column {
}
}
}
}
}
2 changes: 1 addition & 1 deletion demo/DialogDemo.qml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Item {

Column {
anchors.centerIn: parent
spacing: units.dp(20)
spacing: Units.dp(20)

Button {
text: "Show Action Dialog"
Expand Down
20 changes: 10 additions & 10 deletions demo/FormsDemo.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ Item {
View {
anchors.centerIn: parent

width: units.dp(350)
height: column.implicitHeight + units.dp(32)
width: Units.dp(350)
height: column.implicitHeight + Units.dp(32)

elevation: 1
radius: units.dp(2)
radius: Units.dp(2)

ColumnLayout {
id: column

anchors {
fill: parent
topMargin: units.dp(16)
bottomMargin: units.dp(16)
topMargin: Units.dp(16)
bottomMargin: Units.dp(16)
}

Label {
Expand All @@ -29,7 +29,7 @@ Item {
anchors {
left: parent.left
right: parent.right
margins: units.dp(16)
margins: Units.dp(16)
}

style: "title"
Expand All @@ -38,7 +38,7 @@ Item {

Item {
Layout.fillWidth: true
Layout.preferredHeight: units.dp(8)
Layout.preferredHeight: Units.dp(8)
}

ListItem.Standard {
Expand Down Expand Up @@ -115,16 +115,16 @@ Item {

Item {
Layout.fillWidth: true
Layout.preferredHeight: units.dp(8)
Layout.preferredHeight: Units.dp(8)
}

RowLayout {
Layout.alignment: Qt.AlignRight
spacing: units.dp(8)
spacing: Units.dp(8)

anchors {
right: parent.right
margins: units.dp(16)
margins: Units.dp(16)
}

Button {
Expand Down
Loading

0 comments on commit d195e13

Please sign in to comment.