mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 18:32:53 +00:00
kdeplasma-addons: tweak the margin of kolourpicker applet
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
e9e482b07a
commit
e5755dcb77
1 changed files with 9 additions and 1 deletions
|
@ -38,6 +38,9 @@
|
||||||
# include <QX11Info>
|
# include <QX11Info>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// standard issue margin/spacing
|
||||||
|
static const int s_margin = 6;
|
||||||
|
|
||||||
static KMenu* buildMenuForColor(const QColor &color)
|
static KMenu* buildMenuForColor(const QColor &color)
|
||||||
{
|
{
|
||||||
KMenu *menu = new KMenu();
|
KMenu *menu = new KMenu();
|
||||||
|
@ -135,7 +138,12 @@ QIcon ColorButton::colorIcon() const
|
||||||
void ColorButton::updateColorPixmap()
|
void ColorButton::updateColorPixmap()
|
||||||
{
|
{
|
||||||
const QSizeF sizef = Plasma::ToolButton::size();
|
const QSizeF sizef = Plasma::ToolButton::size();
|
||||||
const int minsize = qRound(qMin(sizef.width(), sizef.height())) - 4;
|
const int minsize = qRound(qMin(sizef.width(), sizef.height())) - s_margin;
|
||||||
|
if (minsize < s_margin) {
|
||||||
|
// would issue a warning but will be way too much on e.g. resize
|
||||||
|
m_colorpix = QPixmap();
|
||||||
|
return;
|
||||||
|
}
|
||||||
m_colorpix = QPixmap(QSize(minsize, minsize));
|
m_colorpix = QPixmap(QSize(minsize, minsize));
|
||||||
m_colorpix.fill(QColor(Qt::transparent));
|
m_colorpix.fill(QColor(Qt::transparent));
|
||||||
QPainter p(&m_colorpix);
|
QPainter p(&m_colorpix);
|
||||||
|
|
Loading…
Add table
Reference in a new issue