From 5f999f7a4712c4a4d1c89054b544064cfd4b769e Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Fri, 3 Apr 2026 12:36:59 +0200 Subject: Icon fixes - Detint icon on first signin - Symlink it to the old meegotouch theme dir if it exists. --- rpm/sailfish-account-mastodon.spec | 26 +++++++++++++++++++++++++- settings/accounts/ui/mastodon.qml | 5 ++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/rpm/sailfish-account-mastodon.spec b/rpm/sailfish-account-mastodon.spec index 97e790a..923ae8c 100644 --- a/rpm/sailfish-account-mastodon.spec +++ b/rpm/sailfish-account-mastodon.spec @@ -4,7 +4,7 @@ Name: sailfish-account-mastodon License: BSD-3-Clause AND LGPL-2.1-or-later -Version: 1.0.1 +Version: 1.0.2 Release: 1 Source0: %{name}-%{version}.tar.bz2 Summary: SailfishOS account plugin for Mastodon @@ -63,9 +63,33 @@ Translation source files for sailfish-account-mastodon components. %{_libexecdir}/manage-groups add account-mastodon || : systemctl-user try-restart msyncd.service || : +%posttrans +# Pre-4.6 SailfishOS resolves theme icons from the legacy meegotouch tree. +# If that theme exists, point it at the packaged silica icons. +theme_dir=%{_datadir}/themes/sailfish-default +legacy_dir="$theme_dir/meegotouch" +if [ -d "$legacy_dir" ]; then + for icon in "$theme_dir"/silica/*/icons/icon-l-mastodon.png; do + [ -e "$icon" ] || continue + scale="$(basename "$(dirname "$(dirname "$icon")")")" + target_dir="$legacy_dir/$scale/icons" + [ -d "$target_dir" ] || continue + ln -sfn "../../../silica/${scale}/icons/icon-l-mastodon.png" \ + "$target_dir/icon-l-mastodon.png" + done +fi + %postun /sbin/ldconfig if [ "$1" -eq 0 ]; then + theme_dir=%{_datadir}/themes/sailfish-default + legacy_dir="$theme_dir/meegotouch" + if [ -d "$legacy_dir" ]; then + for icon in "$legacy_dir"/*/icons/icon-l-mastodon.png; do + [ -L "$icon" ] || continue + rm -f "$icon" + done + fi %{_libexecdir}/manage-groups remove account-mastodon || : fi diff --git a/settings/accounts/ui/mastodon.qml b/settings/accounts/ui/mastodon.qml index a4bd512..129fda5 100644 --- a/settings/accounts/ui/mastodon.qml +++ b/settings/accounts/ui/mastodon.qml @@ -255,11 +255,14 @@ AccountCreationAgent { width: parent.width - x * 2 spacing: Theme.paddingMedium - Icon { + Image { id: promptIcon width: Theme.iconSizeMedium height: Theme.iconSizeMedium source: "image://theme/icon-l-mastodon" + fillMode: Image.PreserveAspectFit + sourceSize.width: width + sourceSize.height: height } //: Prompt shown in account setup before OAuth sign-in. -- cgit v1.2.3