Merge pull request #2168 from fufesou/fix_edge_width
fix window border width when fullscreen
This commit is contained in:
commit
325351773c
@ -116,11 +116,13 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final tabWidget = Container(
|
final tabWidget = Obx(
|
||||||
|
() => Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: MyTheme.color(context).border!,
|
color: MyTheme.color(context).border!,
|
||||||
width: kWindowBorderWidth)),
|
width: stateGlobal.windowBorderWidth.value),
|
||||||
|
),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: Theme.of(context).backgroundColor,
|
backgroundColor: Theme.of(context).backgroundColor,
|
||||||
body: DesktopTab(
|
body: DesktopTab(
|
||||||
@ -182,7 +184,9 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
)),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
return Platform.isMacOS
|
return Platform.isMacOS
|
||||||
? tabWidget
|
? tabWidget
|
||||||
|
@ -593,7 +593,7 @@ class CanvasModel with ChangeNotifier {
|
|||||||
return parent.target?.ffiModel.display.height ?? defaultHeight;
|
return parent.target?.ffiModel.display.height ?? defaultHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
double get windowBorderWidth => stateGlobal.windowBorderWidth;
|
double get windowBorderWidth => stateGlobal.windowBorderWidth.value;
|
||||||
double get tabBarHeight => stateGlobal.tabBarHeight;
|
double get tabBarHeight => stateGlobal.tabBarHeight;
|
||||||
|
|
||||||
Size get size {
|
Size get size {
|
||||||
|
@ -8,14 +8,15 @@ class StateGlobal {
|
|||||||
bool _fullscreen = false;
|
bool _fullscreen = false;
|
||||||
final RxBool _showTabBar = true.obs;
|
final RxBool _showTabBar = true.obs;
|
||||||
final RxDouble _resizeEdgeSize = 8.0.obs;
|
final RxDouble _resizeEdgeSize = 8.0.obs;
|
||||||
|
final RxDouble _windowBorderWidth = RxDouble(kWindowBorderWidth);
|
||||||
final RxBool showRemoteMenuBar = false.obs;
|
final RxBool showRemoteMenuBar = false.obs;
|
||||||
|
|
||||||
int get windowId => _windowId;
|
int get windowId => _windowId;
|
||||||
bool get fullscreen => _fullscreen;
|
bool get fullscreen => _fullscreen;
|
||||||
double get tabBarHeight => fullscreen ? 0 : kDesktopRemoteTabBarHeight;
|
double get tabBarHeight => fullscreen ? 0 : kDesktopRemoteTabBarHeight;
|
||||||
double get windowBorderWidth => fullscreen ? 0 : kWindowBorderWidth;
|
|
||||||
RxBool get showTabBar => _showTabBar;
|
RxBool get showTabBar => _showTabBar;
|
||||||
RxDouble get resizeEdgeSize => _resizeEdgeSize;
|
RxDouble get resizeEdgeSize => _resizeEdgeSize;
|
||||||
|
RxDouble get windowBorderWidth => _windowBorderWidth;
|
||||||
|
|
||||||
setWindowId(int id) => _windowId = id;
|
setWindowId(int id) => _windowId = id;
|
||||||
setFullscreen(bool v) {
|
setFullscreen(bool v) {
|
||||||
@ -24,6 +25,7 @@ class StateGlobal {
|
|||||||
_showTabBar.value = !_fullscreen;
|
_showTabBar.value = !_fullscreen;
|
||||||
_resizeEdgeSize.value =
|
_resizeEdgeSize.value =
|
||||||
fullscreen ? kFullScreenEdgeSize : kWindowEdgeSize;
|
fullscreen ? kFullScreenEdgeSize : kWindowEdgeSize;
|
||||||
|
_windowBorderWidth.value = fullscreen ? 0 : kWindowBorderWidth;
|
||||||
WindowController.fromWindowId(windowId).setFullscreen(_fullscreen);
|
WindowController.fromWindowId(windowId).setFullscreen(_fullscreen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user