mirror of
https://github.com/tommyxchow/frosty.git
synced 2025-08-06 17:48:14 +08:00
Add option to un-darken historical recent messages
This commit is contained in:
@ -440,21 +440,27 @@ class ChatMessage extends StatelessWidget {
|
||||
child: dividedMessage,
|
||||
);
|
||||
|
||||
final finalMessage = InkWell(
|
||||
onTap: () {
|
||||
FocusScope.of(context).unfocus();
|
||||
if (chatStore.assetsStore.showEmoteMenu) {
|
||||
chatStore.assetsStore.showEmoteMenu = false;
|
||||
}
|
||||
},
|
||||
onLongPress: () => onLongPressMessage(context, defaultTextStyle),
|
||||
child: coloredMessage,
|
||||
);
|
||||
|
||||
final isHistorical = ircMessage.tags['historical'] == '1';
|
||||
|
||||
return Opacity(
|
||||
opacity: isHistorical ? 0.5 : 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
FocusScope.of(context).unfocus();
|
||||
if (chatStore.assetsStore.showEmoteMenu) {
|
||||
chatStore.assetsStore.showEmoteMenu = false;
|
||||
}
|
||||
},
|
||||
onLongPress: () => onLongPressMessage(context, defaultTextStyle),
|
||||
child: coloredMessage,
|
||||
),
|
||||
);
|
||||
if (chatStore.settings.darkenRecentMessages && isHistorical) {
|
||||
return Opacity(
|
||||
opacity: 0.5,
|
||||
child: finalMessage,
|
||||
);
|
||||
}
|
||||
|
||||
return finalMessage;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -358,6 +358,15 @@ class _ChatSettingsState extends State<ChatSettings> {
|
||||
onChanged: (newValue) =>
|
||||
settingsStore.showRecentMessages = newValue,
|
||||
),
|
||||
SettingsListSwitch(
|
||||
title: 'Darken historical recent messages',
|
||||
subtitle: const Text(
|
||||
'Makes historical recent messages 50% opacity to distinguish them from live messages.',
|
||||
),
|
||||
value: settingsStore.darkenRecentMessages,
|
||||
onChanged: (newValue) =>
|
||||
settingsStore.darkenRecentMessages = newValue,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
@ -152,6 +152,7 @@ abstract class _SettingsStoreBase with Store {
|
||||
|
||||
// Recent messages defaults
|
||||
static const defaultShowRecentMessages = false;
|
||||
static const defaultDarkenRecentMessages = true;
|
||||
|
||||
// Message sizing options
|
||||
@JsonKey(defaultValue: defaultBadgeScale)
|
||||
@ -290,6 +291,10 @@ abstract class _SettingsStoreBase with Store {
|
||||
@observable
|
||||
var showRecentMessages = defaultShowRecentMessages;
|
||||
|
||||
@JsonKey(defaultValue: defaultDarkenRecentMessages)
|
||||
@observable
|
||||
var darkenRecentMessages = defaultDarkenRecentMessages;
|
||||
|
||||
@action
|
||||
void resetChatSettings() {
|
||||
badgeScale = defaultBadgeScale;
|
||||
@ -331,6 +336,7 @@ abstract class _SettingsStoreBase with Store {
|
||||
showFFZBadges = defaultShowFFZBadges;
|
||||
|
||||
showRecentMessages = defaultShowRecentMessages;
|
||||
darkenRecentMessages = defaultDarkenRecentMessages;
|
||||
}
|
||||
|
||||
// * Other settings
|
||||
|
@ -62,6 +62,7 @@ SettingsStore _$SettingsStoreFromJson(Map<String, dynamic> json) =>
|
||||
..showFFZEmotes = json['showFFZEmotes'] as bool? ?? true
|
||||
..showFFZBadges = json['showFFZBadges'] as bool? ?? true
|
||||
..showRecentMessages = json['showRecentMessages'] as bool? ?? false
|
||||
..darkenRecentMessages = json['darkenRecentMessages'] as bool? ?? true
|
||||
..shareCrashLogsAndAnalytics =
|
||||
json['shareCrashLogsAndAnalytics'] as bool? ?? true
|
||||
..fullScreen = json['fullScreen'] as bool? ?? false
|
||||
@ -111,6 +112,7 @@ Map<String, dynamic> _$SettingsStoreToJson(SettingsStore instance) =>
|
||||
'showFFZEmotes': instance.showFFZEmotes,
|
||||
'showFFZBadges': instance.showFFZBadges,
|
||||
'showRecentMessages': instance.showRecentMessages,
|
||||
'darkenRecentMessages': instance.darkenRecentMessages,
|
||||
'shareCrashLogsAndAnalytics': instance.shareCrashLogsAndAnalytics,
|
||||
'fullScreen': instance.fullScreen,
|
||||
'fullScreenChatOverlay': instance.fullScreenChatOverlay,
|
||||
@ -809,6 +811,23 @@ mixin _$SettingsStore on _SettingsStoreBase, Store {
|
||||
});
|
||||
}
|
||||
|
||||
late final _$darkenRecentMessagesAtom =
|
||||
Atom(name: '_SettingsStoreBase.darkenRecentMessages', context: context);
|
||||
|
||||
@override
|
||||
bool get darkenRecentMessages {
|
||||
_$darkenRecentMessagesAtom.reportRead();
|
||||
return super.darkenRecentMessages;
|
||||
}
|
||||
|
||||
@override
|
||||
set darkenRecentMessages(bool value) {
|
||||
_$darkenRecentMessagesAtom.reportWrite(value, super.darkenRecentMessages,
|
||||
() {
|
||||
super.darkenRecentMessages = value;
|
||||
});
|
||||
}
|
||||
|
||||
late final _$shareCrashLogsAndAnalyticsAtom = Atom(
|
||||
name: '_SettingsStoreBase.shareCrashLogsAndAnalytics', context: context);
|
||||
|
||||
@ -972,6 +991,7 @@ showBTTVBadges: ${showBTTVBadges},
|
||||
showFFZEmotes: ${showFFZEmotes},
|
||||
showFFZBadges: ${showFFZBadges},
|
||||
showRecentMessages: ${showRecentMessages},
|
||||
darkenRecentMessages: ${darkenRecentMessages},
|
||||
shareCrashLogsAndAnalytics: ${shareCrashLogsAndAnalytics},
|
||||
fullScreen: ${fullScreen},
|
||||
fullScreenChatOverlay: ${fullScreenChatOverlay}
|
||||
|
Reference in New Issue
Block a user