TF-3480 Fix padding when display single composer

Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
dab246
2025-03-12 19:22:56 +07:00
committed by Dat H. Pham
parent 73c97f15ba
commit 9789458055
3 changed files with 30 additions and 69 deletions
@@ -34,29 +34,17 @@ class ComposerOverlayView extends StatelessWidget {
if (composerIdsQueue.length == 1) { if (composerIdsQueue.length == 1) {
final composerView = composerManager.getComposerView(composerIdsQueue.first); final composerView = composerManager.getComposerView(composerIdsQueue.first);
if (composerView.controller.isHiddenScreen) { return Padding(
return Stack( padding: const EdgeInsetsDirectional.all(ComposerStyle.padding),
children: [ child: composerView.controller.isHiddenScreen
Align( ? ExpandComposerButton(
alignment: AlignmentDirectional.bottomEnd, countComposerHidden: 1,
child: SingleChildScrollView( onRemoveHiddenComposerItem: (controller) =>
scrollDirection: Axis.horizontal, controller.handleClickCloseComposer(context),
child: Padding( onShowComposerAction: composerManager.showComposerIfHidden,
padding: const EdgeInsetsDirectional.all(ComposerStyle.padding), )
child: ExpandComposerButton( : composerView,
countComposerHidden: 1, );
onRemoveHiddenComposerItem: (controller) =>
controller.handleClickCloseComposer(context),
onShowComposerAction: composerManager.showComposerIfHidden,
),
),
),
),
],
);
} else {
return composerView;
}
} }
final countComposerHidden = composerManager.countComposerHidden; final countComposerHidden = composerManager.countComposerHidden;
@@ -65,32 +53,25 @@ class ComposerOverlayView extends StatelessWidget {
.where((view) => !view.controller.isHiddenScreen) .where((view) => !view.controller.isHiddenScreen)
.toList(); .toList();
return Stack( return SingleChildScrollView(
children: [ scrollDirection: Axis.horizontal,
Align( child: Padding(
alignment: AlignmentDirectional.bottomEnd, padding: const EdgeInsetsDirectional.all(ComposerStyle.padding),
child: SingleChildScrollView( child: Row(
scrollDirection: Axis.horizontal, crossAxisAlignment: CrossAxisAlignment.end,
child: Padding( mainAxisSize: MainAxisSize.min,
padding: const EdgeInsetsDirectional.all(ComposerStyle.padding), children: [
child: Row( if (countComposerHidden > 0)
crossAxisAlignment: CrossAxisAlignment.end, ExpandComposerButton(
mainAxisSize: MainAxisSize.min, countComposerHidden: countComposerHidden,
children: [ onRemoveHiddenComposerItem: (controller) =>
if (countComposerHidden > 0) controller.handleClickCloseComposer(context),
ExpandComposerButton( onShowComposerAction: composerManager.showComposerIfHidden,
countComposerHidden: countComposerHidden,
onRemoveHiddenComposerItem: (controller) =>
controller.handleClickCloseComposer(context),
onShowComposerAction: composerManager.showComposerIfHidden,
),
...visibleComposers,
],
), ),
), ...visibleComposers,
), ],
), ),
], ),
); );
}); });
} }
@@ -33,7 +33,7 @@ class DesktopResponsiveContainerView extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (displayMode == ScreenDisplayMode.minimize) { if (displayMode == ScreenDisplayMode.minimize) {
final composerWidget = PointerInterceptor( return PointerInterceptor(
child: MinimizeComposerWidget( child: MinimizeComposerWidget(
imagePaths: imagePaths, imagePaths: imagePaths,
emailSubject: emailSubject, emailSubject: emailSubject,
@@ -41,16 +41,8 @@ class DesktopResponsiveContainerView extends StatelessWidget {
onChangeDisplayModeAction: onChangeDisplayModeAction, onChangeDisplayModeAction: onChangeDisplayModeAction,
), ),
); );
return composerManager.composerIdsQueue.length == 1
? PositionedDirectional(
end: DesktopResponsiveContainerViewStyle.margin,
bottom: DesktopResponsiveContainerViewStyle.margin,
child: composerWidget,
)
: composerWidget;
} else if (displayMode == ScreenDisplayMode.normal) { } else if (displayMode == ScreenDisplayMode.normal) {
final composerWidget = Card( return Card(
elevation: DesktopResponsiveContainerViewStyle.elevation, elevation: DesktopResponsiveContainerViewStyle.elevation,
shape: const RoundedRectangleBorder( shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(DesktopResponsiveContainerViewStyle.radius)), borderRadius: BorderRadius.all(Radius.circular(DesktopResponsiveContainerViewStyle.radius)),
@@ -67,14 +59,6 @@ class DesktopResponsiveContainerView extends StatelessWidget {
), ),
), ),
); );
return composerManager.composerIdsQueue.length == 1
? PositionedDirectional(
end: DesktopResponsiveContainerViewStyle.margin,
bottom: DesktopResponsiveContainerViewStyle.margin,
child: composerWidget,
)
: composerWidget;
} else if (displayMode == ScreenDisplayMode.fullScreen) { } else if (displayMode == ScreenDisplayMode.fullScreen) {
final maxWidth = responsiveUtils.getSizeScreenWidth(context) * 0.85; final maxWidth = responsiveUtils.getSizeScreenWidth(context) * 0.85;
final maxHeight = responsiveUtils.getSizeScreenHeight(context) * 0.9; final maxHeight = responsiveUtils.getSizeScreenHeight(context) * 0.9;
@@ -1,4 +0,0 @@
enum ComposerOverlayState {
active, inActive
}