mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-27 23:09:35 +01:00
Merge branch 'main' of gitlab.com:ChristianPauly/fluffychat-flutter into main
This commit is contained in:
commit
1d5607f9c5
@ -2,6 +2,8 @@
|
|||||||
### Features
|
### Features
|
||||||
- Add ability to enable / disable emotes globally
|
- Add ability to enable / disable emotes globally
|
||||||
- Add ability to manage emote packs with different state keys
|
- Add ability to manage emote packs with different state keys
|
||||||
|
### Fixes
|
||||||
|
- Fix amoled / theme settings not always saving properly
|
||||||
|
|
||||||
# Version 0.19.0 - 2020-09-21
|
# Version 0.19.0 - 2020-09-21
|
||||||
### Features
|
### Features
|
||||||
|
@ -176,8 +176,9 @@ class ThemeSwitcherWidgetState extends State<ThemeSwitcherWidget> {
|
|||||||
|
|
||||||
Future loadSelection(MatrixState matrix) async {
|
Future loadSelection(MatrixState matrix) async {
|
||||||
String item = await matrix.store.getItem('theme') ?? 'light';
|
String item = await matrix.store.getItem('theme') ?? 'light';
|
||||||
selectedTheme =
|
selectedTheme = Themes.values.firstWhere(
|
||||||
Themes.values.firstWhere((e) => e.toString() == 'Themes.' + item);
|
(e) => e.toString() == 'Themes.' + item,
|
||||||
|
orElse: () => Themes.system);
|
||||||
|
|
||||||
amoledEnabled = (await matrix.store.getItem('amoled_enabled') ?? 'false')
|
amoledEnabled = (await matrix.store.getItem('amoled_enabled') ?? 'false')
|
||||||
.toLowerCase() ==
|
.toLowerCase() ==
|
||||||
@ -238,26 +239,6 @@ class ThemeSwitcherWidgetState extends State<ThemeSwitcherWidget> {
|
|||||||
void setup() async {
|
void setup() async {
|
||||||
final matrix = Matrix.of(context);
|
final matrix = Matrix.of(context);
|
||||||
await loadSelection(matrix);
|
await loadSelection(matrix);
|
||||||
|
|
||||||
if (selectedTheme == null) {
|
|
||||||
switchTheme(matrix, Themes.light, false);
|
|
||||||
} else {
|
|
||||||
switch (selectedTheme) {
|
|
||||||
case Themes.light:
|
|
||||||
switchTheme(matrix, Themes.light, false);
|
|
||||||
break;
|
|
||||||
case Themes.dark:
|
|
||||||
if (amoledEnabled) {
|
|
||||||
switchTheme(matrix, Themes.dark, true);
|
|
||||||
} else {
|
|
||||||
switchTheme(matrix, Themes.dark, false);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Themes.system:
|
|
||||||
switchTheme(matrix, Themes.system, false);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
Loading…
Reference in New Issue
Block a user