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 Future<bool> invokeMethod(String method) async {
static Future<bool> invokeMethod(String method, [ dynamic arguments]) async {
return true;
}
}

View File

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

View File

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

View File

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