diff options
author | leo78913 <leo3758@riseup.net> | 2022-12-06 20:10:30 -0300 |
---|---|---|
committer | leo78913 <leo3758@riseup.net> | 2022-12-06 20:10:30 -0300 |
commit | 8036272e87d62e292e78999f4095bf3d5ca89aa9 (patch) | |
tree | d3adb0751c468ee1eb895aca5d45b8cc23489b0c /launcher/ui/dialogs | |
parent | 5ae044db93373e20add854e3be48e59e6c38421b (diff) | |
download | PrismLauncher-8036272e87d62e292e78999f4095bf3d5ca89aa9.tar.gz PrismLauncher-8036272e87d62e292e78999f4095bf3d5ca89aa9.tar.bz2 PrismLauncher-8036272e87d62e292e78999f4095bf3d5ca89aa9.zip |
fix: disable remove icon button for default icons
pressing this button in the icon picker dialog when a default icon is selected does nothing so why not disable it
Signed-off-by: leo78913 <leo3758@riseup.net>
Diffstat (limited to 'launcher/ui/dialogs')
-rw-r--r-- | launcher/ui/dialogs/IconPickerDialog.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/launcher/ui/dialogs/IconPickerDialog.cpp b/launcher/ui/dialogs/IconPickerDialog.cpp index fcb645db..55ff00f7 100644 --- a/launcher/ui/dialogs/IconPickerDialog.cpp +++ b/launcher/ui/dialogs/IconPickerDialog.cpp @@ -64,6 +64,7 @@ IconPickerDialog::IconPickerDialog(QWidget *parent) // NOTE: ResetRole forces the button to be on the left, while the OK/Cancel ones are on the right. We win. auto buttonAdd = ui->buttonBox->addButton(tr("Add Icon"), QDialogButtonBox::ResetRole); auto buttonRemove = ui->buttonBox->addButton(tr("Remove Icon"), QDialogButtonBox::ResetRole); + buttonRemove->setObjectName("buttonRemove"); connect(buttonAdd, SIGNAL(clicked(bool)), SLOT(addNewIcon())); connect(buttonRemove, SIGNAL(clicked(bool)), SLOT(removeSelectedIcon())); @@ -129,6 +130,8 @@ void IconPickerDialog::selectionChanged(QItemSelection selected, QItemSelection if (!key.isEmpty()) { selectedIconKey = key; } + auto buttonRemove = ui->buttonBox->findChild<QPushButton *>("buttonRemove"); + buttonRemove->setEnabled(APPLICATION->icons()->iconFileExists(selectedIconKey)); } int IconPickerDialog::execWithSelection(QString selection) |