mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 11:06:57 +00:00
peer ab/group tab refresh, animated refresh icon
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import 'dart:math';
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
@@ -8,6 +7,7 @@ import 'package:flutter_hbb/common/widgets/address_book.dart';
|
||||
import 'package:flutter_hbb/common/widgets/my_group.dart';
|
||||
import 'package:flutter_hbb/common/widgets/peers_view.dart';
|
||||
import 'package:flutter_hbb/common/widgets/peer_card.dart';
|
||||
import 'package:flutter_hbb/common/widgets/animated_rotation_widget.dart';
|
||||
import 'package:flutter_hbb/consts.dart';
|
||||
import 'package:flutter_hbb/desktop/widgets/popup_menu.dart';
|
||||
import 'package:flutter_hbb/desktop/widgets/tabbar_widget.dart';
|
||||
@@ -18,7 +18,6 @@ import 'package:get/get.dart';
|
||||
import 'package:get/get_rx/src/rx_workers/utils/debouncer.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:visibility_detector/visibility_detector.dart';
|
||||
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||
|
||||
import '../../common.dart';
|
||||
import '../../models/platform_model.dart';
|
||||
@@ -63,12 +62,13 @@ class _PeerTabPageState extends State<PeerTabPage>
|
||||
AddressBook(
|
||||
menuPadding: _menuPadding(),
|
||||
),
|
||||
() => {}),
|
||||
() => gFFI.abModel.pullAb()),
|
||||
_TabEntry(
|
||||
MyGroup(
|
||||
menuPadding: _menuPadding(),
|
||||
),
|
||||
() => {}),
|
||||
MyGroup(
|
||||
menuPadding: _menuPadding(),
|
||||
),
|
||||
() => gFFI.groupModel.pull(),
|
||||
),
|
||||
];
|
||||
final _scrollDebounce = Debouncer(delay: Duration(milliseconds: 50));
|
||||
|
||||
@@ -109,11 +109,11 @@ class _PeerTabPageState extends State<PeerTabPage>
|
||||
child:
|
||||
visibleContextMenuListener(_createSwitchBar(context))),
|
||||
buildScrollJumper(),
|
||||
const PeerSearchBar(),
|
||||
const PeerSearchBar().marginOnly(right: 13),
|
||||
_createRefresh(),
|
||||
Offstage(
|
||||
offstage: !isDesktop,
|
||||
child: _createPeerViewTypeSwitch(context)
|
||||
.marginOnly(left: 13)),
|
||||
child: _createPeerViewTypeSwitch(context)),
|
||||
Offstage(
|
||||
offstage: _hideSort,
|
||||
child: PeerSortDropdown().marginOnly(left: 8),
|
||||
@@ -241,6 +241,29 @@ class _PeerTabPageState extends State<PeerTabPage>
|
||||
child: child.marginSymmetric(vertical: isDesktop ? 12.0 : 6.0));
|
||||
}
|
||||
|
||||
Widget _createRefresh() {
|
||||
final textColor = Theme.of(context).textTheme.titleLarge?.color;
|
||||
return Offstage(
|
||||
offstage: gFFI.peerTabModel.currentTab < 3, // local tab can't see effect
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(4.0),
|
||||
child: AnimatedRotationWidget(
|
||||
onPressed: () {
|
||||
if (gFFI.peerTabModel.currentTab < entries.length) {
|
||||
entries[gFFI.peerTabModel.currentTab].load();
|
||||
}
|
||||
},
|
||||
child: RotatedBox(
|
||||
quarterTurns: 2,
|
||||
child: Icon(
|
||||
Icons.refresh,
|
||||
size: 18,
|
||||
color: textColor,
|
||||
))),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _createPeerViewTypeSwitch(BuildContext context) {
|
||||
final textColor = Theme.of(context).textTheme.titleLarge?.color;
|
||||
final deco = BoxDecoration(
|
||||
|
||||
Reference in New Issue
Block a user