12#include <QResizeEvent>
16#include <klocalizedstring.h>
17#include <qnamespace.h>
32 QGridLayout* l =
new QGridLayout(
this);
35 l->getContentsMargins(&left,
nullptr,
nullptr,
nullptr);
36 l->setContentsMargins(left, 0, 30, 0);
41 m_currentLine->setAttribute(Qt::WA_TransparentForMouseEvents);
56 QComboBox::hidePopup();
62 QComboBox::showPopup();
65 const int widgetMargin = 20;
66 QScreen *screen = qApp->screenAt(QCursor::pos());
69 fitRect =
kisGrowRect(screen->availableGeometry(), -widgetMargin);
72 fitRect =
kisGrowRect(QRect(0, 0, 1024, 768), -widgetMargin);
74 QRect popupRect =
m_popup->rect();
75 popupRect.moveTo(mapToGlobal(QPoint()));
78 m_popup->move(popupRect.topLeft());
96 for(
int i=0; i<
m_popup->layout()->count(); i++) {
108 m_popup->setMinimumWidth(qMax(280, width()));
109 m_popup->setMaximumWidth(qMax(280, width()));
115 for(
int i=0; i<
m_popup->layout()->count(); i++) {
120 item->setMaximumHeight(30);
121 item->setMinimumHeight(30);
132 for(
int i=0; i<
m_popup->layout()->count(); i++) {
145 for(
int i=0; i<
m_popup->layout()->count(); i++) {
158 for(
int i=0; i<
m_popup->layout()->count(); i++) {
void setLineNumber(int n)
KisShadeSelectorLineComboBoxPopup * m_popup
void setLineHeight(int height)
KisShadeSelectorLine * m_currentLine
~KisShadeSelectorLineComboBox() override
KisShadeSelectorLineComboBox(QWidget *parent=0)
void resizeEvent(QResizeEvent *e) override
QString configuration() const
void setConfiguration(const QString &stri)
void hidePopup() override
void setLineNumber(int n)
void showPopup() override
void setPatchCount(int count)
void fromString(const QString &string) override
void setColor(const KoColor &color)
QString toString() const override
void fromQColor(const QColor &c)
Convenient function for converting from a QColor.
T kisGrowRect(const T &rect, U offset)
QRect kisEnsureInRect(QRect rc, const QRect &bounds)