mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-16 17:22:45 -04:00
text: change default rendering back to Qt
This commit is contained in:
@@ -741,7 +741,7 @@ BasePill {
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
visible: !iconImg.visible && !coreIcon.visible && !Paths.isSteamApp(appItem.appId)
|
||||
text: {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import qs.Common
|
||||
import qs.Modules.Plugins
|
||||
import qs.Services
|
||||
@@ -11,7 +10,7 @@ BasePill {
|
||||
property bool layoutPopupVisible: false
|
||||
property var popoutTarget: null
|
||||
|
||||
signal toggleLayoutPopup()
|
||||
signal toggleLayoutPopup
|
||||
|
||||
visible: CompositorService.isDwl && DwlService.dwlAvailable
|
||||
|
||||
@@ -20,27 +19,27 @@ BasePill {
|
||||
property int currentLayoutIndex: outputState?.layout || 0
|
||||
|
||||
readonly property var layoutIcons: ({
|
||||
"CT": "view_compact",
|
||||
"G": "grid_view",
|
||||
"K": "layers",
|
||||
"M": "fullscreen",
|
||||
"RT": "view_sidebar",
|
||||
"S": "view_carousel",
|
||||
"T": "view_quilt",
|
||||
"VG": "grid_on",
|
||||
"VK": "view_day",
|
||||
"VS": "scrollable_header",
|
||||
"VT": "clarify"
|
||||
})
|
||||
"CT": "view_compact",
|
||||
"G": "grid_view",
|
||||
"K": "layers",
|
||||
"M": "fullscreen",
|
||||
"RT": "view_sidebar",
|
||||
"S": "view_carousel",
|
||||
"T": "view_quilt",
|
||||
"VG": "grid_on",
|
||||
"VK": "view_day",
|
||||
"VS": "scrollable_header",
|
||||
"VT": "clarify"
|
||||
})
|
||||
|
||||
function getLayoutIcon(symbol) {
|
||||
return layoutIcons[symbol] || "view_quilt"
|
||||
return layoutIcons[symbol] || "view_quilt";
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: DwlService
|
||||
function onStateChanged() {
|
||||
outputState = parentScreen ? DwlService.getOutputState(parentScreen.name) : null
|
||||
outputState = parentScreen ? DwlService.getOutputState(parentScreen.name) : null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,17 +93,17 @@ BasePill {
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
toggleLayoutPopup()
|
||||
toggleLayoutPopup();
|
||||
}
|
||||
|
||||
onRightClicked: {
|
||||
if (!parentScreen || !DwlService.dwlAvailable || DwlService.layouts.length === 0) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
const currentIndex = layout.currentLayoutIndex
|
||||
const nextIndex = (currentIndex + 1) % DwlService.layouts.length
|
||||
const currentIndex = layout.currentLayoutIndex;
|
||||
const nextIndex = (currentIndex + 1) % DwlService.layouts.length;
|
||||
|
||||
DwlService.setLayout(parentScreen.name, nextIndex)
|
||||
DwlService.setLayout(parentScreen.name, nextIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,12 +131,17 @@ BasePill {
|
||||
if (root.diskUsagePercent === undefined || root.diskUsagePercent === null || root.diskUsagePercent === 0) {
|
||||
return "--";
|
||||
}
|
||||
if (!root.selectedMount) return "--";
|
||||
if (!root.selectedMount)
|
||||
return "--";
|
||||
switch (root.diskUsageMode) {
|
||||
case 1: return root.selectedMount.size || "--";
|
||||
case 2: return root.selectedMount.avail || "--";
|
||||
case 3: return (root.selectedMount.avail || "--") + " / " + (root.selectedMount.size || "--");
|
||||
default: return root.diskUsagePercent.toFixed(0);
|
||||
case 1:
|
||||
return root.selectedMount.size || "--";
|
||||
case 2:
|
||||
return root.selectedMount.avail || "--";
|
||||
case 3:
|
||||
return (root.selectedMount.avail || "--") + " / " + (root.selectedMount.size || "--");
|
||||
default:
|
||||
return root.diskUsagePercent.toFixed(0);
|
||||
}
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
@@ -185,12 +190,17 @@ BasePill {
|
||||
if (root.diskUsagePercent === undefined || root.diskUsagePercent === null || root.diskUsagePercent === 0) {
|
||||
return "--%";
|
||||
}
|
||||
if (!root.selectedMount) return "--%";
|
||||
if (!root.selectedMount)
|
||||
return "--%";
|
||||
switch (root.diskUsageMode) {
|
||||
case 1: return root.selectedMount.size || "--";
|
||||
case 2: return root.selectedMount.avail || "--";
|
||||
case 3: return (root.selectedMount.avail || "--") + " / " + (root.selectedMount.size || "--");
|
||||
default: return root.diskUsagePercent.toFixed(0) + "%";
|
||||
case 1:
|
||||
return root.selectedMount.size || "--";
|
||||
case 2:
|
||||
return root.selectedMount.avail || "--";
|
||||
case 3:
|
||||
return (root.selectedMount.avail || "--") + " / " + (root.selectedMount.size || "--");
|
||||
default:
|
||||
return root.diskUsagePercent.toFixed(0) + "%";
|
||||
}
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
@@ -204,10 +214,13 @@ BasePill {
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
text: {
|
||||
switch (root.diskUsageMode) {
|
||||
case 3: return "888.8G / 888.8G";
|
||||
case 1:
|
||||
case 2: return "888.8G";
|
||||
default: return "100%";
|
||||
case 3:
|
||||
return "888.8G / 888.8G";
|
||||
case 1:
|
||||
case 2:
|
||||
return "888.8G";
|
||||
default:
|
||||
return "100%";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,9 +132,7 @@ BasePill {
|
||||
const focusedWin = NiriService.windows.find(w => w.is_focused);
|
||||
if (!focusedWin)
|
||||
return false;
|
||||
const screenWsIds = new Set(
|
||||
NiriService.allWorkspaces.filter(ws => ws.output === parentScreen.name).map(ws => ws.id)
|
||||
);
|
||||
const screenWsIds = new Set(NiriService.allWorkspaces.filter(ws => ws.output === parentScreen.name).map(ws => ws.id));
|
||||
return screenWsIds.has(focusedWin.workspace_id);
|
||||
}
|
||||
|
||||
@@ -211,7 +209,7 @@ BasePill {
|
||||
visible: root.isVerticalOrientation && activeWindow && activeWindow.appId && appIcon.status !== Image.Ready && Paths.isSteamApp(activeWindow.appId)
|
||||
}
|
||||
|
||||
Text {
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
visible: root.isVerticalOrientation && activeWindow && activeWindow.appId && appIcon.status !== Image.Ready && !Paths.isSteamApp(activeWindow.appId)
|
||||
text: {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import qs.Common
|
||||
import qs.Modules.Plugins
|
||||
import qs.Modules.ProcessList
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
@@ -11,21 +9,21 @@ BasePill {
|
||||
|
||||
function formatNetworkSpeed(bytesPerSec) {
|
||||
if (bytesPerSec < 1024) {
|
||||
return bytesPerSec.toFixed(0) + " B/s"
|
||||
return bytesPerSec.toFixed(0) + " B/s";
|
||||
} else if (bytesPerSec < 1024 * 1024) {
|
||||
return (bytesPerSec / 1024).toFixed(1) + " KB/s"
|
||||
return (bytesPerSec / 1024).toFixed(1) + " KB/s";
|
||||
} else if (bytesPerSec < 1024 * 1024 * 1024) {
|
||||
return (bytesPerSec / (1024 * 1024)).toFixed(1) + " MB/s"
|
||||
return (bytesPerSec / (1024 * 1024)).toFixed(1) + " MB/s";
|
||||
} else {
|
||||
return (bytesPerSec / (1024 * 1024 * 1024)).toFixed(1) + " GB/s"
|
||||
return (bytesPerSec / (1024 * 1024 * 1024)).toFixed(1) + " GB/s";
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
DgopService.addRef(["network"])
|
||||
DgopService.addRef(["network"]);
|
||||
}
|
||||
Component.onDestruction: {
|
||||
DgopService.removeRef(["network"])
|
||||
DgopService.removeRef(["network"]);
|
||||
}
|
||||
|
||||
content: Component {
|
||||
@@ -48,10 +46,12 @@ BasePill {
|
||||
|
||||
StyledText {
|
||||
text: {
|
||||
const rate = DgopService.networkRxRate
|
||||
if (rate < 1024) return rate.toFixed(0)
|
||||
if (rate < 1024 * 1024) return (rate / 1024).toFixed(0) + "K"
|
||||
return (rate / (1024 * 1024)).toFixed(0) + "M"
|
||||
const rate = DgopService.networkRxRate;
|
||||
if (rate < 1024)
|
||||
return rate.toFixed(0);
|
||||
if (rate < 1024 * 1024)
|
||||
return (rate / 1024).toFixed(0) + "K";
|
||||
return (rate / (1024 * 1024)).toFixed(0) + "M";
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.info
|
||||
@@ -60,10 +60,12 @@ BasePill {
|
||||
|
||||
StyledText {
|
||||
text: {
|
||||
const rate = DgopService.networkTxRate
|
||||
if (rate < 1024) return rate.toFixed(0)
|
||||
if (rate < 1024 * 1024) return (rate / 1024).toFixed(0) + "K"
|
||||
return (rate / (1024 * 1024)).toFixed(0) + "M"
|
||||
const rate = DgopService.networkTxRate;
|
||||
if (rate < 1024)
|
||||
return rate.toFixed(0);
|
||||
if (rate < 1024 * 1024)
|
||||
return (rate / 1024).toFixed(0) + "K";
|
||||
return (rate / (1024 * 1024)).toFixed(0) + "M";
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||
color: Theme.error
|
||||
|
||||
@@ -316,7 +316,7 @@ BasePill {
|
||||
visible: !iconImg.visible && Paths.isSteamApp(effectiveAppId)
|
||||
}
|
||||
|
||||
Text {
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
visible: !iconImg.visible && !Paths.isSteamApp(effectiveAppId)
|
||||
text: {
|
||||
@@ -570,7 +570,7 @@ BasePill {
|
||||
visible: !iconImg.visible && Paths.isSteamApp(effectiveAppId)
|
||||
}
|
||||
|
||||
Text {
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
visible: !iconImg.visible && !Paths.isSteamApp(effectiveAppId)
|
||||
text: {
|
||||
|
||||
@@ -428,7 +428,7 @@ BasePill {
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
visible: !iconImg.visible
|
||||
text: {
|
||||
@@ -649,7 +649,7 @@ BasePill {
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
visible: !inlineIconImg.visible
|
||||
text: {
|
||||
@@ -783,7 +783,7 @@ BasePill {
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
visible: !iconImg.visible
|
||||
text: {
|
||||
@@ -1290,7 +1290,7 @@ BasePill {
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
visible: !menuIconImg.visible
|
||||
text: {
|
||||
|
||||
@@ -16,9 +16,11 @@ BasePill {
|
||||
content: Component {
|
||||
Item {
|
||||
implicitWidth: {
|
||||
if (!SettingsData.weatherEnabled) return 0
|
||||
if (root.isVerticalOrientation) return root.widgetThickness - root.horizontalPadding * 2
|
||||
return Math.min(100 - root.horizontalPadding * 2, weatherRow.implicitWidth)
|
||||
if (!SettingsData.weatherEnabled)
|
||||
return 0;
|
||||
if (root.isVerticalOrientation)
|
||||
return root.widgetThickness - root.horizontalPadding * 2;
|
||||
return Math.min(100 - root.horizontalPadding * 2, weatherRow.implicitWidth);
|
||||
}
|
||||
implicitHeight: root.isVerticalOrientation ? weatherColumn.implicitHeight : (root.widgetThickness - root.horizontalPadding * 2)
|
||||
|
||||
|
||||
@@ -1691,7 +1691,7 @@ Item {
|
||||
anchors.bottom: parent.bottom
|
||||
z: 2
|
||||
|
||||
Text {
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
text: modelData.count
|
||||
font.pixelSize: root.appIconSize * 0.44
|
||||
@@ -1860,7 +1860,7 @@ Item {
|
||||
anchors.bottom: parent.bottom
|
||||
z: 2
|
||||
|
||||
Text {
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
text: modelData.count
|
||||
font.pixelSize: root.appIconSize * 0.44
|
||||
|
||||
Reference in New Issue
Block a user