Compare commits
9 commits
74267a7dc4
...
1cdec64535
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1cdec64535 | ||
|
|
149dae4c2e | ||
|
|
ba61c49e44 | ||
|
|
534a676893 | ||
|
|
c4a72273ea | ||
|
|
0d3af3450b | ||
|
|
218873add7 | ||
|
|
a8de6c8946 | ||
|
|
cc0b1ee32c |
13 changed files with 221 additions and 87 deletions
|
|
@ -3,6 +3,10 @@ pragma Singleton
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
|
||||||
Singleton {
|
Singleton {
|
||||||
|
property string batteryFull: "\u{E059}"
|
||||||
|
property string batteryMedium: "\u{E05b}"
|
||||||
|
property string batteryLow: "\u{E05a}"
|
||||||
|
property string batteryWarning: "\u{E3b0}"
|
||||||
property string bell: "\u{E05d}"
|
property string bell: "\u{E05d}"
|
||||||
property string bellRing: "\u{E224}"
|
property string bellRing: "\u{E224}"
|
||||||
property string bluetooth: "\u{E060}"
|
property string bluetooth: "\u{E060}"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import qs.config
|
import qs.config
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import "components"
|
import "components"
|
||||||
import "components/bluetooth"
|
import "components/bluetooth"
|
||||||
|
|
@ -39,7 +40,7 @@ Scope {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
RowLayout {
|
||||||
id: leftbar
|
id: leftbar
|
||||||
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|
@ -52,20 +53,15 @@ Scope {
|
||||||
spacing: Dimensions.bar.spacing
|
spacing: Dimensions.bar.spacing
|
||||||
|
|
||||||
SystemLogo {
|
SystemLogo {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
implicitSize: 22
|
implicitSize: 22
|
||||||
}
|
}
|
||||||
|
|
||||||
Workspaces {
|
Workspaces {}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Tray {
|
Tray {}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
RowLayout {
|
||||||
id: centerbar
|
id: centerbar
|
||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
@ -76,12 +72,10 @@ Scope {
|
||||||
|
|
||||||
spacing: Dimensions.bar.spacing
|
spacing: Dimensions.bar.spacing
|
||||||
|
|
||||||
Mpris {
|
Mpris {}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
RowLayout {
|
||||||
id: rightbar
|
id: rightbar
|
||||||
|
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
@ -93,49 +87,27 @@ Scope {
|
||||||
|
|
||||||
spacing: Dimensions.bar.spacing
|
spacing: Dimensions.bar.spacing
|
||||||
|
|
||||||
Pywal {
|
Pywal {}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Pipewire {
|
Pipewire {}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Caffeine {
|
Caffeine {}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Network {
|
Network {}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Bluetooth {
|
Bluetooth {}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Storage {
|
Storage {}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Memory {
|
Memory {}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Cpu {
|
Cpu {}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Gpu {
|
Gpu {}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Clock {
|
Clock {}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Notifications {
|
Notifications {}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
import qs.config
|
import qs.config
|
||||||
import qs.constants
|
|
||||||
import qs.services
|
import qs.services
|
||||||
import qs.styled
|
import qs.widgets
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|
@ -29,6 +28,7 @@ StyledPopupWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
Switch {
|
Switch {
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
checked: Bluetooth.defaultAdapter.enabled
|
checked: Bluetooth.defaultAdapter.enabled
|
||||||
onClicked: Bluetooth.defaultAdapter.enabled = checked
|
onClicked: Bluetooth.defaultAdapter.enabled = checked
|
||||||
}
|
}
|
||||||
|
|
@ -43,12 +43,18 @@ StyledPopupWindow {
|
||||||
spacing: 8
|
spacing: 8
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
Layout.minimumWidth: 320
|
||||||
font.bold: true
|
font.bold: true
|
||||||
text: "Connected Devices"
|
text: "Connected Devices"
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceList {
|
ColumnLayout {
|
||||||
devices: Bluetooth.connectedDevices
|
Repeater {
|
||||||
|
model: Bluetooth.connectedDevices
|
||||||
|
delegate: ConnectedDevice {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
|
@ -56,8 +62,13 @@ StyledPopupWindow {
|
||||||
text: "Paired Devices"
|
text: "Paired Devices"
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceList {
|
ColumnLayout {
|
||||||
devices: Bluetooth.pairedDevices
|
Repeater {
|
||||||
|
model: Bluetooth.pairedDevices
|
||||||
|
delegate: PairedDevice {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
|
@ -67,6 +78,9 @@ StyledPopupWindow {
|
||||||
|
|
||||||
DeviceList {
|
DeviceList {
|
||||||
devices: Bluetooth.availableDevices
|
devices: Bluetooth.availableDevices
|
||||||
|
onDeviceActivated: device => {
|
||||||
|
device.pair();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
94
modules/bar/components/bluetooth/ConnectedDevice.qml
Normal file
94
modules/bar/components/bluetooth/ConnectedDevice.qml
Normal file
|
|
@ -0,0 +1,94 @@
|
||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import qs.config
|
||||||
|
import qs.constants
|
||||||
|
import qs.widgets
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Bluetooth
|
||||||
|
import Quickshell.Widgets
|
||||||
|
|
||||||
|
StyledLabel {
|
||||||
|
id: device
|
||||||
|
required property BluetoothDevice modelData
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
id: row
|
||||||
|
|
||||||
|
spacing: 8
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
active: modelData.icon != undefined
|
||||||
|
sourceComponent: IconImage {
|
||||||
|
implicitSize: 18
|
||||||
|
source: Quickshell.iconPath(modelData.icon)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: device.modelData.deviceName
|
||||||
|
}
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
active: device.modelData.batteryAvailable
|
||||||
|
sourceComponent: RowLayout {
|
||||||
|
StyledText {
|
||||||
|
id: icon
|
||||||
|
font.family: Theme.lucide.font.family
|
||||||
|
font.pixelSize: Dimensions.cpu.iconSize
|
||||||
|
font.bold: true
|
||||||
|
text: Icons.batteryFull
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "full"
|
||||||
|
when: device.modelData.battery > 0.66
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "medium"
|
||||||
|
when: device.modelData.battery > 0.33
|
||||||
|
PropertyChanges {
|
||||||
|
icon {
|
||||||
|
text: Icons.batteryFull
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "low"
|
||||||
|
when: device.modelData.battery > 0.10
|
||||||
|
PropertyChanges {
|
||||||
|
icon {
|
||||||
|
text: Icons.batteryFull
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "critical"
|
||||||
|
when: device.modelData.battery > 0.10
|
||||||
|
PropertyChanges {
|
||||||
|
icon {
|
||||||
|
text: Icons.batteryWarning
|
||||||
|
color: Theme.palette.error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledButton {
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
color: containsMouse ? Theme.palette.error : Theme.palette.base200
|
||||||
|
content: StyledText {
|
||||||
|
text: 'Disconnect'
|
||||||
|
}
|
||||||
|
onClicked: {
|
||||||
|
if (modelData.state != BluetoothDeviceState.Connected) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
modelData.disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,16 +1,18 @@
|
||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
import qs.config
|
import qs.config
|
||||||
import qs.constants
|
|
||||||
import qs.services
|
|
||||||
import qs.styled
|
import qs.styled
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
import Quickshell.Bluetooth
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: root
|
id: root
|
||||||
required property var devices
|
required property var devices
|
||||||
|
signal deviceActivated(device: BluetoothDevice)
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: devices
|
model: root.devices
|
||||||
delegate: Clickable {
|
delegate: Clickable {
|
||||||
id: device
|
id: device
|
||||||
required property var modelData
|
required property var modelData
|
||||||
|
|
@ -18,6 +20,9 @@ ColumnLayout {
|
||||||
implicitWidth: row.width
|
implicitWidth: row.width
|
||||||
implicitHeight: row.height
|
implicitHeight: row.height
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
onClicked: {
|
||||||
|
root.deviceActivated(modelData);
|
||||||
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: row
|
id: row
|
||||||
|
|
|
||||||
64
modules/bar/components/bluetooth/PairedDevice.qml
Normal file
64
modules/bar/components/bluetooth/PairedDevice.qml
Normal file
|
|
@ -0,0 +1,64 @@
|
||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import qs.config
|
||||||
|
import qs.constants
|
||||||
|
import qs.widgets
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Bluetooth
|
||||||
|
import Quickshell.Widgets
|
||||||
|
|
||||||
|
StyledLabel {
|
||||||
|
id: device
|
||||||
|
required property BluetoothDevice modelData
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
id: row
|
||||||
|
|
||||||
|
spacing: 8
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
active: modelData.icon != undefined
|
||||||
|
sourceComponent: IconImage {
|
||||||
|
implicitSize: 18
|
||||||
|
source: Quickshell.iconPath(device.modelData.icon)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: device.modelData.deviceName
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
StyledButton {
|
||||||
|
hoverEnabled: device.modelData.state == BluetoothDeviceState.Disconnected
|
||||||
|
color: containsMouse ? Theme.palette.info : Theme.palette.base200
|
||||||
|
content: StyledText {
|
||||||
|
text: 'Connect'
|
||||||
|
}
|
||||||
|
onClicked: {
|
||||||
|
if (!hoverEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
device.modelData.connect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledButton {
|
||||||
|
hoverEnabled: device.modelData.state == BluetoothDeviceState.Disconnected
|
||||||
|
color: containsMouse ? Theme.palette.error : Theme.palette.base200
|
||||||
|
content: StyledText {
|
||||||
|
text: 'Unpair'
|
||||||
|
}
|
||||||
|
onClicked: {
|
||||||
|
if (!hoverEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
device.modelData.forget();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -8,8 +8,6 @@ Item {
|
||||||
property int currentIndex: 0
|
property int currentIndex: 0
|
||||||
property var players: Mpris.players
|
property var players: Mpris.players
|
||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
id: players
|
id: players
|
||||||
model: Mpris.players.values.filter(item => item != null)
|
model: Mpris.players.values.filter(item => item != null)
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import qs.config
|
||||||
|
import qs.widgets
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import "../../../../../config/"
|
|
||||||
import "../../../../../styled/"
|
|
||||||
|
|
||||||
StyledPopupWindow {
|
StyledPopupWindow {
|
||||||
id: window
|
id: window
|
||||||
|
|
||||||
backgroundColor: Theme.palette.base300
|
backgroundColor: Theme.palette.base300
|
||||||
margins: 8
|
margins: 14
|
||||||
radius: 8
|
radius: 8
|
||||||
|
|
||||||
property QsMenuOpener menuOpener
|
property QsMenuOpener menuOpener
|
||||||
|
|
@ -25,7 +25,7 @@ StyledPopupWindow {
|
||||||
active: true
|
active: true
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.minimumWidth: 120
|
Layout.minimumWidth: 160
|
||||||
|
|
||||||
sourceComponent: modelData.isSeparator ? menuSeperator : menuItem
|
sourceComponent: modelData.isSeparator ? menuSeperator : menuItem
|
||||||
property Component menuSeperator: Rectangle {
|
property Component menuSeperator: Rectangle {
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,12 @@
|
||||||
|
import qs.widgets
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import "../../../../../config/"
|
|
||||||
import "../../../../../styled/"
|
|
||||||
|
|
||||||
Clickable {
|
StyledButton {
|
||||||
id: item
|
id: root
|
||||||
property QsMenuEntry menuEntry
|
property QsMenuEntry menuEntry
|
||||||
|
|
||||||
implicitWidth: text.width
|
|
||||||
implicitHeight: 30
|
|
||||||
|
|
||||||
onClicked: menuEntry.triggered()
|
onClicked: menuEntry.triggered()
|
||||||
|
content: StyledText {
|
||||||
StyledText {
|
font.pixelSize: 14
|
||||||
id: text
|
text: root.menuEntry.text
|
||||||
|
|
||||||
opacity: item.opacity
|
|
||||||
|
|
||||||
font.pixelSize: Dimensions.clock.fontSize
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
topPadding: Dimensions.clock.verticalPadding
|
|
||||||
bottomPadding: Dimensions.clock.verticalPadding
|
|
||||||
leftPadding: Dimensions.clock.horizontalPadding
|
|
||||||
rightPadding: Dimensions.clock.horizontalPadding
|
|
||||||
|
|
||||||
text: item.menuEntry.text
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ Singleton {
|
||||||
|
|
||||||
property BluetoothAdapter defaultAdapter: Bluetooth.defaultAdapter
|
property BluetoothAdapter defaultAdapter: Bluetooth.defaultAdapter
|
||||||
property list<BluetoothDevice> connectedDevices: defaultAdapter.devices.values.filter(device => device.connected)
|
property list<BluetoothDevice> connectedDevices: defaultAdapter.devices.values.filter(device => device.connected)
|
||||||
property list<BluetoothDevice> pairedDevices: defaultAdapter.devices.values.filter(device => device.paired)
|
property list<BluetoothDevice> pairedDevices: defaultAdapter.devices.values.filter(device => device.paired && !device.connected)
|
||||||
property list<BluetoothDevice> availableDevices: defaultAdapter.devices.values.filter(device => !device.paired)
|
property list<BluetoothDevice> availableDevices: defaultAdapter.devices.values.filter(device => !device.paired)
|
||||||
|
|
||||||
function isConnected(BluetoothDevice: device) {
|
function isConnected(BluetoothDevice: device) {
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ WrapperMouseArea {
|
||||||
}
|
}
|
||||||
Loader {
|
Loader {
|
||||||
active: true
|
active: true
|
||||||
sourceComponent: content
|
sourceComponent: root.content
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import Quickshell.Widgets
|
||||||
|
|
||||||
WrapperRectangle {
|
WrapperRectangle {
|
||||||
id: root
|
id: root
|
||||||
required property Component content
|
|
||||||
margin: 8
|
margin: 8
|
||||||
radius: 8
|
radius: 8
|
||||||
color: Theme.palette.base100
|
color: Theme.palette.base100
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ PopupWindow {
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
active: root.visible
|
active: root.visible
|
||||||
sourceComponent: content
|
sourceComponent: root.content
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Reference in a new issue