feat: support ctrl + A to select all current section
This commit is contained in:
@@ -221,6 +221,13 @@ public class TimeBox : TemplatedControl
|
|||||||
if (_currentActiveSectionIndex is null) return;
|
if (_currentActiveSectionIndex is null) return;
|
||||||
var keymap = TopLevel.GetTopLevel(this)?.PlatformSettings?.HotkeyConfiguration;
|
var keymap = TopLevel.GetTopLevel(this)?.PlatformSettings?.HotkeyConfiguration;
|
||||||
bool Match(List<KeyGesture> gestures) => gestures.Any(g => g.Matches(e));
|
bool Match(List<KeyGesture> gestures) => gestures.Any(g => g.Matches(e));
|
||||||
|
if (keymap is not null && Match(keymap.SelectAll))
|
||||||
|
{
|
||||||
|
_presenters[_currentActiveSectionIndex.Value].SelectionStart = 0;
|
||||||
|
_presenters[_currentActiveSectionIndex.Value].SelectionEnd = _presenters[_currentActiveSectionIndex.Value].Text?.Length ?? 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (e.Key is Key.Enter or Key.Return)
|
if (e.Key is Key.Enter or Key.Return)
|
||||||
{
|
{
|
||||||
ParseTimeSpan(ShowLeadingZero);
|
ParseTimeSpan(ShowLeadingZero);
|
||||||
|
|||||||
Reference in New Issue
Block a user