mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-04-25 15:17:28 -04:00
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:
parent
1dedb909e5
commit
522143cfd8
12 changed files with 267 additions and 86 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue