add FixedSize to AspectRatioMode and don't show resize button when FixedSize.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=860649
This commit is contained in:
parent
4c0fcd80f7
commit
e5fe5ed0c2
3
plasma.h
3
plasma.h
@ -182,7 +182,8 @@ enum AspectRatioMode { InvalidAspectRatioMode = -1 /**< Unsetted mode used for d
|
||||
IgnoreAspectRatio = 0 /**< The applet can be freely resized */,
|
||||
KeepAspectRatio = 1 /**< The applet keeps a fixed aspect ratio */,
|
||||
Square = 2 /**< The applet is always a square */,
|
||||
ConstrainedSquare = 3 /** The applet is no wider (in horizontal formfactors) or no higher (in vertical ones) than a square*/
|
||||
ConstrainedSquare = 3 /** The applet is no wider (in horizontal formfactors) or no higher (in vertical ones) than a square */,
|
||||
FixedSize = 4 /** The applet cannot be resized */
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -275,9 +275,10 @@ void AppletHandle::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti
|
||||
break;
|
||||
}
|
||||
|
||||
if (m_applet && m_applet->aspectRatioMode() != FixedSize) {
|
||||
painter->drawPixmap(basePoint + shiftM, SmallIcon("transform-scale")); //FIXME no transform-resize icon
|
||||
|
||||
basePoint += step;
|
||||
}
|
||||
painter->drawPixmap(basePoint + shiftR, SmallIcon("transform-rotate"));
|
||||
|
||||
if (m_applet && m_applet->hasConfigurationInterface()) {
|
||||
@ -302,11 +303,13 @@ AppletHandle::ButtonType AppletHandle::mapToButton(const QPointF &point) const
|
||||
|
||||
QRectF activeArea = QRectF(basePoint, QSizeF(m_iconSize, m_iconSize));
|
||||
|
||||
if (m_applet && m_applet->aspectRatioMode() != FixedSize) {
|
||||
if (activeArea.contains(point)) {
|
||||
return ResizeButton;
|
||||
}
|
||||
|
||||
activeArea.translate(step);
|
||||
}
|
||||
|
||||
if (activeArea.contains(point)) {
|
||||
return RotateButton;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user