move bluetooth and create popup menu
This commit is contained in:
parent
d7024f3d77
commit
c0125912b1
3 changed files with 48 additions and 7 deletions
|
|
@ -1,10 +1,11 @@
|
||||||
|
import qs.config
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import "components"
|
import "components"
|
||||||
|
import "components/bluetooth"
|
||||||
import "components/hyprland"
|
import "components/hyprland"
|
||||||
import "components/mpris"
|
import "components/mpris"
|
||||||
import "components/tray"
|
import "components/tray"
|
||||||
import "../../config/"
|
|
||||||
|
|
||||||
Scope {
|
Scope {
|
||||||
PanelWindow {
|
PanelWindow {
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
import "../../../config/"
|
import qs.config
|
||||||
import "../../../constants/"
|
import qs.constants
|
||||||
import "../../../styled/"
|
import qs.styled
|
||||||
|
|
||||||
Clickable {
|
Clickable {
|
||||||
id: clickable
|
id: root
|
||||||
|
|
||||||
implicitWidth: text.width
|
implicitWidth: text.width
|
||||||
implicitHeight: Dimensions.bluetooth.height
|
implicitHeight: Dimensions.bluetooth.height
|
||||||
|
|
||||||
onClicked: {}
|
onClicked: {
|
||||||
|
popup.opened = !popup.opened;
|
||||||
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
id: text
|
id: text
|
||||||
|
|
@ -18,7 +20,7 @@ Clickable {
|
||||||
font.bold: true
|
font.bold: true
|
||||||
text: Icons.bluetooth
|
text: Icons.bluetooth
|
||||||
|
|
||||||
color: clickable.containsMouse ? Theme.palette.base300 : Theme.palette.basecontent
|
color: root.containsMouse ? Theme.palette.base300 : Theme.palette.basecontent
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
topPadding: Dimensions.bluetooth.verticalPadding
|
topPadding: Dimensions.bluetooth.verticalPadding
|
||||||
|
|
@ -26,4 +28,12 @@ Clickable {
|
||||||
leftPadding: Dimensions.bluetooth.horizontalPadding
|
leftPadding: Dimensions.bluetooth.horizontalPadding
|
||||||
rightPadding: Dimensions.bluetooth.horizontalPadding
|
rightPadding: Dimensions.bluetooth.horizontalPadding
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BluetoothMenu {
|
||||||
|
id: popup
|
||||||
|
|
||||||
|
anchor.item: root
|
||||||
|
anchor.rect.x: root.width / 2 - width / 2
|
||||||
|
anchor.rect.y: root.height + 8
|
||||||
|
}
|
||||||
}
|
}
|
||||||
30
modules/bar/components/bluetooth/BluetoothMenu.qml
Normal file
30
modules/bar/components/bluetooth/BluetoothMenu.qml
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
import qs.config
|
||||||
|
import qs.styled
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import Quickshell.Bluetooth
|
||||||
|
|
||||||
|
StyledPopupWindow {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
backgroundColor: Theme.palette.base300
|
||||||
|
margins: 8
|
||||||
|
radius: 8
|
||||||
|
|
||||||
|
property BluetoothAdapter defaultAdapter: Bluetooth.defaultAdapter
|
||||||
|
|
||||||
|
content: ColumnLayout {
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
StyledText {
|
||||||
|
text: root.defaultAdapter.name
|
||||||
|
}
|
||||||
|
|
||||||
|
Switch {
|
||||||
|
checked: root.defaultAdapter.enabled
|
||||||
|
onClicked: root.defaultAdapter.enabled = checked
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue