Compare commits
No commits in common. "1cdec64535126087d103f1e6cde168dfe757a3f9" and "74267a7dc49d85f30c48af92f14affb1c8ed0cc1" have entirely different histories.
1cdec64535
...
74267a7dc4
13 changed files with 87 additions and 221 deletions
|
|
@ -3,10 +3,6 @@ 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,6 +1,5 @@
|
||||||
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"
|
||||||
|
|
@ -40,7 +39,7 @@ Scope {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
Row {
|
||||||
id: leftbar
|
id: leftbar
|
||||||
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|
@ -53,15 +52,20 @@ 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 {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
Tray {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
id: centerbar
|
id: centerbar
|
||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
@ -72,10 +76,12 @@ Scope {
|
||||||
|
|
||||||
spacing: Dimensions.bar.spacing
|
spacing: Dimensions.bar.spacing
|
||||||
|
|
||||||
Mpris {}
|
Mpris {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
Row {
|
||||||
id: rightbar
|
id: rightbar
|
||||||
|
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
@ -87,27 +93,49 @@ 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,8 +1,9 @@
|
||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
import qs.config
|
import qs.config
|
||||||
|
import qs.constants
|
||||||
import qs.services
|
import qs.services
|
||||||
import qs.widgets
|
import qs.styled
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|
@ -28,7 +29,6 @@ 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,18 +43,12 @@ StyledPopupWindow {
|
||||||
spacing: 8
|
spacing: 8
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
Layout.minimumWidth: 320
|
|
||||||
font.bold: true
|
font.bold: true
|
||||||
text: "Connected Devices"
|
text: "Connected Devices"
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
DeviceList {
|
||||||
Repeater {
|
devices: Bluetooth.connectedDevices
|
||||||
model: Bluetooth.connectedDevices
|
|
||||||
delegate: ConnectedDevice {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
|
@ -62,13 +56,8 @@ StyledPopupWindow {
|
||||||
text: "Paired Devices"
|
text: "Paired Devices"
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
DeviceList {
|
||||||
Repeater {
|
devices: Bluetooth.pairedDevices
|
||||||
model: Bluetooth.pairedDevices
|
|
||||||
delegate: PairedDevice {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
|
@ -78,9 +67,6 @@ StyledPopupWindow {
|
||||||
|
|
||||||
DeviceList {
|
DeviceList {
|
||||||
devices: Bluetooth.availableDevices
|
devices: Bluetooth.availableDevices
|
||||||
onDeviceActivated: device => {
|
|
||||||
device.pair();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,94 +0,0 @@
|
||||||
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,18 +1,16 @@
|
||||||
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: root.devices
|
model: devices
|
||||||
delegate: Clickable {
|
delegate: Clickable {
|
||||||
id: device
|
id: device
|
||||||
required property var modelData
|
required property var modelData
|
||||||
|
|
@ -20,9 +18,6 @@ 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
|
||||||
|
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
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,6 +8,8 @@ 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: 14
|
margins: 8
|
||||||
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: 160
|
Layout.minimumWidth: 120
|
||||||
|
|
||||||
sourceComponent: modelData.isSeparator ? menuSeperator : menuItem
|
sourceComponent: modelData.isSeparator ? menuSeperator : menuItem
|
||||||
property Component menuSeperator: Rectangle {
|
property Component menuSeperator: Rectangle {
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,28 @@
|
||||||
import qs.widgets
|
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
import "../../../../../config/"
|
||||||
|
import "../../../../../styled/"
|
||||||
|
|
||||||
StyledButton {
|
Clickable {
|
||||||
id: root
|
id: item
|
||||||
property QsMenuEntry menuEntry
|
property QsMenuEntry menuEntry
|
||||||
|
|
||||||
|
implicitWidth: text.width
|
||||||
|
implicitHeight: 30
|
||||||
|
|
||||||
onClicked: menuEntry.triggered()
|
onClicked: menuEntry.triggered()
|
||||||
content: StyledText {
|
|
||||||
font.pixelSize: 14
|
StyledText {
|
||||||
text: root.menuEntry.text
|
id: 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 && !device.connected)
|
property list<BluetoothDevice> pairedDevices: defaultAdapter.devices.values.filter(device => device.paired)
|
||||||
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) {
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ PopupWindow {
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
active: root.visible
|
active: root.visible
|
||||||
sourceComponent: root.content
|
sourceComponent: content
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -26,7 +26,7 @@ WrapperMouseArea {
|
||||||
}
|
}
|
||||||
Loader {
|
Loader {
|
||||||
active: true
|
active: true
|
||||||
sourceComponent: root.content
|
sourceComponent: content
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ 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
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue