Commit 415dc3a3 authored by Chupligin Sergey's avatar Chupligin Sergey

[Styles] Add scale to styles

parent 42a25f7b
...@@ -36,7 +36,7 @@ Rectangle { ...@@ -36,7 +36,7 @@ Rectangle {
id: main id: main
width: childrenRect.width width: childrenRect.width
color: "#313131" color: "#313131"
height: 40 height: 4*mm
property ListModel model: ListModel {} property ListModel model: ListModel {}
property bool enabled: true property bool enabled: true
property int currentIndex: -1 property int currentIndex: -1
...@@ -51,10 +51,10 @@ Rectangle { ...@@ -51,10 +51,10 @@ Rectangle {
Rectangle{ Rectangle{
id: selecter id: selecter
x: rowElement.children[main.currentIndex].x || 0 x: rowElement.children[main.currentIndex].x || 0
y: -5 y: -0.5*mm
width: rowElement.children[main.currentIndex].width || 0 width: rowElement.children[main.currentIndex].width || 0
height: 50 height: 5*mm
color: "#0091e5" color: "#0091e5"
visible: main.currentIndex > -1 visible: main.currentIndex > -1
...@@ -74,10 +74,10 @@ Rectangle { ...@@ -74,10 +74,10 @@ Rectangle {
model: main.model model: main.model
delegate: Rectangle { delegate: Rectangle {
id: rowItem id: rowItem
height: 50 height: 5*mm
width: text.width+(text.width/name.length*2) width: text.width+(text.width/name.length*2)
y: -5 y: -0.5*mm
color: "transparent" color: "transparent"
MouseArea { MouseArea {
......
...@@ -30,8 +30,8 @@ ButtonStyle { ...@@ -30,8 +30,8 @@ ButtonStyle {
// The background of the button. // The background of the button.
background: Rectangle { background: Rectangle {
implicitWidth: 240 implicitWidth: 24*mm
implicitHeight: 50 implicitHeight: 5*mm
clip: true clip: true
color: control.primary ? Theme.primaryButton.background color: control.primary ? Theme.primaryButton.background
: Theme.button.background : Theme.button.background
......
...@@ -39,21 +39,21 @@ CheckBoxStyle { ...@@ -39,21 +39,21 @@ CheckBoxStyle {
indicator: Rectangle { indicator: Rectangle {
id: background id: background
color: "transparent" color: "transparent"
implicitWidth: 72 implicitWidth: 7.2*mm
implicitHeight: 32 implicitHeight: 3.2*mm
Rectangle { Rectangle {
id: back1 id: back1
implicitWidth: 72 implicitWidth: 7.2*mm
implicitHeight: 28 implicitHeight: 2.8*mm
color: Theme.checkbox.back1 color: Theme.checkbox.back1
anchors.centerIn: parent anchors.centerIn: parent
} }
Rectangle { Rectangle {
id: back2 id: back2
implicitWidth: 72 implicitWidth: 7.2*mm
implicitHeight: 28 implicitHeight: 2.8*mm
color: Theme.checkbox.back2 color: Theme.checkbox.back2
anchors.centerIn: parent anchors.centerIn: parent
} }
...@@ -80,7 +80,7 @@ CheckBoxStyle { ...@@ -80,7 +80,7 @@ CheckBoxStyle {
Component.onCompleted: { Component.onCompleted: {
back1.opacity = control.checked ? 1 : 0 back1.opacity = control.checked ? 1 : 0
back2.opacity = control.checked ? 0 : 1 back2.opacity = control.checked ? 0 : 1
ball.x = control.checked ? 32 : 0 ball.x = control.checked ? 3.2*mm : 0
} }
SequentialAnimation { SequentialAnimation {
...@@ -89,7 +89,7 @@ CheckBoxStyle { ...@@ -89,7 +89,7 @@ CheckBoxStyle {
NumberAnimation { NumberAnimation {
target: ball target: ball
property: "x" property: "x"
to: 32 to: 3.2*mm
duration: 120 duration: 120
} }
NumberAnimation { NumberAnimation {
......
...@@ -22,8 +22,8 @@ import QtQuick.Controls.Styles.Nemo 1.0 ...@@ -22,8 +22,8 @@ import QtQuick.Controls.Styles.Nemo 1.0
Component { Component {
Rectangle { Rectangle {
implicitHeight: 16 implicitHeight: 1.6*mm
implicitWidth: 440 implicitWidth: 44*mm
color: Theme.groove.background color: Theme.groove.background
Rectangle { Rectangle {
antialiasing: true antialiasing: true
......
...@@ -59,8 +59,8 @@ Style { ...@@ -59,8 +59,8 @@ Style {
} }
property Component menuItem: Rectangle { property Component menuItem: Rectangle {
width: text.width + 12 width: text.width + 1.2*mm
height: text.height + 4 height: text.height + 0.4*mm
color: sunken ? "#49d" :__backgroundColor color: sunken ? "#49d" :__backgroundColor
SystemPalette { id: syspal } SystemPalette { id: syspal }
......
...@@ -29,9 +29,9 @@ SliderStyle{ ...@@ -29,9 +29,9 @@ SliderStyle{
color: "black" color: "black"
border.color: "#0091e5" border.color: "#0091e5"
border.width: 2 border.width: 2
implicitWidth: 34 implicitWidth: 3.4*mm
implicitHeight: 34 implicitHeight: 3.4*mm
radius: 16 radius: 1.6*mm
visible: control.enabled visible: control.enabled
Text{ Text{
...@@ -46,8 +46,8 @@ SliderStyle{ ...@@ -46,8 +46,8 @@ SliderStyle{
groove: Rectangle{ groove: Rectangle{
id: grove id: grove
implicitHeight: 16 implicitHeight: 1.6*mm
implicitWidth: 440 implicitWidth: 44*mm
color: "#313131" color: "#313131"
z: 1 z: 1
Rectangle{ Rectangle{
...@@ -72,9 +72,9 @@ SliderStyle{ ...@@ -72,9 +72,9 @@ SliderStyle{
verticalCenter: dataLine.verticalCenter verticalCenter: dataLine.verticalCenter
} }
source: "images/slider-handle-left.svg" source: "images/slider-handle-left.svg"
height: 34 height: 3.4*mm
visible: control.enabled visible: control.enabled
width: (styleData.handlePosition > 80) ? 80 : styleData.handlePosition width: (styleData.handlePosition > 8*mm) ? 8*mm : styleData.handlePosition
sourceSize.width: width sourceSize.width: width
sourceSize.height: height sourceSize.height: height
} }
......
...@@ -25,11 +25,11 @@ TextFieldStyle { ...@@ -25,11 +25,11 @@ TextFieldStyle {
selectedTextColor: Theme.textField.selectedTextColor selectedTextColor: Theme.textField.selectedTextColor
selectionColor: Theme.textField.selectionColor selectionColor: Theme.textField.selectionColor
textColor: Theme.textField.selectedTextColor textColor: Theme.textField.selectedTextColor
font.pointSize: 14 font.pointSize: 1.4*mm
font.family: Theme.textField.font font.family: Theme.textField.font
background: Item { background: Item {
anchors.leftMargin: 16 anchors.leftMargin: 1.6*mm
anchors.rightMargin: 16 anchors.rightMargin: 1.6*mm
opacity: control.enabled ? 1 : 0.6 opacity: control.enabled ? 1 : 0.6
Image { Image {
anchors.fill: parent anchors.fill: parent
......
...@@ -28,8 +28,8 @@ Style { ...@@ -28,8 +28,8 @@ Style {
padding.bottom: 3 padding.bottom: 3
property Component panel: Item { property Component panel: Item {
implicitHeight: 75 implicitHeight: 7.5*mm
implicitWidth: 400 implicitWidth: 40*mm
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
color: Theme.toolBar.background color: Theme.toolBar.background
......
...@@ -31,8 +31,8 @@ Style { ...@@ -31,8 +31,8 @@ Style {
id: styleitem id: styleitem
//TODO: Maybe we want to add a descriptive text at the bottom of the icon? //TODO: Maybe we want to add a descriptive text at the bottom of the icon?
implicitWidth: 50 implicitWidth: 5*mm
implicitHeight: 50 implicitHeight: 5*mm
opacity: control.pressed ? 0.5 : 1 opacity: control.pressed ? 0.5 : 1
...@@ -47,7 +47,7 @@ Style { ...@@ -47,7 +47,7 @@ Style {
id: icon id: icon
anchors.fill: parent anchors.fill: parent
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
anchors.margins: 8 anchors.margins: 0.8*mm
source: control.iconSource source: control.iconSource
} }
} }
......
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