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 { Item {
width: parent.width width: parent.width
height: logoModeGroup.implicitHeight height: logoModeGroup.implicitHeight
clip: true
DankButtonGroup { DankButtonGroup {
id: logoModeGroup id: logoModeGroup
anchors.horizontalCenter: parent.horizontalCenter 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: { model: {
const modes = [I18n.tr("Apps Icon"), I18n.tr("OS Logo"), I18n.tr("Dank")]; const modes = [I18n.tr("Apps Icon"), I18n.tr("OS Logo"), I18n.tr("Dank")];
if (CompositorService.isNiri) { if (CompositorService.isNiri) {
@@ -153,12 +157,21 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
} }
Item {
width: parent.width
height: colorOverrideRow.implicitHeight
clip: true
Row { Row {
id: colorOverrideRow
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
spacing: Theme.spacingM spacing: Theme.spacingM
DankButtonGroup { DankButtonGroup {
id: colorModeGroup 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")] model: [I18n.tr("Default"), I18n.tr("Primary"), I18n.tr("Surface"), I18n.tr("Custom")]
currentIndex: { currentIndex: {
const override = SettingsData.launcherLogoColorOverride; const override = SettingsData.launcherLogoColorOverride;
@@ -195,6 +208,7 @@ Item {
} }
Rectangle { Rectangle {
id: colorPickerCircle
visible: { visible: {
const override = SettingsData.launcherLogoColorOverride; const override = SettingsData.launcherLogoColorOverride;
return override !== "" && override !== "primary" && override !== "surface"; return override !== "" && override !== "primary" && override !== "surface";
@@ -204,9 +218,8 @@ Item {
radius: 18 radius: 18
color: { color: {
const override = SettingsData.launcherLogoColorOverride; const override = SettingsData.launcherLogoColorOverride;
if (override !== "" && override !== "primary" && override !== "surface") { if (override !== "" && override !== "primary" && override !== "surface")
return override; return override;
}
return "#ffffff"; return "#ffffff";
} }
border.color: Theme.outline border.color: Theme.outline
@@ -230,6 +243,7 @@ Item {
} }
} }
} }
}
SettingsSliderRow { SettingsSliderRow {
text: I18n.tr("Size Offset") text: I18n.tr("Size Offset")
@@ -329,28 +343,32 @@ Item {
SettingsToggleRow { SettingsToggleRow {
text: I18n.tr("Close Overview on Launch") 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 checked: SettingsData.spotlightCloseNiriOverview
onToggled: checked => SettingsData.set("spotlightCloseNiriOverview", checked) onToggled: checked => SettingsData.set("spotlightCloseNiriOverview", checked)
} }
SettingsToggleRow { SettingsToggleRow {
text: I18n.tr("Enable Overview Overlay") 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 checked: SettingsData.niriOverviewOverlayEnabled
onToggled: checked => SettingsData.set("niriOverviewOverlayEnabled", checked) onToggled: checked => SettingsData.set("niriOverviewOverlayEnabled", checked)
} }
} }
SettingsCard { SettingsCard {
id: recentAppsCard
width: parent.width width: parent.width
iconName: "history" iconName: "history"
title: I18n.tr("Recently Used Apps") title: I18n.tr("Recently Used Apps")
property var rankedAppsModel: { property var rankedAppsModel: {
var ranking = AppUsageHistoryData.appUsageRanking;
if (!ranking)
return [];
var apps = []; var apps = [];
for (var appId in (AppUsageHistoryData.appUsageRanking || {})) { for (var appId in ranking) {
var appData = (AppUsageHistoryData.appUsageRanking || {})[appId]; var appData = ranking[appId];
apps.push({ apps.push({
"id": appId, "id": appId,
"name": appData.name, "name": appData.name,
@@ -401,7 +419,7 @@ Item {
spacing: Theme.spacingS spacing: Theme.spacingS
Repeater { Repeater {
model: parent.parent.rankedAppsModel model: recentAppsCard.rankedAppsModel
delegate: Rectangle { delegate: Rectangle {
width: rankedAppsList.width width: rankedAppsList.width
@@ -496,11 +514,11 @@ Item {
StyledText { StyledText {
width: parent.width 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 font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceVariantText color: Theme.surfaceVariantText
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
visible: parent.parent.rankedAppsModel.length === 0 visible: recentAppsCard.rankedAppsModel.length === 0
} }
} }
} }