From 8036272e87d62e292e78999f4095bf3d5ca89aa9 Mon Sep 17 00:00:00 2001 From: leo78913 Date: Tue, 6 Dec 2022 20:10:30 -0300 Subject: [PATCH] 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 --- launcher/ui/dialogs/IconPickerDialog.cpp | 3 +++ 1 file changed, 3 insertions(+) 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("buttonRemove"); + buttonRemove->setEnabled(APPLICATION->icons()->iconFileExists(selectedIconKey)); } int IconPickerDialog::execWithSelection(QString selection)