Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update style for Mica and Acrylic #121

Closed
wants to merge 6 commits into from

Conversation

Kapranov98
Copy link
Contributor

@Kapranov98 Kapranov98 commented Dec 26, 2021

Updated styles to fully support Mica and Acrylic. I couldn't transfer the navViewPaneBackgroundColor variable from ThemeData to NavigationPaneThemeData :(
Examples of changes:

Before (Mica):

изображение
изображение

After (Mica):

изображение
изображение

Before: (Acrylic):

изображение
изображение

After (Acrylic):

изображение
изображение

Pre-launch Checklist

  • I have run dartfmt on all changed files
  • I have updated CHANGELOG.md with my changes
  • I have run "optimize/organize imports" on all changed files
  • I have addressed all analyzer warnings as best I could
  • I have added/updated relevant documentation
  • I have run flutter pub publish --dry-run and addressed any warnings

Copy link
Owner

@bdlukaa bdlukaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason Mica doesn't work for me. Acrylic looks good!

example/lib/main.dart Outdated Show resolved Hide resolved
@@ -85,6 +91,7 @@ class MyApp extends StatelessWidget {
initialRoute: '/',
routes: {'/': (_) => const MyHomePage()},
theme: ThemeData(
micaBackgroundColor: Colors.transparent,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be handled this way. We should check what's the current AppTheme.acrylicEffect to get the best color for each.

When this is transparent, we get a weird effect when it's WindowEffect.disabled

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I understand correctly that then it is better to use this option?
micaBackgroundColor: appTheme.acrylicEffect == WindowEffect.acrylic || appTheme.acrylicEffect == WindowEffect.mica ? Colors.transparent : null,

lib/src/controls/form/text_box.dart Outdated Show resolved Hide resolved
lib/src/controls/inputs/buttons/button.dart Outdated Show resolved Hide resolved
Comment on lines +223 to +236
color = const Color.fromRGBO(249, 249, 249, 0.7);
} else if (states.isHovering) {
color = const Color(0xFFF6F6F6);
color = const Color.fromRGBO(249, 249, 249, 0.8);
} else {
color = Colors.white;
color = const Color.fromRGBO(255, 255, 255, 0.98);
}
return color;
} else {
if (states.isPressing) {
color = const Color(0xFF272727);
color = const Color.fromRGBO(255, 255, 255, 0.0837);
} else if (states.isHovering) {
color = const Color(0xFF323232);
color = const Color.fromRGBO(255, 255, 255, 0.0837);
} else {
color = const Color(0xFF2b2b2b);
color = const Color.fromRGBO(255, 255, 255, 0.0605);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel like these colors are correct. @WinXaito what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These colors are taken from Microsoft's Figma guidelines and have been slightly tweaked to better match WinUI.
изображение
изображение

@@ -244,8 +244,8 @@ class RadioButtonThemeData with Diagnosticable {
color: states.isPressing
? backgroundColor
: states.isHovering
? backgroundColor.withOpacity(0.8)
: backgroundColor.withOpacity(0.0),
? style.inactiveColor.withOpacity(0.1)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look good on light theme, in my opinion

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the same color on hover as Checkbox and ToggleSwitch
изображение

lib/src/styles/theme.dart Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants