1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-04 12:38:31 -04:00

qs: large sweep of dead code removals

This commit is contained in:
bbedward
2026-07-26 23:22:22 -04:00
parent bab2078dfd
commit c67b185076
113 changed files with 1467 additions and 3254 deletions
@@ -314,26 +314,20 @@ Item {
readonly property real alignedWidth: Theme.px(modalWidth, dpr)
readonly property real alignedHeight: Theme.px(modalHeight, dpr)
function _frameEdgeInset(side) {
if (!effectiveScreen)
return 0;
return SettingsData.frameEdgeInsetForSide(effectiveScreen, side);
}
readonly property real _connectedAlignedX: {
switch (resolvedConnectedBarSide) {
case "top":
case "bottom":
{
const insetL = _frameEdgeInset("left");
const insetR = _frameEdgeInset("right");
const insetL = SettingsData.frameEdgeInsetForSide(effectiveScreen, "left");
const insetR = SettingsData.frameEdgeInsetForSide(effectiveScreen, "right");
const usable = Math.max(0, screenWidth - insetL - insetR);
return insetL + Math.max(0, (usable - alignedWidth) / 2);
}
case "left":
return _frameEdgeInset("left");
return SettingsData.frameEdgeInsetForSide(effectiveScreen, "left");
case "right":
return screenWidth - alignedWidth - _frameEdgeInset("right");
return screenWidth - alignedWidth - SettingsData.frameEdgeInsetForSide(effectiveScreen, "right");
}
return 0;
}
@@ -341,14 +335,14 @@ Item {
readonly property real _connectedAlignedY: {
switch (resolvedConnectedBarSide) {
case "top":
return _frameEdgeInset("top");
return SettingsData.frameEdgeInsetForSide(effectiveScreen, "top");
case "bottom":
return screenHeight - alignedHeight - _frameEdgeInset("bottom");
return screenHeight - alignedHeight - SettingsData.frameEdgeInsetForSide(effectiveScreen, "bottom");
case "left":
case "right":
{
const insetT = _frameEdgeInset("top");
const insetB = _frameEdgeInset("bottom");
const insetT = SettingsData.frameEdgeInsetForSide(effectiveScreen, "top");
const insetB = SettingsData.frameEdgeInsetForSide(effectiveScreen, "bottom");
const usable = Math.max(0, screenHeight - insetT - insetB);
return insetT + Math.max(0, (usable - alignedHeight) / 2);
}
@@ -105,12 +105,6 @@ Item {
}
readonly property bool _dockBlocksEmergence: frameOwnsConnectedChrome && _dockOccupiesSide(resolvedConnectedBarSide)
function _frameEdgeInset(side) {
if (!effectiveScreen)
return 0;
return SettingsData.frameEdgeInsetForSide(effectiveScreen, side);
}
readonly property var _connectedModalPos: {
const fallback = {
"x": (screenWidth - modalWidth) / 2,
@@ -120,10 +114,10 @@ Item {
case "top":
case "bottom":
{
const insetL = _frameEdgeInset("left");
const insetR = _frameEdgeInset("right");
const insetT = _frameEdgeInset("top");
const insetB = _frameEdgeInset("bottom");
const insetL = SettingsData.frameEdgeInsetForSide(effectiveScreen, "left");
const insetR = SettingsData.frameEdgeInsetForSide(effectiveScreen, "right");
const insetT = SettingsData.frameEdgeInsetForSide(effectiveScreen, "top");
const insetB = SettingsData.frameEdgeInsetForSide(effectiveScreen, "bottom");
const usable = Math.max(0, screenWidth - insetL - insetR);
const usableH = Math.max(0, screenHeight - insetT - insetB);
return {
@@ -134,11 +128,11 @@ Item {
case "left":
case "right":
{
const insetT = _frameEdgeInset("top");
const insetB = _frameEdgeInset("bottom");
const insetT = SettingsData.frameEdgeInsetForSide(effectiveScreen, "top");
const insetB = SettingsData.frameEdgeInsetForSide(effectiveScreen, "bottom");
const usable = Math.max(0, screenHeight - insetT - insetB);
return {
"x": resolvedConnectedBarSide === "left" ? _frameEdgeInset("left") : screenWidth - modalWidth - _frameEdgeInset("right"),
"x": resolvedConnectedBarSide === "left" ? SettingsData.frameEdgeInsetForSide(effectiveScreen, "left") : screenWidth - modalWidth - SettingsData.frameEdgeInsetForSide(effectiveScreen, "right"),
"y": insetT + Math.max(0, (usable - modalHeight) / 2)
};
}
@@ -188,16 +182,16 @@ Item {
readonly property real _connectedChromeY: {
if (!launcherArcExtenderActive)
return alignedY;
return resolvedConnectedBarSide === "top" ? Theme.snap(_frameEdgeInset("top"), dpr) : alignedY;
return resolvedConnectedBarSide === "top" ? Theme.snap(SettingsData.frameEdgeInsetForSide(effectiveScreen, "top"), dpr) : alignedY;
}
readonly property real _connectedChromeWidth: alignedWidth
readonly property real _connectedChromeHeight: {
if (!launcherArcExtenderActive)
return alignedHeight;
if (resolvedConnectedBarSide === "top")
return Theme.snap(Math.max(alignedHeight, alignedY + alignedHeight - _frameEdgeInset("top")), dpr);
return Theme.snap(Math.max(alignedHeight, alignedY + alignedHeight - SettingsData.frameEdgeInsetForSide(effectiveScreen, "top")), dpr);
if (resolvedConnectedBarSide === "bottom")
return Theme.snap(Math.max(alignedHeight, screenHeight - _frameEdgeInset("bottom") - alignedY), dpr);
return Theme.snap(Math.max(alignedHeight, screenHeight - SettingsData.frameEdgeInsetForSide(effectiveScreen, "bottom") - alignedY), dpr);
return alignedHeight;
}
readonly property real contentSurfaceHeight: launcherArcExtenderActive ? _connectedChromeHeight : alignedHeight
@@ -89,15 +89,6 @@ function fuzzyScore(text, query) {
return bestScore
}
function getTimeBucketWeight(daysSinceUsed) {
for (var i = 0; i < TimeBuckets.length; i++) {
if (daysSinceUsed <= TimeBuckets[i].maxDays) {
return TimeBuckets[i].weight
}
}
return 10
}
function calculateTextScore(name, query) {
if (name === query) return Weights.exactMatch
if (name.startsWith(query)) return Weights.prefixMatch
+14 -1
View File
@@ -18,6 +18,19 @@ DankModal {
open();
}
function getPowerProfileDescription(profile) {
switch (profile) {
case 0:
return I18n.tr("Extend battery life", "power profile description");
case 1:
return I18n.tr("Balance power and performance", "power profile description");
case 2:
return I18n.tr("Prioritize performance", "power profile description");
default:
return I18n.tr("Custom power profile", "power profile description");
}
}
function hideDialog() {
close();
}
@@ -244,7 +257,7 @@ DankModal {
// Selected power profile description
StyledText {
text: (root.selectedIndex >= 0 && root.selectedIndex < root.profileModel.length) ? Theme.getPowerProfileDescription(root.profileModel[root.selectedIndex]) : ""
text: (root.selectedIndex >= 0 && root.selectedIndex < root.profileModel.length) ? root.getPowerProfileDescription(root.profileModel[root.selectedIndex]) : ""
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceTextMedium
horizontalAlignment: Text.AlignHCenter
+3 -12
View File
@@ -6,6 +6,7 @@ import qs.Common
import qs.Modules.ProcessList
import qs.Services
import qs.Widgets
import "../Common/Format.js" as Format
FloatingWindow {
id: processListModal
@@ -67,16 +68,6 @@ FloatingWindow {
show();
}
function formatBytes(bytes) {
if (bytes < 1024)
return bytes.toFixed(0) + " B/s";
if (bytes < 1024 * 1024)
return (bytes / 1024).toFixed(1) + " KB/s";
if (bytes < 1024 * 1024 * 1024)
return (bytes / (1024 * 1024)).toFixed(1) + " MB/s";
return (bytes / (1024 * 1024 * 1024)).toFixed(2) + " GB/s";
}
function nextTab() {
currentTab = (currentTab + 1) % 4;
}
@@ -541,7 +532,7 @@ FloatingWindow {
}
StyledText {
text: "↓" + formatBytes(DgopService.networkRxRate) + " ↑" + formatBytes(DgopService.networkTxRate)
text: "↓" + Format.formatRate(DgopService.networkRxRate) + " ↑" + Format.formatRate(DgopService.networkTxRate)
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
color: Theme.surfaceText
@@ -559,7 +550,7 @@ FloatingWindow {
}
StyledText {
text: "↓" + formatBytes(DgopService.diskReadRate) + " ↑" + formatBytes(DgopService.diskWriteRate)
text: "↓" + Format.formatRate(DgopService.diskReadRate) + " ↑" + Format.formatRate(DgopService.diskWriteRate)
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
color: Theme.surfaceText