Merge pull request #4815 from dignow/refact/login_close_inkwell

replace close button to inkwell
This commit is contained in:
RustDesk 2023-07-01 16:01:08 +08:00 committed by GitHub
commit a33c94a377
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 24 deletions

View File

@ -506,31 +506,17 @@ Future<bool?> loginDialog() async {
Text(
translate('Login'),
).marginOnly(top: MyTheme.dialogPadding),
TextButton(
style: ButtonStyle(
overlayColor: MaterialStateProperty.resolveWith<Color?>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.hovered)) {
return Colors.red;
}
return null;
},
),
padding: MaterialStateProperty.all<EdgeInsetsGeometry>(
EdgeInsets.all(5)),
minimumSize: MaterialStateProperty.all(
Size(0, 0),
),
shape: MaterialStateProperty.all(RoundedRectangleBorder(
side: BorderSide.none,
borderRadius: BorderRadius.all(Radius.circular(5)))),
),
InkWell(
child: Icon(
Icons.close,
size: 22,
color: Colors.black54,
color: MyTheme.currentThemeMode() == ThemeMode.dark
? Colors.white70
: Colors.black54,
),
onPressed: onDialogCancel,
onTap: onDialogCancel,
hoverColor: Colors.red,
borderRadius: BorderRadius.circular(5),
).marginOnly(top: 5, right: 5),
],
);

View File

@ -310,7 +310,7 @@ pub struct TransferSerde {
}
#[inline]
pub fn get_online_statue() -> i64 {
pub fn get_online_state() -> i64 {
*ONLINE.lock().unwrap().values().max().unwrap_or(&0)
}

View File

@ -685,7 +685,7 @@ pub fn main_get_connect_status() -> String {
}
#[cfg(any(target_os = "android", target_os = "ios"))]
{
let mut state = hbb_common::config::get_online_statue();
let mut state = hbb_common::config::get_online_state();
if state > 0 {
state = 1;
}

View File

@ -347,7 +347,7 @@ async fn handle(data: Data, stream: &mut Connection) {
}
}
Data::OnlineStatus(_) => {
let x = config::get_online_statue();
let x = config::get_online_state();
let confirmed = Config::get_key_confirmed();
allow_err!(stream.send(&Data::OnlineStatus(Some((x, confirmed)))).await);
}