mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-05-11 10:26:19 +02:00
fix: win10, border (#10753)
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
2a0e8c109b
commit
a039741e5a
7 changed files with 94 additions and 27 deletions
|
@ -2566,6 +2566,8 @@ bool get kUseCompatibleUiMode =>
|
|||
isWindows &&
|
||||
const [WindowsTarget.w7].contains(windowsBuildNumber.windowsVersion);
|
||||
|
||||
bool get isWin10 => windowsBuildNumber.windowsVersion == WindowsTarget.w10;
|
||||
|
||||
class ServerConfig {
|
||||
late String idServer;
|
||||
late String relayServer;
|
||||
|
@ -3638,3 +3640,59 @@ extension WorkaroundFreezeLinuxMint on Widget {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Don't use `extension` here, the border looks weird if using `extension` in my test.
|
||||
Widget workaroundWindowBorder(BuildContext context, Widget child) {
|
||||
if (!isWin10) {
|
||||
return child;
|
||||
}
|
||||
|
||||
final isLight = Theme.of(context).brightness == Brightness.light;
|
||||
final borderColor = isLight ? Colors.black87 : Colors.grey;
|
||||
final width = isLight ? 0.5 : 0.1;
|
||||
|
||||
getBorderWidget(Widget child) {
|
||||
return Obx(() =>
|
||||
(stateGlobal.isMaximized.isTrue || stateGlobal.fullscreen.isTrue)
|
||||
? Offstage()
|
||||
: child);
|
||||
}
|
||||
|
||||
final List<Widget> borders = [
|
||||
getBorderWidget(Container(
|
||||
color: borderColor,
|
||||
height: width + 0.1,
|
||||
))
|
||||
];
|
||||
if (kWindowType == WindowType.Main && !isLight) {
|
||||
borders.addAll([
|
||||
getBorderWidget(Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Container(
|
||||
color: borderColor,
|
||||
width: width,
|
||||
),
|
||||
)),
|
||||
getBorderWidget(Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: Container(
|
||||
color: borderColor,
|
||||
width: width,
|
||||
),
|
||||
)),
|
||||
getBorderWidget(Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Container(
|
||||
color: borderColor,
|
||||
height: width,
|
||||
),
|
||||
)),
|
||||
]);
|
||||
}
|
||||
return Stack(
|
||||
children: [
|
||||
child,
|
||||
...borders,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue