Some UI code refactoring.

Since 'repeat' is now enabled below the UI level, we no longer need to track key presses.
This commit is contained in:
Stephen Anthony 2019-06-15 19:58:45 -02:30
parent 802b5a33bc
commit 5e6db1be0d
4 changed files with 2 additions and 16 deletions

View File

@ -664,8 +664,7 @@ void DebuggerDialog::addRomArea()
Common::Rect DebuggerDialog::getTiaBounds() const
{
// The area showing the TIA image (NTSC and PAL supported, up to 260 lines)
Common::Rect r(0, 0, 320, std::max(260, int(_h * 0.35)));
return r;
return Common::Rect(0, 0, 320, std::max(260, int(_h * 0.35)));
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -106,8 +106,7 @@ void EditTextWidget::drawWidget(bool hilite)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Common::Rect EditTextWidget::getEditRect() const
{
Common::Rect r(2, 1, _w - 2, _h);
return r;
return Common::Rect(2, 1, _w - 2, _h);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -37,7 +37,6 @@ ListWidget::ListWidget(GuiObject* boss, const GUI::Font& font,
_selectedItem(-1),
_highlightedItem(-1),
_editMode(false),
_currentKeyDown(KBDK_UNKNOWN),
_quickSelect(quickSelect),
_quickSelectTime(0)
{
@ -321,18 +320,9 @@ bool ListWidget::handleKeyDown(StellaKey key, StellaMod mod)
}
}
_currentKeyDown = key;
return handled;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool ListWidget::handleKeyUp(StellaKey key, StellaMod mod)
{
if (key == _currentKeyDown)
_currentKeyDown = KBDK_UNKNOWN;
return true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool ListWidget::handleEvent(Event::Type e)
{

View File

@ -71,7 +71,6 @@ class ListWidget : public EditableWidget
void handleMouseWheel(int x, int y, int direction) override;
bool handleText(char text) override;
bool handleKeyDown(StellaKey key, StellaMod mod) override;
bool handleKeyUp(StellaKey key, StellaMod mod) override;
bool handleEvent(Event::Type e) override;
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
@ -100,7 +99,6 @@ class ListWidget : public EditableWidget
int _selectedItem;
int _highlightedItem;
bool _editMode;
StellaKey _currentKeyDown;
ScrollBarWidget* _scrollBar;