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!, if (leading != null) leading!,
Expanded(child: MoveWindow(child: Center(child: center))), Expanded(child: MoveWindow(child: Center(child: center))),
if (!kIsMacOS && !kIsMobile) if (!kIsMacOS && !kIsMobile) const PlatformWindowButtons()
TitleBarActionButtons(color: foregroundColor)
], ],
), ),
), ),

View File

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