diff options
| author | Nippy <nippy@rp1.hu> | 2026-05-08 19:50:49 +0200 |
|---|---|---|
| committer | Nippy <nippy@rp1.hu> | 2026-05-08 19:50:49 +0200 |
| commit | 3462bcc46ecf74f576ea4397f16492c16bd75b10 (patch) | |
| tree | c5ab7aef4498647e057bda8d49c11e5f9dda74c9 /raveos-hyprland-theme/theme-data/dms/Modules/ControlCenter/BuiltinPlugins | |
| parent | 56616f693b4f263cbf0d47da43b67424efa6022d (diff) | |
| download | RaveOS-PKGBUILD-3462bcc46ecf74f576ea4397f16492c16bd75b10.tar.gz RaveOS-PKGBUILD-3462bcc46ecf74f576ea4397f16492c16bd75b10.zip | |
raveos update
Diffstat (limited to 'raveos-hyprland-theme/theme-data/dms/Modules/ControlCenter/BuiltinPlugins')
2 files changed, 354 insertions, 0 deletions
diff --git a/raveos-hyprland-theme/theme-data/dms/Modules/ControlCenter/BuiltinPlugins/CupsWidget.qml b/raveos-hyprland-theme/theme-data/dms/Modules/ControlCenter/BuiltinPlugins/CupsWidget.qml new file mode 100644 index 0000000..a275397 --- /dev/null +++ b/raveos-hyprland-theme/theme-data/dms/Modules/ControlCenter/BuiltinPlugins/CupsWidget.qml @@ -0,0 +1,321 @@ +import QtQuick +import QtQuick.Layouts +import qs.Common +import qs.Services +import qs.Widgets +import qs.Modules.Plugins + +PluginComponent { + id: root + + Ref { + service: CupsService + } + + ccWidgetIcon: CupsService.cupsAvailable && CupsService.getPrintersNum() > 0 ? "print" : "print_disabled" + ccWidgetPrimaryText: I18n.tr("Printers") + ccWidgetSecondaryText: { + if (CupsService.cupsAvailable && CupsService.getPrintersNum() > 0) { + return I18n.tr("Printers: ") + CupsService.getPrintersNum() + " - " + I18n.tr("Jobs: ") + CupsService.getTotalJobsNum(); + } else { + if (!CupsService.cupsAvailable) { + return I18n.tr("Print Server not available"); + } else { + return I18n.tr("No printer found"); + } + } + } + ccWidgetIsActive: CupsService.cupsAvailable && CupsService.getTotalJobsNum() > 0 + + onCcWidgetToggled: {} + + ccDetailContent: Component { + Rectangle { + id: detailRoot + implicitHeight: detailColumn.implicitHeight + Theme.spacingM * 2 + radius: Theme.cornerRadius + color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) + + DankActionButton { + anchors.top: parent.top + anchors.right: parent.right + anchors.topMargin: Theme.spacingS + anchors.rightMargin: Theme.spacingS + iconName: "settings" + buttonSize: 24 + iconSize: 14 + iconColor: Theme.surfaceVariantText + onClicked: { + PopoutService.closeControlCenter(); + PopoutService.openSettingsWithTab("printers"); + } + } + + Column { + visible: !CupsService.cupsAvailable || CupsService.getPrintersNum() == 0 + anchors.centerIn: parent + spacing: Theme.spacingS + + DankIcon { + name: "print_disabled" + size: 36 + color: Theme.surfaceVariantText + anchors.horizontalCenter: parent.horizontalCenter + } + + StyledText { + text: !CupsService.cupsAvailable ? I18n.tr("Print Server not available") : I18n.tr("No printer found") + font.pixelSize: Theme.fontSizeMedium + color: Theme.surfaceVariantText + anchors.horizontalCenter: parent.horizontalCenter + } + } + + Column { + id: detailColumn + anchors.fill: parent + anchors.margins: Theme.spacingM + spacing: Theme.spacingS + visible: CupsService.cupsAvailable && CupsService.getPrintersNum() > 0 + height: visible ? 120 : 0 + + RowLayout { + spacing: Theme.spacingS + width: parent.width + + DankDropdown { + id: printerDropdown + text: "" + Layout.fillWidth: true + Layout.maximumWidth: parent.width - 180 + description: "" + currentValue: { + CupsService.getSelectedPrinter(); + } + options: CupsService.getPrintersNames() + onValueChanged: value => { + CupsService.setSelectedPrinter(value); + } + } + + Column { + spacing: Theme.spacingS + + StyledText { + text: CupsService.getCurrentPrinterStatePrettyShort() + font.pixelSize: Theme.fontSizeSmall + color: Theme.surfaceText + font.weight: Font.Medium + anchors.horizontalCenter: parent.horizontalCenter + } + + Row { + spacing: Theme.spacingM + + Rectangle { + height: 24 + width: 80 + radius: 14 + color: printerStatusToggle.containsMouse ? Theme.errorHover : Theme.surfaceLight + visible: true + opacity: 1.0 + + Row { + anchors.centerIn: parent + spacing: Theme.spacingXS + + DankIcon { + anchors.verticalCenter: parent.verticalCenter + name: CupsService.getCurrentPrinterState() === "stopped" ? "play_arrow" : "pause" + size: Theme.fontSizeSmall + 4 + color: Theme.surfaceText + } + + StyledText { + anchors.verticalCenter: parent.verticalCenter + text: CupsService.getCurrentPrinterState() === "stopped" ? I18n.tr("Resume") : I18n.tr("Pause") + font.pixelSize: Theme.fontSizeSmall + color: Theme.surfaceText + font.weight: Font.Medium + } + } + + MouseArea { + id: printerStatusToggle + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + enabled: true + onClicked: { + const selected = CupsService.getSelectedPrinter(); + if (CupsService.getCurrentPrinterState() === "stopped") { + CupsService.resumePrinter(selected); + } else { + CupsService.pausePrinter(selected); + } + } + } + } + + Rectangle { + height: 24 + width: 80 + radius: 14 + color: clearJobsToggle.containsMouse ? Theme.errorHover : Theme.surfaceLight + visible: true + opacity: 1.0 + + Row { + anchors.centerIn: parent + spacing: Theme.spacingXS + + DankIcon { + anchors.verticalCenter: parent.verticalCenter + name: "delete_forever" + size: Theme.fontSizeSmall + 4 + color: Theme.surfaceText + } + + StyledText { + anchors.verticalCenter: parent.verticalCenter + text: I18n.tr("Jobs") + font.pixelSize: Theme.fontSizeSmall + color: Theme.surfaceText + font.weight: Font.Medium + } + } + + MouseArea { + id: clearJobsToggle + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + enabled: true + onClicked: { + const selected = CupsService.getSelectedPrinter(); + CupsService.purgeJobs(selected); + } + } + } + } + } + } + + Rectangle { + height: 1 + width: parent.width + color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12) + } + + DankFlickable { + width: parent.width + height: 160 + contentHeight: listCol.height + clip: true + + Column { + id: listCol + width: parent.width + spacing: Theme.spacingXS + + Item { + width: parent.width + height: 120 + visible: CupsService.getCurrentPrinterJobs().length === 0 + + Column { + anchors.centerIn: parent + spacing: Theme.spacingS + + DankIcon { + name: "work" + size: 36 + color: Theme.surfaceVariantText + anchors.horizontalCenter: parent.horizontalCenter + } + + StyledText { + text: I18n.tr("The job queue of this printer is empty") + font.pixelSize: Theme.fontSizeMedium + color: Theme.surfaceVariantText + anchors.horizontalCenter: parent.horizontalCenter + } + } + } + + Repeater { + model: CupsService.getCurrentPrinterJobs() + + delegate: Rectangle { + required property var modelData + + width: parent ? parent.width : 300 + height: 50 + radius: Theme.cornerRadius + color: Theme.surfaceLight + border.width: 1 + border.color: Theme.outlineLight + opacity: 1.0 + + RowLayout { + anchors.left: parent.left + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + anchors.margins: Theme.spacingM + spacing: Theme.spacingM + + DankIcon { + name: "docs" + size: Theme.iconSize + 2 + color: Theme.surfaceText + Layout.alignment: Qt.AlignVCenter + } + + Column { + spacing: 2 + Layout.alignment: Qt.AlignVCenter + Layout.fillWidth: true + + StyledText { + text: "[" + modelData.id + "] " + modelData.state + " (" + (modelData.size / 1024) + "kb)" + font.pixelSize: Theme.fontSizeMedium + color: Theme.surfaceText + elide: Text.ElideRight + wrapMode: Text.NoWrap + width: parent.width + } + + StyledText { + text: { + var date = new Date(modelData.timeCreated); + return date.toLocaleString(Qt.locale(), Locale.ShortFormat); + } + font.pixelSize: Theme.fontSizeSmall + color: Theme.surfaceTextMedium + } + } + + Item { + Layout.fillWidth: true + } + } + + DankActionButton { + id: cancelJobButton + anchors.right: parent.right + anchors.rightMargin: Theme.spacingM + anchors.verticalCenter: parent.verticalCenter + iconName: "delete" + buttonSize: 36 + onClicked: { + CupsService.cancelJob(CupsService.getSelectedPrinter(), modelData.id); + } + } + } + } + } + } + } + } + } +} diff --git a/raveos-hyprland-theme/theme-data/dms/Modules/ControlCenter/BuiltinPlugins/VpnWidget.qml b/raveos-hyprland-theme/theme-data/dms/Modules/ControlCenter/BuiltinPlugins/VpnWidget.qml new file mode 100644 index 0000000..531045e --- /dev/null +++ b/raveos-hyprland-theme/theme-data/dms/Modules/ControlCenter/BuiltinPlugins/VpnWidget.qml @@ -0,0 +1,33 @@ +import QtQuick +import qs.Common +import qs.Services +import qs.Widgets +import qs.Modules.Plugins + +PluginComponent { + id: root + + Ref { + service: DMSNetworkService + } + + ccWidgetIcon: DMSNetworkService.isBusy ? "sync" : (DMSNetworkService.connected ? "vpn_lock" : "vpn_key_off") + ccWidgetPrimaryText: I18n.tr("VPN") + ccWidgetSecondaryText: { + if (!DMSNetworkService.connected) + return I18n.tr("Disconnected"); + const names = DMSNetworkService.activeNames || []; + if (names.length <= 1) + return names[0] || I18n.tr("Connected"); + return names[0] + " +" + (names.length - 1); + } + ccWidgetIsActive: DMSNetworkService.connected + + onCcWidgetToggled: DMSNetworkService.toggleVpn() + + ccDetailContent: Component { + VpnDetailContent { + listHeight: 260 + } + } +} |