From 13b72f5180848eaa59691c3344398b77c5242a7f Mon Sep 17 00:00:00 2001 From: cutefishd Date: Fri, 9 Apr 2021 22:31:52 +0800 Subject: [PATCH] Update FishUI --- qml/StandardButton.qml | 24 ++++++++++++------------ qml/StandardPad.qml | 12 ++++++------ qml/Zone.qml | 16 ++++++++-------- qml/main.qml | 8 ++++---- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/qml/StandardButton.qml b/qml/StandardButton.qml index b0dea99..0abd01d 100644 --- a/qml/StandardButton.qml +++ b/qml/StandardButton.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import MeuiKit 1.0 as Meui +import FishUI 1.0 as FishUI Item { id: control @@ -16,17 +16,17 @@ Item { Layout.fillWidth: true Layout.fillHeight: true - property color backgroundColor: Meui.Theme.backgroundColor - property color hoveredColor: Meui.Theme.darkMode ? Qt.lighter(Meui.Theme.backgroundColor, 1.1) - : Qt.darker(Meui.Theme.backgroundColor, 1.1) - property color pressedColor: Meui.Theme.darkMode ? Qt.darker(Meui.Theme.backgroundColor, 1.05) - : Qt.darker(Meui.Theme.backgroundColor, 1.3) + property color backgroundColor: FishUI.Theme.backgroundColor + property color hoveredColor: FishUI.Theme.darkMode ? Qt.lighter(FishUI.Theme.backgroundColor, 1.1) + : Qt.darker(FishUI.Theme.backgroundColor, 1.1) + property color pressedColor: FishUI.Theme.darkMode ? Qt.darker(FishUI.Theme.backgroundColor, 1.05) + : Qt.darker(FishUI.Theme.backgroundColor, 1.3) - property color flatBg: Meui.Theme.highlightColor - property color flatHoveredBg: Meui.Theme.darkMode ? Qt.lighter(Meui.Theme.highlightColor, 1.1) - : Qt.darker(Meui.Theme.highlightColor, 1.1) - property color flatPressedBg: Meui.Theme.darkMode ? Qt.lighter(Meui.Theme.highlightColor, 1.05) - : Qt.darker(Meui.Theme.highlightColor, 1.3) + property color flatBg: FishUI.Theme.highlightColor + property color flatHoveredBg: FishUI.Theme.darkMode ? Qt.lighter(FishUI.Theme.highlightColor, 1.1) + : Qt.darker(FishUI.Theme.highlightColor, 1.1) + property color flatPressedBg: FishUI.Theme.darkMode ? Qt.lighter(FishUI.Theme.highlightColor, 1.05) + : Qt.darker(FishUI.Theme.highlightColor, 1.3) Rectangle { id: _background @@ -62,7 +62,7 @@ Item { anchors.verticalCenter: parent.verticalCenter Layout.minimumWidth: parent.width horizontalAlignment: Text.AlignHCenter - color: !flat ? Meui.Theme.textColor : Meui.Theme.highlightedTextColor + color: !flat ? FishUI.Theme.textColor : FishUI.Theme.highlightedTextColor text: control.text visible: !_icon.visible minimumPointSize: Math.round(control.height / 5) diff --git a/qml/StandardPad.qml b/qml/StandardPad.qml index f63d3c8..954f5ab 100644 --- a/qml/StandardPad.qml +++ b/qml/StandardPad.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import MeuiKit 1.0 as Meui +import FishUI 1.0 as FishUI Item { id: control @@ -17,23 +17,23 @@ Item { StandardButton { text: "C"; onClicked: control.pressed(text) } StandardButton { - icon: Meui.Theme.darkMode ? "qrc:/images/dark/backspace.svg" : "qrc:/images/light/backspace.svg" + icon: FishUI.Theme.darkMode ? "qrc:/images/dark/backspace.svg" : "qrc:/images/light/backspace.svg" onClicked: control.pressed("BACKSPACE") } StandardButton { text: "%"; onClicked: control.pressed(text) } - StandardButton { text: "÷"; textColor: Meui.Theme.highlightColor; onClicked: control.pressed(text) } + StandardButton { text: "÷"; textColor: FishUI.Theme.highlightColor; onClicked: control.pressed(text) } StandardButton { text: "7"; onClicked: control.pressed(text) } StandardButton { text: "8"; onClicked: control.pressed(text) } StandardButton { text: "9"; onClicked: control.pressed(text) } - StandardButton { text: "×"; textColor: Meui.Theme.highlightColor; onClicked: control.pressed(text) } + StandardButton { text: "×"; textColor: FishUI.Theme.highlightColor; onClicked: control.pressed(text) } StandardButton { text: "4"; onClicked: control.pressed(text) } StandardButton { text: "5"; onClicked: control.pressed(text) } StandardButton { text: "6"; onClicked: control.pressed(text) } - StandardButton { text: "-"; textColor: Meui.Theme.highlightColor; onClicked: control.pressed(text) } + StandardButton { text: "-"; textColor: FishUI.Theme.highlightColor; onClicked: control.pressed(text) } StandardButton { text: "1"; onClicked: control.pressed(text) } StandardButton { text: "2"; onClicked: control.pressed(text) } StandardButton { text: "3"; onClicked: control.pressed(text) } - StandardButton { text: "+"; textColor: Meui.Theme.highlightColor; onClicked: control.pressed(text) } + StandardButton { text: "+"; textColor: FishUI.Theme.highlightColor; onClicked: control.pressed(text) } StandardButton { text: "0"; onClicked: control.pressed(text) } StandardButton { text: "."; onClicked: control.pressed(text) } StandardButton { text: "()"; onClicked: control.pressed(text) } diff --git a/qml/Zone.qml b/qml/Zone.qml index 85d98b5..c478933 100644 --- a/qml/Zone.qml +++ b/qml/Zone.qml @@ -3,7 +3,7 @@ import QtQuick.Layouts 1.3 import QtQuick.Controls 2.5 import QtQuick.Controls.Styles 1.4 -import MeuiKit 1.0 as Meui +import FishUI 1.0 as FishUI import Cutefish.Calculator 1.0 Item { @@ -30,7 +30,7 @@ Item { } delegate: Item { - height: label.implicitHeight + Meui.Units.largeSpacing * 2 + height: label.implicitHeight + FishUI.Units.largeSpacing * 2 width: parent ? parent.width : undefined Label { @@ -39,10 +39,10 @@ Item { horizontalAlignment: Qt.AlignRight text: historyModel.get(index).text elide: Text.ElideMiddle - color: Meui.Theme.disabledTextColor + color: FishUI.Theme.disabledTextColor - leftPadding: Meui.Units.largeSpacing - rightPadding: Meui.Units.largeSpacing + leftPadding: FishUI.Units.largeSpacing + rightPadding: FishUI.Units.largeSpacing MouseArea { hoverEnabled: true @@ -68,8 +68,8 @@ Item { color: "transparent" } - leftPadding: Meui.Units.largeSpacing - rightPadding: Meui.Units.largeSpacing + leftPadding: FishUI.Units.largeSpacing + rightPadding: FishUI.Units.largeSpacing } } @@ -78,7 +78,7 @@ Item { var res = calculate(textField.text) if (res !== '') { var expressionText = textField.text - textField.text = res; + textField.text = res // If the expression and the result area equal, // it will not be added to the ListView diff --git a/qml/main.qml b/qml/main.qml index b512a56..e508c88 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -2,9 +2,9 @@ import QtQuick 2.12 import QtQuick.Controls 2.5 import QtQuick.Layouts 1.3 import Cutefish.Calculator 1.0 -import MeuiKit 1.0 as Meui +import FishUI 1.0 as FishUI -Meui.Window { +FishUI.Window { visible: true width: 350 height: 550 @@ -13,7 +13,7 @@ Meui.Window { title: qsTr("Calculator") id: rootWindow - backgroundColor: Meui.Theme.darkMode ? Qt.rgba(46 / 255, 46 / 255, 46 / 255, 1.0) + backgroundColor: FishUI.Theme.darkMode ? Qt.rgba(46 / 255, 46 / 255, 46 / 255, 1.0) : Qt.rgba(240 / 255, 238 / 255, 241 / 255, 1.0) CalcEngine { @@ -26,7 +26,7 @@ Meui.Window { ColumnLayout { anchors.fill: parent - spacing: Meui.Units.smallSpacing + spacing: FishUI.Units.smallSpacing Zone { id: zone