Fix non sdl2 builds and fix dropdown keyboard bug

This commit is contained in:
2025-07-04 22:03:38 -05:00
parent 5df32110f8
commit 4e516b5840

View File

@@ -1,4 +1,4 @@
#if defined(TESSESFRAMEWORK_ENABLE_SDL2)
#include "TessesFramework/SDL2/Views/DropDownView.hpp" #include "TessesFramework/SDL2/Views/DropDownView.hpp"
namespace Tesses::Framework::SDL2::Views { namespace Tesses::Framework::SDL2::Views {
@@ -66,7 +66,7 @@ namespace Tesses::Framework::SDL2::Views {
win->ShowPopup(pu); win->ShowPopup(pu);
} }
} }
else if(event.type == SDL_KEYDOWN) else if(event.type == SDL_KEYDOWN && this->GetViewFlag(VIEWFLAG_ISACTIVE))
{ {
switch(event.key.keysym.sym) switch(event.key.keysym.sym)
{ {
@@ -94,7 +94,7 @@ namespace Tesses::Framework::SDL2::Views {
} }
DropDownView::DropDownView() : View("--PLEASE SELECT ONE--") DropDownView::DropDownView() : View("--PLEASE SELECT ONE--")
{ {
this->hasSet=false;
} }
std::vector<std::string>& DropDownView::GetItems() std::vector<std::string>& DropDownView::GetItems()
@@ -110,4 +110,5 @@ namespace Tesses::Framework::SDL2::Views {
return this->listView.selected; return this->listView.selected;
} }
} }
#endif