ubuntu / yaru.dart

Ubuntu Yaru Flutter widgets and themes for building desktop and web applications
https://ubuntu.github.io/yaru.dart/
Mozilla Public License 2.0
179 stars 33 forks source link

hovered close button in windows light theme has wrong color #806

Closed Feichtmeier closed 4 months ago

Feichtmeier commented 7 months ago

👋 morning

grafik

could be fixed by catching yet another case inside yaruwindowcontrol but I dont know if you would like this

Color _getIconColor(ColorScheme colorScheme) {
    if (widget.platform == YaruWindowControlPlatform.windows &&
        widget.type == YaruWindowControlType.close &&
        _hovered) {
      return Colors.white;
    }

    if (widget.foregroundColor != null) {
      return widget.foregroundColor!;
    }

    switch (style) {
      case YaruWindowControlPlatform.yaru:
        return _getYaruIconColor(colorScheme);
      case YaruWindowControlPlatform.windows:
        return _getWindowsIconColor(colorScheme);
    }
  }

or by ignoring the foreground color specifically in the titlebar for the close button if the platform is windows

      if (isClosable == true)
        YaruWindowControl(
          platform: windowControlPlatform,
          foregroundColor: windowControlPlatform ==
                  YaruWindowControlPlatform.windows
              ? null
              : foregroundColor,
          type: YaruWindowControlType.close,
          onTap: onClose != null
              ? () => onClose!(context)
              : null,
        ),

grafik

would you like any of those solutions @Jupi007 ?

Jupi007 commented 7 months ago

@Feichtmeier I would like to fix it in a little different way :D

Feichtmeier commented 7 months ago

okay! I got two other fixes in the PR then I make a new PR with only those padding and cliprrect changes

Jupi007 commented 7 months ago

@Feichtmeier I'm sorry, I now realize your fix was the correct way 😅 You can reopen your PR. The way I wanted to fix this problem would have broke the foregroundColor property which should be able to override the icon color in every case.

Feichtmeier commented 4 months ago

I think we fixed this