Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

update peer view type options

Sahil Yeoled9e1b2df7fb8
diff --git a/flutter/lib/common/widgets/peer_tab_page.dart b/flutter/lib/common/widgets/peer_tab_page.dart
index b5143eb82..63d9e18f8 100644
--- a/flutter/lib/common/widgets/peer_tab_page.dart
+++ b/flutter/lib/common/widgets/peer_tab_page.dart
@@ -216,21 +216,24 @@ class _PeerTabPageState extends State<PeerTabPage>
Widget _createPeerViewTypeSwitch(BuildContext context) {
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(
context: context,
onTap: () async {
- final type = types
- .elementAt(peerCardUiType.value == types.elementAt(0) ? 1 : 0);
+ final currentIndex = types.indexOf(peerCardUiType.value);
+ final newIndex = (currentIndex + 1) % types.length; // cycle through types
+ final type = types[newIndex];
await bind.setLocalFlutterOption(
k: 'peer-card-ui-type', v: type.index.toString());
peerCardUiType.value = type;
},
child: Tooltip(
message: peerCardUiType.value == PeerUiType.grid
- ? translate('List View')
- : translate('Grid View'),
+ ? translate('Small tiles')
+ : peerCardUiType.value == PeerUiType.tile
+ ? translate('List')
+ : translate('Big tiles'),
child: Icon(
peerCardUiType.value == PeerUiType.grid
? Icons.view_list_rounded