Merge pull request #4867 from pangeachat/4864-emoji-mode-tweaks
4864 emoji mode tweaks
This commit is contained in:
commit
e05b0af013
5 changed files with 29 additions and 34 deletions
|
|
@ -27,7 +27,7 @@ abstract class AppConfig {
|
|||
static const bool allowOtherHomeservers = true;
|
||||
static const bool enableRegistration = true;
|
||||
// #Pangea
|
||||
static const double toolbarMaxHeight = 225.0;
|
||||
static const double toolbarMaxHeight = 235.0;
|
||||
static const double toolbarMinHeight = 150.0;
|
||||
static const double toolbarMinWidth = 350.0;
|
||||
static const double toolbarMenuHeight = 50.0;
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class LemmaHighlightEmojiRowState extends State<LemmaHighlightEmojiRow> {
|
|||
}
|
||||
|
||||
return SizedBox(
|
||||
height: 60.0,
|
||||
height: 70.0,
|
||||
child: Row(
|
||||
spacing: 4.0,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
|
@ -88,6 +88,7 @@ class LemmaHighlightEmojiRowState extends State<LemmaHighlightEmojiRow> {
|
|||
badge: widget.emoji == emoji
|
||||
? widget.selectedEmojiBadge
|
||||
: null,
|
||||
showShimmer: widget.emoji == null,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
|
|
@ -105,6 +106,7 @@ class EmojiChoiceItem extends StatefulWidget {
|
|||
final bool selected;
|
||||
final String transformTargetId;
|
||||
final Widget? badge;
|
||||
final bool showShimmer;
|
||||
|
||||
const EmojiChoiceItem({
|
||||
super.key,
|
||||
|
|
@ -114,6 +116,7 @@ class EmojiChoiceItem extends StatefulWidget {
|
|||
required this.onSelectEmoji,
|
||||
required this.transformTargetId,
|
||||
this.badge,
|
||||
this.showShimmer = true,
|
||||
});
|
||||
|
||||
@override
|
||||
|
|
@ -121,7 +124,7 @@ class EmojiChoiceItem extends StatefulWidget {
|
|||
}
|
||||
|
||||
class EmojiChoiceItemState extends State<EmojiChoiceItem> {
|
||||
bool shimmer = true;
|
||||
bool shimmer = false;
|
||||
Timer? _shimmerTimer;
|
||||
|
||||
@override
|
||||
|
|
@ -145,6 +148,8 @@ class EmojiChoiceItemState extends State<EmojiChoiceItem> {
|
|||
}
|
||||
|
||||
void _showShimmer() {
|
||||
if (!widget.showShimmer) return;
|
||||
|
||||
setState(() => shimmer = true);
|
||||
_shimmerTimer?.cancel();
|
||||
_shimmerTimer = Timer(const Duration(milliseconds: 1500), () {
|
||||
|
|
@ -171,16 +176,16 @@ class EmojiChoiceItemState extends State<EmojiChoiceItem> {
|
|||
link: layerLink,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
padding: const EdgeInsets.all(8),
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: hovered
|
||||
? Theme.of(context).colorScheme.primary.withAlpha(50)
|
||||
color: hovered || widget.selected
|
||||
? Theme.of(context).colorScheme.secondary.withAlpha(30)
|
||||
: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
border: widget.selected
|
||||
? Border.all(
|
||||
color: AppConfig.goldLight.withAlpha(200),
|
||||
width: 2,
|
||||
color: Colors.transparent,
|
||||
width: 4,
|
||||
)
|
||||
: null,
|
||||
),
|
||||
|
|
@ -193,8 +198,8 @@ class EmojiChoiceItemState extends State<EmojiChoiceItem> {
|
|||
),
|
||||
if (widget.badge != null)
|
||||
Positioned(
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
right: 6,
|
||||
bottom: 6,
|
||||
child: widget.badge!,
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -104,17 +104,11 @@ class TokenEmojiButtonState extends State<TokenEmojiButton>
|
|||
}
|
||||
|
||||
final child = widget.enabled
|
||||
? _emoji != null
|
||||
? Text(
|
||||
_emoji!,
|
||||
style: TextStyle(fontSize: buttonSize - 8.0),
|
||||
textScaler: TextScaler.noScaling,
|
||||
)
|
||||
: Icon(
|
||||
Icons.add_reaction_outlined,
|
||||
size: buttonSize - 8.0,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
)
|
||||
? Text(
|
||||
_emoji ?? "-",
|
||||
style: TextStyle(fontSize: buttonSize - 8.0),
|
||||
textScaler: TextScaler.noScaling,
|
||||
)
|
||||
: null;
|
||||
|
||||
final content = ValueListenableBuilder(
|
||||
|
|
|
|||
|
|
@ -121,16 +121,9 @@ class LemmaReactionPickerState extends State<LemmaReactionPicker>
|
|||
selectedEmojiBadge: widget.event != null &&
|
||||
_selectedEmoji != null &&
|
||||
_sentReaction(_selectedEmoji!) == null
|
||||
? CircleAvatar(
|
||||
backgroundColor: Theme.of(context).colorScheme.onSurface,
|
||||
radius: 8.0,
|
||||
child: Center(
|
||||
child: Icon(
|
||||
Icons.send,
|
||||
size: 12.0,
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
),
|
||||
),
|
||||
? const Icon(
|
||||
Icons.add_reaction,
|
||||
size: 12.0,
|
||||
)
|
||||
: null,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||
|
||||
import 'package:fluffychat/config/themes.dart';
|
||||
import 'package:fluffychat/pangea/toolbar/layout/message_selection_positioner.dart';
|
||||
import 'package:fluffychat/pangea/toolbar/reading_assistance/select_mode_buttons.dart';
|
||||
import 'package:fluffychat/pangea/toolbar/word_card/reading_assistance_content.dart';
|
||||
|
||||
class WordCardSwitcher extends StatelessWidget {
|
||||
|
|
@ -22,9 +23,11 @@ class WordCardSwitcher extends StatelessWidget {
|
|||
? ReadingAssistanceContent(
|
||||
overlayController: controller.widget.overlayController,
|
||||
)
|
||||
: MessageReactionPicker(
|
||||
chatController: controller.widget.chatController,
|
||||
),
|
||||
: mode != SelectMode.emoji
|
||||
? MessageReactionPicker(
|
||||
chatController: controller.widget.chatController,
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue