mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-06-07 18:02:48 +08:00
update peer view type options
Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>
This commit is contained in:
parent
94e51a8041
commit
d9e1b2df7f
@ -216,21 +216,24 @@ class _PeerTabPageState extends State<PeerTabPage>
|
|||||||
|
|
||||||
Widget _createPeerViewTypeSwitch(BuildContext context) {
|
Widget _createPeerViewTypeSwitch(BuildContext context) {
|
||||||
final textColor = Theme.of(context).textTheme.titleLarge?.color;
|
final textColor = Theme.of(context).textTheme.titleLarge?.color;
|
||||||
final types = [PeerUiType.grid, PeerUiType.list];
|
final types = [PeerUiType.grid, PeerUiType.tile, PeerUiType.list];
|
||||||
|
|
||||||
return Obx(() => _hoverAction(
|
return Obx(() => _hoverAction(
|
||||||
context: context,
|
context: context,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
final type = types
|
final currentIndex = types.indexOf(peerCardUiType.value);
|
||||||
.elementAt(peerCardUiType.value == types.elementAt(0) ? 1 : 0);
|
final newIndex = (currentIndex + 1) % types.length; // cycle through types
|
||||||
|
final type = types[newIndex];
|
||||||
await bind.setLocalFlutterOption(
|
await bind.setLocalFlutterOption(
|
||||||
k: 'peer-card-ui-type', v: type.index.toString());
|
k: 'peer-card-ui-type', v: type.index.toString());
|
||||||
peerCardUiType.value = type;
|
peerCardUiType.value = type;
|
||||||
},
|
},
|
||||||
child: Tooltip(
|
child: Tooltip(
|
||||||
message: peerCardUiType.value == PeerUiType.grid
|
message: peerCardUiType.value == PeerUiType.grid
|
||||||
? translate('List View')
|
? translate('Small tiles')
|
||||||
: translate('Grid View'),
|
: peerCardUiType.value == PeerUiType.tile
|
||||||
|
? translate('List')
|
||||||
|
: translate('Big tiles'),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
peerCardUiType.value == PeerUiType.grid
|
peerCardUiType.value == PeerUiType.grid
|
||||||
? Icons.view_list_rounded
|
? Icons.view_list_rounded
|
||||||
|
Loading…
Reference in New Issue
Block a user