Restore look & feel for toggle buttons

pull/1633/head
Aleksei 1 year ago
parent ad3be0c431
commit e168600c58
  1. 5
      lib/src/widgets/toolbar/buttons/clear_format_button.dart
  2. 2
      lib/src/widgets/toolbar/buttons/color/color_button.dart
  3. 7
      lib/src/widgets/toolbar/buttons/link_style2_button.dart
  4. 7
      lib/src/widgets/toolbar/buttons/link_style_button.dart

@ -107,11 +107,14 @@ class QuillToolbarClearFormatButton extends StatelessWidget {
final theme = Theme.of(context); final theme = Theme.of(context);
final iconColor = iconTheme?.iconUnselectedColor ?? theme.iconTheme.color; final iconColor = iconTheme?.iconUnselectedColor ?? theme.iconTheme.color;
final fillColor = iconTheme?.iconUnselectedFillColor ?? theme.canvasColor;
return QuillToolbarIconButton( return QuillToolbarIconButton(
tooltip: tooltip, tooltip: tooltip,
icon: Icon(iconData, size: iconSize * iconButtonFactor, color: iconColor), size: iconSize * iconButtonFactor,
icon: Icon(iconData, size: iconSize, color: iconColor),
isFilled: false, isFilled: false,
iconFilledStyle: IconButton.styleFrom(backgroundColor: fillColor),
onPressed: _sharedOnPressed, onPressed: _sharedOnPressed,
afterPressed: afterButtonPressed, afterPressed: afterButtonPressed,
); );

@ -200,7 +200,7 @@ class QuillToolbarColorButtonState extends State<QuillToolbarColorButton> {
icon: Icon(iconData, icon: Icon(iconData,
size: iconSize, size: iconSize,
color: widget.isBackground ? iconColorBackground : iconColor), color: widget.isBackground ? iconColorBackground : iconColor),
isFilled: false, isFilled: _isToggledColor || _isToggledBackground,
iconFilledStyle: IconButton.styleFrom( iconFilledStyle: IconButton.styleFrom(
backgroundColor: backgroundColor:
widget.isBackground ? fillColorBackground : fillColor), widget.isBackground ? fillColorBackground : fillColor),

@ -148,14 +148,19 @@ class _QuillToolbarLinkStyleButton2State
final isToggled = _getLinkAttributeValue() != null; final isToggled = _getLinkAttributeValue() != null;
return QuillToolbarIconButton( return QuillToolbarIconButton(
tooltip: tooltip, tooltip: tooltip,
size: iconSize * iconButtonFactor,
icon: Icon( icon: Icon(
iconData, iconData,
size: iconSize * iconButtonFactor, size: iconSize,
color: isToggled color: isToggled
? (iconTheme?.iconSelectedColor ?? theme.primaryIconTheme.color) ? (iconTheme?.iconSelectedColor ?? theme.primaryIconTheme.color)
: (iconTheme?.iconUnselectedColor ?? theme.iconTheme.color), : (iconTheme?.iconUnselectedColor ?? theme.iconTheme.color),
), ),
isFilled: isToggled, isFilled: isToggled,
iconFilledStyle: IconButton.styleFrom(
backgroundColor: isToggled
? (iconTheme?.iconSelectedFillColor ?? theme.primaryColor)
: (iconTheme?.iconUnselectedFillColor ?? theme.canvasColor)),
onPressed: _openLinkDialog, onPressed: _openLinkDialog,
afterPressed: afterButtonPressed, afterPressed: afterButtonPressed,
); );

@ -140,14 +140,19 @@ class QuillToolbarLinkStyleButtonState
final theme = Theme.of(context); final theme = Theme.of(context);
return QuillToolbarIconButton( return QuillToolbarIconButton(
tooltip: tooltip, tooltip: tooltip,
size: iconSize * iconButtonFactor,
icon: Icon( icon: Icon(
iconData, iconData,
size: iconSize * iconButtonFactor, size: iconSize,
color: isToggled color: isToggled
? (iconTheme?.iconSelectedColor ?? theme.primaryIconTheme.color) ? (iconTheme?.iconSelectedColor ?? theme.primaryIconTheme.color)
: (iconTheme?.iconUnselectedColor ?? theme.iconTheme.color), : (iconTheme?.iconUnselectedColor ?? theme.iconTheme.color),
), ),
isFilled: isToggled, isFilled: isToggled,
iconFilledStyle: IconButton.styleFrom(
backgroundColor: isToggled
? (iconTheme?.iconSelectedFillColor ?? theme.primaryColor)
: (iconTheme?.iconUnselectedFillColor ?? theme.canvasColor)),
onPressed: () => _openLinkDialog(context), onPressed: () => _openLinkDialog(context),
afterPressed: afterButtonPressed, afterPressed: afterButtonPressed,
); );

Loading…
Cancel
Save