feat(settings): add mpris blacklist and entry placeholder text for all inputs

This commit is contained in:
Ly-sec
2026-05-03 13:47:41 +02:00
parent f9c617bfa7
commit 9d6b1ce440
3 changed files with 56 additions and 36 deletions
+16 -6
View File
@@ -561,7 +561,7 @@
"unknown-value": "Unknown: {value}"
},
"list": {
"add-placeholder": "Pick…"
"add-entry-placeholder": "Add entry…"
}
},
"dialogs": {
@@ -711,6 +711,7 @@
"interface": "Interface",
"layout": "Layout",
"location": "Location",
"media": "Media",
"motion": "Motion",
"network": "Network",
"night-light": "Night Light",
@@ -1150,7 +1151,8 @@
"shell": {
"avatar-path": {
"label": "Avatar Path",
"description": "Path to a custom avatar image"
"description": "Path to a custom avatar image",
"placeholder": "/path/to/avatar.png"
},
"offline-mode": {
"label": "Offline Mode",
@@ -1304,11 +1306,13 @@
},
"directory-light": {
"label": "Light Mode Directory",
"description": "Wallpaper folder used in Light theme mode"
"description": "Wallpaper folder used in Light theme mode",
"placeholder": "~/Pictures/Wallpapers"
},
"directory-dark": {
"label": "Dark Mode Directory",
"description": "Wallpaper folder used in Dark theme mode"
"description": "Wallpaper folder used in Dark theme mode",
"placeholder": "~/Pictures/Wallpapers"
},
"transitions": {
"label": "Transition Effects",
@@ -1386,11 +1390,17 @@
},
"volume-change-sound": {
"label": "Volume Change Sound",
"description": "Sound file used for volume feedback"
"description": "Sound file used for volume feedback",
"placeholder": "/path/to/sound.ogg"
},
"notification-sound": {
"label": "Notification Sound",
"description": "Sound file used for notification feedback"
"description": "Sound file used for notification feedback",
"placeholder": "/path/to/sound.ogg"
},
"mpris-blacklist": {
"label": "MPRIS player blacklist",
"description": "Players to ignore for media controls and Now Playing."
},
"ddcutil": {
"label": "DDC/CI (ddcutil)",
+14 -13
View File
@@ -514,7 +514,8 @@ namespace settings {
const auto makeText = [&](const std::string& value, const std::string& placeholder, std::vector<std::string> path) {
auto input = std::make_unique<Input>();
input->setValue(value);
input->setPlaceholder(placeholder);
input->setPlaceholder(placeholder.empty() ? i18n::tr("settings.controls.list.add-entry-placeholder")
: placeholder);
input->setFontSize(Style::fontSizeBody * scale);
input->setControlHeight(Style::controlHeight * scale);
input->setHorizontalPadding(Style::spaceSm * scale);
@@ -844,7 +845,7 @@ namespace settings {
auto addRow = std::make_unique<Flex>();
addRow->setDirection(FlexDirection::Horizontal);
addRow->setAlign(FlexAlign::Center);
addRow->setGap(Style::spaceXs * scale);
addRow->setGap(Style::spaceSm * scale);
const bool useSelectAdder = !list.suggestedOptions.empty();
std::vector<SelectOption> remaining;
@@ -872,7 +873,7 @@ namespace settings {
auto select = std::make_unique<Select>();
select->setOptions(remainingLabels);
select->setPlaceholder(i18n::tr("settings.controls.list.add-placeholder"));
select->setPlaceholder(i18n::tr("settings.controls.list.add-entry-placeholder"));
select->setFontSize(Style::fontSizeCaption * scale);
select->setControlHeight(Style::controlHeightSm * scale);
select->setGlyphSize(Style::fontSizeCaption * scale);
@@ -903,21 +904,21 @@ namespace settings {
addRow->addChild(std::move(addBtn));
} else {
auto addInput = std::make_unique<Input>();
addInput->setFontSize(Style::fontSizeCaption * scale);
addInput->setControlHeight(Style::controlHeightSm * scale);
addInput->setHorizontalPadding(Style::spaceXs * scale);
addInput->setSize(140.0f * scale, Style::controlHeightSm * scale);
addInput->setFlexGrow(1.0f);
addInput->setPlaceholder(i18n::tr("settings.controls.list.add-entry-placeholder"));
addInput->setFontSize(Style::fontSizeBody * scale);
addInput->setControlHeight(Style::controlHeight * scale);
addInput->setHorizontalPadding(Style::spaceSm * scale);
addInput->setSize(190.0f * scale, Style::controlHeight * scale);
auto* addInputPtr = addInput.get();
auto addBtn = std::make_unique<Button>();
addBtn->setGlyph("add");
addBtn->setVariant(ButtonVariant::Ghost);
addBtn->setGlyphSize(Style::fontSizeCaption * scale);
addBtn->setMinWidth(Style::controlHeightSm * scale);
addBtn->setMinHeight(Style::controlHeightSm * scale);
addBtn->setPadding(Style::spaceXs * scale);
addBtn->setRadius(Style::radiusSm * scale);
addBtn->setGlyphSize(Style::fontSizeBody * scale);
addBtn->setMinWidth(Style::controlHeight * scale);
addBtn->setMinHeight(Style::controlHeight * scale);
addBtn->setPadding(Style::spaceSm * scale);
addBtn->setRadius(Style::radiusMd * scale);
auto items = list.items;
auto path = entry.path;
addBtn->setOnClick([setOverride = ctx.setOverride, addInputPtr, items, path]() mutable {
+26 -17
View File
@@ -331,14 +331,16 @@ namespace settings {
entries.push_back(makeEntry("wallpaper", "directories", tr("settings.schema.wallpaper.directory.label"),
tr("settings.schema.wallpaper.directory.description"), {"wallpaper", "directory"},
TextSetting{cfg.wallpaper.directory, "~/Pictures/Wallpapers"}, "folder path"));
entries.push_back(makeEntry("wallpaper", "directories", tr("settings.schema.wallpaper.directory-light.label"),
tr("settings.schema.wallpaper.directory-light.description"),
{"wallpaper", "directory_light"}, TextSetting{cfg.wallpaper.directoryLight, ""},
"folder path light theme", true));
entries.push_back(makeEntry("wallpaper", "directories", tr("settings.schema.wallpaper.directory-dark.label"),
tr("settings.schema.wallpaper.directory-dark.description"),
{"wallpaper", "directory_dark"}, TextSetting{cfg.wallpaper.directoryDark, ""},
"folder path dark theme", true));
entries.push_back(makeEntry(
"wallpaper", "directories", tr("settings.schema.wallpaper.directory-light.label"),
tr("settings.schema.wallpaper.directory-light.description"), {"wallpaper", "directory_light"},
TextSetting{cfg.wallpaper.directoryLight, tr("settings.schema.wallpaper.directory-light.placeholder")},
"folder path light theme", true));
entries.push_back(
makeEntry("wallpaper", "directories", tr("settings.schema.wallpaper.directory-dark.label"),
tr("settings.schema.wallpaper.directory-dark.description"), {"wallpaper", "directory_dark"},
TextSetting{cfg.wallpaper.directoryDark, tr("settings.schema.wallpaper.directory-dark.placeholder")},
"folder path dark theme", true));
{
MultiSelectSetting transitions;
transitions.options.reserve(std::size(kWallpaperTransitions));
@@ -527,7 +529,8 @@ namespace settings {
// Shell
entries.push_back(makeEntry("shell", "profile", tr("settings.schema.shell.avatar-path.label"),
tr("settings.schema.shell.avatar-path.description"), {"shell", "avatar_path"},
TextSetting{cfg.shell.avatarPath, ""}, "image picture"));
TextSetting{cfg.shell.avatarPath, tr("settings.schema.shell.avatar-path.placeholder")},
"image picture"));
entries.push_back(makeEntry("shell", "network", tr("settings.schema.shell.offline-mode.label"),
tr("settings.schema.shell.offline-mode.description"), {"shell", "offline_mode"},
ToggleSetting{cfg.shell.offlineMode}, "network http fetch download"));
@@ -596,14 +599,20 @@ namespace settings {
entries.push_back(makeEntry("services", "audio", tr("settings.schema.services.sound-volume.label"),
tr("settings.schema.services.sound-volume.description"), {"audio", "sound_volume"},
SliderSetting{cfg.audio.soundVolume, 0.0f, 1.0f, 0.01f, false}, "sound"));
entries.push_back(makeEntry("services", "audio", tr("settings.schema.services.volume-change-sound.label"),
tr("settings.schema.services.volume-change-sound.description"),
{"audio", "volume_change_sound"}, TextSetting{cfg.audio.volumeChangeSound, ""},
"sound path file", true));
entries.push_back(makeEntry("services", "audio", tr("settings.schema.services.notification-sound.label"),
tr("settings.schema.services.notification-sound.description"),
{"audio", "notification_sound"}, TextSetting{cfg.audio.notificationSound, ""},
"sound path file", true));
entries.push_back(makeEntry(
"services", "audio", tr("settings.schema.services.volume-change-sound.label"),
tr("settings.schema.services.volume-change-sound.description"), {"audio", "volume_change_sound"},
TextSetting{cfg.audio.volumeChangeSound, tr("settings.schema.services.volume-change-sound.placeholder")},
"sound path file", true));
entries.push_back(makeEntry(
"services", "audio", tr("settings.schema.services.notification-sound.label"),
tr("settings.schema.services.notification-sound.description"), {"audio", "notification_sound"},
TextSetting{cfg.audio.notificationSound, tr("settings.schema.services.notification-sound.placeholder")},
"sound path file", true));
entries.push_back(makeEntry("services", "media", tr("settings.schema.services.mpris-blacklist.label"),
tr("settings.schema.services.mpris-blacklist.description"),
{"shell", "mpris", "blacklist"}, ListSetting{.items = cfg.shell.mpris.blacklist},
"mpris media player dbus session blacklist"));
entries.push_back(makeEntry("services", "brightness", tr("settings.schema.services.ddcutil.label"),
tr("settings.schema.services.ddcutil.description"), {"brightness", "enable_ddcutil"},
ToggleSetting{cfg.brightness.enableDdcutil}, "monitor ddcutil"));