mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-29 09:18:01 +01:00
Fixes #1796. If TextView is ReadOnly tab and return are ignored. Also fixes Button click via spacebar (#1804)
* Fixes #1796. If TextView is read only allows tab around and return. * Fixes space bar responding on Button.
This commit is contained in:
@@ -159,7 +159,7 @@ namespace Terminal.Gui {
|
||||
set {
|
||||
if (hotKey != value) {
|
||||
var v = value == Key.Unknown ? Key.Null : value;
|
||||
if (ContainsKeyBinding (Key.Space | hotKey)) {
|
||||
if (hotKey != Key.Null && ContainsKeyBinding (Key.Space | hotKey)) {
|
||||
if (v == Key.Null) {
|
||||
ClearKeybinding (Key.Space | hotKey);
|
||||
} else {
|
||||
|
||||
@@ -2934,8 +2934,8 @@ namespace Terminal.Gui {
|
||||
{
|
||||
ResetColumnTrack ();
|
||||
|
||||
if (!AllowsTab) {
|
||||
return false;
|
||||
if (!AllowsTab || isReadOnly) {
|
||||
return ProcessMovePreviousView ();
|
||||
}
|
||||
if (currentColumn > 0) {
|
||||
var currentLine = GetCurrentLine ();
|
||||
@@ -2958,8 +2958,8 @@ namespace Terminal.Gui {
|
||||
{
|
||||
ResetColumnTrack ();
|
||||
|
||||
if (!AllowsTab) {
|
||||
return false;
|
||||
if (!AllowsTab || isReadOnly) {
|
||||
return ProcessMoveNextView ();
|
||||
}
|
||||
InsertText (new KeyEvent ((Key)'\t', null));
|
||||
DoNeededAction ();
|
||||
@@ -2977,11 +2977,9 @@ namespace Terminal.Gui {
|
||||
{
|
||||
ResetColumnTrack ();
|
||||
|
||||
if (!AllowsReturn) {
|
||||
if (!AllowsReturn || isReadOnly) {
|
||||
return false;
|
||||
}
|
||||
if (isReadOnly)
|
||||
return true;
|
||||
|
||||
var currentLine = GetCurrentLine ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user