diff --git a/example/lib/main.dart b/example/lib/main.dart index b2739b6ae..ac069cf92 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -52,6 +52,7 @@ void main() async { [TargetPlatform.windows, TargetPlatform.linux] .contains(defaultTargetPlatform)) { await flutter_acrylic.Window.initialize(); + flutter_acrylic.Window.hideWindowControls(); } runApp(const MyApp()); @@ -84,6 +85,7 @@ class MyApp extends StatelessWidget { initialRoute: '/', routes: {'/': (_) => const MyHomePage()}, theme: ThemeData( + micaBackgroundColor: appTheme.acrylicEffect == flutter_acrylic.WindowEffect.acrylic || appTheme.acrylicEffect == flutter_acrylic.WindowEffect.mica ? Colors.transparent : null, accentColor: appTheme.color, brightness: appTheme.mode == ThemeMode.system ? darkMode diff --git a/lib/src/controls/form/combo_box.dart b/lib/src/controls/form/combo_box.dart index c840793a3..b5085f9dd 100644 --- a/lib/src/controls/form/combo_box.dart +++ b/lib/src/controls/form/combo_box.dart @@ -329,10 +329,13 @@ class _ComboboxMenuState extends State<_ComboboxMenu> { constraints.maxHeight; return Scrollbar( isAlwaysShown: isScrollable, - child: ListView( - padding: _kListPadding, - shrinkWrap: true, - children: children, + child: ScrollConfiguration( + behavior: ScrollConfiguration.of(context).copyWith(scrollbars: false), + child: ListView( + padding: _kListPadding, + shrinkWrap: true, + children: children, + ), ), ); }, diff --git a/lib/src/controls/form/text_box.dart b/lib/src/controls/form/text_box.dart index f815f52cb..674b841da 100644 --- a/lib/src/controls/form/text_box.dart +++ b/lib/src/controls/form/text_box.dart @@ -590,10 +590,12 @@ class _TextBoxState extends State final Color cursorColor = theme.inactiveColor; final Color disabledColor = theme.disabledColor; final Color backgroundColor = _effectiveFocusNode.hasFocus - ? theme.scaffoldBackgroundColor + ? theme.brightness.isLight + ? Colors.white + : const Color.fromRGBO(30, 30, 30, 0.7) : AccentColor('normal', const { - 'normal': Colors.white, - 'dark': Color(0xFF2d2d2d), + 'normal': Color.fromRGBO(255, 255, 255, 0.7), + 'dark': Color.fromRGBO(255, 255, 255, 0.0605), }).resolve(context); final TextStyle placeholderStyle = widget.placeholderStyle ?? @@ -685,9 +687,7 @@ class _TextBoxState extends State }, child: IgnorePointer( ignoring: !enabled, - child: AnimatedContainer( - duration: theme.fasterAnimationDuration, - curve: theme.animationCurve, + child: Container( decoration: BoxDecoration( borderRadius: radius, border: Border.all( diff --git a/lib/src/controls/inputs/buttons/button.dart b/lib/src/controls/inputs/buttons/button.dart index 8ca405b40..208e3528e 100644 --- a/lib/src/controls/inputs/buttons/button.dart +++ b/lib/src/controls/inputs/buttons/button.dart @@ -39,7 +39,7 @@ class Button extends BaseButton { if (states.isPressing) return 0.0; return 0.3; }), - shadowColor: ButtonState.all(theme.shadowColor), + shadowColor: ButtonState.all(const Color.fromRGBO(255, 255, 255, 0.04)), padding: ButtonState.all(const EdgeInsets.only( left: 11.0, top: 5.0, @@ -60,12 +60,7 @@ class Button extends BaseButton { }), foregroundColor: ButtonState.resolveWith((states) { if (states.isDisabled) return theme.disabledColor; - return ButtonThemeData.buttonColor(theme.brightness, states).basedOnLuminance().toAccentColor()[ - states.isPressing - ? theme.brightness.isLight - ? 'lighter' - : 'dark' - : 'normal']; + return theme.brightness.isLight ? Colors.black : Colors.white; }), ); } diff --git a/lib/src/controls/inputs/buttons/theme.dart b/lib/src/controls/inputs/buttons/theme.dart index 648b73d5b..de7f53a63 100644 --- a/lib/src/controls/inputs/buttons/theme.dart +++ b/lib/src/controls/inputs/buttons/theme.dart @@ -220,20 +220,20 @@ class ButtonThemeData with Diagnosticable { late Color color; if (brightness == Brightness.light) { if (states.isPressing) { - color = const Color(0xFFf2f2f2); + 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); } return color; } diff --git a/lib/src/controls/inputs/checkbox.dart b/lib/src/controls/inputs/checkbox.dart index cd29a912f..f1412d146 100644 --- a/lib/src/controls/inputs/checkbox.dart +++ b/lib/src/controls/inputs/checkbox.dart @@ -129,7 +129,7 @@ class Checkbox extends StatelessWidget { if (content != null) { child = Row(mainAxisSize: MainAxisSize.min, children: [ child, - const SizedBox(width: 6.0), + const SizedBox(width: 10.0), content!, ]); } @@ -260,9 +260,8 @@ class CheckboxThemeData with Diagnosticable { ? const Color.fromRGBO(0, 0, 0, 0.2169) : const Color.fromRGBO(255, 255, 255, 0.1581), ), - color: states.isHovering - ? style.inactiveColor.withOpacity(0.1) - : null, + color: + states.isHovering ? style.inactiveColor.withOpacity(0.1) : null, borderRadius: radius, ), ), @@ -274,10 +273,10 @@ class CheckboxThemeData with Diagnosticable { ), checkedIconColor: ButtonState.resolveWith((states) { return !states.isDisabled - ? style.checkedColor - : style.brightness.isLight - ? Colors.white - : const Color.fromRGBO(255, 255, 255, 0.5302); + ? style.checkedColor + : style.brightness.isLight + ? Colors.white + : const Color.fromRGBO(255, 255, 255, 0.5302); }), uncheckedIconColor: ButtonState.all(Colors.transparent), icon: FluentIcons.check_mark, diff --git a/lib/src/controls/inputs/dropdown_button.dart b/lib/src/controls/inputs/dropdown_button.dart index b148a0eb5..b53978d68 100644 --- a/lib/src/controls/inputs/dropdown_button.dart +++ b/lib/src/controls/inputs/dropdown_button.dart @@ -1,6 +1,6 @@ import 'package:fluent_ui/fluent_ui.dart'; -const EdgeInsets _kDefaultPadding = EdgeInsets.all(5.0); +const EdgeInsets _kDefaultPadding = EdgeInsets.all(10.0); const double _kVerticalOffset = 20.0; const double _kContentWidth = 100.0; @@ -91,7 +91,7 @@ class DropDownButton extends StatelessWidget { if (title != null) title!, Padding( padding: EdgeInsets.only(left: padding.left), - child: trailing ?? const Icon(FluentIcons.chevron_down, size: 12), + child: trailing ?? const Icon(FluentIcons.chevron_down, size: 8), ), ]; diff --git a/lib/src/controls/inputs/radio_button.dart b/lib/src/controls/inputs/radio_button.dart index 60212e38b..703689621 100644 --- a/lib/src/controls/inputs/radio_button.dart +++ b/lib/src/controls/inputs/radio_button.dart @@ -125,7 +125,7 @@ class RadioButton extends StatelessWidget { if (content != null) { child = Row(mainAxisSize: MainAxisSize.min, children: [ child, - const SizedBox(width: 6.0), + const SizedBox(width: 10.0), content!, ]); } @@ -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) + : null, border: Border.all( width: states.isPressing ? 4.5 : 1, color: !states.isDisabled diff --git a/lib/src/controls/navigation/navigation_view/style.dart b/lib/src/controls/navigation/navigation_view/style.dart index 6659ff533..c3983670c 100644 --- a/lib/src/controls/navigation/navigation_view/style.dart +++ b/lib/src/controls/navigation/navigation_view/style.dart @@ -78,6 +78,7 @@ class NavigationPaneThemeData with Diagnosticable { /// The highlight color used on the tiles. If null, [ThemeData.accentColor] /// is used. final Color? highlightColor; + final Color? navViewPaneBackgroundColor; final EdgeInsets? labelPadding; final EdgeInsets? iconPadding; @@ -90,6 +91,7 @@ class NavigationPaneThemeData with Diagnosticable { final Duration? animationDuration; final Curve? animationCurve; + const NavigationPaneThemeData({ this.backgroundColor, @@ -104,6 +106,7 @@ class NavigationPaneThemeData with Diagnosticable { this.animationCurve, this.selectedIconColor, this.unselectedIconColor, + this.navViewPaneBackgroundColor, }); factory NavigationPaneThemeData.standard({ @@ -114,11 +117,13 @@ class NavigationPaneThemeData with Diagnosticable { required Color highlightColor, required Typography typography, required Color inactiveColor, + Color? navViewPaneBackgroundColor, }) { final disabledTextStyle = TextStyle( color: disabledColor, fontWeight: FontWeight.bold, ); + return NavigationPaneThemeData( animationDuration: animationDuration, animationCurve: animationCurve, @@ -133,6 +138,7 @@ class NavigationPaneThemeData with Diagnosticable { }), labelPadding: const EdgeInsets.only(right: 10.0), iconPadding: const EdgeInsets.symmetric(horizontal: 10.0), + navViewPaneBackgroundColor: navViewPaneBackgroundColor, ); } @@ -160,6 +166,7 @@ class NavigationPaneThemeData with Diagnosticable { a?.selectedIconColor, b?.selectedIconColor, t, Color.lerp), unselectedIconColor: ButtonState.lerp( a?.unselectedIconColor, b?.unselectedIconColor, t, Color.lerp), + navViewPaneBackgroundColor: Color.lerp(a?.navViewPaneBackgroundColor, b?.navViewPaneBackgroundColor, t), ); } @@ -177,6 +184,7 @@ class NavigationPaneThemeData with Diagnosticable { animationDuration: style?.animationDuration ?? animationDuration, selectedIconColor: style?.selectedIconColor ?? selectedIconColor, unselectedIconColor: style?.unselectedIconColor ?? unselectedIconColor, + navViewPaneBackgroundColor: style?.navViewPaneBackgroundColor ?? navViewPaneBackgroundColor, ); } diff --git a/lib/src/controls/navigation/navigation_view/view.dart b/lib/src/controls/navigation/navigation_view/view.dart index 0b5630de9..5ed07dc98 100644 --- a/lib/src/controls/navigation/navigation_view/view.dart +++ b/lib/src/controls/navigation/navigation_view/view.dart @@ -132,6 +132,7 @@ class NavigationViewState extends State { final NavigationPaneThemeData theme = NavigationPaneTheme.of(context); final localizations = FluentLocalizations.of(context); final appBarPadding = EdgeInsets.only(top: widget.appBar?.height ?? 0.0); + final ThemeData style = FluentTheme.of(context); Widget appBar = () { if (widget.appBar != null) { @@ -336,7 +337,7 @@ class NavigationViewState extends State { ); } else if (_compactOverlayOpen) { return Mica( - backgroundColor: theme.backgroundColor, + backgroundColor: theme.navViewPaneBackgroundColor ?? (style.brightness.isLight ? const Color(0xFFf9f9f9) : const Color(0xFF272727)), elevation: 10.0, child: Container( decoration: BoxDecoration( @@ -431,7 +432,7 @@ class NavigationViewState extends State { child: PrimaryScrollController( controller: scrollController, child: Mica( - backgroundColor: theme.backgroundColor, + backgroundColor: theme.navViewPaneBackgroundColor, elevation: 10.0, child: Container( decoration: BoxDecoration( diff --git a/lib/src/controls/surfaces/dialog.dart b/lib/src/controls/surfaces/dialog.dart index c48ba9903..194dd56c2 100644 --- a/lib/src/controls/surfaces/dialog.dart +++ b/lib/src/controls/surfaces/dialog.dart @@ -179,6 +179,7 @@ class FluentDialogRoute extends RawDialogRoute { required WidgetBuilder builder, required BuildContext context, bool barrierDismissible = false, + var test, Color? barrierColor, String? barrierLabel, Duration transitionDuration = const Duration(milliseconds: 250), @@ -257,7 +258,7 @@ class ContentDialogThemeData { factory ContentDialogThemeData.standard(ThemeData style) { return ContentDialogThemeData( decoration: BoxDecoration( - color: style.scaffoldBackgroundColor, + color: style.brightness.isLight ? const Color(0xFFf9f9f9) : const Color(0xFF272727), borderRadius: BorderRadius.circular(12), boxShadow: kElevationToShadow[8], ), @@ -265,7 +266,8 @@ class ContentDialogThemeData { titlePadding: const EdgeInsets.only(bottom: 12), actionsSpacing: 10, actionsDecoration: BoxDecoration( - color: style.micaBackgroundColor, + //Доработать + color: style.brightness.isLight ? const Color(0xFFf3f3f3) : const Color(0xFF202020), borderRadius: const BorderRadius.vertical(bottom: Radius.circular(12)), boxShadow: kElevationToShadow[1], ), diff --git a/lib/src/styles/theme.dart b/lib/src/styles/theme.dart index 1080e5918..26662bc71 100644 --- a/lib/src/styles/theme.dart +++ b/lib/src/styles/theme.dart @@ -316,8 +316,9 @@ class ThemeData with Diagnosticable { disabledColor ??= isLight ? const Color(0xFF838383) : Colors.grey[80].withOpacity(0.6); shadowColor ??= isLight ? Colors.black : Colors.grey[130]; - scaffoldBackgroundColor ??= - isLight ? const Color(0xFFf9f9f9) : const Color(0xFF272727); + scaffoldBackgroundColor ??= isLight + ? const Color.fromRGBO(255, 255, 255, 0.5) + : const Color.fromRGBO(58, 58, 58, 0.2); acrylicBackgroundColor ??= isLight ? const Color.fromARGB(204, 255, 255, 255) : const Color(0x7F1e1e1e);