fix(StatusButtonRow): move to StatusQ
- also split the SB pages
This commit is contained in:
parent
824f14e220
commit
9eba61e18c
|
@ -0,0 +1,68 @@
|
||||||
|
import QtQuick 2.15
|
||||||
|
import QtQuick.Layouts 1.15
|
||||||
|
import QtQuick.Controls 2.15
|
||||||
|
|
||||||
|
import StatusQ.Core 0.1
|
||||||
|
import StatusQ.Core.Theme 0.1
|
||||||
|
|
||||||
|
import shared.controls 1.0
|
||||||
|
import utils 1.0
|
||||||
|
|
||||||
|
import Storybook 1.0
|
||||||
|
|
||||||
|
SplitView {
|
||||||
|
orientation: Qt.Horizontal
|
||||||
|
|
||||||
|
Logs { id: logs }
|
||||||
|
|
||||||
|
Pane {
|
||||||
|
SplitView.fillWidth: true
|
||||||
|
SplitView.fillHeight: true
|
||||||
|
|
||||||
|
SlippageSelector {
|
||||||
|
id: buttonRow
|
||||||
|
|
||||||
|
anchors.centerIn: parent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LogsAndControlsPanel {
|
||||||
|
SplitView.fillHeight: true
|
||||||
|
SplitView.preferredWidth: 300
|
||||||
|
|
||||||
|
logsView.logText: logs.logText
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
Label {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
font.weight: Font.Medium
|
||||||
|
text: "Value: %1".arg(buttonRow.value)
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
font.weight: Font.Medium
|
||||||
|
text: "Valid: " + buttonRow.valid//"%1".arg(buttonRow.valid ? "true" : "false")
|
||||||
|
}
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
Repeater {
|
||||||
|
model: [0.1, 0.5, 0.24, 0.8, 120.84]
|
||||||
|
|
||||||
|
Button {
|
||||||
|
text: "set " + modelData
|
||||||
|
onClicked: buttonRow.value = modelData
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item { Layout.fillHeight: true }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// category: Controls
|
||||||
|
|
||||||
|
// https://www.figma.com/design/TS0eQX9dAZXqZtELiwKIoK/Swap---Milestone-1?node-id=3409-257346&t=ENK93cK7GyTqEV8S-0
|
||||||
|
// https://www.figma.com/design/TS0eQX9dAZXqZtELiwKIoK/Swap---Milestone-1?node-id=3410-262441&t=ENK93cK7GyTqEV8S-0
|
|
@ -4,8 +4,8 @@ import QtQuick.Controls 2.15
|
||||||
|
|
||||||
import StatusQ.Core 0.1
|
import StatusQ.Core 0.1
|
||||||
import StatusQ.Core.Theme 0.1
|
import StatusQ.Core.Theme 0.1
|
||||||
|
import StatusQ.Controls 0.1
|
||||||
|
|
||||||
import shared.controls 1.0
|
|
||||||
import utils 1.0
|
import utils 1.0
|
||||||
|
|
||||||
import Storybook 1.0
|
import Storybook 1.0
|
||||||
|
@ -15,14 +15,27 @@ SplitView {
|
||||||
|
|
||||||
Logs { id: logs }
|
Logs { id: logs }
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: d
|
||||||
|
readonly property var values: [0.1, 0.5, 0.7, 1] // predefined values
|
||||||
|
}
|
||||||
|
|
||||||
|
ListModel {
|
||||||
|
id: valuesModel
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
valuesModel.append(d.values.map(i => ({ text: "%L1".arg(i), value: i })))
|
||||||
|
}
|
||||||
|
|
||||||
Pane {
|
Pane {
|
||||||
SplitView.fillWidth: true
|
SplitView.fillWidth: true
|
||||||
SplitView.fillHeight: true
|
SplitView.fillHeight: true
|
||||||
|
|
||||||
SlippageSelector {
|
StatusButtonRow {
|
||||||
id: buttonRow
|
id: buttonRow
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
model: valuesModel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,23 +51,13 @@ SplitView {
|
||||||
Label {
|
Label {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
text: "Value: %1".arg(buttonRow.value)
|
text: "Raw model: %1".arg(d.values)
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
text: "Valid: " + buttonRow.valid//"%1".arg(buttonRow.valid ? "true" : "false")
|
text: "Value: %1".arg(buttonRow.value)
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
Repeater {
|
|
||||||
model: [0.1, 0.5, 0.24, 0.8, 120.84]
|
|
||||||
|
|
||||||
Button {
|
|
||||||
text: "set " + modelData
|
|
||||||
onClicked: buttonRow.value = modelData
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item { Layout.fillHeight: true }
|
Item { Layout.fillHeight: true }
|
||||||
|
|
|
@ -5,8 +5,6 @@ import QtQuick.Layouts 1.15
|
||||||
import StatusQ.Core 0.1
|
import StatusQ.Core 0.1
|
||||||
import StatusQ.Controls 0.1
|
import StatusQ.Controls 0.1
|
||||||
|
|
||||||
import utils 1.0
|
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
@ -16,7 +14,7 @@ RowLayout {
|
||||||
property alias model: repeater.model
|
property alias model: repeater.model
|
||||||
property var value: null
|
property var value: null
|
||||||
|
|
||||||
spacing: Style.current.halfPadding
|
spacing: 8
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
id: repeater
|
id: repeater
|
|
@ -15,6 +15,7 @@ StatusTabBarIconButton 0.1 StatusTabBarIconButton.qml
|
||||||
StatusToolTip 0.1 StatusToolTip.qml
|
StatusToolTip 0.1 StatusToolTip.qml
|
||||||
StatusBaseButton 0.1 StatusBaseButton.qml
|
StatusBaseButton 0.1 StatusBaseButton.qml
|
||||||
StatusButton 0.1 StatusButton.qml
|
StatusButton 0.1 StatusButton.qml
|
||||||
|
StatusButtonRow 0.1 StatusButtonRow.qml
|
||||||
StatusFlatButton 0.1 StatusFlatButton.qml
|
StatusFlatButton 0.1 StatusFlatButton.qml
|
||||||
StatusRoundButton 0.1 StatusRoundButton.qml
|
StatusRoundButton 0.1 StatusRoundButton.qml
|
||||||
StatusFlatRoundButton 0.1 StatusFlatRoundButton.qml
|
StatusFlatRoundButton 0.1 StatusFlatRoundButton.qml
|
||||||
|
|
|
@ -93,6 +93,7 @@
|
||||||
<file>StatusQ/Controls/StatusBaseInput.qml</file>
|
<file>StatusQ/Controls/StatusBaseInput.qml</file>
|
||||||
<file>StatusQ/Controls/StatusBlockProgressBar.qml</file>
|
<file>StatusQ/Controls/StatusBlockProgressBar.qml</file>
|
||||||
<file>StatusQ/Controls/StatusButton.qml</file>
|
<file>StatusQ/Controls/StatusButton.qml</file>
|
||||||
|
<file>StatusQ/Controls/StatusButtonRow.qml</file>
|
||||||
<file>StatusQ/Controls/StatusChatCommandButton.qml</file>
|
<file>StatusQ/Controls/StatusChatCommandButton.qml</file>
|
||||||
<file>StatusQ/Controls/StatusChatInfoButton.qml</file>
|
<file>StatusQ/Controls/StatusChatInfoButton.qml</file>
|
||||||
<file>StatusQ/Controls/StatusChatListCategoryItemButton.qml</file>
|
<file>StatusQ/Controls/StatusChatListCategoryItemButton.qml</file>
|
||||||
|
|
|
@ -33,7 +33,6 @@ SettingsRadioButton 1.0 SettingsRadioButton.qml
|
||||||
ShapeRectangle 1.0 ShapeRectangle.qml
|
ShapeRectangle 1.0 ShapeRectangle.qml
|
||||||
SlippageSelector 1.0 SlippageSelector.qml
|
SlippageSelector 1.0 SlippageSelector.qml
|
||||||
SocialLinkPreview 1.0 SocialLinkPreview.qml
|
SocialLinkPreview 1.0 SocialLinkPreview.qml
|
||||||
StatusButtonRow 1.0 StatusButtonRow.qml
|
|
||||||
StatusSyncCodeInput 1.0 StatusSyncCodeInput.qml
|
StatusSyncCodeInput 1.0 StatusSyncCodeInput.qml
|
||||||
StatusSyncCodeScan 1.0 StatusSyncCodeScan.qml
|
StatusSyncCodeScan 1.0 StatusSyncCodeScan.qml
|
||||||
StatusSyncingInstructions 1.0 StatusSyncingInstructions.qml
|
StatusSyncingInstructions 1.0 StatusSyncingInstructions.qml
|
||||||
|
|
Loading…
Reference in New Issue