unify menu icon

This commit is contained in:
rustdesk 2022-04-04 01:38:53 +08:00
parent 91f3048ac2
commit 71c50e6f1e
4 changed files with 75 additions and 70 deletions

View File

@ -83,7 +83,7 @@ class PlatformFFI {
static void setMethodCallHandler(FMethod callback) {} static void setMethodCallHandler(FMethod callback) {}
static Future<bool> invokeMethod(String method) async { static Future<bool> invokeMethod(String method, [ dynamic arguments]) async {
return true; return true;
} }
} }

View File

@ -22,7 +22,7 @@ class ChatPage extends StatelessWidget implements PageShape {
@override @override
final appBarActions = [ final appBarActions = [
PopupMenuButton<int>( PopupMenuButton<int>(
icon: Icon(Icons.list_alt), icon: Icon(Icons.more_vert),
itemBuilder: (context) { itemBuilder: (context) {
final chatModel = FFI.chatModel; final chatModel = FFI.chatModel;
final serverModel = FFI.serverModel; final serverModel = FFI.serverModel;
@ -176,8 +176,7 @@ class _ChatWindowOverlayState extends State<ChatWindowOverlay> {
}); });
} }
checkScreenSize() { checkScreenSize() {}
}
checkKeyboard() { checkKeyboard() {
final bottomHeight = MediaQuery.of(context).viewInsets.bottom; final bottomHeight = MediaQuery.of(context).viewInsets.bottom;

View File

@ -286,37 +286,40 @@ class _WebMenuState extends State<WebMenu> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
Provider.of<FfiModel>(context); Provider.of<FfiModel>(context);
final username = getUsername(); final username = getUsername();
return PopupMenuButton<String>(itemBuilder: (context) { return PopupMenuButton<String>(
return [ icon: Icon(Icons.more_vert),
PopupMenuItem( itemBuilder: (context) {
child: Text(translate('ID/Relay Server')), return [
value: "server", PopupMenuItem(
), child: Text(translate('ID/Relay Server')),
PopupMenuItem( value: "server",
child: Text(username == null ),
? translate("Login") PopupMenuItem(
: translate("Logout") + ' ($username)'), child: Text(username == null
value: "login", ? translate("Login")
), : translate("Logout") + ' ($username)'),
PopupMenuItem( value: "login",
child: Text(translate('About') + ' RustDesk'), ),
value: "about", PopupMenuItem(
) child: Text(translate('About') + ' RustDesk'),
]; value: "about",
}, onSelected: (value) { )
if (value == 'server') { ];
showServer(); },
} onSelected: (value) {
if (value == 'about') { if (value == 'server') {
showAbout(); showServer();
} }
if (value == 'login') { if (value == 'about') {
if (username == null) { showAbout();
showLogin(); }
} else { if (value == 'login') {
logout(); if (username == null) {
} showLogin();
} } else {
}); logout();
}
}
});
} }
} }

View File

@ -17,41 +17,44 @@ class ServerPage extends StatelessWidget implements PageShape {
@override @override
final appBarActions = [ final appBarActions = [
PopupMenuButton<String>(itemBuilder: (context) { PopupMenuButton<String>(
return [ icon: Icon(Icons.more_vert),
PopupMenuItem( itemBuilder: (context) {
child: Text(translate("Change ID")), return [
value: "changeID", PopupMenuItem(
enabled: false, child: Text(translate("Change ID")),
), value: "changeID",
PopupMenuItem( enabled: false,
child: Text(translate("Set your own password")), ),
value: "changePW", PopupMenuItem(
enabled: FFI.serverModel.isStart, child: Text(translate("Set your own password")),
), value: "changePW",
PopupMenuItem( enabled: FFI.serverModel.isStart,
child: Text(translate("Refresh random password")), ),
value: "refreshPW", PopupMenuItem(
enabled: FFI.serverModel.isStart, child: Text(translate("Refresh random password")),
) value: "refreshPW",
]; enabled: FFI.serverModel.isStart,
}, onSelected: (value) { )
if (value == "changeID") { ];
// TODO },
} else if (value == "changePW") { onSelected: (value) {
updatePasswordDialog(); if (value == "changeID") {
} else if (value == "refreshPW") { // TODO
() async { } else if (value == "changePW") {
showLoading(translate("Waiting")); updatePasswordDialog();
if(await FFI.serverModel.updatePassword("")){ } else if (value == "refreshPW") {
showSuccess(); () async {
}else{ showLoading(translate("Waiting"));
showError(); if (await FFI.serverModel.updatePassword("")) {
showSuccess();
} else {
showError();
}
debugPrint("end updatePassword");
}();
} }
debugPrint("end updatePassword"); })
}();
}
})
]; ];
@override @override