mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-06-11 00:47:22 +00:00
quicksettings: request -symbolic icons for masked tiles
Kirigami.Icon { isMask: true } flattens an SVG to its alpha, so when a quick-setting tile resolves to a colored preferences/scalable glyph the whole rounded background collapses into a solid square. Append -symbolic to the five icon names that collided with colored tiles and add symlink aliases where no real symbolic variant exists yet. Guard the regression with a check in tests/check-shift-icon-theme.sh.
This commit is contained in:
parent
d1e55a47a7
commit
8e25b68355
9 changed files with 33 additions and 5 deletions
|
|
@ -0,0 +1 @@
|
||||||
|
dialog-information.svg
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
preferences-desktop-display-randr.svg
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
redshift-status-on.svg
|
||||||
|
|
@ -9,7 +9,7 @@ import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS
|
||||||
|
|
||||||
QS.QuickSetting {
|
QS.QuickSetting {
|
||||||
text: i18n("Docked Mode")
|
text: i18n("Docked Mode")
|
||||||
icon: "preferences-desktop-display-randr"
|
icon: "preferences-desktop-display-randr-symbolic"
|
||||||
enabled: ShellSettings.Settings.convergenceModeEnabled
|
enabled: ShellSettings.Settings.convergenceModeEnabled
|
||||||
|
|
||||||
function toggle() {
|
function toggle() {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS
|
||||||
|
|
||||||
QS.QuickSetting {
|
QS.QuickSetting {
|
||||||
text: i18n("Launch Hint")
|
text: i18n("Launch Hint")
|
||||||
icon: "dialog-information"
|
icon: "dialog-information-symbolic"
|
||||||
status: ShellSettings.Settings.gamingDismissHintEnabled ? i18n("On") : i18n("Off")
|
status: ShellSettings.Settings.gamingDismissHintEnabled ? i18n("On") : i18n("Off")
|
||||||
enabled: true
|
enabled: true
|
||||||
available: ShellSettings.Settings.gamingModeEnabled
|
available: ShellSettings.Settings.gamingModeEnabled
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ QS.QuickSetting {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
text: i18n("Hotspot")
|
text: i18n("Hotspot")
|
||||||
icon: "network-wireless-hotspot"
|
icon: "network-wireless-hotspot-symbolic"
|
||||||
|
|
||||||
enabled: MobileShell.NetworkInfo.wirelessStatus.hotspotSSID.length !== 0
|
enabled: MobileShell.NetworkInfo.wirelessStatus.hotspotSSID.length !== 0
|
||||||
status: enabled ? MobileShell.NetworkInfo.wirelessStatus.hotspotSSID : ""
|
status: enabled ? MobileShell.NetworkInfo.wirelessStatus.hotspotSSID : ""
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import org.kde.plasma.workspace.keyboardlayout 1.0 as Keyboards
|
||||||
|
|
||||||
QS.QuickSetting {
|
QS.QuickSetting {
|
||||||
text: i18n("Virtual Keyboard")
|
text: i18n("Virtual Keyboard")
|
||||||
icon: "input-keyboard-virtual"
|
icon: "input-keyboard-virtual-symbolic"
|
||||||
status: enabled ? i18n("On") :
|
status: enabled ? i18n("On") :
|
||||||
(Keyboards.KWinVirtualKeyboard.available ? i18n("Off") : i18n("Tap to open settings"))
|
(Keyboards.KWinVirtualKeyboard.available ? i18n("Off") : i18n("Tap to open settings"))
|
||||||
enabled: Keyboards.KWinVirtualKeyboard.enabled && Keyboards.KWinVirtualKeyboard.available
|
enabled: Keyboards.KWinVirtualKeyboard.enabled && Keyboards.KWinVirtualKeyboard.available
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS
|
||||||
|
|
||||||
QS.QuickSetting {
|
QS.QuickSetting {
|
||||||
text: i18n("Night Color")
|
text: i18n("Night Color")
|
||||||
icon: "redshift-status-on"
|
icon: "redshift-status-on-symbolic"
|
||||||
enabled: NightColor.NightColorUtil.enabled
|
enabled: NightColor.NightColorUtil.enabled
|
||||||
status: ""
|
status: ""
|
||||||
settingsCommand: "plasma-open-settings kcm_nightcolor"
|
settingsCommand: "plasma-open-settings kcm_nightcolor"
|
||||||
|
|
|
||||||
|
|
@ -255,4 +255,29 @@ if [[ -s "$missing_icons" ]]; then
|
||||||
printf 'Missing required Shift icons:\n' >&2
|
printf 'Missing required Shift icons:\n' >&2
|
||||||
sed 's/^/ - /' "$missing_icons" >&2
|
sed 's/^/ - /' "$missing_icons" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Quick-setting tiles render with Kirigami.Icon { isMask: true }; if their icon
|
||||||
|
# name resolves to a colored preferences/scalable tile it collapses to a solid
|
||||||
|
# rounded square. Require an explicit -symbolic suffix for any quick-setting
|
||||||
|
# icon name that also exists as a colored tile.
|
||||||
|
masked_collisions="$(mktemp)"
|
||||||
|
trap 'rm -f "$required_icons" "$missing_icons" "$broken_icons" "$plasma_files" "$masked_collisions"' EXIT
|
||||||
|
|
||||||
|
while IFS= read -r -d '' qml; do
|
||||||
|
perl -ne 'if (/^\s*icon:\s*"([^"]+)"\s*$/) { print "$1\n"; }' "$qml"
|
||||||
|
done < <(find quicksettings -name 'main.qml' -print0) \
|
||||||
|
| sort -u \
|
||||||
|
| while IFS= read -r icon_name; do
|
||||||
|
case "$icon_name" in
|
||||||
|
*-symbolic) continue ;;
|
||||||
|
esac
|
||||||
|
[[ -e "$theme_dir/preferences/scalable/$icon_name.svg" ]] || continue
|
||||||
|
printf '%s\n' "$icon_name"
|
||||||
|
done > "$masked_collisions"
|
||||||
|
|
||||||
|
if [[ -s "$masked_collisions" ]]; then
|
||||||
|
printf 'Quick-setting icon names must use a -symbolic suffix when a colored preferences/scalable tile exists, otherwise the masked tile renders as a solid square:\n' >&2
|
||||||
|
sed 's/^/ - /' "$masked_collisions" >&2
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
Loading…
Reference in a new issue