refactor: Replace usage of StatusRadioButton under ui/shared to its corresponding StatusQ component
closes #3897
This commit is contained in:
parent
7037df9da0
commit
ef4934cee4
|
@ -5,7 +5,6 @@ import utils 1.0
|
|||
import "../../../../shared"
|
||||
import "../../../../shared/popups"
|
||||
import "../../../../shared/panels"
|
||||
import "../../../../shared/status"
|
||||
|
||||
import "../controls"
|
||||
import "../panels"
|
||||
|
@ -203,7 +202,7 @@ ModalPopup {
|
|||
onClicked: radio.toggle()
|
||||
}
|
||||
|
||||
StatusRadioButton {
|
||||
StatusQControls.StatusRadioButton {
|
||||
id: radio
|
||||
visible: !!messageToPin
|
||||
anchors.right: parent.right
|
||||
|
@ -232,7 +231,7 @@ ModalPopup {
|
|||
enabled: !!messageToUnpin
|
||||
//% "Unpin"
|
||||
text: qsTrId("unpin")
|
||||
type: StatusBaseButton.Type.Danger
|
||||
type: StatusQControls.StatusBaseButton.Type.Danger
|
||||
anchors.right: parent.right
|
||||
onClicked: {
|
||||
const chatId = chatsModel.channelView.activeChannel.id
|
||||
|
|
|
@ -7,6 +7,8 @@ import "../../../../shared"
|
|||
import "../../../../shared/panels"
|
||||
import "../../../../shared/status"
|
||||
|
||||
import StatusQ.Controls 0.1 as StatusQControls
|
||||
|
||||
Rectangle {
|
||||
id: accountViewDelegate
|
||||
|
||||
|
@ -67,13 +69,12 @@ Rectangle {
|
|||
color: Style.current.secondaryText
|
||||
}
|
||||
|
||||
StatusRadioButton {
|
||||
StatusQControls.StatusRadioButton {
|
||||
id: radio
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Style.current.padding
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: accountViewDelegate.selected
|
||||
isHovered: accountViewDelegate.isHovered
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
|
|
|
@ -5,8 +5,8 @@ import QtQuick.Layouts 1.13
|
|||
import utils 1.0
|
||||
import "../../../../shared"
|
||||
import "../../../../shared/panels"
|
||||
import "../../../../shared/status"
|
||||
|
||||
import StatusQ.Controls 0.1
|
||||
|
||||
Rectangle {
|
||||
property var buttonGroup
|
||||
|
|
|
@ -4,7 +4,8 @@ import "./"
|
|||
|
||||
import utils 1.0
|
||||
import "../../../../shared"
|
||||
import "../../../../shared/status"
|
||||
|
||||
import StatusQ.Controls 0.1
|
||||
|
||||
Item {
|
||||
property bool checked: false
|
||||
|
|
|
@ -5,7 +5,8 @@ import utils 1.0
|
|||
|
||||
import "../../../../shared"
|
||||
import "../../../../shared/panels"
|
||||
import "../../../../shared/status"
|
||||
|
||||
import StatusQ.Controls 0.1 as StatusQControls
|
||||
|
||||
Item {
|
||||
id: modalBody
|
||||
|
@ -58,10 +59,9 @@ Item {
|
|||
anchors.leftMargin: Style.current.padding
|
||||
}
|
||||
|
||||
StatusRadioButton {
|
||||
StatusQControls.StatusRadioButton {
|
||||
id: currencyRadioBtn
|
||||
checked: currency === key
|
||||
isHovered: wrapper.hovered
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Style.current.padding
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
|
|
@ -3,10 +3,12 @@ import QtQuick.Controls 2.13
|
|||
import QtQuick.Layouts 1.13
|
||||
|
||||
import utils 1.0
|
||||
import "../status"
|
||||
|
||||
import "../"
|
||||
import "../panels"
|
||||
|
||||
import StatusQ.Controls 0.1
|
||||
|
||||
// TODO: use StatusQ components
|
||||
Rectangle {
|
||||
property var buttonGroup
|
||||
|
|
|
@ -7,6 +7,8 @@ import "../../shared"
|
|||
import "../../shared/panels"
|
||||
import "./"
|
||||
|
||||
import StatusQ.Controls 0.1 as StatusQControls
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
|
||||
|
@ -33,7 +35,7 @@ Rectangle {
|
|||
anchors.rightMargin: root.padding
|
||||
}
|
||||
|
||||
StatusRadioButton {
|
||||
StatusQControls.StatusRadioButton {
|
||||
id: radioControl
|
||||
anchors.top: img.bottom
|
||||
anchors.topMargin: root.padding
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import QtQml 2.14
|
||||
|
||||
import utils 1.0
|
||||
import "../../shared"
|
||||
import "../../shared/panels"
|
||||
|
||||
RadioButton {
|
||||
id: control
|
||||
property bool isHovered: false
|
||||
width: indicator.implicitWidth
|
||||
|
||||
function getColor() {
|
||||
if (checked) {
|
||||
return Style.current.blue
|
||||
}
|
||||
if (hovered || isHovered) {
|
||||
return Style.current.secondaryHover
|
||||
}
|
||||
return Style.current.grey
|
||||
}
|
||||
|
||||
indicator: Rectangle {
|
||||
implicitWidth: 20
|
||||
implicitHeight: 20
|
||||
x: 0
|
||||
y: 6
|
||||
radius: 10
|
||||
color: control.getColor()
|
||||
|
||||
Rectangle {
|
||||
width: 12
|
||||
height: 12
|
||||
radius: 6
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: control.checked ? Style.current.white : Style.current.grey
|
||||
visible: control.checked
|
||||
}
|
||||
}
|
||||
contentItem: StyledText {
|
||||
text: control.text
|
||||
color: Style.current.textColor
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
leftPadding: !!control.text ? control.indicator.width + control.spacing : control.indicator.width
|
||||
font.pixelSize: 15
|
||||
font.family: Style.current.fontRegular.name
|
||||
}
|
||||
}
|
|
@ -6,6 +6,8 @@ import ".."
|
|||
import "../panels"
|
||||
import "."
|
||||
|
||||
import StatusQ.Controls 0.1
|
||||
|
||||
Rectangle {
|
||||
property alias text: textElement.text
|
||||
property var buttonGroup
|
||||
|
|
|
@ -8,7 +8,6 @@ StatusEmojiSection 1.0 StatusEmojiSection.qml
|
|||
StatusGifPopup 1.0 StatusGifPopup.qml
|
||||
StatusGifColumn 1.0 StatusGifColumn.qml
|
||||
StatusImageIdenticon 1.0 StatusImageIdenticon.qml
|
||||
StatusRadioButton 1.0 StatusRadioButton.qml
|
||||
StatusRoundButton 1.0 StatusRoundButton.qml
|
||||
StatusSectionHeadline 1.0 StatusSectionHeadline.qml
|
||||
StatusSlider 1.0 StatusSlider.qml
|
||||
|
|
Loading…
Reference in New Issue