diff --git a/CHANGELOG.md b/CHANGELOG.md index c8720cfc..3ec51d63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. +## 9.1.0 +* Fix the simple toolbar by add properties of `IconButton` and fix some buttons + ## 9.1.0-dev.2 * Fix the history buttons diff --git a/example/lib/main.dart b/example/lib/main.dart index a7ae8990..089042b0 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -56,7 +56,7 @@ class MyApp extends StatelessWidget { ), ), darkTheme: ThemeData( - useMaterial3: false, + useMaterial3: true, visualDensity: VisualDensity.adaptivePlatformDensity, colorScheme: ColorScheme.fromSeed( brightness: Brightness.dark, diff --git a/example/lib/presentation/quill/my_quill_toolbar.dart b/example/lib/presentation/quill/my_quill_toolbar.dart index 1614528d..f0e6a7b2 100644 --- a/example/lib/presentation/quill/my_quill_toolbar.dart +++ b/example/lib/presentation/quill/my_quill_toolbar.dart @@ -202,6 +202,15 @@ class MyQuillToolbar extends StatelessWidget { controller: controller, showAlignmentButtons: true, multiRowsDisplay: true, + buttonOptions: const QuillSimpleToolbarButtonOptions( + base: QuillToolbarBaseButtonOptions( + iconTheme: QuillIconTheme( + iconButtonUnselectedData: IconButtonData( + splashRadius: 200, + ), + ), + ), + ), customButtons: [ QuillToolbarCustomButtonOptions( icon: const Icon(Icons.add_alarm_rounded), diff --git a/flutter_quill_extensions/lib/embeds/formula/toolbar/formula_button.dart b/flutter_quill_extensions/lib/embeds/formula/toolbar/formula_button.dart index 757df66e..9fab66a9 100644 --- a/flutter_quill_extensions/lib/embeds/formula/toolbar/formula_button.dart +++ b/flutter_quill_extensions/lib/embeds/formula/toolbar/formula_button.dart @@ -94,6 +94,7 @@ class QuillToolbarFormulaButton extends StatelessWidget { tooltip: tooltip, onPressed: () => _sharedOnPressed(context), isSelected: false, + iconTheme: iconTheme, ); } diff --git a/lib/src/models/themes/quill_icon_theme.dart b/lib/src/models/themes/quill_icon_theme.dart index e6183319..4d4acd12 100644 --- a/lib/src/models/themes/quill_icon_theme.dart +++ b/lib/src/models/themes/quill_icon_theme.dart @@ -3,7 +3,6 @@ import 'package:flutter/material.dart'; @immutable class QuillIconTheme { const QuillIconTheme({ - this.padding, this.iconButtonSelectedStyle, this.iconButtonUnselectedStyle, this.iconButtonSelectedData, @@ -17,9 +16,6 @@ class QuillIconTheme { final IconButtonData? iconButtonUnselectedData; final IconButtonData? iconButtonSelectedData; - - ///The padding for icons - final EdgeInsets? padding; } @immutable diff --git a/lib/src/widgets/toolbar/buttons/color/color_button.dart b/lib/src/widgets/toolbar/buttons/color/color_button.dart index fe4e093c..587b4a33 100644 --- a/lib/src/widgets/toolbar/buttons/color/color_button.dart +++ b/lib/src/widgets/toolbar/buttons/color/color_button.dart @@ -193,12 +193,14 @@ class QuillToolbarColorButtonState extends State { ); } - return IconButton( + return QuillToolbarIconButton( tooltip: tooltip, - iconSize: iconSize * iconButtonFactor, + isSelected: false, + iconTheme: iconTheme, icon: Icon( iconData, color: widget.isBackground ? iconColorBackground : iconColor, + size: iconSize * iconButtonFactor, ), onPressed: _showColorPicker, ); diff --git a/lib/src/widgets/toolbar/buttons/custom_button_button.dart b/lib/src/widgets/toolbar/buttons/custom_button_button.dart index 3f83bf10..4f99aa9a 100644 --- a/lib/src/widgets/toolbar/buttons/custom_button_button.dart +++ b/lib/src/widgets/toolbar/buttons/custom_button_button.dart @@ -85,6 +85,7 @@ class QuillToolbarCustomButton extends StatelessWidget { tooltip: tooltip, onPressed: () => _onPressed(context), afterPressed: afterButtonPressed, + iconTheme: iconTheme, ); } } diff --git a/lib/src/widgets/toolbar/buttons/link_style2_button.dart b/lib/src/widgets/toolbar/buttons/link_style2_button.dart index 0c24d4ec..7f2a2658 100644 --- a/lib/src/widgets/toolbar/buttons/link_style2_button.dart +++ b/lib/src/widgets/toolbar/buttons/link_style2_button.dart @@ -156,6 +156,7 @@ class _QuillToolbarLinkStyleButton2State ), isSelected: isToggled, onPressed: _openLinkDialog, + iconTheme: iconTheme, afterPressed: afterButtonPressed, ); } diff --git a/lib/src/widgets/toolbar/buttons/link_style_button.dart b/lib/src/widgets/toolbar/buttons/link_style_button.dart index 484ffc87..2670ff6e 100644 --- a/lib/src/widgets/toolbar/buttons/link_style_button.dart +++ b/lib/src/widgets/toolbar/buttons/link_style_button.dart @@ -149,6 +149,7 @@ class QuillToolbarLinkStyleButtonState isSelected: isToggled, onPressed: () => _openLinkDialog(context), afterPressed: afterButtonPressed, + iconTheme: iconTheme, ); } diff --git a/lib/src/widgets/toolbar/buttons/quill_icon_button.dart b/lib/src/widgets/toolbar/buttons/quill_icon_button.dart index e3350d1b..2bf75ebe 100644 --- a/lib/src/widgets/toolbar/buttons/quill_icon_button.dart +++ b/lib/src/widgets/toolbar/buttons/quill_icon_button.dart @@ -7,10 +7,10 @@ class QuillToolbarIconButton extends StatelessWidget { required this.onPressed, required this.icon, required this.isSelected, + required this.iconTheme, this.afterPressed, this.tooltip, super.key, - this.iconTheme, }); final VoidCallback? onPressed; diff --git a/lib/src/widgets/toolbar/buttons/search/search_button.dart b/lib/src/widgets/toolbar/buttons/search/search_button.dart index bba06036..c98afe13 100644 --- a/lib/src/widgets/toolbar/buttons/search/search_button.dart +++ b/lib/src/widgets/toolbar/buttons/search/search_button.dart @@ -122,6 +122,7 @@ class QuillToolbarSearchButton extends StatelessWidget { isSelected: false, onPressed: () => _sharedOnPressed(context), afterPressed: afterButtonPressed, + iconTheme: iconTheme, ); }