Commit e284aa29 authored by Laurent Montel's avatar Laurent Montel 😁

Fix enable/disable up/down button

parent c80318d0
...@@ -150,6 +150,9 @@ TimeScaleConfigDialog::~TimeScaleConfigDialog() ...@@ -150,6 +150,9 @@ TimeScaleConfigDialog::~TimeScaleConfigDialog()
void TimeScaleConfigDialog::slotUpdateButton() void TimeScaleConfigDialog::slotUpdateButton()
{ {
removeButton->setEnabled(listWidget->currentItem()); removeButton->setEnabled(listWidget->currentItem());
const bool numberElementMoreThanOneElement = (listWidget->count() > 1);
upButton->setEnabled(numberElementMoreThanOneElement && (listWidget->currentRow() >= 1));
downButton->setEnabled(numberElementMoreThanOneElement && (listWidget->currentRow() < listWidget->count() - 1));
} }
void TimeScaleConfigDialog::okClicked() void TimeScaleConfigDialog::okClicked()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment