diff options
Diffstat (limited to 'hoverwindow.cpp')
-rw-r--r-- | hoverwindow.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/hoverwindow.cpp b/hoverwindow.cpp index 6ca6bce..9e09728 100644 --- a/hoverwindow.cpp +++ b/hoverwindow.cpp @@ -47,14 +47,16 @@ void HoverWindow::setContent(const QString &parent, const QStringList &children) mLabel->setText(curText); } -void HoverWindow::setPixmap(const QPixmap &pm){ +void HoverWindow::setPixmap(const QPixmap &pm, bool scale){ mAlignCenter = true; QPixmap curPm = pm; - if(curPm.height() > 500){ - curPm = curPm.scaledToHeight(500); - } - if(curPm.width() > 300){ - curPm = curPm.scaledToWidth(300); + if(scale){ + if(curPm.height() > 500){ + curPm = curPm.scaledToHeight(500); + } + if(curPm.width() > 300){ + curPm = curPm.scaledToWidth(300); + } } mLabel->setPixmap(curPm); setMaximumSize(curPm.width() + 10, curPm.height() + 10); |