feat: support adjusting document width (#6327)

* feat: support adjusting document width

* chore: refactor padding calculation function

* fix: remove reset confim dialog

* chore: remove unused code

* feat: update sider position

* feat: use max width instead of padding

* fix: remove unused code

* fix: padding is negative error

* fix: set maxDocumentWidth to 480 * 4 and minDocumentWidth to 480

* fix: integration test
This commit is contained in:
Lucas 2024-09-18 10:43:23 +08:00 committed by GitHub
parent 1dedb909e5
commit 522143cfd8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 267 additions and 86 deletions

View file

@ -1,4 +1,5 @@
import 'package:appflowy/mobile/application/page_style/document_page_style_bloc.dart';
import 'package:appflowy/plugins/document/application/document_appearance_cubit.dart';
import 'package:appflowy/plugins/document/application/document_bloc.dart';
import 'package:appflowy/plugins/document/presentation/banner.dart';
import 'package:appflowy/plugins/document/presentation/editor_drop_manager.dart';
@ -145,6 +146,8 @@ class _DocumentPageState extends State<DocumentPage>
DocumentState state,
EditorDropManagerState dropState,
) {
final width = context.read<DocumentAppearanceCubit>().state.width;
final Widget child;
if (UniversalPlatform.isMobile) {
child = BlocBuilder<DocumentPageStyleBloc, DocumentPageStyleState>(
@ -153,7 +156,7 @@ class _DocumentPageState extends State<DocumentPage>
editorState: state.editorState!,
styleCustomizer: EditorStyleCustomizer(
context: context,
// the 44 is the width of the left action list
width: width,
padding: EditorStyleCustomizer.documentPadding,
),
header: _buildCoverAndIcon(context, state),
@ -243,7 +246,7 @@ class _DocumentPageState extends State<DocumentPage>
editorState: state.editorState!,
styleCustomizer: EditorStyleCustomizer(
context: context,
// the 44 is the width of the left action list
width: width,
padding: EditorStyleCustomizer.documentPadding,
),
header: _buildCoverAndIcon(context, state),