mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-23 12:08:53 +00:00
chore(StatusQ): Add new component StatusIconSwitch
Component holding a switch and a title/subtitle using the app style
This commit is contained in:
parent
9d4bc9466e
commit
ac569b8ba5
57
ui/StatusQ/src/StatusQ/Controls/StatusIconSwitch.qml
Normal file
57
ui/StatusQ/src/StatusQ/Controls/StatusIconSwitch.qml
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
import QtQuick 2.14
|
||||||
|
import QtQuick.Controls 2.14
|
||||||
|
import QtQuick.Layouts 1.14
|
||||||
|
|
||||||
|
import StatusQ.Core 0.1
|
||||||
|
import StatusQ.Components 0.1
|
||||||
|
import StatusQ.Controls 0.1
|
||||||
|
import StatusQ.Core.Theme 0.1
|
||||||
|
|
||||||
|
Control {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property string title
|
||||||
|
property string subTitle
|
||||||
|
property string icon
|
||||||
|
property alias checked: switchItem.checked
|
||||||
|
|
||||||
|
signal toggled
|
||||||
|
|
||||||
|
contentItem: RowLayout {
|
||||||
|
spacing: 16
|
||||||
|
|
||||||
|
StatusRoundIcon {
|
||||||
|
asset.name: root.icon
|
||||||
|
}
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
StatusBaseText {
|
||||||
|
text: root.title
|
||||||
|
color: Theme.palette.directColor1
|
||||||
|
font.pixelSize: 15
|
||||||
|
}
|
||||||
|
|
||||||
|
Item { Layout.fillWidth: true }
|
||||||
|
|
||||||
|
StatusBaseText {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
text: root.subTitle
|
||||||
|
visible: !!text
|
||||||
|
color: Theme.palette.baseColor1
|
||||||
|
font.pixelSize: 15
|
||||||
|
lineHeight: 1.2
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
elide: Text.ElideRight
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StatusSwitch {
|
||||||
|
id: switchItem
|
||||||
|
|
||||||
|
onToggled: root.toggled()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -58,3 +58,4 @@ StatusImageSelector 0.1 StatusImageSelector.qml
|
|||||||
StatusColorRadioButton 0.1 StatusColorRadioButton.qml
|
StatusColorRadioButton 0.1 StatusColorRadioButton.qml
|
||||||
StatusBlockProgressBar 0.1 StatusBlockProgressBar.qml
|
StatusBlockProgressBar 0.1 StatusBlockProgressBar.qml
|
||||||
StatusWarningBox 0.1 StatusWarningBox.qml
|
StatusWarningBox 0.1 StatusWarningBox.qml
|
||||||
|
StatusIconSwitch 0.1 StatusIconSwitch.qml
|
||||||
|
@ -102,6 +102,7 @@
|
|||||||
<file>StatusQ/Controls/StatusDropdown.qml</file>
|
<file>StatusQ/Controls/StatusDropdown.qml</file>
|
||||||
<file>StatusQ/Controls/StatusFlatButton.qml</file>
|
<file>StatusQ/Controls/StatusFlatButton.qml</file>
|
||||||
<file>StatusQ/Controls/StatusFlatRoundButton.qml</file>
|
<file>StatusQ/Controls/StatusFlatRoundButton.qml</file>
|
||||||
|
<file>StatusQ/Controls/StatusIconSwitch.qml</file>
|
||||||
<file>StatusQ/Controls/StatusIconTabButton.qml</file>
|
<file>StatusQ/Controls/StatusIconTabButton.qml</file>
|
||||||
<file>StatusQ/Controls/StatusIconTextButton.qml</file>
|
<file>StatusQ/Controls/StatusIconTextButton.qml</file>
|
||||||
<file>StatusQ/Controls/StatusIdenticonRing.qml</file>
|
<file>StatusQ/Controls/StatusIdenticonRing.qml</file>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user