@@ -339,13 +339,15 @@ class _ProxyList extends StatelessWidget {
339339 final testing = testingTags.value;
340340 final items = _sortedItems (group? .items ?? []);
341341
342+ final selectable = group? .selectable ?? false ;
342343 return ListView .builder (
343344 itemCount: items.length,
344345 itemBuilder: (_, i) => _ProxyTile (
345346 key: ValueKey (items[i].tag),
346347 item: items[i],
347348 selected: items[i].tag == selected,
348349 groupName: groupTag,
350+ selectable: selectable,
349351 testing: testing.contains (items[i].tag),
350352 testingTags: testingTags,
351353 ),
@@ -375,13 +377,15 @@ class _ProxyList extends StatelessWidget {
375377class _ProxyTile extends StatelessWidget {
376378 final ProxyGroupItem item;
377379 final bool selected;
380+ final bool selectable;
378381 final bool testing;
379382 final String groupName;
380383 final Signal <Set <String >> testingTags;
381384 const _ProxyTile ({
382385 super .key,
383386 required this .item,
384387 required this .selected,
388+ required this .selectable,
385389 required this .testing,
386390 required this .groupName,
387391 required this .testingTags,
@@ -429,11 +433,16 @@ class _ProxyTile extends StatelessWidget {
429433 return _delayWidget (delay, testing, item.tag, testingTags);
430434 }),
431435 onTap: () async {
436+ if (! selectable) {
437+ _showHint (context, t.proxies.autoGroupHint);
438+ return ;
439+ }
432440 try {
433441 await LibCore .instance.selectProxy (groupName, item.tag);
434442 } catch (e) {
435443 if (context.mounted) {
436- showErrorDialog (context, t.proxies.switchFailed (error: '$e ' ));
444+ showErrorDialog (
445+ context, t.proxies.switchFailed (error: '$e ' ));
437446 }
438447 }
439448 },
@@ -506,3 +515,9 @@ Widget _delayText(int delay, BuildContext context) {
506515 : _delayColorBad;
507516 return Text ('${delay }ms' , style: TextStyle (color: color, fontSize: 13 ));
508517}
518+
519+ void _showHint (BuildContext context, String message) {
520+ if (! context.mounted) return ;
521+ ScaffoldMessenger .of (context)..clearSnackBars ()
522+ ..showSnackBar (SnackBar (content: Text (message)));
523+ }
0 commit comments