optimize ui style

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2022-08-22 17:58:48 +08:00
parent 714d474ff2
commit 930bf72c91
7 changed files with 218 additions and 160 deletions

View File

@@ -249,6 +249,7 @@ class WindowActionPanel extends StatelessWidget {
},
is_close: false,
)),
// TODO: drag makes window restore
Offstage(
offstage: !showMaximize,
child: FutureBuilder(builder: (context, snapshot) {
@@ -273,21 +274,15 @@ class WindowActionPanel extends StatelessWidget {
if (is_maximized.value) {
windowManager.unmaximize();
} else {
WindowController.fromWindowId(windowId!).minimize();
windowManager.maximize();
}
} else {
// TODO: subwindow is maximized but first query result is not maximized.
final wc = WindowController.fromWindowId(windowId!);
if (is_maximized.value) {
wc.unmaximize();
} else {
final wc = WindowController.fromWindowId(windowId!);
wc.isMaximized().then((maximized) {
if (maximized) {
wc.unmaximize();
} else {
wc.maximize();
}
});
wc.maximize();
}
}
is_maximized.value = !is_maximized.value;