Improve implementation and remove unnecessary code

This commit is contained in:
B.Melnik 2021-09-02 15:20:34 +03:00
parent 50c9a4ca87
commit 4da3ecd92a
No known key found for this signature in database
GPG Key ID: 4A9B2E42E3BD4727
5 changed files with 15 additions and 16 deletions

View File

@ -10,13 +10,13 @@ GridLayout {
rowSpacing: 5
StatusSwitchTabBar {
StatusSwitchTab {
StatusSwitchTabButton {
text: "Swap"
}
StatusSwitchTab {
StatusSwitchTabButton {
text: "Swap & Send"
}
StatusSwitchTab {
StatusSwitchTabButton {
text: "Send"
}
}

View File

@ -3,14 +3,12 @@ import QtQuick.Controls 2.14
import StatusQ.Core.Theme 0.1
TabBar {
id: control
id: statusSwitchTabBar
padding: 1
background: Rectangle {
implicitHeight: 36
color: Theme.palette.directColor7
radius: 8
border.width: 1
border.color: color
}
}

View File

@ -6,19 +6,22 @@ import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
TabButton {
id: control
id: statusSwitchTabButton
contentItem: Item {
height: 36
MouseArea {
id: sensor
hoverEnabled: true
anchors.fill: parent
cursorShape: control.hovered ? Qt.PointingHandCursor : Qt.ArrowCursor
onClicked: control.checked = true
cursorShape: Qt.PointingHandCursor
onPressed: mouse.accepted = false
onReleased: mouse.accepted = false
StatusBaseText {
id: label
text: control.text
text: statusSwitchTabButton.text
color: Theme.palette.primaryColor1
font.weight: Font.Medium
font.pixelSize: 15
@ -32,16 +35,12 @@ TabButton {
id: controlBackground
implicitHeight: 36
implicitWidth: 148
color: control.checked ?
color: statusSwitchTabButton.checked ?
Theme.palette.statusSwitchTab.backgroundColor :
"transparent"
radius: 8
layer.enabled: true
layer.effect: DropShadow {
width: controlBackground.width
height: controlBackground.height
x: controlBackground.x
source: controlBackground
horizontalOffset: 0
verticalOffset: 0
radius: 10

View File

@ -17,5 +17,5 @@ StatusSlider 0.1 StatusSlider.qml
StatusBaseInput 0.1 StatusBaseInput.qml
StatusInput 0.1 StatusInput.qml
StatusPickerButton 0.1 StatusPickerButton.qml
StatusSwitchTab 0.1 StatusSwitchTab.qml
StatusSwitchTabButton 0.1 StatusSwitchTabButton.qml
StatusSwitchTabBar 0.1 StatusSwitchTabBar.qml

View File

@ -263,5 +263,7 @@
<file>src/assets/img/icons/windows_titlebar/maximize.svg</file>
<file>src/assets/img/icons/windows_titlebar/minimise.svg</file>
<file>src/assets/img/icons/windows_titlebar/status.svg</file>
<file>src/StatusQ/Controls/StatusSwitchTabButton.qml</file>
<file>src/StatusQ/Controls/StatusSwitchTabBar.qml</file>
</qresource>
</RCC>