-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve more action in document (#4639)
- Loading branch information
Showing
4 changed files
with
91 additions
and
118 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
frontend/appflowy_flutter/lib/plugins/document/presentation/more/font_size_slider.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'package:appflowy/plugins/document/presentation/more/cubit/document_appearance_cubit.dart'; | ||
import 'package:flowy_infra_ui/style_widget/text.dart'; | ||
import 'package:flowy_infra_ui/widget/spacing.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
|
||
class FontSizeStepper extends StatelessWidget { | ||
const FontSizeStepper({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return BlocBuilder<DocumentAppearanceCubit, DocumentAppearance>( | ||
builder: (context, state) { | ||
return Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 10), | ||
child: Row( | ||
children: [ | ||
const FlowyText('A', fontSize: 14), | ||
const HSpace(6), | ||
Expanded( | ||
child: SliderTheme( | ||
data: Theme.of(context).sliderTheme.copyWith( | ||
showValueIndicator: ShowValueIndicator.never, | ||
thumbShape: const RoundSliderThumbShape( | ||
enabledThumbRadius: 8, | ||
), | ||
overlayShape: const RoundSliderOverlayShape( | ||
overlayRadius: 16, | ||
), | ||
), | ||
child: Slider( | ||
value: state.fontSize, | ||
min: 10, | ||
max: 24, | ||
divisions: 8, | ||
onChanged: (fontSize) => context | ||
.read<DocumentAppearanceCubit>() | ||
.syncFontSize(fontSize), | ||
), | ||
), | ||
), | ||
const HSpace(6), | ||
const FlowyText('A', fontSize: 20), | ||
], | ||
), | ||
); | ||
}, | ||
); | ||
} | ||
} |
92 changes: 0 additions & 92 deletions
92
frontend/appflowy_flutter/lib/plugins/document/presentation/more/font_size_switcher.dart
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters