Restore feel&look for font families and font sizes

pull/1633/head
Aleksei 1 year ago
parent 3cf012c2d6
commit 208c05e6b0
  1. 42
      lib/src/widgets/toolbar/buttons/font_family_button.dart
  2. 43
      lib/src/widgets/toolbar/buttons/font_size_button.dart

@ -165,6 +165,9 @@ class QuillToolbarFontFamilyButtonState
),
);
}
final borderRadius = BorderRadius.circular(iconTheme?.borderRadius ?? 2);
return ConstrainedBox(
constraints: BoxConstraints.tightFor(
height: iconSize * 1.81,
@ -181,31 +184,26 @@ class QuillToolbarFontFamilyButtonState
}
return Tooltip(message: effectiveTooltip, child: child);
},
child: Builder(
builder: (context) {
final isMaterial3 = Theme.of(context).useMaterial3;
if (!isMaterial3) {
return RawMaterialButton(
child: Theme.of(context).useMaterial3
? IconButton(
visualDensity: VisualDensity.compact,
style: IconButton.styleFrom(
shape: iconTheme?.borderRadius != null
? RoundedRectangleBorder(borderRadius: borderRadius)
: null,
),
onPressed: _onPressed,
icon: _buildContent(context),
)
: RawMaterialButton(
visualDensity: VisualDensity.compact,
shape: RoundedRectangleBorder(borderRadius: borderRadius),
elevation: 0,
hoverElevation: 0,
highlightElevation: 0,
onPressed: _onPressed,
child: _buildContent(context),
);
}
return IconButton(
// tooltip: , // TODO: Use this here
visualDensity: VisualDensity.compact,
style: IconButton.styleFrom(
shape: iconTheme?.borderRadius != null
? RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
iconTheme?.borderRadius ?? -1),
)
: null,
),
onPressed: _onPressed,
icon: _buildContent(context),
);
},
),
),
);
}

@ -136,36 +136,35 @@ class QuillToolbarFontSizeButtonState
),
);
}
final borderRadius = BorderRadius.circular(iconTheme?.borderRadius ?? 2);
return ConstrainedBox(
constraints: BoxConstraints.tightFor(
height: iconSize * 1.81,
width: options.width,
),
child: Builder(
builder: (context) {
final isMaterial3 = Theme.of(context).useMaterial3;
if (!isMaterial3) {
return RawMaterialButton(
child: Theme.of(context).useMaterial3
? IconButton(
tooltip: tooltip,
visualDensity: VisualDensity.compact,
style: IconButton.styleFrom(
shape: iconTheme?.borderRadius != null
? RoundedRectangleBorder(borderRadius: borderRadius)
: null,
),
onPressed: _onPressed,
icon: _buildContent(context),
)
: RawMaterialButton(
visualDensity: VisualDensity.compact,
shape: RoundedRectangleBorder(borderRadius: borderRadius),
elevation: 0,
hoverElevation: 0,
highlightElevation: 0,
onPressed: _onPressed,
child: _buildContent(context),
);
}
return IconButton(
tooltip: tooltip,
visualDensity: VisualDensity.compact,
style: IconButton.styleFrom(
shape: iconTheme?.borderRadius != null
? RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(iconTheme?.borderRadius ?? -1),
)
: null,
),
onPressed: _onPressed,
icon: _buildContent(context),
);
},
),
);
}

Loading…
Cancel
Save