replace close button to inkwell

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow 2023-07-01 14:43:00 +08:00
parent 61135645d3
commit 588168f638
4 changed files with 7 additions and 23 deletions

View File

@ -506,31 +506,15 @@ 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,
),
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);
}