mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-23 04:33:09 +00:00
GUI: Disable download button when no item is selected in DLC browsing dialog
This commit is contained in:
parent
dd87960fe8
commit
a4329e21b9
@ -54,7 +54,7 @@ DLCsDialog::DLCsDialog() : Dialog("DownloadGames") {
|
||||
|
||||
new ButtonWidget(this, "DownloadGames.Back", _("Back"), Common::U32String(), kCloseCmd);
|
||||
new ButtonWidget(this, "DownloadGames.AllDownloads", _("All Downloads"), Common::U32String(), kAllDownloadsCmd);
|
||||
new ButtonWidget(this, "DownloadGames.Download", _("Download"), Common::U32String(), kDownloadSelectedCmd);
|
||||
_downloadButton = new ButtonWidget(this, "DownloadGames.Download", _("Download"), Common::U32String(), kDownloadSelectedCmd);
|
||||
}
|
||||
|
||||
DLCsDialog::~DLCsDialog() {
|
||||
@ -83,6 +83,23 @@ void DLCsDialog::refreshDLCList() {
|
||||
g_gui.scheduleTopDialogRedraw();
|
||||
}
|
||||
|
||||
void DLCsDialog::handleTickle() {
|
||||
// enable download button only when a list item is selected
|
||||
if (_gamesList->getSelected() == -1) {
|
||||
if (_downloadButton->isEnabled()) {
|
||||
_downloadButton->setEnabled(false);
|
||||
g_gui.scheduleTopDialogRedraw();
|
||||
}
|
||||
} else {
|
||||
if (!_downloadButton->isEnabled()) {
|
||||
_downloadButton->setEnabled(true);
|
||||
g_gui.scheduleTopDialogRedraw();
|
||||
}
|
||||
}
|
||||
|
||||
Dialog::handleTickle();
|
||||
}
|
||||
|
||||
void DLCsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
|
||||
switch (cmd) {
|
||||
case kAllDownloadsCmd: {
|
||||
|
@ -39,12 +39,14 @@ public:
|
||||
DLCsDialog();
|
||||
~DLCsDialog() override;
|
||||
|
||||
void handleTickle() override;
|
||||
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
|
||||
|
||||
void refreshDLCList();
|
||||
|
||||
private:
|
||||
ListWidget *_gamesList;
|
||||
ButtonWidget *_downloadButton;
|
||||
};
|
||||
|
||||
} // End of namespace GUI
|
||||
|
Loading…
x
Reference in New Issue
Block a user