flutter_desktop: adjust window, debug done
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
2cc92c199c
commit
8ec565d5a0
@ -1029,12 +1029,14 @@ Future<void> saveWindowPosition(WindowType type, {int? windowId}) async {
|
|||||||
_adjustRestoreMainWindowSize(double? width, double? height) async {
|
_adjustRestoreMainWindowSize(double? width, double? height) async {
|
||||||
const double minWidth = 600;
|
const double minWidth = 600;
|
||||||
const double minHeight = 100;
|
const double minHeight = 100;
|
||||||
double maxWidth = ((isDesktop || isWebDesktop)
|
double maxWidth = (((isDesktop || isWebDesktop)
|
||||||
? kDesktopMaxDisplayWidth
|
? kDesktopMaxDisplayWidth
|
||||||
: kMobileMaxDisplayWidth) as double;
|
: kMobileMaxDisplayWidth))
|
||||||
|
.toDouble();
|
||||||
double maxHeight = ((isDesktop || isWebDesktop)
|
double maxHeight = ((isDesktop || isWebDesktop)
|
||||||
? kDesktopMaxDisplayHeight
|
? kDesktopMaxDisplayHeight
|
||||||
: kMobileMaxDisplayHeight) as double;
|
: kMobileMaxDisplayHeight)
|
||||||
|
.toDouble();
|
||||||
|
|
||||||
if (isDesktop || isWebDesktop) {
|
if (isDesktop || isWebDesktop) {
|
||||||
final screen = (await window_size.getWindowInfo()).screen;
|
final screen = (await window_size.getWindowInfo()).screen;
|
||||||
@ -1044,12 +1046,12 @@ _adjustRestoreMainWindowSize(double? width, double? height) async {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final defaultWidth = ((isDesktop || isWebDesktop)
|
final defaultWidth =
|
||||||
? 1280
|
((isDesktop || isWebDesktop) ? 1280 : kMobileDefaultDisplayWidth)
|
||||||
: kMobileDefaultDisplayWidth) as double;
|
.toDouble();
|
||||||
final defaultHeight = ((isDesktop || isWebDesktop)
|
final defaultHeight =
|
||||||
? 720
|
((isDesktop || isWebDesktop) ? 720 : kMobileDefaultDisplayHeight)
|
||||||
: kMobileDefaultDisplayHeight) as double;
|
.toDouble();
|
||||||
double restoreWidth = width ?? defaultWidth;
|
double restoreWidth = width ?? defaultWidth;
|
||||||
double restoreHeight = height ?? defaultHeight;
|
double restoreHeight = height ?? defaultHeight;
|
||||||
|
|
||||||
@ -1078,11 +1080,13 @@ _adjustRestoreMainWindowOffset(double? left, double? top) async {
|
|||||||
double frameLeft = 0;
|
double frameLeft = 0;
|
||||||
double frameTop = 0;
|
double frameTop = 0;
|
||||||
double frameRight = ((isDesktop || isWebDesktop)
|
double frameRight = ((isDesktop || isWebDesktop)
|
||||||
? kDesktopMaxDisplayWidth
|
? kDesktopMaxDisplayWidth
|
||||||
: kMobileMaxDisplayWidth) as double;
|
: kMobileMaxDisplayWidth)
|
||||||
|
.toDouble();
|
||||||
double frameBottom = ((isDesktop || isWebDesktop)
|
double frameBottom = ((isDesktop || isWebDesktop)
|
||||||
? kDesktopMaxDisplayHeight
|
? kDesktopMaxDisplayHeight
|
||||||
: kMobileMaxDisplayHeight) as double;
|
: kMobileMaxDisplayHeight)
|
||||||
|
.toDouble();
|
||||||
|
|
||||||
if (isDesktop || isWebDesktop) {
|
if (isDesktop || isWebDesktop) {
|
||||||
final screen = (await window_size.getWindowInfo()).screen;
|
final screen = (await window_size.getWindowInfo()).screen;
|
||||||
|
@ -628,8 +628,7 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
|
|||||||
double scale = _screen!.scaleFactor;
|
double scale = _screen!.scaleFactor;
|
||||||
double selfWidth = _screen!.frame.width;
|
double selfWidth = _screen!.frame.width;
|
||||||
double selfHeight = _screen!.frame.height;
|
double selfHeight = _screen!.frame.height;
|
||||||
final RxBool fullscreen = Get.find(tag: 'fullscreen');
|
if (isFullscreen) {
|
||||||
if (fullscreen.isFalse) {
|
|
||||||
selfWidth = _screen!.visibleFrame.width;
|
selfWidth = _screen!.visibleFrame.width;
|
||||||
selfHeight = _screen!.visibleFrame.height;
|
selfHeight = _screen!.visibleFrame.height;
|
||||||
}
|
}
|
||||||
@ -816,6 +815,7 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
|
|||||||
() async {
|
() async {
|
||||||
await _updateScreen();
|
await _updateScreen();
|
||||||
if (_screen != null) {
|
if (_screen != null) {
|
||||||
|
_setFullscreen(false);
|
||||||
double scale = _screen!.scaleFactor;
|
double scale = _screen!.scaleFactor;
|
||||||
final wndRect =
|
final wndRect =
|
||||||
await WindowController.fromWindowId(widget.windowId)
|
await WindowController.fromWindowId(widget.windowId)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user