Skip to content

Commit

Permalink
Revert "Workaround to use new design with StyleV2.qml"
Browse files Browse the repository at this point in the history
This reverts commit 3af22ae.
  • Loading branch information
iiLubos committed Nov 29, 2023
1 parent a47502d commit 0bcfd36
Show file tree
Hide file tree
Showing 33 changed files with 200 additions and 266 deletions.
2 changes: 1 addition & 1 deletion app/qmlV2/StyleV2.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* *
***************************************************************************/

//pragma Singleton
pragma Singleton
import QtQuick

QtObject {
Expand Down
8 changes: 3 additions & 5 deletions app/qmlV2/component/MMButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,22 @@ Button {

property bool transparent: false

StyleV2 { id: styleV2 }

contentItem: Text {
anchors.centerIn: control
font: styleV2.t3
font: StyleV2.t3
text: control.text
leftPadding: 32 * __dp
rightPadding: 32 * __dp
topPadding: 10 * __dp
bottomPadding: 10 * __dp
color: control.enabled ? control.down || control.hovered ? styleV2.grassColor : styleV2.forestColor : styleV2.forestColor
color: control.enabled ? control.down || control.hovered ? StyleV2.grassColor : StyleV2.forestColor : StyleV2.forestColor
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}

background: Rectangle {
color: transparent ? "transparent" : control.enabled ? control.down || control.hovered ? styleV2.forestColor : styleV2.grassColor : styleV2.mediumGreenColor
color: transparent ? "transparent" : control.enabled ? control.down || control.hovered ? StyleV2.forestColor : StyleV2.grassColor : StyleV2.mediumGreenColor
radius: height / 2
}
}
34 changes: 16 additions & 18 deletions app/qmlV2/component/MMButtonInput.qml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ Column {
spacing: 6 * __dp
width: 280 * __dp

StyleV2 { id: styleV2 }

Text {
id: titleItem

width: parent.width
font: styleV2.p6
font: StyleV2.p6
wrapMode: Text.WordWrap
visible: text.length > 0
}
Expand All @@ -44,8 +42,8 @@ Column {

height: 40 * __dp
width: parent.width
color: (errorMsg.length > 0 || warningMsg.length > 0) ? styleV2.errorBgInputColor : styleV2.whiteColor
border.color: errorMsg.length > 0 ? styleV2.negativeColor : warningMsg.length > 0 ? styleV2.warningColor : styleV2.forestColor
color: (errorMsg.length > 0 || warningMsg.length > 0) ? StyleV2.errorBgInputColor : StyleV2.whiteColor
border.color: errorMsg.length > 0 ? StyleV2.negativeColor : warningMsg.length > 0 ? StyleV2.warningColor : StyleV2.forestColor
border.width: enabled ? (textField.activeFocus ? 2*__dp : textField.hovered ? 1*__dp : 0) : 0
radius: parent.height

Expand All @@ -59,9 +57,9 @@ Column {
id: leftIcon

source: control.iconSource
color: errorMsg.length > 0 ? styleV2.negativeColor :
warningMsg.length > 0 ? styleV2.warningColor :
control.enabled ? styleV2.forestColor : styleV2.mediumGreenColor
color: errorMsg.length > 0 ? StyleV2.negativeColor :
warningMsg.length > 0 ? StyleV2.warningColor :
control.enabled ? StyleV2.forestColor : StyleV2.mediumGreenColor
height: rect.height
}

Expand All @@ -73,13 +71,13 @@ Column {
- (leftIcon.visible ? leftIcon.width : 0)
- (button.visible ? button.width : 0)
height: rect.height - 4 * __dp
color: control.enabled ? styleV2.nightColor : styleV2.mediumGreenColor
placeholderTextColor: styleV2.nightAlphaColor
font: styleV2.p5
color: control.enabled ? StyleV2.nightColor : StyleV2.mediumGreenColor
placeholderTextColor: StyleV2.nightAlphaColor
font: StyleV2.p5
hoverEnabled: true
anchors.verticalCenter: parent.verticalCenter
background: Rectangle {
color: styleV2.transparentColor
color: StyleV2.transparentColor
}
}

Expand All @@ -90,20 +88,20 @@ Column {

contentItem: Text {
anchors.centerIn: button
font: styleV2.t5
font: StyleV2.t5
text: control.buttonText
leftPadding: 2 * __dp
rightPadding: 2 * __dp
topPadding: 2 * __dp
bottomPadding: 2 * __dp
color: styleV2.deepOceanColor
color: StyleV2.deepOceanColor
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}

background: Rectangle {
color: button.enabled ? styleV2.grassColor : styleV2.mediumGreenColor
color: button.enabled ? StyleV2.grassColor : StyleV2.mediumGreenColor
radius: height / 2
}

Expand All @@ -126,13 +124,13 @@ Column {
MMIcon {
id: msgIcon

source: visible ? styleV2.errorIcon : ""
color: errorMsg.length > 0 ? styleV2.negativeColor : styleV2.warningColor
source: visible ? StyleV2.errorIcon : ""
color: errorMsg.length > 0 ? StyleV2.negativeColor : StyleV2.warningColor
visible: errorMsg.length > 0 || warningMsg.length > 0
}
Text {
text: errorMsg.length > 0 ? errorMsg : warningMsg
font: styleV2.t4
font: StyleV2.t4
wrapMode: Text.WordWrap
width: messageItem.width - msgRow.spacing - msgIcon.width
visible: errorMsg.length > 0 || warningMsg.length > 0
Expand Down
12 changes: 5 additions & 7 deletions app/qmlV2/component/MMCheckBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,29 @@ CheckBox {

checked: true

StyleV2 { id: styleV2 }

indicator: Rectangle {
implicitWidth: 24
implicitHeight: 24
x: control.leftPadding
y: parent.height / 2 - height / 2
radius: 5
color: enabled ? ( control.checked ? styleV2.grassColor: styleV2.whiteColor ) : styleV2.whiteColor
border.color: enabled ? ( control.checked ? styleV2.grassColor: styleV2.forestColor ) : styleV2.mediumGreenColor
color: enabled ? ( control.checked ? StyleV2.grassColor: StyleV2.whiteColor ) : StyleV2.whiteColor
border.color: enabled ? ( control.checked ? StyleV2.grassColor: StyleV2.forestColor ) : StyleV2.mediumGreenColor
border.width: control.hovered ? 2.5 : 2

MMIcon {
id: icon

anchors.centerIn: parent
source: styleV2.checkmarkIcon
color: control.enabled ? styleV2.forestColor : styleV2.mediumGreenColor
source: StyleV2.checkmarkIcon
color: control.enabled ? StyleV2.forestColor : StyleV2.mediumGreenColor
visible: control.checked
}
}

contentItem: Text {
text: control.text
font: styleV2.p5
font: StyleV2.p5
color: icon.color
verticalAlignment: Text.AlignVCenter
leftPadding: control.indicator.width + control.spacing
Expand Down
32 changes: 15 additions & 17 deletions app/qmlV2/component/MMComboBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,15 @@ Item {
width: 280 * __dp
height: combobox.height + messageItem.height

StyleV2 { id: styleV2 }

ComboBox {
id: combobox

width: parent.width
height: 40 * __dp

indicator: MMIcon {
source: popup.visible ? styleV2.arrowUpIcon : styleV2.arrowDownIcon
color: control.enabled ? styleV2.forestColor : styleV2.mediumGreenColor
source: popup.visible ? StyleV2.arrowUpIcon : StyleV2.arrowDownIcon
color: control.enabled ? StyleV2.forestColor : StyleV2.mediumGreenColor
x: combobox.width - width - combobox.rightPadding
anchors.verticalCenter: parent.verticalCenter
}
Expand All @@ -44,17 +42,17 @@ Item {
rightPadding: combobox.indicator.width + combobox.spacing

text: combobox.displayText
font: styleV2.p4
color: control.enabled ? styleV2.nightColor : styleV2.mediumGreenColor
font: StyleV2.p4
color: control.enabled ? StyleV2.nightColor : StyleV2.mediumGreenColor
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}

background: Rectangle {
color: (errorMsg.length > 0 || warningMsg.length > 0) ? styleV2.errorBgInputColor : styleV2.whiteColor
border.color: (combobox.activeFocus || combobox.hovered) ? (errorMsg.length > 0 ? styleV2.negativeColor :
warningMsg.length > 0 ? styleV2.warningColor :
styleV2.forestColor) : styleV2.transparentColor
color: (errorMsg.length > 0 || warningMsg.length > 0) ? StyleV2.errorBgInputColor : StyleV2.whiteColor
border.color: (combobox.activeFocus || combobox.hovered) ? (errorMsg.length > 0 ? StyleV2.negativeColor :
warningMsg.length > 0 ? StyleV2.warningColor :
StyleV2.forestColor) : StyleV2.transparentColor
border.width: enabled ? (combobox.activeFocus ? 2*__dp : 1*__dp) : 0
radius: parent.height
}
Expand All @@ -77,7 +75,7 @@ Item {
}

background: Rectangle {
border.color: styleV2.forestColor
border.color: StyleV2.forestColor
radius: 2
}
}
Expand All @@ -89,13 +87,13 @@ Item {
height: 30 * __dp
contentItem: Text {
text: modelData
color: combobox.highlightedIndex === index ? styleV2.grassColor : styleV2.forestColor
font: styleV2.p4
color: combobox.highlightedIndex === index ? StyleV2.grassColor : StyleV2.forestColor
font: StyleV2.p4
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
}
background: Rectangle {
border.color: styleV2.whiteColor
border.color: StyleV2.whiteColor
}
}

Expand All @@ -119,13 +117,13 @@ Item {
MMIcon {
id: msgIcon

source: visible ? styleV2.errorIcon : ""
color: errorMsg.length > 0 ? styleV2.negativeColor : styleV2.warningColor
source: visible ? StyleV2.errorIcon : ""
color: errorMsg.length > 0 ? StyleV2.negativeColor : StyleV2.warningColor
visible: errorMsg.length > 0 || warningMsg.length > 0
}
Text {
text: errorMsg.length > 0 ? errorMsg : warningMsg
font: styleV2.t4
font: StyleV2.t4
wrapMode: Text.WordWrap
width: messageItem.width - msgRow.spacing - msgIcon.width
visible: errorMsg.length > 0 || warningMsg.length > 0
Expand Down
30 changes: 14 additions & 16 deletions app/qmlV2/component/MMComponent_reachedDataLimit.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ Item {

width: parent.width

StyleV2 { id: styleV2 }

Component {
id: component

Expand All @@ -41,8 +39,8 @@ Item {
Text {
width: parent.width
text: qsTr("Data to sync")
font: styleV2.p5
color: styleV2.nightColor
font: StyleV2.p5
color: StyleV2.nightColor
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
Expand All @@ -51,14 +49,14 @@ Item {

width: parent.width
text: control.dataToSync
font: styleV2.t3
color: styleV2.nightColor
font: StyleV2.t3
color: StyleV2.nightColor
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
}
}

Rectangle { width: parent.width; height: 1; color: styleV2.grayColor }
Rectangle { width: parent.width; height: 1; color: StyleV2.grayColor }

Item {
width: parent.width
Expand All @@ -67,8 +65,8 @@ Item {
Text {
width: parent.width
text: qsTr("Using")
font: styleV2.p5
color: styleV2.nightColor
font: StyleV2.p5
color: StyleV2.nightColor
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
Expand All @@ -77,8 +75,8 @@ Item {

width: parent.width
text: control.dataUsing
font: styleV2.t3
color: styleV2.nightColor
font: StyleV2.t3
color: StyleV2.nightColor
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
}
Expand All @@ -88,7 +86,7 @@ Item {
position: control.usedData
}

Rectangle { width: parent.width; height: 1; color: styleV2.grayColor }
Rectangle { width: parent.width; height: 1; color: StyleV2.grayColor }

Item {
width: parent.width
Expand All @@ -97,8 +95,8 @@ Item {
Text {
width: parent.width
text: qsTr("Plan")
font: styleV2.p5
color: styleV2.nightColor
font: StyleV2.p5
color: StyleV2.nightColor
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
Expand All @@ -107,8 +105,8 @@ Item {

width: parent.width
text: control.plan
font: styleV2.t3
color: styleV2.nightColor
font: StyleV2.t3
color: StyleV2.nightColor
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
}
Expand Down
Loading

1 comment on commit 0bcfd36

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS - version 23.11.490311 just submitted!

Please sign in to comment.