Skip to content

Commit

Permalink
fix: [MDS-514] Recreate icon font once more and fix scaling and platf…
Browse files Browse the repository at this point in the history
…orm alignment problems (#161)
  • Loading branch information
Kypsis authored May 2, 2023
1 parent f5a620d commit 1fd1c47
Show file tree
Hide file tree
Showing 19 changed files with 2,729 additions and 2,456 deletions.
4 changes: 2 additions & 2 deletions example/lib/src/storybook/stories/accordion.dart
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class AccordionStory extends Story {
shadows: showShadowKnob == true ? null : [],
childrenPadding: const EdgeInsets.all(12),
onExpansionChanged: (value) => setState(() => currentlyOpenAccordionItem = value),
leading: const Icon(MoonIcons.frame_24),
leading: const MoonIcon(MoonIcons.frame_24),
title: const Text("Grouped MoonAccordion item #1"),
children: const [
Text(
Expand Down Expand Up @@ -182,7 +182,7 @@ class AccordionStory extends Story {
shadows: showShadowKnob == true ? null : [],
childrenPadding: const EdgeInsets.all(12),
onExpansionChanged: (value) => setState(() => currentlyOpenAccordionItem = value),
leading: const Icon(MoonIcons.frame_24),
leading: const MoonIcon(MoonIcons.frame_24),
title: const Text("Grouped MoonAccordion item #2"),
children: const [
Text(
Expand Down
12 changes: 6 additions & 6 deletions example/lib/src/storybook/stories/alert.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ class AlertStory extends Story {
),
borderRadius:
borderRadiusKnob != null ? BorderRadius.circular(borderRadiusKnob.toDouble()) : null,
leading: showLeadingKnob ? const Icon(MoonIcons.frame_24) : null,
leading: showLeadingKnob ? const MoonIcon(MoonIcons.frame_24) : null,
trailing: showTrailingKnob
? MoonButton.icon(
buttonSize: MoonButtonSize.xs,
borderRadius: borderRadiusKnob != null
? BorderRadius.circular(borderRadiusKnob.toDouble())
: null,
disabledOpacityValue: 1,
icon: Icon(
icon: MoonIcon(
MoonIcons.close_small_24,
color: trailingColor,
size: 24,
Expand Down Expand Up @@ -181,7 +181,7 @@ class AlertStory extends Story {
title: const Text("Filled error MoonAlert"),
borderRadius:
borderRadiusKnob != null ? BorderRadius.circular(borderRadiusKnob.toDouble()) : null,
leading: showLeadingKnob ? const Icon(MoonIcons.alert_24) : null,
leading: showLeadingKnob ? const MoonIcon(MoonIcons.alert_24) : null,
color: context.moonColors!.chiChi100,
body: showBodyKnob
? const SizedBox(
Expand All @@ -200,7 +200,7 @@ class AlertStory extends Story {
title: const Text("Filled warning MoonAlert"),
borderRadius:
borderRadiusKnob != null ? BorderRadius.circular(borderRadiusKnob.toDouble()) : null,
leading: showLeadingKnob ? const Icon(MoonIcons.alarm_round_24) : null,
leading: showLeadingKnob ? const MoonIcon(MoonIcons.alarm_round_24) : null,
color: context.moonColors!.krillin100,
body: showBodyKnob
? const SizedBox(
Expand All @@ -221,7 +221,7 @@ class AlertStory extends Story {
title: const Text("Outlined success MoonAlert"),
borderRadius:
borderRadiusKnob != null ? BorderRadius.circular(borderRadiusKnob.toDouble()) : null,
leading: showLeadingKnob ? const Icon(MoonIcons.check_rounded_24) : null,
leading: showLeadingKnob ? const MoonIcon(MoonIcons.check_rounded_24) : null,
color: context.moonColors!.roshi100,
body: showBodyKnob
? const SizedBox(
Expand All @@ -240,7 +240,7 @@ class AlertStory extends Story {
title: const Text('Outlined info MoonAlert'),
borderRadius:
borderRadiusKnob != null ? BorderRadius.circular(borderRadiusKnob.toDouble()) : null,
leading: showLeadingKnob ? const Icon(MoonIcons.alert_24) : null,
leading: showLeadingKnob ? const MoonIcon(MoonIcons.alert_24) : null,
color: context.moonColors!.whis100,
body: showBodyKnob
? const SizedBox(
Expand Down
24 changes: 12 additions & 12 deletions example/lib/src/storybook/stories/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class ButtonStory extends Story {
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(height: 64),
const TextDivider(text: "Base and Icon MoonButton"),
const TextDivider(text: "Base and MoonIcon MoonButton"),
const SizedBox(height: 32),
MoonButton(
onTap: showDisabledKnob ? null : () {},
Expand All @@ -146,9 +146,9 @@ class ButtonStory extends Story {
borderColor: borderColor,
showPulseEffect: showPulseEffectKnob,
showPulseEffectJiggle: showPulseEffectJiggleKnob,
leading: showLeadingKnob ? Icon(resolvedIconVariant) : null,
leading: showLeadingKnob ? MoonIcon(resolvedIconVariant) : null,
label: showLabelKnob ? Text(customLabelTextKnob) : null,
trailing: showTrailingKnob ? Icon(resolvedIconVariant) : null,
trailing: showTrailingKnob ? MoonIcon(resolvedIconVariant) : null,
),
const SizedBox(height: 32),
MoonButton.icon(
Expand All @@ -163,7 +163,7 @@ class ButtonStory extends Story {
borderColor: borderColor,
showPulseEffect: showPulseEffectKnob,
showPulseEffectJiggle: showPulseEffectJiggleKnob,
icon: showLeadingKnob ? Icon(resolvedIconVariant) : null,
icon: showLeadingKnob ? MoonIcon(resolvedIconVariant) : null,
),
const SizedBox(height: 40),
const TextDivider(text: "MoonButton variants"),
Expand All @@ -175,9 +175,9 @@ class ButtonStory extends Story {
showTooltip: showTooltipKnob,
tooltipMessage: 'This is MoonTooltip',
showPulseEffect: showPulseEffectKnob,
leading: showLeadingKnob ? Icon(resolvedIconVariant) : null,
leading: showLeadingKnob ? MoonIcon(resolvedIconVariant) : null,
label: showLabelKnob ? const Text("MoonFilledButton") : null,
trailing: showTrailingKnob ? Icon(resolvedIconVariant) : null,
trailing: showTrailingKnob ? MoonIcon(resolvedIconVariant) : null,
),
const SizedBox(height: 32),
MoonOutlinedButton(
Expand All @@ -188,9 +188,9 @@ class ButtonStory extends Story {
tooltipMessage: 'This is MoonTooltip',
showPulseEffect: showPulseEffectKnob,
borderColor: borderColor,
leading: showLeadingKnob ? Icon(resolvedIconVariant) : null,
leading: showLeadingKnob ? MoonIcon(resolvedIconVariant) : null,
label: showLabelKnob ? const Text("MoonOutlinedButton") : null,
trailing: showTrailingKnob ? Icon(resolvedIconVariant) : null,
trailing: showTrailingKnob ? MoonIcon(resolvedIconVariant) : null,
),
const SizedBox(height: 32),
MoonTextButton(
Expand All @@ -200,9 +200,9 @@ class ButtonStory extends Story {
showTooltip: showTooltipKnob,
tooltipMessage: 'This is MoonTooltip',
showPulseEffect: showPulseEffectKnob,
leading: showLeadingKnob ? Icon(resolvedIconVariant) : null,
leading: showLeadingKnob ? MoonIcon(resolvedIconVariant) : null,
label: showLabelKnob ? const Text("MoonTextButton") : null,
trailing: showTrailingKnob ? Icon(resolvedIconVariant) : null,
trailing: showTrailingKnob ? MoonIcon(resolvedIconVariant) : null,
),
const SizedBox(height: 40),
const TextDivider(text: "Custom MoonButton with non-standard children"),
Expand Down Expand Up @@ -239,15 +239,15 @@ class ButtonStory extends Story {
height: 20,
child: CircleAvatar(
backgroundColor: context.moonTheme!.colors.trunks,
child: const Icon(
child: const MoonIcon(
Icons.person,
size: 16,
color: Colors.white,
),
),
)
: null,
trailing: showTrailingKnob ? Icon(resolvedIconVariant) : null,
trailing: showTrailingKnob ? MoonIcon(resolvedIconVariant) : null,
),
const SizedBox(height: 64),
],
Expand Down
12 changes: 6 additions & 6 deletions example/lib/src/storybook/stories/chip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ class ChipStory extends Story {
showBorder: showBorderKnob,
chipSize: chipSizesKnob,
backgroundColor: backgroundColor,
leading: showLeadingKnob ? Icon(resolvedIconVariant) : null,
leading: showLeadingKnob ? MoonIcon(resolvedIconVariant) : null,
label: showLabelKnob ? Text(customLabelTextKnob) : null,
trailing: showTrailingKnob ? Icon(resolvedIconVariant) : null,
trailing: showTrailingKnob ? MoonIcon(resolvedIconVariant) : null,
),
const SizedBox(height: 40),
const TextDivider(text: "Text MoonChip"),
Expand All @@ -137,9 +137,9 @@ class ChipStory extends Story {
borderRadiusKnob != null ? BorderRadius.circular(borderRadiusKnob.toDouble()) : null,
showBorder: showBorderKnob,
chipSize: chipSizesKnob,
leading: showLeadingKnob ? Icon(resolvedIconVariant) : null,
leading: showLeadingKnob ? MoonIcon(resolvedIconVariant) : null,
label: showLabelKnob ? Text(customLabelTextKnob) : null,
trailing: showTrailingKnob ? Icon(resolvedIconVariant) : null,
trailing: showTrailingKnob ? MoonIcon(resolvedIconVariant) : null,
),
const SizedBox(height: 40),
const TextDivider(text: "Preset MoonChip"),
Expand All @@ -152,9 +152,9 @@ class ChipStory extends Story {
borderWidth: 2,
showBorder: showBorderKnob,
chipSize: chipSizesKnob,
leading: showLeadingKnob ? Icon(resolvedIconVariant) : null,
leading: showLeadingKnob ? MoonIcon(resolvedIconVariant) : null,
label: showLabelKnob ? Text(customLabelTextKnob) : null,
trailing: showTrailingKnob ? Icon(resolvedIconVariant) : null,
trailing: showTrailingKnob ? MoonIcon(resolvedIconVariant) : null,
),
const SizedBox(height: 64),
],
Expand Down
6 changes: 3 additions & 3 deletions example/lib/src/storybook/stories/icons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ class _IconsGridWithTitle extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (iconsNameList[index].contains("16"))
Icon(iconsList[index], size: 16)
MoonIcon(iconsList[index], size: 16)
else if (iconsNameList[index].contains("24"))
Icon(iconsList[index], size: 24)
MoonIcon(iconsList[index], size: 24)
else
Icon(iconsList[index], size: 32),
MoonIcon(iconsList[index], size: 32),
const SizedBox(height: 20),
Text(
iconsNameList[index],
Expand Down
2 changes: 1 addition & 1 deletion example/lib/src/storybook/stories/popover.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class PopoverStory extends Story {
children: [
MoonAvatar(
backgroundColor: context.moonColors?.heles,
content: const Icon(MoonIcons.rocket_24),
content: const MoonIcon(MoonIcons.rocket_24),
),
const SizedBox(width: 12),
Expanded(child: Text(customLabelTextKnob)),
Expand Down
8 changes: 4 additions & 4 deletions example/lib/src/storybook/stories/switch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ class SwitchStory extends Story {
StatefulBuilder(
builder: (context, setState) {
return MoonSwitch(
activeThumbWidget: const Icon(
activeThumbWidget: const MoonIcon(
MoonIcons.check_alternative_16,
size: 14,
),
inactiveThumbWidget: const Icon(
inactiveThumbWidget: const MoonIcon(
MoonIcons.close_16,
size: 12,
),
Expand All @@ -112,11 +112,11 @@ class SwitchStory extends Story {
StatefulBuilder(
builder: (context, setState) {
return MoonSwitch(
activeTrackWidget: const Icon(
activeTrackWidget: const MoonIcon(
MoonIcons.check_alternative_16,
size: 14,
),
inactiveTrackWidget: const Icon(
inactiveTrackWidget: const MoonIcon(
MoonIcons.close_16,
size: 12,
),
Expand Down
9 changes: 6 additions & 3 deletions example/lib/src/storybook/stories/tag.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,14 @@ class TagStory extends Story {
isUpperCase: setUpperCase,
textColor: textColor,
backgroundColor: backgroundColor,
leading: showLeadingKnob ? const Icon(MoonIcons.close_small_16) : null,
leading: showLeadingKnob ? const MoonIcon(MoonIcons.close_small_16) : null,
label: showLabelKnob
? Text(setUpperCase ? customLabelTextKnob.toUpperCase() : customLabelTextKnob)
? Padding(
padding: EdgeInsets.only(top: setUpperCase ? 1.5 : 0),
child: Text(setUpperCase ? customLabelTextKnob.toUpperCase() : customLabelTextKnob),
)
: null,
trailing: showTrailingKnob ? const Icon(MoonIcons.close_small_16) : null,
trailing: showTrailingKnob ? const MoonIcon(MoonIcons.close_small_16) : null,
),
const SizedBox(height: 64),
],
Expand Down
4 changes: 2 additions & 2 deletions example/lib/src/storybook/stories/toast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ class ToastStory extends Story {
displayDurationKnob != null ? Duration(seconds: displayDurationKnob) : null,
borderRadius:
borderRadiusKnob != null ? BorderRadius.circular(borderRadiusKnob.toDouble()) : null,
leading: const Icon(MoonIcons.info_24),
leading: const MoonIcon(MoonIcons.info_24),
title: Text(customLabelTextKnob),
trailing: const Icon(MoonIcons.star_24),
trailing: const MoonIcon(MoonIcons.star_24),
);
},
);
Expand Down
2 changes: 1 addition & 1 deletion example/lib/src/storybook/stories/tooltip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class TooltipStory extends Story {
tooltipMessage: customLabelTextKnob,
borderRadius: BorderRadius.circular(20),
backgroundColor: context.moonColors!.hit,
leading: const Icon(MoonIcons.frame_24),
leading: const MoonIcon(MoonIcons.frame_24),
label: const Text("MoonChip"),
),
const SizedBox(height: 64),
Expand Down
Binary file modified fonts/MoonIcons.ttf
Binary file not shown.
Loading

0 comments on commit 1fd1c47

Please sign in to comment.