Commit 9d0a1bba authored by Halla Rempt's avatar Halla Rempt
Browse files

Disable pixel grid action of opengl is disabled

BUG:388903
Differential Revision: https://phabricator.kde.org/D15299
CCMAIL: capriciouswalk@gmail.com

Patch by Shingo Ohtsuka, thanks!
parent fb16dc57
......@@ -802,7 +802,7 @@
<toolTip>Show Pixel Grid</toolTip>
<iconText>Show Pixel Grid</iconText>
<activationFlags>1000</activationFlags>
<activationConditions>0</activationConditions>
<activationConditions>1000</activationConditions>
<shortcut></shortcut>
<isCheckable>true</isCheckable>
<statusTip></statusTip>
......
......@@ -1388,5 +1388,5 @@ void KisViewManager::slotUpdatePixelGridAction()
KisSignalsBlocker b(d->showPixelGrid);
KisConfig cfg(true);
d->showPixelGrid->setChecked(cfg.pixelGridEnabled());
d->showPixelGrid->setChecked(cfg.pixelGridEnabled() && cfg.useOpenGL());
}
......@@ -77,7 +77,8 @@ public:
NO_CONDITION = 0,
ACTIVE_NODE_EDITABLE = 0x1,
ACTIVE_NODE_EDITABLE_PAINT_DEVICE = 0x2,
SELECTION_EDITABLE = 0x4
SELECTION_EDITABLE = 0x4,
OPENGL_ENABLED = 0x8,
};
Q_DECLARE_FLAGS(ActivationConditions, ActivationCondition)
......
......@@ -33,6 +33,7 @@
#include "KisDocument.h"
#include "kis_clipboard.h"
#include <kis_image_animation_interface.h>
#include "kis_config.h"
#include <QMenu>
#include "QFile"
......@@ -305,6 +306,10 @@ void KisActionManager::updateGUI()
}
}
KisConfig cfg(true);
if (cfg.useOpenGL()) {
conditions |= KisAction::OPENGL_ENABLED;
}
// loop through all actions in action manager and determine what should be enabled
Q_FOREACH (QPointer<KisAction> action, d->actions) {
......@@ -485,6 +490,9 @@ void KisActionManager::dumpActionFlags()
if (conditions & KisAction::SELECTION_EDITABLE) {
out << " Selection is editable\n";
}
if (conditions & KisAction::OPENGL_ENABLED) {
out << " OpenGL is enabled\n";
}
out << "\n\n";
}
}
......
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