style: 调整加号面板中更多操作选项的样式

This commit is contained in:
Zeew 2025-08-18 10:19:56 +08:00
parent aa87129838
commit 2c03ed7f1c
2 changed files with 32 additions and 5 deletions

View File

@ -83,8 +83,14 @@ class MorePanel extends StatefulWidget {
final ConvType conversationType;
final MorePanelConfig? morePanelConfig;
final ValueChanged<double>? onPanelHeightChanged;
const MorePanel({required this.conversationID, required this.conversationType, Key? key, this.morePanelConfig})
const MorePanel(
{required this.conversationID,
required this.conversationType,
Key? key,
this.morePanelConfig,
this.onPanelHeightChanged})
: super(key: key);
@override
@ -750,8 +756,15 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
final TUITheme theme = value.theme;
final TUIChatSeparateViewModel model = Provider.of<TUIChatSeparateViewModel>(context);
final screenWidth = MediaQuery.of(context).size.width;
final items = itemList(model, theme);
final double panelHeight = items.length > 4 ? 248.0 : 120;
if (widget.onPanelHeightChanged != null) {
WidgetsBinding.instance.addPostFrameCallback((_) {
widget.onPanelHeightChanged?.call(panelHeight);
});
}
return Container(
height: 248,
height: panelHeight,
decoration: BoxDecoration(
// color: hexToColor("EBF0F6"),
border: Border(
@ -767,7 +780,7 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
child: Wrap(
spacing: (screenWidth - (23 * 2) - 64 * 4) / 3,
runSpacing: 20,
children: itemList(model, theme)
children: items
.map((item) => InkWell(
onTap: () {
if (item.onTap != null) {

View File

@ -154,6 +154,7 @@ class _TIMUIKitTextFieldLayoutNarrowState extends TIMUIKitState<TIMUIKitTextFiel
bool showKeyboard = false;
Function? setKeyboardHeight;
double? bottomPadding;
double? morePanelDynamicHeight;
@override
void initState() {
@ -264,7 +265,14 @@ class _TIMUIKitTextFieldLayoutNarrowState extends TIMUIKitState<TIMUIKitTextFiel
return MorePanel(
morePanelConfig: widget.morePanelConfig,
conversationID: widget.conversationID,
conversationType: widget.conversationType);
conversationType: widget.conversationType,
onPanelHeightChanged: (h) {
if (morePanelDynamicHeight != h) {
setState(() {
morePanelDynamicHeight = h;
});
}
});
}
return const SizedBox(height: 0);
@ -284,8 +292,11 @@ class _TIMUIKitTextFieldLayoutNarrowState extends TIMUIKitState<TIMUIKitTextFiel
}
final height = originHeight != 0 ? originHeight : currentKeyboardHeight;
return height;
} else if (showMore || showEmojiPanel) {
} else if (showEmojiPanel) {
return 248.0 + (bottomPadding ?? 0.0);
} else if (showMore) {
final double inner = morePanelDynamicHeight ?? 120;
return inner + (bottomPadding ?? 0.0);
} else if (widget.textEditingController.text.length >= 46 && showKeyboard == false) {
return 25 + (bottomPadding ?? 0.0);
} else {
@ -302,6 +313,9 @@ class _TIMUIKitTextFieldLayoutNarrowState extends TIMUIKitState<TIMUIKitTextFiel
showKeyboard = false;
showEmojiPanel = false;
showSendSoundText = false;
if (!showMore) {
morePanelDynamicHeight = 120;
}
showMore = !showMore;
});
}