Update FishUI

pull/1/head 0.1
cutefishd 5 years ago
parent 8072695b5d
commit 13b72f5180

@ -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)

@ -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) }

@ -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

@ -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

Loading…
Cancel
Save