gui1: Make disabled textboxes look and behave like...

...non-editable textboxes used to do

This should solve various focus-stealing issues related to the Filter
textbox in the old-lobby since non-editable textboxes gained the
ability to have focus in 2012-12-23T06:10:31Z!shadowm@wesnoth.org.
This commit is contained in:
Ignacio R. Morelle 2012-12-29 03:24:05 +00:00
parent 7eb57b40dd
commit b1171cb3a1

View File

@ -131,7 +131,7 @@ void textbox::clear()
void textbox::draw_cursor(int pos, CVideo &video) const
{
if(show_cursor_ && editable_) {
if(show_cursor_ && editable_ && enabled()) {
SDL_Rect rect = create_rect(location().x + pos
, location().y
, 1
@ -351,7 +351,7 @@ namespace {
bool textbox::requires_event_focus(const SDL_Event* event) const
{
if(!focus_ || hidden()) {
if(!focus_ || hidden() || !enabled()) {
return false;
}
if(event == NULL) {
@ -379,6 +379,9 @@ bool textbox::requires_event_focus(const SDL_Event* event) const
void textbox::handle_event(const SDL_Event& event)
{
if(!enabled())
return;
scrollarea::handle_event(event);
if(hidden())
return;