update styledbutton to extend button
This commit is contained in:
parent
160cd3c1d5
commit
c983cf206b
12 changed files with 74 additions and 134 deletions
|
|
@ -1,7 +1,6 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import qs.components
|
||||
import qs.config
|
||||
import qs.widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
|
@ -31,13 +30,11 @@ StyledLabel {
|
|||
}
|
||||
|
||||
StyledButton {
|
||||
|
||||
Layout.alignment: Qt.AlignRight
|
||||
hoverEnabled: !root.modelData.pairing
|
||||
color: containsMouse ? Theme.palette.primary : Theme.palette.base200
|
||||
content: StyledText {
|
||||
text: 'Pair'
|
||||
font.pixelSize: 12
|
||||
}
|
||||
text: 'Pair'
|
||||
|
||||
onClicked: {
|
||||
if (!hoverEnabled) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -80,11 +80,9 @@ StyledLabel {
|
|||
|
||||
StyledButton {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
color: containsMouse ? Theme.palette.error : Theme.palette.base200
|
||||
content: StyledText {
|
||||
text: 'Disconnect'
|
||||
font.pixelSize: 12
|
||||
}
|
||||
text: 'Disconnect'
|
||||
palette.button: hovered ? Theme.palette.error : Theme.palette.base200
|
||||
|
||||
onClicked: {
|
||||
if (root.modelData.state != BluetoothDeviceState.Connected) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -34,11 +34,8 @@ StyledLabel {
|
|||
Layout.alignment: Qt.AlignRight
|
||||
StyledButton {
|
||||
hoverEnabled: root.modelData.state == BluetoothDeviceState.Disconnected
|
||||
color: containsMouse ? Theme.palette.primary : Theme.palette.base200
|
||||
content: StyledText {
|
||||
text: 'Connect'
|
||||
font.pixelSize: 12
|
||||
}
|
||||
text: 'Connect'
|
||||
|
||||
onClicked: {
|
||||
if (!hoverEnabled) {
|
||||
return;
|
||||
|
|
@ -49,11 +46,10 @@ StyledLabel {
|
|||
|
||||
StyledButton {
|
||||
hoverEnabled: root.modelData.state == BluetoothDeviceState.Disconnected
|
||||
color: containsMouse ? Theme.palette.error : Theme.palette.base200
|
||||
content: StyledText {
|
||||
text: 'Unpair'
|
||||
font.pixelSize: 12
|
||||
}
|
||||
text: 'Unpair'
|
||||
|
||||
palette.button: hovered ? Theme.palette.error : Theme.palette.base100
|
||||
|
||||
onClicked: {
|
||||
if (!hoverEnabled) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue