mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 15:57:25 +00:00
Fix Fullscreen switch (#229)
* Fix Fullscreen switch for windows * Fix Fullscreen switch for windows
This commit is contained in:
@@ -6,10 +6,15 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:venera/foundation/app.dart';
|
||||
import 'package:venera/foundation/comic_source/comic_source.dart';
|
||||
import 'package:venera/foundation/global_state.dart';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
|
||||
const _kTitleBarHeight = 36.0;
|
||||
|
||||
void toggleWindowFrame() {
|
||||
GlobalState.find<_WindowFrameState>().toggleWindowFrame();
|
||||
}
|
||||
|
||||
class WindowFrame extends StatefulWidget {
|
||||
const WindowFrame(this.child, {super.key});
|
||||
|
||||
@@ -19,10 +24,14 @@ class WindowFrame extends StatefulWidget {
|
||||
State<WindowFrame> createState() => _WindowFrameState();
|
||||
}
|
||||
|
||||
class _WindowFrameState extends State<WindowFrame> {
|
||||
class _WindowFrameState extends AutomaticGlobalState<WindowFrame> {
|
||||
bool isHideWindowFrame = false;
|
||||
bool useDarkTheme = false;
|
||||
|
||||
void toggleWindowFrame() {
|
||||
isHideWindowFrame = !isHideWindowFrame;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (App.isMobile) return widget.child;
|
||||
@@ -99,6 +108,9 @@ class _WindowFrameState extends State<WindowFrame> {
|
||||
return body;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object? get key => 'WindowFrame';
|
||||
}
|
||||
|
||||
class WindowButtons extends StatefulWidget {
|
||||
|
Reference in New Issue
Block a user