Skip to content

Commit cf1d544

Browse files
committed
将展开/收起的快捷键调整为/,避免无法通过上下键选择搜索结果。
1 parent 2e8ee5e commit cf1d544

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

lib/pages/info/source_sheet.dart

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -437,21 +437,21 @@ class _SourceSheetState extends State<SourceSheet> with SingleTickerProviderStat
437437
IconButton(
438438
onPressed: () {
439439
setState(() {
440-
_showOnlySuccess = !_showOnlySuccess;
440+
expandedByDrag = false; //避免触顶展开>锁上>拉回>解锁时自动收起
441+
_isLocked = !_isLocked;
441442
});
442443
},
443-
icon: Icon(_showOnlySuccess ? Icons.filter_alt : Icons.filter_alt_outlined,),
444-
tooltip: '筛选有结果项',
444+
icon: Icon(_isLocked ? Icons.lock : Icons.lock_open),
445+
tooltip: '锁定/解锁',
445446
),
446447
IconButton(
447448
onPressed: () {
448449
setState(() {
449-
expandedByDrag = false; //避免触顶展开>锁上>拉回>解锁时自动收起
450-
_isLocked = !_isLocked;
450+
_showOnlySuccess = !_showOnlySuccess;
451451
});
452452
},
453-
icon: Icon(_isLocked ? Icons.lock : Icons.lock_open),
454-
tooltip: '锁定/解锁',
453+
icon: Icon(_showOnlySuccess ? Icons.filter_alt : Icons.filter_alt_outlined,),
454+
tooltip: '筛选有结果项',
455455
),
456456
IconButton(
457457
onPressed: () {
@@ -751,20 +751,14 @@ class _SourceSheetState extends State<SourceSheet> with SingleTickerProviderStat
751751
}
752752
}
753753
if (event is KeyDownEvent) {
754-
if (event.logicalKey == LogicalKeyboardKey.arrowDown) {
754+
if (event.logicalKey == LogicalKeyboardKey.slash) {
755755
if(!_showTabGrid){
756756
setState(() {
757-
_showTabGrid = true;
758757
if(autoLock){ _isLocked = true;}
759758
if(autoShowSuccess){_showOnlySuccess = true;}
760759
});
761760
}
762-
return KeyEventResult.handled;
763-
}
764-
if (event.logicalKey == LogicalKeyboardKey.arrowUp) {
765-
setState(() {
766-
_showTabGrid = false;
767-
});
761+
setState(() {_showTabGrid = !_showTabGrid;});
768762
return KeyEventResult.handled;
769763
}
770764
}

0 commit comments

Comments
 (0)