Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_color_label_selector_widget.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2015 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef __KIS_COLOR_LABEL_SELECTOR_WIDGET_H
8#define __KIS_COLOR_LABEL_SELECTOR_WIDGET_H
9
10#include <QScopedPointer>
11#include <QWidget>
12
13#include "kritaui_export.h"
14
15
16class KRITAUI_EXPORT KisColorLabelSelectorWidget : public QWidget
17{
18 Q_OBJECT
19
20public:
33
34 KisColorLabelSelectorWidget(QWidget *parent = nullptr);
36
40 bool isButtonChecked(int index) const;
46 int currentIndex() const;
50 QList<int> selection() const;
51
55 bool exclusive() const;
60 void setExclusive(bool exclusive);
61
66 bool buttonWrapEnabled() const;
71 void setButtonWrapEnabled(bool enabled);
72
76 bool mouseDragEnabled() const;
80 void setMouseDragEnabled(bool enabled);
81
85 SelectionIndicationType selectionIndicationType() const;
89 void setSelectionIndicationType(SelectionIndicationType type);
90
94 int buttonSize() const;
98 void setButtonSize(int size);
99
100public Q_SLOTS:
104 void setButtonChecked(int index, bool state);
109 void setCurrentIndex(int index);
113 void setSelection(const QList<int> &indices);
114
115Q_SIGNALS:
116 void buttonToggled(int index, bool state);
117 void currentIndexChanged(int index);
119
120private:
121 struct Private;
122 QScopedPointer<Private> m_d;
123};
124
125
126class KRITAUI_EXPORT KisColorLabelSelectorWidgetMenuWrapper : public QWidget
127{
128 Q_OBJECT
129
130public:
131 KisColorLabelSelectorWidgetMenuWrapper(QWidget *parent = nullptr);
133
134 KisColorLabelSelectorWidget* colorLabelSelector() const;
135
136 void showEvent(QShowEvent* e) override;
137
138 int calculateMenuOffset() const;
139
140private:
141 struct Private;
142 QScopedPointer<Private> m_d;
143};
144
145#endif /* __KIS_COLOR_LABEL_SELECTOR_WIDGET_H */
static int buttonSize(int screen)
Definition KoToolBox.cpp:41
void buttonToggled(int index, bool state)
void currentIndexChanged(int index)
@ FillIn
The buttons show a border and their interior is filled when selected and empty when not selected.