Commit 1bf70b45 authored by Thomas Friedrichsmeier's avatar Thomas Friedrichsmeier
Browse files

Provide fallback for menu-button icon, as it seems we can't rely on it being installed.

parent 322e8407
......@@ -5,6 +5,7 @@ INSTALL(FILES
function.png
list.png
matrix.png
menu.svg
data-numeric.png
data-factor.png
data-logical.png
......
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<!-- Created using Karbon, part of Calligra: http://www.calligra.org/karbon -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="255.119pt" height="255.119pt">
<defs/>
<g id="layer0">
<rect id="shape0" transform="translate(35.4331, 53.1497)" fill="#29373a" fill-rule="evenodd" stroke="#000000" stroke-width="1.25000000000" stroke-linecap="square" stroke-linejoin="miter" stroke-miterlimit="2.00000000000" width="198.42554060000pt" height="26.07878533600pt"/>
<rect id="shape1" transform="translate(35.4331, 141.733)" fill="#29373a" fill-rule="evenodd" stroke="#000000" stroke-width="1.25000000000" stroke-linecap="square" stroke-linejoin="miter" stroke-miterlimit="2.00000000000" width="198.42554060000pt" height="26.07878533600pt"/>
<rect id="shape2" transform="translate(35.7875, 230.315)" fill="#29373a" fill-rule="evenodd" stroke="#000000" stroke-width="1.25000000000" stroke-linecap="square" stroke-linejoin="miter" stroke-miterlimit="2.00000000000" width="198.42554060000pt" height="26.07878533600pt"/>
</g>
</svg>
......@@ -2,7 +2,7 @@
rkstandardicons - description
-------------------
begin : Wed Oct 24 2007
copyright : (C) 2007, 2009, 2010, 2011, 2015 by Thomas Friedrichsmeier
copyright : (C) 2007-2016 by Thomas Friedrichsmeier
email : thomas.friedrichsmeier@kdemail.net
***************************************************************************/
......@@ -84,6 +84,9 @@ void RKStandardIcons::initIcons () {
icons[ActionLock] = KIcon ("object-locked");
icons[ActionUnlock] = KIcon ("object-unlocked");
icons[ActionShowMenu] = QIcon::fromTheme ("application-menu");
if (icons[ActionShowMenu].isNull ()) icons[ActionShowMenu] = QIcon (rkward_icon_base + "menu.svg"); // fallback
// objects
icons[ObjectList] = QIcon (rkward_icon_base + "list.png");
icons[ObjectFunction] = QIcon (rkward_icon_base + "function.png");
......@@ -117,6 +120,7 @@ void RKStandardIcons::initIcons () {
icons[DocumentPDF] = KIcon ("application-pdf");
// KF5 TODO: The code below should work allright with QIcon::fromTheme
/* This does not work, as the icons are not really Null in this case, but some default icon. Any way to really test this?
RK_DO ({
for (int i = ActionRunAll; i < Last; ++i) {
......
......@@ -2,7 +2,7 @@
rkstandardicons - description
-------------------
begin : Wed Oct 24 2007
copyright : (C) 2007, 2009, 2010, 2011, 2015 by Thomas Friedrichsmeier
copyright : (C) 2007-2016 by Thomas Friedrichsmeier
email : thomas.friedrichsmeier@kdemail.net
***************************************************************************/
......@@ -84,6 +84,8 @@ public:
ActionLock,
ActionUnlock,
ActionShowMenu,
ObjectList,
ObjectFunction,
ObjectEnvironment,
......
......@@ -30,6 +30,7 @@
#include <klocale.h>
#include "../windows/rkmdiwindow.h"
#include "rkstandardicons.h"
#include "../debug.h"
......@@ -38,7 +39,7 @@ RKXMLGUIPreviewArea::RKXMLGUIPreviewArea (QWidget* parent) : KXmlGuiWindow (pare
menu_button = new QToolButton (this);
menu_button->setPopupMode (QToolButton::InstantPopup);
menu_button->setIcon (QIcon::fromTheme ("application-menu"));
menu_button->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionShowMenu));
menu_button->setMenu (menu = new QMenu ());
// KF5 TODO:
connect (menu, SIGNAL (aboutToShow()), this, SLOT (prepareMenu()));
......
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