Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 808ba0ce authored by Laurent Montel's avatar Laurent Montel 😁

Add icons

parent 996b6610
......@@ -438,14 +438,17 @@ void SimpleStringListEditor::slotContextMenu(const QPoint &pos)
const bool hasItemsSelected = !lstSelectedItems.isEmpty();
QMenu menu(this);
if (d->mAddButton) {
menu.addAction(d->mAddButton->text(), this, &SimpleStringListEditor::slotAdd);
QAction *act = menu.addAction(d->mAddButton->text(), this, &SimpleStringListEditor::slotAdd);
act->setIcon(QIcon::fromTheme(QStringLiteral("list-add")));
}
if (d->mModifyButton && (lstSelectedItems.count() == 1)) {
menu.addAction(d->mModifyButton->text(), this, &SimpleStringListEditor::slotModify);
QAction *act = menu.addAction(d->mModifyButton->text(), this, &SimpleStringListEditor::slotModify);
act->setIcon(QIcon::fromTheme(QStringLiteral("document-edit")));
}
if (d->mRemoveButton && hasItemsSelected) {
menu.addSeparator();
menu.addAction(d->mRemoveButton->text(), this, &SimpleStringListEditor::slotRemove);
QAction *act = menu.addAction(d->mRemoveButton->text(), this, &SimpleStringListEditor::slotRemove);
act->setIcon(QIcon::fromTheme(QStringLiteral("list-remove")));
}
if (!menu.isEmpty()) {
menu.exec(d->mListBox->mapToGlobal(pos));
......
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