Changeset - r20609:d49b35458da1
[Not reviewed]
master
0 1 0
frosch - 11 years ago 2013-08-03 21:26:49
frosch@openttd.org
(svn r25647) -Add: If an editbox is configured to be cleared with ESC, but the editbox is already empty, unselect the editbox instead.
1 file changed with 8 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/window.cpp
Show inline comments
 
@@ -2429,9 +2429,14 @@ EventState Window::HandleEditBoxKey(int 
 
			break;
 

	
 
		case QueryString::ACTION_CLEAR:
 
			query->text.DeleteAll();
 
			this->SetWidgetDirty(wid);
 
			this->OnEditboxChanged(wid);
 
			if (query->text.bytes <= 1) {
 
				/* If already empty, unfocus instead */
 
				this->UnfocusFocusedWidget();
 
			} else {
 
				query->text.DeleteAll();
 
				this->SetWidgetDirty(wid);
 
				this->OnEditboxChanged(wid);
 
			}
 
			break;
 

	
 
		default:
0 comments (0 inline, 0 general)