Commit 4bc648db authored by Ralf Habacker's avatar Ralf Habacker

Fix 'Umbrello toolbar icons does not match diagram widgets and cursors running...

Fix 'Umbrello toolbar icons does not match diagram widgets and cursors running under "breeze" style'.

Icons are now integrated into umbrello binary by using a qrc file.

BUG:364120
FIXED-IN:2.19.80 (KDE Applications 16.07.80)
parent 51fca079
......@@ -25,6 +25,7 @@ if(NOT BUILD_KF5)
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(Qt4 4.4.3 REQUIRED QtCore QtGui QtXml QtTest)
......
......@@ -471,6 +471,7 @@ set(umbrellobase_SRCS
umlviewimageexportermodel.cpp
uniqueid.cpp
worktoolbar.cpp
icons.qrc
)
set(umbrellomodels_SRCS
......
......@@ -26,8 +26,12 @@
#include <kiconloader.h>
#include <QFile>
namespace Icon_Utils {
#define ICON_PREFIX QLatin1String(":/pics/")
/**
* Returns the pixmap for the given type as small icon.
* @param type the identification of the icon
......@@ -35,7 +39,11 @@ namespace Icon_Utils {
*/
QPixmap SmallIcon(IconType type)
{
return SmallIcon(toString(type));
QString icon = toString(type);
if (QFile::exists(ICON_PREFIX + icon + QLatin1String(".png")))
return QPixmap(ICON_PREFIX + icon);
else
return SmallIcon(icon);
}
/**
......@@ -45,7 +53,11 @@ QPixmap SmallIcon(IconType type)
*/
QPixmap BarIcon(IconType type)
{
return BarIcon(toString(type));
QString icon = toString(type);
if (QFile::exists(ICON_PREFIX + icon + QLatin1String(".png")))
return QPixmap(ICON_PREFIX + icon);
else
return BarIcon(icon);
}
/**
......@@ -55,7 +67,11 @@ QPixmap BarIcon(IconType type)
*/
QPixmap MainBarIcon(IconType type)
{
return MainBarIcon(toString(type));
QString icon = toString(type);
if (QFile::exists(ICON_PREFIX + icon + QLatin1String(".png")))
return QPixmap(ICON_PREFIX + icon);
else
return MainBarIcon(icon);
}
/**
......@@ -65,7 +81,11 @@ QPixmap MainBarIcon(IconType type)
*/
QPixmap UserIcon(IconType type)
{
return UserIcon(toString(type));
QString icon = toString(type);
if (QFile::exists(ICON_PREFIX + icon + QLatin1String(".png")))
return QPixmap(ICON_PREFIX + icon);
else
return UserIcon(icon);
}
/**
......@@ -75,7 +95,11 @@ QPixmap UserIcon(IconType type)
*/
QPixmap DesktopIcon(IconType type)
{
return DesktopIcon(toString(type));
QString icon = toString(type);
if (QFile::exists(ICON_PREFIX + icon + QLatin1String(".png")))
return QPixmap(ICON_PREFIX + icon);
else
return DesktopIcon(icon);
}
/**
......
<RCC>
<qresource prefix="/">
<file>pics/accept_signal.png</file>
<file>pics/accept_time_event.png</file>
<file>pics/activity-fork.png</file>
<file>pics/actor.png</file>
<file>pics/aggregation.png</file>
<file>pics/align-horizontal-center.png</file>
<file>pics/align-horizontal-left.png</file>
<file>pics/align-horizontal-right.png</file>
<file>pics/align-vertical-bottom.png</file>
<file>pics/align-vertical-center.png</file>
<file>pics/align-vertical-top.png</file>
<file>pics/anchor.png</file>
<file>pics/andline.png</file>
<file>pics/arrow.png</file>
<file>pics/artifact.png</file>
<file>pics/association.png</file>
<file>pics/box.png</file>
<file>pics/branch.png</file>
<file>pics/category2parent.png</file>
<file>pics/category.png</file>
<file>pics/check_constraint.png</file>
<file>pics/child2category.png</file>
<file>pics/choice-rhomb.png</file>
<file>pics/choice-round.png</file>
<file>pics/class-or-package.png</file>
<file>pics/class.png</file>
<file>pics/combined_fragment.png</file>
<file>pics/component.png</file>
<file>pics/composition.png</file>
<file>pics/containment.png</file>
<file>pics/cursor-accept_signal.png</file>
<file>pics/cursor-accept_time_event.png</file>
<file>pics/cursor-activity-fork.png</file>
<file>pics/cursor-actor.png</file>
<file>pics/cursor-aggregation.png</file>
<file>pics/cursor-anchor.png</file>
<file>pics/cursor-andline.png</file>
<file>pics/cursor-artifact.png</file>
<file>pics/cursor-association.png</file>
<file>pics/cursor-box.png</file>
<file>pics/cursor-branch.png</file>
<file>pics/cursor-category2parent.png</file>
<file>pics/cursor-category.png</file>
<file>pics/cursor-child2category.png</file>
<file>pics/cursor-choice-rhomb.png</file>
<file>pics/cursor-choice-round.png</file>
<file>pics/cursor-class.png</file>
<file>pics/cursor-combined_fragment.png</file>
<file>pics/cursor-component.png</file>
<file>pics/cursor-composition.png</file>
<file>pics/cursor-containment.png</file>
<file>pics/cursor-datatype.png</file>
<file>pics/cursor-deep-history.png</file>
<file>pics/cursor-dependency.png</file>
<file>pics/cursor-end_of_life.png</file>
<file>pics/cursor-end_state.png</file>
<file>pics/cursor-entity.png</file>
<file>pics/cursor-enum.png</file>
<file>pics/cursor-exception.png</file>
<file>pics/cursor-final_activity.png</file>
<file>pics/cursor-generalisation.png</file>
<file>pics/cursor-initial_state.png</file>
<file>pics/cursor-interface.png</file>
<file>pics/cursor-join.png</file>
<file>pics/cursor-junction.png</file>
<file>pics/cursor-node.png</file>
<file>pics/cursor-note.png</file>
<file>pics/cursor-object_node.png</file>
<file>pics/cursor-object.png</file>
<file>pics/cursor-package.png</file>
<file>pics/cursor-pin.png</file>
<file>pics/cursor-precondition.png</file>
<file>pics/cursor-PrePostCondition.png</file>
<file>pics/cursor-region.png</file>
<file>pics/cursor-relationship.png</file>
<file>pics/cursor-send_signal.png</file>
<file>pics/cursor-shallow-history.png</file>
<file>pics/cursor-state-fork.png</file>
<file>pics/cursor-text.png</file>
<file>pics/cursor-umbr-coll-message-asynchronous.png</file>
<file>pics/cursor-umbr-coll-message-synchronous.png</file>
<file>pics/cursor-umbr-message-asynchronous.png</file>
<file>pics/cursor-umbr-message-found.png</file>
<file>pics/cursor-umbr-message-lost.png</file>
<file>pics/cursor-umbr-message-synchronous.png</file>
<file>pics/cursor-uniassociation.png</file>
<file>pics/cursor-usecase.png</file>
<file>pics/CVglobal_meth.png</file>
<file>pics/CVglobal_var.png</file>
<file>pics/CVimplementation_meth.png</file>
<file>pics/CVimplementation_signal.png</file>
<file>pics/CVimplementation_slot.png</file>
<file>pics/CVimplementation_var.png</file>
<file>pics/CVprivate_meth.png</file>
<file>pics/CVprivate_signal.png</file>
<file>pics/CVprivate_slot.png</file>
<file>pics/CVprivate_var.png</file>
<file>pics/CVprotected_meth.png</file>
<file>pics/CVprotected_signal.png</file>
<file>pics/CVprotected_slot.png</file>
<file>pics/CVprotected_var.png</file>
<file>pics/CVpublic_meth.png</file>
<file>pics/CVpublic_signal.png</file>
<file>pics/CVpublic_slot.png</file>
<file>pics/CVpublic_var.png</file>
<file>pics/CVstruct.png</file>
<file>pics/datatype.png</file>
<file>pics/deep-history.png</file>
<file>pics/dependency.png</file>
<file>pics/distribute-horizontal.png</file>
<file>pics/distribute-vertical.png</file>
<file>pics/end_of_life.png</file>
<file>pics/end_state.png</file>
<file>pics/entity.png</file>
<file>pics/enum.png</file>
<file>pics/exception.png</file>
<file>pics/final_activity.png</file>
<file>pics/foreignkey_constraint.png</file>
<file>pics/generalisation.png</file>
<file>pics/global/128-apps-umbrello.png</file>
<file>pics/global/16-apps-umbrello.png</file>
<file>pics/global/16-mimetypes-application-x-uml.png</file>
<file>pics/global/22-apps-umbrello.png</file>
<file>pics/global/32-apps-umbrello.png</file>
<file>pics/global/32-mimetypes-application-x-uml.png</file>
<file>pics/global/48-apps-umbrello.png</file>
<file>pics/global/64-apps-umbrello.png</file>
<file alias="pics/umbrello_diagram_activity.png">pics/hi16-actions-umbrello_diagram_activity.png</file>
<file alias="pics/umbrello_diagram_class.png">pics/hi16-actions-umbrello_diagram_class.png</file>
<file alias="pics/umbrello_diagram_collaboration.png">pics/hi16-actions-umbrello_diagram_collaboration.png</file>
<file alias="pics/umbrello_diagram_component.png">pics/hi16-actions-umbrello_diagram_component.png</file>
<file alias="pics/umbrello_diagram_deployment.png">pics/hi16-actions-umbrello_diagram_deployment.png</file>
<file alias="pics/umbrello_diagram_sequence.png">pics/hi16-actions-umbrello_diagram_sequence.png</file>
<file alias="pics/umbrello_diagram_state.png">pics/hi16-actions-umbrello_diagram_state.png</file>
<file alias="pics/umbrello_diagram_usecase.png">pics/hi16-actions-umbrello_diagram_usecase.png</file>
<file alias="pics/umbrello_diagram_activity.png">pics/hi22-actions-umbrello_diagram_activity.png</file>
<file>pics/initial_state.png</file>
<file>pics/interface.png</file>
<file>pics/join.png</file>
<file>pics/junction.png</file>
<file>pics/node.png</file>
<file>pics/note.png</file>
<file>pics/object_node.png</file>
<file>pics/object.png</file>
<file>pics/package.png</file>
<file>pics/pin.png</file>
<file>pics/port.png</file>
<file>pics/precondition.png</file>
<file>pics/PrePostCondition.png</file>
<file>pics/primarykey_constraint.png</file>
<file>pics/realization.png</file>
<file>pics/refactor.png</file>
<file>pics/region.png</file>
<file>pics/relationship.png</file>
<file>pics/send_signal.png</file>
<file>pics/shallow-history.png</file>
<file>pics/startlogo.png</file>
<file>pics/state-fork.png</file>
<file>pics/subsystem.png</file>
<file>pics/template.png</file>
<file>pics/text.png</file>
<file>pics/umbr-coll-message-asynchronous.png</file>
<file>pics/umbr-coll-message-synchronous.png</file>
<file>pics/umbr-message-asynchronous.png</file>
<file>pics/umbr-message-found.png</file>
<file>pics/umbr-message-lost.png</file>
<file>pics/umbr-message-synchronous.png</file>
<file>pics/uniassociation.png</file>
<file>pics/unique_constraint.png</file>
<file>pics/usecase.png</file>
</qresource>
</RCC>
......@@ -176,6 +176,7 @@ int main(int argc, char *argv[])
KCmdLineArgs::addCmdLineOptions(options); // Add our own options.
KApplication app;
#endif
Q_INIT_RESOURCE(icons);
QPointer<UMLApp> uml;
if (app.isSessionRestored()) {
......
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