Commit 83f4ce73 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Use the KisHighlightedToolButton for KoGroupButton

This makes it a tiny bit easier to see which selection option
is selected.
parent 8039b084
......@@ -80,7 +80,7 @@
#include "tool/kis_tool.h"
#include "kis_signals_blocker.h"
#include "kis_action_manager.h"
#include "kis_highlighted_button.h"
#include "KisHighlightedToolButton.h"
typedef KoResourceServerSimpleConstruction<KisPaintOpPreset, SharedPointerStoragePolicy<KisPaintOpPresetSP> > KisPaintOpPresetResourceServer;
typedef KoResourceServerAdapter<KisPaintOpPreset, SharedPointerStoragePolicy<KisPaintOpPresetSP> > KisPaintOpPresetResourceServerAdapter;
......
......@@ -27,7 +27,7 @@
#include "KisViewManager.h"
#include "kactioncollection.h"
#include "kis_tool_button.h"
#include "kis_highlighted_button.h"
#include "KisHighlightedToolButton.h"
#include <KisColorSelectorInterface.h>
class KisFavoriteResourceManager;
......
......@@ -16,22 +16,29 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __KIS_HIGHLIGHTED_BUTTON_H
#define __KIS_HIGHLIGHTED_BUTTON_H
#ifndef __KIS_HIGHLIGHTED_TOOL_BUTTON_H
#define __KIS_HIGHLIGHTED_TOOL_BUTTON_H
template <class BaseButton>
class HighlightedButtonBase : public BaseButton
#include <QToolButton>
#include "kritawidgetutils_export.h"
class KRITAWIDGETUTILS_EXPORT KisHighlightedToolButton : public QToolButton
{
public:
HighlightedButtonBase(QWidget *parent = 0) : BaseButton(parent) {}
KisHighlightedToolButton(QWidget *parent = 0)
: QToolButton(parent)
{
}
protected:
void checkStateSet() override {
BaseButton::checkStateSet();
QToolButton::checkStateSet();
updatePalette();
}
void nextCheckState() override {
BaseButton::nextCheckState();
QToolButton::nextCheckState();
updatePalette();
}
......@@ -48,9 +55,4 @@ private:
};
class QPushButton;
class QToolButton;
typedef HighlightedButtonBase<QPushButton> KisHighlightedButton;
typedef HighlightedButtonBase<QToolButton> KisHighlightedToolButton;
#endif /* __KIS_HIGHLIGHTED_BUTTON_H */
......@@ -17,16 +17,12 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "KoGroupButton.h"
// Qt
#include <QAction>
#include <QStyleOptionToolButton>
#include <QStylePainter>
#include <QToolButton>
// KF5
#include <KLocalizedString>
class Q_DECL_HIDDEN KoGroupButton::Private
......@@ -42,12 +38,12 @@ public:
};
KoGroupButton::KoGroupButton(GroupPosition position, QWidget* parent)
: QToolButton(parent), d(new Private(this, position))
: KisHighlightedToolButton(parent), d(new Private(this, position))
{
}
KoGroupButton::KoGroupButton(QWidget* parent)
: QToolButton(parent), d(new Private(this, NoGroup))
: KisHighlightedToolButton(parent), d(new Private(this, NoGroup))
{
}
......
......@@ -22,8 +22,7 @@
#include "kritawidgetutils_export.h"
// Qt
#include <QToolButton>
#include <KisHighlightedToolButton.h>
/**
* A thin tool button which can be visually grouped with other buttons.
......@@ -32,7 +31,7 @@
*
* For groupping layout can be used. For exclusive checkable behaviour assign QButtonGroup on the buttons.
*/
class KRITAWIDGETUTILS_EXPORT KoGroupButton : public QToolButton
class KRITAWIDGETUTILS_EXPORT KoGroupButton : public KisHighlightedToolButton
{
Q_OBJECT
Q_ENUMS( GroupPosition )
......
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