Skip to content

Commit

Permalink
Merge pull request rustdesk#5440 from 21pages/opt
Browse files Browse the repository at this point in the history
opt peer tab ui
  • Loading branch information
rustdesk authored Aug 19, 2023
2 parents 622b2f3 + cdb264d commit e2d3820
Show file tree
Hide file tree
Showing 2 changed files with 167 additions and 92 deletions.
11 changes: 6 additions & 5 deletions flutter/lib/common/widgets/peer_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class _PeerCardState extends State<_PeerCard>
],
).marginOnly(top: 2),
),
checkBoxOrActionMoreDesktop(peer),
checkBoxOrActionMoreDesktop(peer, isTile: true),
],
).paddingOnly(left: 10.0, top: 3.0),
),
Expand Down Expand Up @@ -321,7 +321,7 @@ class _PeerCardState extends State<_PeerCard>
style: Theme.of(context).textTheme.titleSmall,
)),
]).paddingSymmetric(vertical: 8)),
checkBoxOrActionMoreDesktop(peer),
checkBoxOrActionMoreDesktop(peer, isTile: false),
],
).paddingSymmetric(horizontal: 12.0),
)
Expand Down Expand Up @@ -387,7 +387,7 @@ class _PeerCardState extends State<_PeerCard>
}
}

Widget checkBoxOrActionMoreDesktop(Peer peer) {
Widget checkBoxOrActionMoreDesktop(Peer peer, {required bool isTile}) {
final PeerTabModel peerTabModel = Provider.of(context);
final selected = peerTabModel.isPeerSelected(peer.id);
if (peerTabModel.multiSelectionMode) {
Expand All @@ -398,14 +398,15 @@ class _PeerCardState extends State<_PeerCard>
)
: Icon(Icons.check_box_outline_blank);
bool last = peerTabModel.isShiftDown && peer.id == peerTabModel.lastId;
double right = isTile ? 4 : 0;
if (last) {
return Container(
decoration: BoxDecoration(
border: Border.all(color: MyTheme.accent, width: 1)),
child: icon,
);
).marginOnly(right: right);
} else {
return icon;
return icon.marginOnly(right: right);
}
} else {
return _actionMore(peer);
Expand Down
Loading

0 comments on commit e2d3820

Please sign in to comment.