Skip to content

Commit

Permalink
Merge pull request #39 from neochapay/5.2
Browse files Browse the repository at this point in the history
Add scaling
  • Loading branch information
locusf authored Apr 11, 2017
2 parents 921bbd9 + e96571c commit d20c032
Show file tree
Hide file tree
Showing 21 changed files with 273 additions and 94 deletions.
10 changes: 5 additions & 5 deletions examples/touch/content/TabBarPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,23 @@ Page {
frame: Item { }
tab: Item {
implicitWidth: control.width/control.count
implicitHeight: 50
implicitHeight: size.dp(50)
BorderImage {
anchors.fill: parent
border.bottom: 8
border.top: 8
border.bottom: size.dp(8)
border.top: size.dp(8)
source: styleData.selected ? "../images/tab_selected.png":"../images/tabs_standard.png"
Text {
anchors.centerIn: parent
color: "white"
text: styleData.title.toUpperCase()
font.pixelSize: 16
font.pixelSize: size.dp(16)
}
Rectangle {
visible: index > 0
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.margins: 10
anchors.margins: size.dp(10)
width:1
color: "#3a3a3a"
}
Expand Down
22 changes: 11 additions & 11 deletions examples/touch/content/TextInputPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -65,36 +65,36 @@ Page {
headerTools: HeaderToolsLayout { showBackButton: true; title: "Text input" }

Column {
spacing: 40
spacing: size.dp(40)
anchors.centerIn: parent

TextField {
anchors.margins: 20
anchors.margins: size.dp(20)
text: "Text input"
//style: touchStyle
}

TextField {
anchors.margins: 20
anchors.margins: size.dp(20)
text: "Readonly Text input"
//style: touchStyle
readOnly: true
}

TextField {
anchors.margins: 20
anchors.margins: size.dp(20)
text: "Disabled textfield"
enabled: false
}

TextField {
anchors.margins: 20
anchors.margins: size.dp(20)
text: "Text input"
style: touchStyle
}

TextField {
anchors.margins: 20
anchors.margins: size.dp(20)
text: "Readonly Text input"
style: touchStyle
readOnly: true
Expand All @@ -107,14 +107,14 @@ Page {

TextFieldStyle {
textColor: "white"
font.pixelSize: 28
font.pixelSize: size.dp(28)
background: Item {
implicitHeight: 50
implicitWidth: 320
implicitHeight: size.dp(50)
implicitWidth: size.dp(320)
BorderImage {
source: "../images/textinput.png"
border.left: 8
border.right: 8
border.left: size.dp(8)
border.right: size.dp(8)
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
Expand Down
2 changes: 1 addition & 1 deletion rpm/qtquickcontrols-nemo.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name: qt5-qtquickcontrols-nemo
Summary: Nemomobile Qt Quick Controls
Version: 5.1.3
Version: 5.2.0
Release: nemo1
Group: Qt/Qt
License: LGPLv2.1 with exception or GPLv3
Expand Down
11 changes: 5 additions & 6 deletions src/controls/ButtonRow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Rectangle {
id: main
width: childrenRect.width
color: "#313131"
height: 40
height: size.dp(40)
property ListModel model: ListModel {}
property bool enabled: true
property int currentIndex: -1
Expand All @@ -51,10 +51,10 @@ Rectangle {
Rectangle{
id: selecter
x: rowElement.children[main.currentIndex].x || 0
y: -5
y: size.dp(-5)

width: rowElement.children[main.currentIndex].width || 0
height: 50
height: size.dp(50)
color: "#0091e5"

visible: main.currentIndex > -1
Expand All @@ -74,11 +74,9 @@ Rectangle {
model: main.model
delegate: Rectangle {
id: rowItem
height: 50
height: size.dp(40)
width: text.width+(text.width/name.length*2)

y: -5

color: "transparent"
MouseArea {
width: parent.width
Expand All @@ -93,6 +91,7 @@ Rectangle {
Label {
id: text
text: name
height: parent.heigh

anchors.horizontalCenter: parent.horizontalCenter

Expand Down
12 changes: 6 additions & 6 deletions src/controls/GlacierRoller.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Item {
id: label
visible: label.text != ""
font.capitalization: Font.AllUppercase
font.pixelSize: 14
font.pixelSize: size.dp(14)
color: "white"

anchors{
Expand Down Expand Up @@ -51,19 +51,19 @@ Item {

PathView{
id: view
property int itemHeight: 40
property int itemHeight: size.dp(40)
property bool showRow: false

interactive: activated
width: parent.width-60
height: 40
width: parent.width-size.dp(60)
height: size.dp(40)
clip: true

anchors{
top: label.top
topMargin: 20
topMargin: size.dp(20)
left: label.left
leftMargin: 30
leftMargin: size.dp(30)
}

pathItemCount: height/itemHeight
Expand Down
4 changes: 2 additions & 2 deletions src/controls/Header.qml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Item {
PropertyChanges {
target: toolBarRect
width: parent.width
height: 75
height: size.dp(75)
}
},
State {
Expand Down Expand Up @@ -91,7 +91,7 @@ Item {
}
PropertyChanges {
target: toolBarRect
width: 75
width: size.dp(75)
height: parent.height
}
}
Expand Down
22 changes: 11 additions & 11 deletions src/controls/HeaderToolsLayout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ Item {

Rectangle {
id: backButton
width: opacity ? 60 : 0
anchors.leftMargin: 20
width: opacity ? size.dp(60) : 0
anchors.leftMargin: size.dp(20)
//check if Stack.view has already been initialized as well
anchors.verticalCenter: parent.verticalCenter
antialiasing: true
height: width
radius: 4
radius: size.dp(4)
color: backmouse.pressed ? "#222" : "transparent"

rotation: isUiPortrait ? 0 : 90
Expand All @@ -46,7 +46,7 @@ Item {
MouseArea {
id: backmouse
anchors.fill: parent
anchors.margins: -10
anchors.margins: size.dp(-10)
onClicked: header && header.stackView && header.stackView.pop()
}
}
Expand All @@ -56,16 +56,16 @@ Item {
anchors.right: toolButtonsContainer.left
anchors.left: backButton.visible ? backButton.right : parent.left
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 20
anchors.rightMargin: 20
anchors.leftMargin: size.dp(20)
anchors.rightMargin: size.dp(20)
clip: true
font.family: Theme.fontFamily
color: Theme.label.color
font.pointSize: 24
font.pointSize: size.dp(24)
font.weight: Font.Bold
LinearGradient {
anchors.right: parent.right
width: 50
width: size.dp(50)
height: parent.paintedHeight
visible: titleTxt.paintedWidth > titleTxt.width
start: Qt.point(0,0)
Expand All @@ -79,9 +79,9 @@ Item {
Item {
id: toolButtonsContainer
anchors.right: dots.visible ? dots.left : parent.right
anchors.rightMargin: 20
anchors.rightMargin: size.dp(20)
anchors.verticalCenter: parent.verticalCenter
width: tools ? (50 * Math.min(maxNumberOfToolButtons, tools.length)) : 0
width: tools ? (size.dp(50) * Math.min(maxNumberOfToolButtons, tools.length)) : 0

property int maxNumberOfToolButtons: 3

Expand All @@ -107,7 +107,7 @@ Item {
Image {
id: dots
anchors.right: parent.right
anchors.rightMargin: 20
anchors.rightMargin: size.dp(20)
anchors.verticalCenter: parent.verticalCenter
visible: drawerLevels && drawerLevels.length > 1
source: "../Styles/Nemo/images/dots-vertical.png"
Expand Down
2 changes: 1 addition & 1 deletion src/controls/Label.qml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ Text {
renderType: Text.NativeRendering
font.family: Theme.fontFamily
color: Theme.label.color
font.pointSize: Theme.label.pointSize
font.pointSize: size.dp(Theme.label.pointSize)
}
18 changes: 9 additions & 9 deletions src/controls/ListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ ListView {
id: sectionHeading
Rectangle {
width: listView.width
height: 44
height: size.dp(44)
color: "black"

Text {
id: sectionText
text: section
font.capitalization: Font.AllUppercase
font.pixelSize: 20
font.pixelSize: size.dp(20)
color: "white"
anchors{
left: parent.left
leftMargin: 10
leftMargin: size.dp(10)
verticalCenter: parent.verticalCenter
}
}
Expand All @@ -35,10 +35,10 @@ ListView {
id: line
height: 1
color: "white"
width: listView.width-sectionText.width-30
width: listView.width-sectionText.width-size.dp(30)
anchors{
left: sectionText.right
leftMargin: 10
leftMargin: size.dp(10)
verticalCenter: sectionText.verticalCenter
}
}
Expand All @@ -48,15 +48,15 @@ ListView {
Item{
id: bottom
width: parent.width
height: 30
height: size.dp(30)
anchors.bottom: parent.bottom

visible: listView.contentHeight > listView.height

LinearGradient{
anchors.fill: parent
start: Qt.point(0, 0)
end: Qt.point(0, 30)
end: Qt.point(0, size.dp(30))
gradient: Gradient {
GradientStop { position: 0.0; color: "transparent" }
GradientStop { position: 1.0; color: "black" }
Expand All @@ -70,13 +70,13 @@ ListView {
visible: (listView.showDecorator && listView.contentHeight > listView.height)
color: "#0091e5"

width: 5
width: size.dp(5)
height: listView.height*listView.height/listView.contentHeight
y: (listView.height)/listView.contentHeight*listView.contentY

anchors{
right: listView.right
rightMargin: 4
rightMargin: size.dp(4)
}
}
}
Expand Down
Loading

0 comments on commit d20c032

Please sign in to comment.