text editor: enable/disable the erase button in the color dialog properly.

The button to erase a selected color in the Fonts & Colors
(groupbox 'color scheme') was not set enabled if a color was selected,
neither was it disabled if a color had been removed using the button.

Fixes: 254202
This commit is contained in:
Daniel Molkentin
2009-05-26 14:58:28 +02:00
parent f4ba8f1de3
commit da2c44ee02

View File

@@ -320,6 +320,7 @@ void FontSettingsPage::changeBackColor()
if (!newColor.isValid())
return;
d_ptr->ui.backgroundToolButton->setStyleSheet(colorButtonStyleSheet(newColor));
d_ptr->ui.eraseBackgroundToolButton->setEnabled(true);
const int numFormats = d_ptr->m_descriptions.size();
for (int i = 0; i < numFormats; i++) {
@@ -344,6 +345,7 @@ void FontSettingsPage::eraseBackColor()
if (!items.isEmpty() && items.first()->isSelected())
d_ptr->m_value.formatFor(d_ptr->m_descriptions[i].name()).setBackground(newColor);
}
d_ptr->ui.eraseBackgroundToolButton->setEnabled(false);
updatePreview();
}