mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 13:32:50 -05:00
launcher v2: add micro size
This commit is contained in:
@@ -25,8 +25,30 @@ Item {
|
|||||||
readonly property real screenHeight: effectiveScreen?.height ?? 1080
|
readonly property real screenHeight: effectiveScreen?.height ?? 1080
|
||||||
readonly property real dpr: effectiveScreen ? CompositorService.getScreenScale(effectiveScreen) : 1
|
readonly property real dpr: effectiveScreen ? CompositorService.getScreenScale(effectiveScreen) : 1
|
||||||
|
|
||||||
readonly property int baseWidth: SettingsData.dankLauncherV2Size === "medium" ? 720 : SettingsData.dankLauncherV2Size === "large" ? 860 : 620
|
readonly property int baseWidth: {
|
||||||
readonly property int baseHeight: SettingsData.dankLauncherV2Size === "medium" ? 720 : SettingsData.dankLauncherV2Size === "large" ? 860 : 600
|
switch (SettingsData.dankLauncherV2Size) {
|
||||||
|
case "micro":
|
||||||
|
return 500;
|
||||||
|
case "medium":
|
||||||
|
return 720;
|
||||||
|
case "large":
|
||||||
|
return 860;
|
||||||
|
default:
|
||||||
|
return 620;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
readonly property int baseHeight: {
|
||||||
|
switch (SettingsData.dankLauncherV2Size) {
|
||||||
|
case "micro":
|
||||||
|
return 480;
|
||||||
|
case "medium":
|
||||||
|
return 720;
|
||||||
|
case "large":
|
||||||
|
return 860;
|
||||||
|
default:
|
||||||
|
return 600;
|
||||||
|
}
|
||||||
|
}
|
||||||
readonly property int modalWidth: Math.min(baseWidth, screenWidth - 100)
|
readonly property int modalWidth: Math.min(baseWidth, screenWidth - 100)
|
||||||
readonly property int modalHeight: Math.min(baseHeight, screenHeight - 100)
|
readonly property int modalHeight: Math.min(baseHeight, screenHeight - 100)
|
||||||
readonly property real modalX: (screenWidth - modalWidth) / 2
|
readonly property real modalX: (screenWidth - modalWidth) / 2
|
||||||
|
|||||||
@@ -274,8 +274,9 @@ FocusScope {
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
height: SettingsData.dankLauncherV2ShowFooter ? 32 : 0
|
readonly property bool showFooter: SettingsData.dankLauncherV2Size !== "micro" && SettingsData.dankLauncherV2ShowFooter
|
||||||
visible: SettingsData.dankLauncherV2ShowFooter
|
height: showFooter ? 32 : 0
|
||||||
|
visible: showFooter
|
||||||
color: Theme.surfaceContainerHigh
|
color: Theme.surfaceContainerHigh
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
|
|
||||||
|
|||||||
@@ -382,12 +382,24 @@ Item {
|
|||||||
buttonPadding: parent.width < 400 ? Theme.spacingS : Theme.spacingL
|
buttonPadding: parent.width < 400 ? Theme.spacingS : Theme.spacingL
|
||||||
minButtonWidth: parent.width < 400 ? 60 : 80
|
minButtonWidth: parent.width < 400 ? 60 : 80
|
||||||
textSize: parent.width < 400 ? Theme.fontSizeSmall : Theme.fontSizeMedium
|
textSize: parent.width < 400 ? Theme.fontSizeSmall : Theme.fontSizeMedium
|
||||||
model: [I18n.tr("Compact", "compact launcher size"), I18n.tr("Medium", "medium launcher size"), I18n.tr("Large", "large launcher size")]
|
model: ["1", "2", "3", "4"]
|
||||||
currentIndex: SettingsData.dankLauncherV2Size === "compact" ? 0 : SettingsData.dankLauncherV2Size === "large" ? 2 : 1
|
currentIndex: {
|
||||||
|
switch (SettingsData.dankLauncherV2Size) {
|
||||||
|
case "micro":
|
||||||
|
return 0;
|
||||||
|
case "compact":
|
||||||
|
return 1;
|
||||||
|
case "large":
|
||||||
|
return 3;
|
||||||
|
default:
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
onSelectionChanged: (index, selected) => {
|
onSelectionChanged: (index, selected) => {
|
||||||
if (!selected)
|
if (!selected)
|
||||||
return;
|
return;
|
||||||
SettingsData.set("dankLauncherV2Size", index === 0 ? "compact" : index === 2 ? "large" : "medium");
|
var sizes = ["micro", "compact", "medium", "large"];
|
||||||
|
SettingsData.set("dankLauncherV2Size", sizes[index]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -399,6 +411,7 @@ Item {
|
|||||||
text: I18n.tr("Show Footer", "launcher footer visibility")
|
text: I18n.tr("Show Footer", "launcher footer visibility")
|
||||||
description: I18n.tr("Show mode tabs and keyboard hints at the bottom.", "launcher footer description")
|
description: I18n.tr("Show mode tabs and keyboard hints at the bottom.", "launcher footer description")
|
||||||
checked: SettingsData.dankLauncherV2ShowFooter
|
checked: SettingsData.dankLauncherV2ShowFooter
|
||||||
|
enabled: SettingsData.dankLauncherV2Size !== "micro"
|
||||||
onToggled: checked => SettingsData.set("dankLauncherV2ShowFooter", checked)
|
onToggled: checked => SettingsData.set("dankLauncherV2ShowFooter", checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -201,8 +201,30 @@ Scope {
|
|||||||
x: Theme.snap((parent.width - width) / 2, overlayWindow.dpr)
|
x: Theme.snap((parent.width - width) / 2, overlayWindow.dpr)
|
||||||
y: Theme.snap((parent.height - height) / 2, overlayWindow.dpr)
|
y: Theme.snap((parent.height - height) / 2, overlayWindow.dpr)
|
||||||
|
|
||||||
readonly property int baseWidth: SettingsData.dankLauncherV2Size === "medium" ? 720 : SettingsData.dankLauncherV2Size === "large" ? 860 : 620
|
readonly property int baseWidth: {
|
||||||
readonly property int baseHeight: SettingsData.dankLauncherV2Size === "medium" ? 720 : SettingsData.dankLauncherV2Size === "large" ? 860 : 600
|
switch (SettingsData.dankLauncherV2Size) {
|
||||||
|
case "micro":
|
||||||
|
return 500;
|
||||||
|
case "medium":
|
||||||
|
return 720;
|
||||||
|
case "large":
|
||||||
|
return 860;
|
||||||
|
default:
|
||||||
|
return 620;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
readonly property int baseHeight: {
|
||||||
|
switch (SettingsData.dankLauncherV2Size) {
|
||||||
|
case "micro":
|
||||||
|
return 480;
|
||||||
|
case "medium":
|
||||||
|
return 720;
|
||||||
|
case "large":
|
||||||
|
return 860;
|
||||||
|
default:
|
||||||
|
return 600;
|
||||||
|
}
|
||||||
|
}
|
||||||
width: Math.min(baseWidth, overlayWindow.screen.width - 100)
|
width: Math.min(baseWidth, overlayWindow.screen.width - 100)
|
||||||
height: Math.min(baseHeight, overlayWindow.screen.height - 100)
|
height: Math.min(baseHeight, overlayWindow.screen.height - 100)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user