Merge pull request #1876 from fufesou/flutter_desktop_remote_menubar

flutter_desktop: remote menu refactor
This commit is contained in:
RustDesk 2022-10-30 19:11:02 +08:00 committed by GitHub
commit e6ae4a7f58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,18 +106,24 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
width: 100, width: 100,
height: 13, height: 13,
child: TextButton( child: TextButton(
onHover: (bool v) { onHover: (bool v) {
_hideColor.value = v ? Colors.white60 : Colors.white24; _hideColor.value = v ? Colors.white60 : Colors.white24;
}, },
onPressed: () { onPressed: () {
_show.value = !_show.value; _show.value = !_show.value;
if (_show.isTrue) { _hideColor.value = Colors.white24;
_updateScreen(); if (_show.isTrue) {
} _updateScreen();
}, }
child: Obx(() => Container( },
child: Obx(() => Container(
decoration: BoxDecoration(
color: _hideColor.value, color: _hideColor.value,
).marginOnly(bottom: 8.0)))))); border: Border.all(color: MyTheme.border),
borderRadius: BorderRadius.all(Radius.circular(5.0)),
),
).marginOnly(bottom: 8.0)),
))));
} }
_updateScreen() async { _updateScreen() async {
@ -170,7 +176,11 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
textStyle: TextStyle(color: _MenubarTheme.commonColor)), textStyle: TextStyle(color: _MenubarTheme.commonColor)),
child: Column(mainAxisSize: MainAxisSize.min, children: [ child: Column(mainAxisSize: MainAxisSize.min, children: [
Container( Container(
color: Colors.white, decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: MyTheme.border),
borderRadius: BorderRadius.all(Radius.circular(10.0)),
),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: menubarItems, children: menubarItems,