mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 10:22:49 +00:00
kcontrol: take margins into account when drawing in desktoptheme KCM
otherwise some look off Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
a62e897f42
commit
513f747ff9
1 changed files with 7 additions and 2 deletions
|
@ -181,8 +181,13 @@ void ThemeDelegate::paint(QPainter *painter,
|
||||||
// draw image
|
// draw image
|
||||||
Plasma::FrameSvg *svg = static_cast<Plasma::FrameSvg *>(
|
Plasma::FrameSvg *svg = static_cast<Plasma::FrameSvg *>(
|
||||||
index.model()->data(index, ThemeModel::SvgRole).value<void *>());
|
index.model()->data(index, ThemeModel::SvgRole).value<void *>());
|
||||||
svg->resizeFrame(QSize(option.rect.width() - (2 * MARGIN), 100 - (2 * MARGIN)));
|
qreal left = 0.0;
|
||||||
svg->paintFrame(painter, QPoint(option.rect.left() + MARGIN, option.rect.top() + MARGIN));
|
qreal top = 0.0;
|
||||||
|
qreal right = 0.0;
|
||||||
|
qreal bottom = 0.0;
|
||||||
|
svg->getMargins(left, top, right, bottom);
|
||||||
|
svg->resizeFrame(QSize(option.rect.width() - (2 * MARGIN) + (2 * left), 100 - (2 * MARGIN) + (2 * top)));
|
||||||
|
svg->paintFrame(painter, QPoint(option.rect.left() - left + MARGIN, option.rect.top() - top + MARGIN));
|
||||||
|
|
||||||
// draw text
|
// draw text
|
||||||
painter->save();
|
painter->save();
|
||||||
|
|
Loading…
Add table
Reference in a new issue