fix: improve caption button appearance on Windows 11 (#41586)

4428171

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot] 2024-03-14 09:54:31 +01:00 committed by GitHub
parent d16f1d52e8
commit b39f36496d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 64 additions and 59 deletions

View file

@ -10,6 +10,7 @@
namespace electron {
// Copied from chrome/browser/ui/views/frame/windows_icon_painter.h
class WinIconPainter {
public:
WinIconPainter();
@ -22,22 +23,22 @@ class WinIconPainter {
// Paints the minimize icon for the button
virtual void PaintMinimizeIcon(gfx::Canvas* canvas,
const gfx::Rect& symbol_rect,
const cc::PaintFlags& flags);
cc::PaintFlags& flags);
// Paints the maximize icon for the button
virtual void PaintMaximizeIcon(gfx::Canvas* canvas,
const gfx::Rect& symbol_rect,
const cc::PaintFlags& flags);
cc::PaintFlags& flags);
// Paints the restore icon for the button
virtual void PaintRestoreIcon(gfx::Canvas* canvas,
const gfx::Rect& symbol_rect,
const cc::PaintFlags& flags);
cc::PaintFlags& flags);
// Paints the close icon for the button
virtual void PaintCloseIcon(gfx::Canvas* canvas,
const gfx::Rect& symbol_rect,
const cc::PaintFlags& flags);
cc::PaintFlags& flags);
};
class Win11IconPainter : public WinIconPainter {
@ -52,12 +53,12 @@ class Win11IconPainter : public WinIconPainter {
// Paints the maximize icon for the button
void PaintMaximizeIcon(gfx::Canvas* canvas,
const gfx::Rect& symbol_rect,
const cc::PaintFlags& flags) override;
cc::PaintFlags& flags) override;
// Paints the restore icon for the button
void PaintRestoreIcon(gfx::Canvas* canvas,
const gfx::Rect& symbol_rect,
const cc::PaintFlags& flags) override;
cc::PaintFlags& flags) override;
};
} // namespace electron