themeImage #801

Merged
dan merged 2 commits from themeImage into trunk 2024-01-17 21:32:44 +00:00
32 changed files with 109 additions and 28 deletions

View File

@ -1 +1 @@
2024-01-03-20-52-v0.0.10-4-g6c0b2e2
2024-01-15-10-14-v0.0.10-9-g425c3e6

View File

@ -61,6 +61,7 @@ themes:
textfieldHintColor: mainTextColor
toolbarIconColor: settings # whiteishPurple
topbarColor: header # darkGreyPurple
chatImageColor: purple
light:
colors:
background: whitePurple
@ -102,3 +103,4 @@ themes:
textfieldHintColor: font
toolbarIconColor: settings # darkPurple
topbarColor: header # softPurple
chatImageColor: purple

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

@ -81,6 +81,7 @@ class CwtchDark extends OpaqueThemeType {
get textfieldHintColor => mainTextColor;
get toolbarIconColor => settings; //whiteishPurple;
get topbarColor => header; //darkGreyPurple;
get chatImageColor => purple;
}
class CwtchLight extends OpaqueThemeType {
@ -126,4 +127,5 @@ class CwtchLight extends OpaqueThemeType {
get textfieldHintColor => font;
get toolbarIconColor => settings; //darkPurple;
get topbarColor => header; //softPurple;
get chatImageColor => purple;
}

View File

@ -121,6 +121,7 @@ abstract class OpaqueThemeType {
// Images
get chatImageColor => red;
get chatImage => null;
ImageProvider loadImage(String key, {BuildContext? context}) { return AssetImage(""); }

View File

@ -140,6 +140,7 @@ class YmlTheme extends OpaqueThemeType {
// Images
get chatImageColor => getColor("chatImageColor") ?? fallbackTheme.chatImageColor;
get chatImage => getImage("chatImage") ?? fallbackTheme.chatImage;
ImageProvider loadImage(String key, {BuildContext? context}) {

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,11 +117,11 @@ 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),
colorFilter: ColorFilter.mode(Provider.of<Settings>(context).theme.hilightElementColor.withOpacity(0.15), BlendMode.srcIn))
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.chatImageColor, BlendMode.srcIn))
: null
: DecorationImage(
fit: BoxFit.scaleDown,