1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-05 21:15:38 -05:00

settings: fix launcher tab sizing

This commit is contained in:
bbedward
2025-12-04 16:01:07 -05:00
parent f312868154
commit 4291cfe82f

View File

@@ -45,10 +45,14 @@ Item {
Item {
width: parent.width
height: logoModeGroup.implicitHeight
clip: true
DankButtonGroup {
id: logoModeGroup
anchors.horizontalCenter: parent.horizontalCenter
buttonPadding: parent.width < 480 ? Theme.spacingS : Theme.spacingL
minButtonWidth: parent.width < 480 ? 44 : 64
textSize: parent.width < 480 ? Theme.fontSizeSmall : Theme.fontSizeMedium
model: {
const modes = [I18n.tr("Apps Icon"), I18n.tr("OS Logo"), I18n.tr("Dank")];
if (CompositorService.isNiri) {
@@ -153,12 +157,21 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
}
Item {
width: parent.width
height: colorOverrideRow.implicitHeight
clip: true
Row {
id: colorOverrideRow
anchors.horizontalCenter: parent.horizontalCenter
spacing: Theme.spacingM
DankButtonGroup {
id: colorModeGroup
buttonPadding: parent.parent.width < 480 ? Theme.spacingS : Theme.spacingL
minButtonWidth: parent.parent.width < 480 ? 44 : 64
textSize: parent.parent.width < 480 ? Theme.fontSizeSmall : Theme.fontSizeMedium
model: [I18n.tr("Default"), I18n.tr("Primary"), I18n.tr("Surface"), I18n.tr("Custom")]
currentIndex: {
const override = SettingsData.launcherLogoColorOverride;
@@ -195,6 +208,7 @@ Item {
}
Rectangle {
id: colorPickerCircle
visible: {
const override = SettingsData.launcherLogoColorOverride;
return override !== "" && override !== "primary" && override !== "surface";
@@ -204,9 +218,8 @@ Item {
radius: 18
color: {
const override = SettingsData.launcherLogoColorOverride;
if (override !== "" && override !== "primary" && override !== "surface") {
if (override !== "" && override !== "primary" && override !== "surface")
return override;
}
return "#ffffff";
}
border.color: Theme.outline
@@ -230,6 +243,7 @@ Item {
}
}
}
}
SettingsSliderRow {
text: I18n.tr("Size Offset")
@@ -329,28 +343,32 @@ Item {
SettingsToggleRow {
text: I18n.tr("Close Overview on Launch")
description: I18n.tr("When enabled, launching an app from the launcher will automatically close the Niri overview if it's open.")
description: I18n.tr("Auto-close Niri overview when launching apps.")
checked: SettingsData.spotlightCloseNiriOverview
onToggled: checked => SettingsData.set("spotlightCloseNiriOverview", checked)
}
SettingsToggleRow {
text: I18n.tr("Enable Overview Overlay")
description: I18n.tr("When enabled, shows the launcher overlay when typing in Niri overview mode. Disable this if you prefer to not have the launcher when typing on Niri overview or want to use other launcher in the overview.")
description: I18n.tr("Show launcher overlay when typing in Niri overview. Disable to use another launcher.")
checked: SettingsData.niriOverviewOverlayEnabled
onToggled: checked => SettingsData.set("niriOverviewOverlayEnabled", checked)
}
}
SettingsCard {
id: recentAppsCard
width: parent.width
iconName: "history"
title: I18n.tr("Recently Used Apps")
property var rankedAppsModel: {
var ranking = AppUsageHistoryData.appUsageRanking;
if (!ranking)
return [];
var apps = [];
for (var appId in (AppUsageHistoryData.appUsageRanking || {})) {
var appData = (AppUsageHistoryData.appUsageRanking || {})[appId];
for (var appId in ranking) {
var appData = ranking[appId];
apps.push({
"id": appId,
"name": appData.name,
@@ -401,7 +419,7 @@ Item {
spacing: Theme.spacingS
Repeater {
model: parent.parent.rankedAppsModel
model: recentAppsCard.rankedAppsModel
delegate: Rectangle {
width: rankedAppsList.width
@@ -496,11 +514,11 @@ Item {
StyledText {
width: parent.width
text: parent.parent.rankedAppsModel.length === 0 ? "No apps have been launched yet." : ""
text: "No apps have been launched yet."
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceVariantText
horizontalAlignment: Text.AlignHCenter
visible: parent.parent.rankedAppsModel.length === 0
visible: recentAppsCard.rankedAppsModel.length === 0
}
}
}