diff --git a/lib/src/models/config/toolbar/buttons/font_family_configurations.dart b/lib/src/models/config/toolbar/buttons/font_family_configurations.dart index 8d7daf9e..6ada035c 100644 --- a/lib/src/models/config/toolbar/buttons/font_family_configurations.dart +++ b/lib/src/models/config/toolbar/buttons/font_family_configurations.dart @@ -49,11 +49,18 @@ class QuillToolbarFontFamilyButtonOptions extends QuillToolbarBaseButtonOptions< this.itemPadding, this.defaultItemColor = Colors.red, this.renderFontFamilies = true, + this.highlightElevation = 1, + this.hoverElevation = 1, + this.fillColor, this.iconSize, this.iconButtonFactor, }); - /// By default it will be [fontFamilyValues] from [QuillSimpleToolbarConfigurations] + final Color? fillColor; + final double hoverElevation; + final double highlightElevation; + + /// By default it will be [fontFamilyValues] from [QuillToolbarConfigurations] /// You can override this if you want final Map? rawItemsMap; final ValueChanged? onSelected; @@ -75,6 +82,9 @@ class QuillToolbarFontFamilyButtonOptions extends QuillToolbarBaseButtonOptions< final double? iconButtonFactor; QuillToolbarFontFamilyButtonOptions copyWith({ + Color? fillColor, + double? hoverElevation, + double? highlightElevation, List>? items, Map? rawItemsMap, ValueChanged? onSelected, @@ -91,6 +101,8 @@ class QuillToolbarFontFamilyButtonOptions extends QuillToolbarBaseButtonOptions< Color? defaultItemColor, double? iconSize, double? iconButtonFactor, + // Add properties to override inherited properties + QuillController? controller, IconData? iconData, VoidCallback? afterButtonPressed, String? tooltip, @@ -117,6 +129,9 @@ class QuillToolbarFontFamilyButtonOptions extends QuillToolbarBaseButtonOptions< defaultItemColor: defaultItemColor ?? this.defaultItemColor, iconSize: iconSize ?? this.iconSize, iconButtonFactor: iconButtonFactor ?? this.iconButtonFactor, + fillColor: fillColor ?? this.fillColor, + hoverElevation: hoverElevation ?? this.hoverElevation, + highlightElevation: highlightElevation ?? this.highlightElevation, ); } } diff --git a/lib/src/widgets/toolbar/buttons/font_family_button.dart b/lib/src/widgets/toolbar/buttons/font_family_button.dart index 42c5ca6b..b67e799a 100644 --- a/lib/src/widgets/toolbar/buttons/font_family_button.dart +++ b/lib/src/widgets/toolbar/buttons/font_family_button.dart @@ -188,6 +188,15 @@ class QuillToolbarFontFamilyButtonState final isMaterial3 = Theme.of(context).useMaterial3; if (!isMaterial3) { return RawMaterialButton( + visualDensity: VisualDensity.compact, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(iconTheme?.borderRadius ?? 2), + ), + fillColor: options.fillColor, + elevation: 0, + hoverElevation: options.hoverElevation, + highlightElevation: options.hoverElevation, onPressed: _onPressed, child: _buildContent(context), ); @@ -198,8 +207,8 @@ class QuillToolbarFontFamilyButtonState style: IconButton.styleFrom( shape: iconTheme?.borderRadius != null ? RoundedRectangleBorder( - borderRadius: BorderRadius.circular( - iconTheme?.borderRadius ?? -1), + borderRadius: + BorderRadius.circular(iconTheme?.borderRadius ?? 2), ) : null, ),