Commit 3eba11f1 authored by Jekyll Wu's avatar Jekyll Wu
Browse files

Always show one icon to make sure items are vertically aligned

Use the "system-run" icon from F.D.O specs as the fallback,  when there is
no appropriate icon.

REVIEW: 107663
parent ae4f2580
......@@ -230,10 +230,16 @@ void KGlobalShortcutsEditor::addCollection(
editor = new KShortcutsEditor(this, d->actionTypes);
d->stack->addWidget(editor);
// try to find one appropriate icon ( allowing NULL pixmap to be returned)
QPixmap pixmap = KIconLoader::global()->loadIcon(id, KIconLoader::Small, 0,
KIconLoader::DefaultState, QStringList(), 0, true);
// if NULL pixmap is returned, use the F.D.O "system-run" icon
if (pixmap.isNull()) {
pixmap = KIconLoader::global()->loadIcon("system-run", KIconLoader::Small);
}
// Add to the component combobox
d->ui.components->addItem(KIconLoader::global()->loadIcon(id, KIconLoader::Small, 0,
KIconLoader::DefaultState, QStringList(), 0, true) // so it returns a NULL pixmap if no icon found
, friendlyName);
d->ui.components->addItem(pixmap, friendlyName);
d->ui.components->model()->sort(0);
// Add to our component registry
......
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