Commit 03c77737 authored by eekkelund's avatar eekkelund

[Controls] Use Theme.sizes in controls for correct scaling. Fixes to make...

[Controls] Use Theme.sizes in controls for correct scaling. Fixes to make controls according to spec
parent af6f5fdc
...@@ -6,7 +6,7 @@ import QtQuick.Controls.Styles.Nemo 1.0 ...@@ -6,7 +6,7 @@ import QtQuick.Controls.Styles.Nemo 1.0
Page { Page {
id: listViewPage id: listViewPage
headerTools: HeaderToolsLayout { showBackButton: false; title: "MediumListView" } headerTools: HeaderToolsLayout { showBackButton: true; title: "MediumListView" }
ListModel { ListModel {
...@@ -36,6 +36,7 @@ Page { ...@@ -36,6 +36,7 @@ Page {
delegate: ListViewItemWithActions { delegate: ListViewItemWithActions {
label: name label: name
description: desc description: desc
showNext: false
} }
section.property: "size" section.property: "size"
} }
......
...@@ -43,6 +43,7 @@ Page { ...@@ -43,6 +43,7 @@ Page {
cancelText: "Cancel" cancelText: "Cancel"
acceptText: "Delete" acceptText: "Delete"
headingText: "Are you sure you want to delete this?" headingText: "Are you sure you want to delete this?"
subLabelText: "Continue?"
onAccepted: { onAccepted: {
result.text = "User accepted" result.text = "User accepted"
} }
......
...@@ -10,11 +10,11 @@ Page { ...@@ -10,11 +10,11 @@ Page {
allowedOrientations: Qt.PortraitOrientation | Qt.LandscapeOrientation | Qt.InvertedLandscapeOrientation | Qt.InvertedPortraitOrientation allowedOrientations: Qt.PortraitOrientation | Qt.LandscapeOrientation | Qt.InvertedLandscapeOrientation | Qt.InvertedPortraitOrientation
Column { Column {
spacing: 40 spacing: Theme.itemSpacingHuge
width: parent.width width: parent.width
anchors{ anchors{
top: parent.top top: parent.top
topMargin: 40 topMargin: Theme.itemSpacingHuge
} }
ListModel { ListModel {
...@@ -46,9 +46,10 @@ Page { ...@@ -46,9 +46,10 @@ Page {
delegate: GlacierRollerItem{ delegate: GlacierRollerItem{
Text{ Text{
height: simpleRoller.itemHeight height: simpleRoller.itemHeight
verticalAlignment: Text.AlignVCenter
text: name text: name
color: "white" color: Theme.textColor
font.pixelSize: 32 font.pixelSize: Theme.fontSizeMedium
font.bold: (simpleRoller.activated && simpleRoller.currentIndex === index) font.bold: (simpleRoller.activated && simpleRoller.currentIndex === index)
} }
} }
...@@ -65,9 +66,10 @@ Page { ...@@ -65,9 +66,10 @@ Page {
delegate: GlacierRollerItem{ delegate: GlacierRollerItem{
Text{ Text{
height: simpleRoller2.itemHeight height: simpleRoller2.itemHeight
verticalAlignment: Text.AlignVCenter
text: name text: name
color: "white" color: Theme.textColor
font.pixelSize: 32 font.pixelSize: Theme.fontSizeMedium
font.bold: (simpleRoller2.activated && simpleRoller2.currentIndex === index) font.bold: (simpleRoller2.activated && simpleRoller2.currentIndex === index)
} }
} }
......
...@@ -51,7 +51,7 @@ Page { ...@@ -51,7 +51,7 @@ Page {
TabView { TabView {
anchors.fill: parent anchors.fill: parent
style: touchStyle style: TabViewStyle { }
Tab { Tab {
title: "Buttons" title: "Buttons"
ButtonPage{ visible: true } ButtonPage{ visible: true }
...@@ -65,37 +65,4 @@ Page { ...@@ -65,37 +65,4 @@ Page {
ProgressBarPage{ visible: true } ProgressBarPage{ visible: true }
} }
} }
Component {
id: touchStyle
TabViewStyle {
tabsAlignment: Qt.AlignVCenter
tabOverlap: 0
frame: Item { }
tab: Item {
implicitWidth: control.width/control.count
implicitHeight: size.dp(50)
BorderImage {
anchors.fill: parent
border.bottom: size.dp(8)
border.top: size.dp(8)
source: styleData.selected ? "/usr/share/glacier-components/images/tab_selected.png":"/usr/share/glacier-components/images/tabs_standard.png"
Text {
anchors.centerIn: parent
color: "white"
text: styleData.title.toUpperCase()
font.pixelSize: size.dp(16)
}
Rectangle {
visible: index > 0
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.margins: size.dp(10)
width:1
color: "#3a3a3a"
}
}
}
}
}
} }
...@@ -65,34 +65,34 @@ Page { ...@@ -65,34 +65,34 @@ Page {
headerTools: HeaderToolsLayout { showBackButton: true; title: "Text input" } headerTools: HeaderToolsLayout { showBackButton: true; title: "Text input" }
Column { Column {
spacing: size.dp(40) spacing:Theme.itemSpacingHuge
anchors.centerIn: parent anchors.centerIn: parent
TextField { TextField {
anchors.margins: size.dp(20) anchors.margins: Theme.itemSpacingLarge
text: "Text input" text: "Text input"
} }
TextField { TextField {
anchors.margins: size.dp(20) anchors.margins: Theme.itemSpacingLarge
text: "Readonly Text input" text: "Readonly Text input"
readOnly: true readOnly: true
} }
TextField { TextField {
anchors.margins: size.dp(20) anchors.margins: Theme.itemSpacingLarge
text: "Disabled textfield" text: "Disabled textfield"
enabled: false enabled: false
} }
TextField { TextField {
anchors.margins: size.dp(20) anchors.margins: Theme.itemSpacingLarge
text: "Text input" text: "Text input"
style: touchStyle style: touchStyle
} }
TextField { TextField {
anchors.margins: size.dp(20) anchors.margins: Theme.itemSpacingLarge
text: "Readonly Text input" text: "Readonly Text input"
style: touchStyle style: touchStyle
readOnly: true readOnly: true
...@@ -104,15 +104,15 @@ Page { ...@@ -104,15 +104,15 @@ Page {
id: touchStyle id: touchStyle
TextFieldStyle { TextFieldStyle {
textColor: "white" textColor: Theme.textColor
font.pixelSize: size.dp(28) font.pixelSize: Theme.fontSizeMedium
background: Item { background: Item {
implicitHeight: size.dp(50) implicitHeight: Theme.itemHeightMedium
implicitWidth: size.dp(320) implicitWidth: Theme.itemWidthLarge
BorderImage { BorderImage {
source: "/usr/share/glacier-components/images/textinput.png" source: "/usr/share/glacier-components/images/textinput.png"
border.left: size.dp(8) border.left: Theme.itemSpacingExtraSmall
border.right: size.dp(8) border.right: Theme.itemSpacingExtraSmall
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
......
...@@ -52,10 +52,10 @@ Rectangle { ...@@ -52,10 +52,10 @@ Rectangle {
Rectangle{ Rectangle{
id: selecter id: selecter
x: rowElement.children[main.currentIndex].x || 0 x: rowElement.children[main.currentIndex].x || 0
y: size.dp(-5) anchors.verticalCenter: rowElement.verticalCenter
width: rowElement.children[main.currentIndex].width || 0 width: rowElement.children[main.currentIndex].width || 0
height: Theme.itemHeightSmall height: Theme.itemHeightMedium
color: Theme.accentColor color: Theme.accentColor
visible: main.currentIndex > -1 visible: main.currentIndex > -1
...@@ -75,7 +75,7 @@ Rectangle { ...@@ -75,7 +75,7 @@ Rectangle {
model: main.model model: main.model
delegate: Rectangle { delegate: Rectangle {
id: rowItem id: rowItem
height: size.dp(40) height: Theme.itemHeightSmall
width: text.width+(text.width/name.length*2) width: text.width+(text.width/name.length*2)
color: "transparent" color: "transparent"
...@@ -93,13 +93,14 @@ Rectangle { ...@@ -93,13 +93,14 @@ Rectangle {
id: text id: text
text: name text: name
height: parent.heigh height: parent.heigh
elide:Text.ElideNone
anchors.horizontalCenter: parent.horizontalCenter anchors.centerIn: parent
Component.onCompleted: { Component.onCompleted: {
width = paintedWidth width = paintedWidth
} }
font.bold: main.currentIndex == index font.weight: main.currentIndex == index ? Theme.fontWeightLarge : Theme.fontWeightMedium
} }
} }
} }
......
...@@ -17,13 +17,12 @@ Item { ...@@ -17,13 +17,12 @@ Item {
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
Text{ Label{
id: label id: label
visible: label.text != "" visible: label.text != ""
font.capitalization: Font.AllUppercase font.pixelSize: Theme.fontSizeSmall
font.pixelSize: size.dp(14) color: Theme.textColor
color: "white" width: parent.width - anchors.leftMargin
anchors{ anchors{
top: parent.top top: parent.top
left: parent.left left: parent.left
...@@ -33,37 +32,37 @@ Item { ...@@ -33,37 +32,37 @@ Item {
Rectangle{ Rectangle{
id: topLine id: topLine
width: view.width width: parent.width
height: 1 height: size.ratio(1)
color: "white" color: Theme.backgroundAccentColor
anchors.top: view.top anchors.top: view.top
z: 2 z: 2
} }
Rectangle{ Rectangle{
id: bottomLine id: bottomLine
width: view.width width: parent.width
height: 3 height: size.ratio(3)
color: "white" color: Theme.backgroundAccentColor
anchors.bottom: view.bottom anchors.bottom: view.bottom
z: 2 z: 2
} }
PathView{ PathView{
id: view id: view
property int itemHeight: size.dp(40) property int itemHeight: Theme.itemHeightLarge
property bool showRow: false property bool showRow: false
interactive: activated interactive: activated
width: parent.width-size.dp(60) width: parent.width-Theme.itemWidthSmall
height: size.dp(40) height: Theme.itemHeightMedium
clip: true clip: true
anchors{ anchors{
top: label.top top: label.bottom
topMargin: size.dp(20) topMargin:Theme.itemSpacingLarge
left: label.left left: label.left
leftMargin: size.dp(30) leftMargin:Theme.itemSpacingLarge + Theme.itemSpacingSmall
} }
pathItemCount: height/itemHeight pathItemCount: height/itemHeight
...@@ -116,16 +115,16 @@ Item { ...@@ -116,16 +115,16 @@ Item {
ParallelAnimation { ParallelAnimation {
id: activateAnimations id: activateAnimations
NumberAnimation{target: bottomLine; property: "opacity"; to: 1; duration: 250} NumberAnimation{target: bottomLine; property: "opacity"; to: 1; duration: 150}
NumberAnimation{target: topLine; property: "opacity"; to: 1; duration: 250} NumberAnimation{target: topLine; property: "opacity"; to: 1; duration: 150}
NumberAnimation{target: view; property: "height"; to: itemHeight*activateSize; duration: 250} NumberAnimation{target: view; property: "height"; to: itemHeight*activateSize; duration: 150}
} }
ParallelAnimation { ParallelAnimation {
id: deActivateAnimations id: deActivateAnimations
NumberAnimation{target: bottomLine; property: "opacity"; to: 0; duration: 250} NumberAnimation{target: bottomLine; property: "opacity"; to: 0; duration: 150}
NumberAnimation{target: topLine; property: "opacity"; to: 0; duration: 250} NumberAnimation{target: topLine; property: "opacity"; to: 0; duration: 150}
NumberAnimation{target: view; property: "height"; to: itemHeight; duration: 250} NumberAnimation{target: view; property: "height"; to: itemHeight; duration: 150}
onStopped: { onStopped: {
view.showRow = true view.showRow = true
} }
......
...@@ -14,21 +14,20 @@ Rectangle{ ...@@ -14,21 +14,20 @@ Rectangle{
width: childrenRect.width width: childrenRect.width
height: parent.height height: parent.height
color: "transparent" color: "transparent"
anchors.verticalCenter: glacierRollerItem.verticalCenter
} }
Image{ Image{
id: arrowDown id: arrowDown
source: "images/glacierroller-icon-arrow-down.svg" source: "images/glacierroller-icon-arrow-down.svg"
width: glacierRollerItem.height/4 height: parent.height / 3
height: width
sourceSize.width: width sourceSize.width: width
sourceSize.height: height sourceSize.height: height
visible: glacierRollerItem.parent.showRow visible: glacierRollerItem.parent.showRow
fillMode: Image.PreserveAspectFit
anchors{ anchors{
verticalCenter: dataLine.verticalCenter verticalCenter: glacierRollerItem.verticalCenter
left: dataLine.right left: dataLine.right
leftMargin: width leftMargin: width
} }
...@@ -42,7 +41,7 @@ Rectangle{ ...@@ -42,7 +41,7 @@ Rectangle{
} }
MouseArea{ MouseArea{
anchors.fill: dataLine anchors.fill: parent
onClicked: { onClicked: {
if(!glacierRollerItem.parent.parent.activated) if(!glacierRollerItem.parent.parent.activated)
{ {
......
...@@ -62,7 +62,7 @@ Item { ...@@ -62,7 +62,7 @@ Item {
PropertyChanges { PropertyChanges {
target: toolBarRect target: toolBarRect
width: parent.width width: parent.width
height: Theme.itemHeightExtraLarge height: Theme.itemHeightLarge
} }
}, },
State { State {
...@@ -91,7 +91,7 @@ Item { ...@@ -91,7 +91,7 @@ Item {
} }
PropertyChanges { PropertyChanges {
target: toolBarRect target: toolBarRect
width: Theme.itemHeightExtraLarge width: Theme.itemHeightLarge
height: parent.height height: parent.height
} }
} }
......
...@@ -22,17 +22,17 @@ Item { ...@@ -22,17 +22,17 @@ Item {
property bool isUiPortrait: header && header.appWindow.isUiPortrait property bool isUiPortrait: header && header.appWindow.isUiPortrait
property bool showBackButton: false property bool showBackButton: false
property int toolMeasure: parent.width/10 property int toolMeasure: Theme.itemHeightSmall
height: toolMeasure height: toolMeasure
Rectangle { Rectangle {
id: backButton id: backButton
width: opacity ? size.dp(60) : 0 width: opacity ? Theme.itemHeightHuge : 0
anchors.leftMargin: Theme.itemSpacingLarge anchors.leftMargin: Theme.itemSpacingLarge
//check if Stack.view has already been initialized as well //check if Stack.view has already been initialized as well
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
antialiasing: true antialiasing: true
height: width height: width
radius: size.dp(4) radius: Theme.itemSpacingExtraSmall / 2
color: backmouse.pressed ? "#222" : "transparent" color: backmouse.pressed ? "#222" : "transparent"
rotation: isUiPortrait ? 0 : 90 rotation: isUiPortrait ? 0 : 90
...@@ -41,6 +41,11 @@ Item { ...@@ -41,6 +41,11 @@ Item {
Image { Image {
anchors.centerIn: parent anchors.centerIn: parent
height: toolMeasure
width: height
fillMode: Image.PreserveAspectFit
sourceSize.width: width
sourceSize.height: height
source: "/usr/lib/qt5/qml/QtQuick/Controls/Styles/Nemo/images/icon-triangle-left.png" source: "/usr/lib/qt5/qml/QtQuick/Controls/Styles/Nemo/images/icon-triangle-left.png"
} }
...@@ -68,7 +73,7 @@ Item { ...@@ -68,7 +73,7 @@ Item {
font.weight: Font.Bold font.weight: Font.Bold
LinearGradient { LinearGradient {
anchors.right: parent.right anchors.right: parent.right
width: size.dp(50) width: Theme.itemHeightMedium
height: parent.paintedHeight height: parent.paintedHeight
visible: titleTxt.paintedWidth > titleTxt.width visible: titleTxt.paintedWidth > titleTxt.width
start: Qt.point(0,0) start: Qt.point(0,0)
...@@ -82,9 +87,9 @@ Item { ...@@ -82,9 +87,9 @@ Item {
Item { Item {
id: toolButtonsContainer id: toolButtonsContainer
anchors.right: dots.visible ? dots.left : parent.right anchors.right: dots.visible ? dots.left : parent.right
anchors.rightMargin: size.dp(20) anchors.rightMargin: Theme.itemSpacingLarge
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: tools ? (size.dp(50) * Math.min(maxNumberOfToolButtons, tools.length)) : 0 width: tools ? (Theme.itemHeightMedium * Math.min(maxNumberOfToolButtons, tools.length)) : 0
property int maxNumberOfToolButtons: 3 property int maxNumberOfToolButtons: 3
RowLayout { RowLayout {
...@@ -113,6 +118,9 @@ Item { ...@@ -113,6 +118,9 @@ Item {
rightMargin: Theme.itemSpacingLarge rightMargin: Theme.itemSpacingLarge
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
fillMode: Image.PreserveAspectFit
height: toolMeasure
sourceSize.height: height
visible: drawerLevels && drawerLevels.length > 1 visible: drawerLevels && drawerLevels.length > 1
source: "/usr/lib/qt5/qml/QtQuick/Controls/Styles/Nemo/images/dots-vertical.png" source: "/usr/lib/qt5/qml/QtQuick/Controls/Styles/Nemo/images/dots-vertical.png"
rotation: isUiPortrait ? 0 : 90 rotation: isUiPortrait ? 0 : 90
......
...@@ -36,4 +36,5 @@ Text { ...@@ -36,4 +36,5 @@ Text {
font.family: Theme.fontFamily font.family: Theme.fontFamily
color: Theme.textColor color: Theme.textColor
font.pixelSize: Theme.fontSizeMedium font.pixelSize: Theme.fontSizeMedium
elide: horizontalAlignment == Text.AlignLeft ? Text.ElideRight : (horizontalAlignment == Text.AlignRight ? Text.ElideLeft : Text.ElideMiddle)
} }
...@@ -18,7 +18,7 @@ ListView { ...@@ -18,7 +18,7 @@ ListView {
id: sectionHeading id: sectionHeading
Rectangle { Rectangle {
width: listView.width width: listView.width
height: size.dp(44) height: Theme.itemHeightMedium
color: delegateColor color: delegateColor
Text { Text {
...@@ -36,9 +36,9 @@ ListView { ...@@ -36,9 +36,9 @@ ListView {
Rectangle{ Rectangle{
id: line id: line
height: 1 height: size.ratio(1)
color: Theme.textColor color: Theme.textColor
width: listView.width-sectionText.width-size.dp(30) width: listView.width-sectionText.width-Theme.itemHeightExtraSmall
anchors{ anchors{
left: sectionText.right left: sectionText.right
leftMargin: Theme.itemSpacingSmall leftMargin: Theme.itemSpacingSmall
...@@ -51,7 +51,7 @@ ListView { ...@@ -51,7 +51,7 @@ ListView {
Item{ Item{
id: bottom id: bottom
width: parent.width width: parent.width
height: size.dp(30) height: Theme.itemHeightExtraSmall
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
visible: listView.contentHeight > listView.height visible: listView.contentHeight > listView.height
...@@ -59,7 +59,7 @@ ListView { ...@@ -59,7 +59,7 @@ ListView {
LinearGradient{ LinearGradient{
anchors.fill: parent anchors.fill: parent
start: Qt.point(0, 0) start: Qt.point(0, 0)
end: Qt.point(0, size.dp(30)) end: Qt.point(0, Theme.itemHeightExtraSmall)
gradient: Gradient { gradient: Gradient {
GradientStop { position: 0.0; color: "transparent" } GradientStop { position: 0.0; color: "transparent" }
GradientStop { position: 1.0; color: bottomGradientColor } GradientStop { position: 1.0; color: bottomGradientColor }
...@@ -73,13 +73,13 @@ ListView { ...@@ -73,13 +73,13 @@ ListView {
visible: (listView.showDecorator && listView.contentHeight > listView.height) visible: (listView.showDecorator && listView.contentHeight > listView.height)
color: scrollerDecoratorColor color: scrollerDecoratorColor
width: size.dp(5) width: Theme.itemSpacingExtraSmall
height: listView.height*listView.height/listView.contentHeight height: listView.height*listView.height/listView.contentHeight
y: (listView.height)/listView.contentHeight*listView.contentY y: (listView.height)/listView.contentHeight*listView.contentY
anchors{ anchors{
right: listView.right right: listView.right
rightMargin: size.dp(4) rightMargin: Theme.itemSpacingExtraSmall / 2
} }
} }
} }
......
...@@ -6,7 +6,7 @@ import QtGraphicalEffects 1.0 ...@@ -6,7 +6,7 @@ import QtGraphicalEffects 1.0
Item { Item {
id: root id: root
width: parent.width width: parent.width
height: size.dp(60) height: Theme.itemHeightLarge
property string label: "" property string label: ""
...@@ -15,6 +15,7 @@ Item { ...@@ -15,6 +15,7 @@ Item {
property string icon: "" property string icon: ""
property bool showNext: true property bool showNext: true
property bool iconVisible: true
property alias actions: actionsLoader.sourceComponent property alias actions: actionsLoader.sourceComponent
...@@ -65,36 +66,35 @@ Item { ...@@ -65,36 +66,35 @@ Item {
Image{ Image{
id: itemIcon id: itemIcon
height: parent.height-size.dp(10) height: iconVisible ? parent.height-Theme.itemSpacingSmall : 0
width: height width: height
anchors{ anchors{
left: parent.left left: parent.left
leftMargin: Theme.itemSpacingLarge leftMargin: Theme.itemSpacingLarge
top: parent.top verticalCenter:parent.verticalCenter
topMargin: size.dp(5)
} }
sourceSize.width: width sourceSize.width: width
sourceSize.height: height sourceSize.height: height
visible: iconVisible
source: (icon != "") ? icon : "images/listview-icon-template-s.svg" source: (icon != "") ? icon : iconVisible ? "images/listview-icon-template-s.svg" : ""
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
} }
Rectangle{ Rectangle{
id: dataArea id: dataArea
width: parent.width-itemIcon.width-arrowItem.width-size.dp(60) width: parent.width-itemIcon.width-Theme.itemHeightLarge - (showNext ? arrowItem.width : 0)
height: labelItem.height+(description != "" ? descriptionItem.height : 0)+(subdescription != "" ? subDescriptionItem.height : 0) height: labelItem.height+(description != "" ? descriptionItem.height : 0)+(subdescription != "" ? subDescriptionItem.height : 0)
clip: true clip: true
anchors{ anchors{
left:itemIcon.right left: iconVisible ? itemIcon.right : parent.left
leftMargin: Theme.itemSpacingLarge leftMargin: Theme.itemSpacingLarge
verticalCenter: itemIcon.verticalCenter verticalCenter: iconVisible ? itemIcon.verticalCenter : parent.verticalCenter
} }
color: "transparent" color: "transparent"
Text { Label {
id: labelItem id: labelItem
color: Theme.textColor color: Theme.textColor
text: label text: label
...@@ -102,11 +102,11 @@ Item { ...@@ -102,11 +102,11 @@ Item {
left: parent.left left: parent.left
right: parent.right right: parent.right
} }
font.pixelSize: size.dp(30) font.pixelSize: Theme.fontSizeMedium
clip: true clip: true
} }
Text{ Label {
id: descriptionItem id: descriptionItem
color: Theme.textColor color: Theme.textColor
text: description text: description
...@@ -115,12 +115,12 @@ Item { ...@@ -115,12 +115,12 @@ Item {
right: parent.right right: parent.right
top: labelItem.bottom top: labelItem.bottom
} }
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeTiny
clip: true clip: true
visible: description != "" visible: description != ""
} }
Text{ Label {
id: subDescriptionItem id: subDescriptionItem
color: Theme.textColor color: Theme.textColor
text: subdescription text: subdescription
...@@ -129,23 +129,23 @@ Item { ...@@ -129,23 +129,23 @@ Item {
right: parent.right right: parent.right
top: descriptionItem.bottom top: descriptionItem.bottom
} }
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeTiny
clip: true clip: true
visible: subdescription != "" visible: subdescription != ""
} }
Item{ Item{
width: size.dp(15) width: Theme.itemHeightExtraSmall / 2
height: parent.height height: parent.height
anchors{ anchors{
top: parent.top top: parent.top
right: parent.right right: parent.right
} }
visible: !mouse.pressed visible: showNext ? !mouse.pressed : false
LinearGradient{ LinearGradient{
anchors.fill: parent anchors.fill: parent
start: Qt.point(0, 0) start: Qt.point(0, 0)
end: Qt.point(size.dp(15), 0) end: Qt.point( Theme.itemHeightExtraSmall / 2, 0)
gradient: Gradient { gradient: Gradient {
GradientStop { position: 0.0; color: "transparent" } GradientStop { position: 0.0; color: "transparent" }
GradientStop { position: 1.0; color: "black" } GradientStop { position: 1.0; color: "black" }
...@@ -156,7 +156,7 @@ Item { ...@@ -156,7 +156,7 @@ Item {
Image { Image {
id: arrowItem id: arrowItem
height: parent.height-size.dp(10) height: parent.height- Theme.itemSpacingSmall
width: height width: height
anchors{ anchors{
......
import QtQuick 2.6 import QtQuick 2.6
Rectangle { Item {
id: shell id: shell
anchors.fill: parent anchors.fill: parent
opacity: 0.7
color: Theme.backgroundColor
signal accepted() signal accepted()
signal canceled() signal canceled()
property alias cancelText: cancel.text property alias cancelText: cancel.text
property alias acceptText: accept.text property alias acceptText: accept.text
property alias headingText: heading.text property alias headingText: heading.text
property alias subLabelText: subLabel.text
Rectangle {
anchors.fill: parent
opacity: 0.65
color: Theme.backgroundColor
}
Label { Label {
width: parent.width*0.8 width: parent.width*0.8
id: heading id: heading
anchors.centerIn: parent anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter
font.weight: Theme.fontWeightLarge
wrapMode: Text.Wrap wrapMode: Text.Wrap
} }
Label {
id:subLabel
width: parent.width*0.8
wrapMode: Text.Wrap
font.weight: Theme.fontWeightMedium
horizontalAlignment: Text.AlignHCenter
anchors {
top:heading.bottom
topMargin: Theme.itemSpacingLarge
horizontalCenter: shell.horizontalCenter
}
}
Button { Button {
id: cancel id: cancel
width: parent.width / 2 width: parent.width / 2
height: Theme.itemHeightLarge
anchors { anchors {
left: parent.left left: parent.left
bottom: parent.bottom bottom: parent.bottom
...@@ -33,6 +54,8 @@ Rectangle { ...@@ -33,6 +54,8 @@ Rectangle {
Button { Button {
id: accept id: accept
width: parent.width / 2 width: parent.width / 2
height: Theme.itemHeightLarge
primary: true
anchors { anchors {
left: cancel.right left: cancel.right
bottom: parent.bottom bottom: parent.bottom
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <QScreen> #include <QScreen>
#include <QDebug> #include <QDebug>
#include <QGuiApplication> #include <QGuiApplication>
#include <math.h>
Sizing::Sizing(QObject *parent) : QObject(parent) Sizing::Sizing(QObject *parent) : QObject(parent)
{ {
......
#include "theme.h" #include "theme.h"
#include "sizing.h" #include "sizing.h"
#include <math.h>
#include <QFile> #include <QFile>
#include <QDebug> #include <QDebug>
#include <QJsonDocument> #include <QJsonDocument>
......
...@@ -41,26 +41,29 @@ CheckBoxStyle { ...@@ -41,26 +41,29 @@ CheckBoxStyle {
implicitHeight: Theme.itemHeightExtraSmall implicitHeight: Theme.itemHeightExtraSmall
Rectangle { Rectangle {
id: back1 id: back2
implicitWidth: Theme.itemWidthExtraSmall implicitWidth: Theme.itemWidthExtraSmall
implicitHeight: size.dp(28) implicitHeight: Theme.itemHeightExtraSmall - Theme.itemSpacingExtraSmall
color: Theme.accentColor color: Theme.fillDarkColor
anchors.centerIn: parent anchors.centerIn: parent
}
Rectangle { Rectangle {
id: back2 id: back1
implicitWidth: Theme.itemWidthExtraSmall implicitWidth: Theme.itemWidthExtraSmall
implicitHeight: size.dp(28) implicitHeight: Theme.itemHeightExtraSmall - Theme.itemSpacingExtraSmall
color: Theme.fillDarkColor color: Theme.accentColor
anchors.centerIn: parent anchors.centerIn: parent
} }
}
Image { Image {
id: ball id: ball
width: size.dp(40) width: Theme.itemHeightSmall
height: Theme.itemHeightExtraSmall height: Theme.itemHeightExtraSmall
fillMode: Image.PreserveAspectFit
sourceSize.width: width
sourceSize.height: height
source: "images/switch-ball.png" source: "images/switch-ball.png"
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
...@@ -78,8 +81,7 @@ CheckBoxStyle { ...@@ -78,8 +81,7 @@ CheckBoxStyle {
Component.onCompleted: { Component.onCompleted: {
back1.opacity = control.checked ? 1 : 0 back1.opacity = control.checked ? 1 : 0
back2.opacity = control.checked ? 0 : 1 ball.x = control.checked ? background.width - ball.width : 0
ball.x = control.checked ? Theme.itemHeightExtraSmall : 0
} }
SequentialAnimation { SequentialAnimation {
...@@ -88,20 +90,14 @@ CheckBoxStyle { ...@@ -88,20 +90,14 @@ CheckBoxStyle {
NumberAnimation { NumberAnimation {
target: ball target: ball
property: "x" property: "x"
to: Theme.itemHeightExtraSmall to: background.width - ball.width
duration: 120 duration: 120
} }
NumberAnimation { NumberAnimation {
target: back1 target: back1
property: "opacity" property: "opacity"
to: 1 to: 1
duration: 60 duration: 120
}
NumberAnimation {
target: back2
property: "opacity"
to: 0
duration: 60
} }
} }
...@@ -114,17 +110,11 @@ CheckBoxStyle { ...@@ -114,17 +110,11 @@ CheckBoxStyle {
to: 0 to: 0
duration: 120 duration: 120
} }
NumberAnimation {
target: back2
property: "opacity"
to: 1
duration: 60
}
NumberAnimation { NumberAnimation {
target: back1 target: back1
property: "opacity" property: "opacity"
to: 0 to: 0
duration: 60 duration: 120
} }
} }
} }
...@@ -132,5 +122,5 @@ CheckBoxStyle { ...@@ -132,5 +122,5 @@ CheckBoxStyle {
text: control.text text: control.text
font.pixelSize:control.fontSize font.pixelSize:control.fontSize
} }
spacing: 10 spacing: Theme.itemSpacingSmall
} }
...@@ -22,9 +22,9 @@ import QtQuick.Controls.Nemo 1.0 ...@@ -22,9 +22,9 @@ import QtQuick.Controls.Nemo 1.0
Component { Component {
Rectangle { Rectangle {
implicitHeight: size.dp(16) implicitHeight: Theme.itemHeightSmall/2
implicitWidth: size.dp(440) implicitWidth: Theme.itemWidthLarge + Theme.itemWidthSmall
color: Theme.fillColorDark color: Theme.fillDarkColor
Rectangle { Rectangle {
antialiasing: true antialiasing: true
radius: 1 radius: 1
......
...@@ -29,9 +29,9 @@ SliderStyle{ ...@@ -29,9 +29,9 @@ SliderStyle{
color: Theme.backgroundColor color: Theme.backgroundColor
border.color: Theme.accentColor border.color: Theme.accentColor
border.width: 2 border.width: 2
implicitWidth: size.dp(34) implicitWidth: Theme.itemHeightExtraSmall
implicitHeight: size.dp(34) implicitHeight: Theme.itemHeightExtraSmall
radius: size.dp(16) radius: implicitHeight / 2
visible: control.enabled visible: control.enabled
Text{ Text{
...@@ -47,8 +47,8 @@ SliderStyle{ ...@@ -47,8 +47,8 @@ SliderStyle{
groove: Rectangle{ groove: Rectangle{
id: grove id: grove
implicitHeight: size.dp(16) implicitHeight: Theme.itemHeightExtraSmall / 2
implicitWidth: size.dp(440) implicitWidth: Theme.itemWidthLarge + Theme.itemWidthSmall
color: Theme.fillDarkColor color: Theme.fillDarkColor
z: 1 z: 1
Rectangle{ Rectangle{
...@@ -73,9 +73,9 @@ SliderStyle{ ...@@ -73,9 +73,9 @@ SliderStyle{
verticalCenter: dataLine.verticalCenter verticalCenter: dataLine.verticalCenter
} }
source: "images/slider-handle-left.svg" source: "images/slider-handle-left.svg"
height: size.dp(34) height:Theme.itemHeightExtraSmall
visible: control.enabled visible: control.enabled
width: (styleData.handlePosition > size.dp(80)) ? size.dp(80) : styleData.handlePosition width: (styleData.handlePosition > Theme.itemHeightHuge) ? Theme.itemHeightHuge : styleData.handlePosition
sourceSize.width: width sourceSize.width: width
sourceSize.height: height sourceSize.height: height
} }
......
...@@ -21,5 +21,31 @@ import QtQuick 2.6 ...@@ -21,5 +21,31 @@ import QtQuick 2.6
import QtQuick.Controls.Styles 1.0 import QtQuick.Controls.Styles 1.0
TabViewStyle { TabViewStyle {
tabsAlignment: Qt.AlignVCenter
tabOverlap: 0
frame: Item { }
tab: Item {
implicitWidth: control.width/control.count
implicitHeight: Theme.itemHeightMedium
BorderImage {
anchors.fill: parent
border.bottom:Theme.itemSpacingExtraSmall
border.top: Theme.itemSpacingExtraSmall
source: styleData.selected ? "/usr/share/glacier-components/images/tab_selected.png":"/usr/share/glacier-components/images/tabs_standard.png"
Text {
anchors.centerIn: parent
color: Theme.textColor
text: styleData.title.toUpperCase()
font.pixelSize: Theme.fontSizeTiny
}
Rectangle {
visible: index > 0
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.margins: Theme.itemSpacingExtraSmall
width:1
color: Theme.fillDarkColor
}
}
}
} }
...@@ -35,7 +35,7 @@ TextFieldStyle { ...@@ -35,7 +35,7 @@ TextFieldStyle {
rightMargin: Theme.itemSpacingMedium rightMargin: Theme.itemSpacingMedium
} }
implicitHeight: Theme.itemHeightMedium implicitHeight: Theme.itemHeightSmall
implicitWidth: Theme.itemWidthLarge implicitWidth: Theme.itemWidthLarge
opacity: control.enabled ? 1 : 0.6 opacity: control.enabled ? 1 : 0.6
Image { Image {
...@@ -48,7 +48,7 @@ TextFieldStyle { ...@@ -48,7 +48,7 @@ TextFieldStyle {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: 2 height: size.ratio(2)
width: parent.width width: parent.width
color: control.readOnly ? Theme.fillDarkColor : Theme.accentColor color: control.readOnly ? Theme.fillDarkColor : Theme.accentColor
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment