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) {
final composerView = composerManager.getComposerView(composerIdsQueue.first);
if (composerView.controller.isHiddenScreen) {
return Stack(
children: [
Align(
alignment: AlignmentDirectional.bottomEnd,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Padding(
padding: const EdgeInsetsDirectional.all(ComposerStyle.padding),
child: ExpandComposerButton(
countComposerHidden: 1,
onRemoveHiddenComposerItem: (controller) =>
controller.handleClickCloseComposer(context),
onShowComposerAction: composerManager.showComposerIfHidden,
),
),
),
),
],
);
} else {
return composerView;
}
return Padding(
padding: const EdgeInsetsDirectional.all(ComposerStyle.padding),
child: composerView.controller.isHiddenScreen
? ExpandComposerButton(
countComposerHidden: 1,
onRemoveHiddenComposerItem: (controller) =>
controller.handleClickCloseComposer(context),
onShowComposerAction: composerManager.showComposerIfHidden,
)
: composerView,
);
}
final countComposerHidden = composerManager.countComposerHidden;
@@ -65,32 +53,25 @@ class ComposerOverlayView extends StatelessWidget {
.where((view) => !view.controller.isHiddenScreen)
.toList();
return Stack(
children: [
Align(
alignment: AlignmentDirectional.bottomEnd,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Padding(
padding: const EdgeInsetsDirectional.all(ComposerStyle.padding),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
if (countComposerHidden > 0)
ExpandComposerButton(
countComposerHidden: countComposerHidden,
onRemoveHiddenComposerItem: (controller) =>
controller.handleClickCloseComposer(context),
onShowComposerAction: composerManager.showComposerIfHidden,
),
...visibleComposers,
],
return SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Padding(
padding: const EdgeInsetsDirectional.all(ComposerStyle.padding),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
if (countComposerHidden > 0)
ExpandComposerButton(
countComposerHidden: countComposerHidden,
onRemoveHiddenComposerItem: (controller) =>
controller.handleClickCloseComposer(context),
onShowComposerAction: composerManager.showComposerIfHidden,
),
),
),
...visibleComposers,
],
),
],
),
);
});
}
@@ -33,7 +33,7 @@ class DesktopResponsiveContainerView extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (displayMode == ScreenDisplayMode.minimize) {
final composerWidget = PointerInterceptor(
return PointerInterceptor(
child: MinimizeComposerWidget(
imagePaths: imagePaths,
emailSubject: emailSubject,
@@ -41,16 +41,8 @@ class DesktopResponsiveContainerView extends StatelessWidget {
onChangeDisplayModeAction: onChangeDisplayModeAction,
),
);
return composerManager.composerIdsQueue.length == 1
? PositionedDirectional(
end: DesktopResponsiveContainerViewStyle.margin,
bottom: DesktopResponsiveContainerViewStyle.margin,
child: composerWidget,
)
: composerWidget;
} else if (displayMode == ScreenDisplayMode.normal) {
final composerWidget = Card(
return Card(
elevation: DesktopResponsiveContainerViewStyle.elevation,
shape: const RoundedRectangleBorder(
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) {
final maxWidth = responsiveUtils.getSizeScreenWidth(context) * 0.85;
final maxHeight = responsiveUtils.getSizeScreenHeight(context) * 0.9;
@@ -1,4 +0,0 @@
enum ComposerOverlayState {
active, inActive
}