summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swift/QtUI/QtHighlightEditor.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Swift/QtUI/QtHighlightEditor.cpp b/Swift/QtUI/QtHighlightEditor.cpp
index a5f49c2..5aa4560 100644
--- a/Swift/QtUI/QtHighlightEditor.cpp
+++ b/Swift/QtUI/QtHighlightEditor.cpp
@@ -166,18 +166,21 @@ void QtHighlightEditor::soundCustomSelect()
void QtHighlightEditor::onNewButtonClicked()
{
int row = getSelectedRow() + 1;
populateList();
HighlightRule newRule;
newRule.setMatchMUC(true);
highlightManager_->insertRule(row, newRule);
QListWidgetItem *item = new QListWidgetItem();
item->setText(P2QSTRING(formatShortDescription(newRule)));
+ QFont font;
+ font.setItalic(true);
+ item->setFont(font);
ui_.listWidget->insertItem(row, item);
selectRow(row);
}
void QtHighlightEditor::onDeleteButtonClicked()
{
int selectedRow = getSelectedRow();
assert(selectedRow>=0 && selectedRow<ui_.listWidget->count());
delete ui_.listWidget->takeItem(selectedRow);
@@ -213,26 +216,32 @@ void QtHighlightEditor::onDownButtonClicked() {
void QtHighlightEditor::onCurrentRowChanged(int currentRow)
{
ui_.deleteButton->setEnabled(currentRow != -1);
ui_.moveUpButton->setEnabled(currentRow != -1 && currentRow != 0);
ui_.moveDownButton->setEnabled(currentRow != -1 && currentRow != (ui_.listWidget->count()-1));
if (previousRow_ != -1) {
if (ui_.listWidget->count() > previousRow_) {
+ QFont font;
+ font.setItalic(false);
+ ui_.listWidget->item(previousRow_)->setFont(font);
highlightManager_->setRule(previousRow_, ruleFromDialog());
}
}
if (currentRow != -1) {
HighlightRule rule = highlightManager_->getRule(currentRow);
ruleToDialog(rule);
if (ui_.listWidget->currentItem()) {
+ QFont font;
+ font.setItalic(true);
+ ui_.listWidget->currentItem()->setFont(font);
ui_.listWidget->currentItem()->setText(P2QSTRING(formatShortDescription(rule)));
}
}
/* grey the dialog if we have nothing selected */
if (currentRow == -1) {
disableDialog();
}