feat: platform title bar buttons add

This commit is contained in:
Kingkor Roy Tirtho 2022-11-11 11:20:43 +06:00
parent ff1446982f
commit 54048cbfc3
2 changed files with 8 additions and 2 deletions

View File

@ -123,8 +123,7 @@ class PageWindowTitleBar extends StatelessWidget
),
if (leading != null) leading!,
Expanded(child: MoveWindow(child: Center(child: center))),
if (!kIsMacOS && !kIsMobile)
TitleBarActionButtons(color: foregroundColor)
if (!kIsMacOS && !kIsMobile) const PlatformWindowButtons()
],
),
),

View File

@ -235,6 +235,13 @@ class SpotubeState extends ConsumerState<Spotube> with WidgetsBindingObserver {
macosTheme: macosTheme,
macosDarkTheme: macosDarkTheme,
themeMode: themeMode,
windowButtonConfig: PlatformWindowButtonConfig(
isMaximized: appWindow.isMaximized,
onClose: appWindow.close,
onRestore: appWindow.restore,
onMaximize: appWindow.maximize,
onMinimize: appWindow.minimize,
),
shortcuts: PlatformProperty.all({
...WidgetsApp.defaultShortcuts.map((key, value) {
return MapEntry(