Skip to content

Commit

Permalink
Fix icon for toggleable tools
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Dec 31, 2024
1 parent 6e8e42b commit 8f09746
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
17 changes: 11 additions & 6 deletions app/lib/views/edit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,7 @@ class _EditToolbarState extends State<EditToolbar> {
ToolStatus.disabled
? Theme.of(context).disabledColor
: null;
var icon = handler.getIcon(bloc) ??
tool.icon(selected
? PhosphorIconsStyle.fill
: PhosphorIconsStyle.light);
var handlerIcon = handler.getIcon(bloc);
final toolWidget = Padding(
padding: const EdgeInsets.symmetric(horizontal: 4.0),
child: OptionButton(
Expand Down Expand Up @@ -318,8 +315,16 @@ class _EditToolbarState extends State<EditToolbar> {
PhosphorIconsLight.caretLeft,
})
: null,
selectedIcon: _buildIcon(icon, size, color),
icon: _buildIcon(icon, size, color),
selectedIcon: _buildIcon(
handlerIcon ??
tool.icon(PhosphorIconsStyle.fill),
size,
color),
icon: _buildIcon(
handlerIcon ??
tool.icon(PhosphorIconsStyle.light),
size,
color),
onPressed: () {
if (_mouseState == _MouseState.multi) {
context
Expand Down
3 changes: 2 additions & 1 deletion app/lib/widgets/option_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class _OptionButtonState extends State<OptionButton>
void didUpdateWidget(covariant OptionButton oldWidget) {
super.didUpdateWidget(oldWidget);
if (widget.selected != oldWidget.selected ||
widget.highlighted != oldWidget.highlighted) {
widget.highlighted != oldWidget.highlighted ||
widget.showBottom != oldWidget.showBottom) {
setState(() {});
_animationController.animateTo(_nextValue);
}
Expand Down

0 comments on commit 8f09746

Please sign in to comment.