forked from qt-creator/qt-creator
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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user