mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-02 20:01:21 +00:00
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:
parent
7eb57b40dd
commit
b1171cb3a1
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user