Commit 8ef6ef75 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Add some more icons

parent 5ae0fac4
......@@ -31,11 +31,13 @@ QString Icons::actionIcon(const QString &actionName)
return icon;
}
static QHash<QString, QString> s_icons {
static const QHash<QString, QString> s_icons {
{QStringLiteral("image-new"), QStringLiteral("document-new")}, // Gimp "New" item
{QStringLiteral("new-window"), QStringLiteral("window-new")},
{QStringLiteral("newwindow"), QStringLiteral("window-new")},
{QStringLiteral("new-tab"), QStringLiteral("tab-new")},
{QStringLiteral("open"), QStringLiteral("document-open")},
{QStringLiteral("open-location"), QStringLiteral("document-open-remote")},
{QStringLiteral("save"), QStringLiteral("document-save")},
{QStringLiteral("save-as"), QStringLiteral("document-save-as")},
{QStringLiteral("saveas"), QStringLiteral("document-save-as")},
......@@ -45,6 +47,8 @@ QString Icons::actionIcon(const QString &actionName)
{QStringLiteral("exportto"), QStringLiteral("document-export")}, // LibreOffice
{QStringLiteral("printpreview"), QStringLiteral("document-print-preview")},
{QStringLiteral("print"), QStringLiteral("document-print")},
{QStringLiteral("print-gtk"), QStringLiteral("document-print")}, // Gimp
{QStringLiteral("mail-image"), QStringLiteral("mail-message-new")}, // Gimp
{QStringLiteral("close"), QStringLiteral("document-close")},
{QStringLiteral("closedoc"), QStringLiteral("document-close")},
{QStringLiteral("close-all"), QStringLiteral("document-close")},
......@@ -59,6 +63,7 @@ QString Icons::actionIcon(const QString &actionName)
{QStringLiteral("duplicate"), QStringLiteral("edit-duplicate")},
{QStringLiteral("preferences"), QStringLiteral("settings-configure")},
{QStringLiteral("keyboard-shortcuts"), QStringLiteral("configure-shortcuts")},
{QStringLiteral("fullscreen"), QStringLiteral("view-fullscreen")},
......@@ -67,15 +72,30 @@ QString Icons::actionIcon(const QString &actionName)
{QStringLiteral("searchdialog"), QStringLiteral("edit-find-replace")}, // LibreOffice
{QStringLiteral("select-all"), QStringLiteral("edit-select-all")},
{QStringLiteral("selectall"), QStringLiteral("edit-select-all")},
{QStringLiteral("select-none"), QStringLiteral("edit-select-invert")},
{QStringLiteral("select-invert"), QStringLiteral("edit-select-invert")},
{QStringLiteral("increasesize"), QStringLiteral("zoom-in")},
{QStringLiteral("decreasesize"), QStringLiteral("zoom-out")},
{QStringLiteral("zoom-in"), QStringLiteral("zoom-in")},
{QStringLiteral("zoom-out"), QStringLiteral("zoom-out")},
{QStringLiteral("zoomfit"), QStringLiteral("zoom-fit-best")},
{QStringLiteral("zoom-fit-in"), QStringLiteral("zoom-fit-best")},
{QStringLiteral("show-guides"), QStringLiteral("show-guides")},
{QStringLiteral("show-grid"), QStringLiteral("show-grid")},
{QStringLiteral("rotateclockwise"), QStringLiteral("object-rotate-right")},
{QStringLiteral("rotatecounterclockwise"), QStringLiteral("object-rotate-left")},
{QStringLiteral("fliphorizontally"), QStringLiteral("object-flip-horizontal")},
{QStringLiteral("image-flip-horizontal"), QStringLiteral("object-flip-horizontal")},
{QStringLiteral("flipvertically"), QStringLiteral("object-flip-vertical")},
{QStringLiteral("image-flip-vertical"), QStringLiteral("object-flip-vertical")},
{QStringLiteral("image-scale"), QStringLiteral("transform-scale")},
{QStringLiteral("layers-new"), QStringLiteral("layer-new")},
{QStringLiteral("layers-duplicate"), QStringLiteral("layer-duplicate")},
{QStringLiteral("layers-delete"), QStringLiteral("layer-delete")},
{QStringLiteral("layers-anchor"), QStringLiteral("anchor")},
{QStringLiteral("slideshow"), QStringLiteral("media-playback-start")}, // Gwenview uses this icon for that
{QStringLiteral("playvideo"), QStringLiteral("media-playback-start")},
......@@ -90,11 +110,24 @@ QString Icons::actionIcon(const QString &actionName)
{QStringLiteral("redeye"), QStringLiteral("redeyes")},
{QStringLiteral("crop"), QStringLiteral("transform-crop")},
{QStringLiteral("move"), QStringLiteral("transform-move")},
{QStringLiteral("rotate"), QStringLiteral("transform-rotate")},
{QStringLiteral("scale"), QStringLiteral("transform-scale")},
{QStringLiteral("shear"), QStringLiteral("transform-shear")},
{QStringLiteral("flip"), QStringLiteral("object-flip-horizontal")},
{QStringLiteral("flag"), QStringLiteral("flag-red")}, // is there a "mark" or "important" icon that isn't email?
{QStringLiteral("tools-measure"), QStringLiteral("measure")},
{QStringLiteral("tools-text"), QStringLiteral("draw-text")},
{QStringLiteral("tools-color-picker"), QStringLiteral("color-picker")},
{QStringLiteral("tools-paintbrush"), QStringLiteral("draw-brush")},
{QStringLiteral("tools-eraser"), QStringLiteral("draw-eraser")},
{QStringLiteral("tools-paintbrush"), QStringLiteral("draw-brush")},
{QStringLiteral("help"), QStringLiteral("help-contents")},
{QStringLiteral("helpindex"), QStringLiteral("help-contents")},
{QStringLiteral("helpcontents"), QStringLiteral("help-contents")},
{QStringLiteral("context-help"), QStringLiteral("help-whatsthis")},
{QStringLiteral("helpreportproblem"), QStringLiteral("tools-report-bug")},
{QStringLiteral("sendfeedback"), QStringLiteral("tools-report-bug")}, // LibreOffice
{QStringLiteral("about"), QStringLiteral("help-about")},
......@@ -107,7 +140,7 @@ QString Icons::actionIcon(const QString &actionName)
if (icon.isEmpty()) {
const int dotIndex = action.indexOf(QLatin1Char('.')); // app., win., or unity. prefix
if (dotIndex > 0) {
if (dotIndex > -1) {
action = action.mid(dotIndex + 1);
}
......@@ -132,6 +165,31 @@ QString Icons::actionIcon(const QString &actionName)
icon = s_icons.value(action);
}
if (icon.isEmpty()) {
static const auto s_prefixes = QStringList{ // Gimp with appmenu-gtk
QStringLiteral("file-"),
QStringLiteral("edit-"),
QStringLiteral("view-"),
QStringLiteral("image-"),
QStringLiteral("layers-"),
QStringLiteral("colors-"),
QStringLiteral("tools-"),
QStringLiteral("plug-in-"),
QStringLiteral("windows-"),
QStringLiteral("dialogs-"),
QStringLiteral("help-"),
};
for (const QString &prefix : s_prefixes) {
if (action.startsWith(prefix)) {
action = action.mid(prefix.length());
break;
}
}
icon = s_icons.value(action);
}
if (icon.isEmpty()) {
action = action.toLower();
icon = s_icons.value(action);
......
Supports Markdown
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