add themeImage setting and use

This commit is contained in:
Dan Ballard 2024-01-09 21:41:55 -08:00
parent 111bceab5d
commit 238cddd7d3
27 changed files with 101 additions and 26 deletions

View File

@ -1,6 +1,8 @@
{
"@@locale": "cy",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "da",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "de",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "el",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "en",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "es",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"deleteServerConfirmBtn": "¿Realmente desea borrar el servidor?",
"defaultScalingText": "Factor de escala del texto",

View File

@ -1,6 +1,8 @@
{
"@@locale": "fr",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "it",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "ja",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "ko",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "lb",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "nl",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "no",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "pl",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "pt",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "pt_BR",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "ro",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "ru",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "sk",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "sv",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "sw",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "tr",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "uk",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -1,6 +1,8 @@
{
"@@locale": "uz",
"@@last_modified": "2024-01-04T10:56:20+01:00",
"@@last_modified": "2024-01-10T06:54:15+01:00",
"settingsThemeImagesDescription": "Enable display of images from themes",
"settingsThemeImages": "Theme Images",
"settingsGroupAbout": "About",
"localeUzbek": "Uzbek \/ Oʻzbekcha",
"profileOfflineAtStart": "Appear Offline at Startup",

View File

@ -43,6 +43,7 @@ class Settings extends ChangeNotifier {
Locale locale;
late PackageInfo packageInfo;
OpaqueThemeType theme;
bool _themeImages = false;
// explicitly set experiments to false until told otherwise...
bool experimentsEnabled = false;
@ -92,6 +93,12 @@ class Settings extends ChangeNotifier {
notifyListeners();
}
bool get themeImages => _themeImages;
set themeImages(bool newVal) {
_themeImages = newVal;
notifyListeners();
}
/// Get access to the current theme.
OpaqueThemeType current() {
return theme;
@ -127,6 +134,7 @@ class Settings extends ChangeNotifier {
handleUpdate(dynamic settings) {
// Set Theme and notify listeners
this.setTheme(settings["Theme"], settings["ThemeMode"] ?? mode_dark);
_themeImages = settings["ThemeImages"] ?? false;
// Set Locale and notify listeners
switchLocaleByCode(settings["Locale"]);
@ -469,6 +477,7 @@ class Settings extends ChangeNotifier {
"Locale": this.locale.toString(),
"Theme": theme.theme,
"ThemeMode": theme.mode,
"ThemeImages": _themeImages,
"PreviousPid": -1,
"BlockUnknownConnections": blockUnknownConnections,
"NotificationPolicy": _notificationPolicy.toString(),

View File

@ -144,6 +144,24 @@ class _GlobalSettingsAppearanceViewState extends State<GlobalSettingsAppearanceV
.current()
.mainTextColor),
),
SwitchListTile(
title: Text(
AppLocalizations.of(context)!.settingsThemeImages),
subtitle: Text(AppLocalizations.of(context)!
.settingsThemeImagesDescription),
value: settings.themeImages,
onChanged: (bool value) {
settings.themeImages = value;// Save Settings...
saveSettings(context);
},
activeTrackColor: settings.theme.defaultButtonColor,
inactiveTrackColor:
settings.theme.defaultButtonDisabledColor,
secondary: Icon(Icons.image,
color: settings
.current()
.mainTextColor),
),
ListTile(
title: Text(AppLocalizations.of(context)!
.settingUIColumnPortrait),

View File

@ -117,10 +117,10 @@ class _MessageListState extends State<MessageList> {
// Only show broken heart is the contact is offline...
decoration: BoxDecoration(
image: Provider.of<ContactInfoState>(outerContext).isOnline()
? (Provider.of<Settings>(context).theme.chatImage != null)
? (Provider.of<Settings>(context).themeImages && Provider.of<Settings>(context).theme.chatImage != null)
? DecorationImage(
repeat: ImageRepeat.repeat,
image: Provider.of<Settings>(context).theme.loadImage(Provider.of<Settings>(context).theme.chatImage, context: context),
image: Provider.of<Settings>(context, listen: false).theme.loadImage(Provider.of<Settings>(context, listen: false).theme.chatImage, context: context),
colorFilter: ColorFilter.mode(Provider.of<Settings>(context).theme.hilightElementColor.withOpacity(0.15), BlendMode.srcIn))
: null
: DecorationImage(