fixed size

This commit is contained in:
Patrick von Reth 2014-07-03 18:24:28 +02:00
parent ff73367efb
commit 432fd89dd3
2 changed files with 16 additions and 3 deletions

View File

@ -93,10 +93,10 @@ void NotifyWidget::update(const Notification &notification)
m_notification = notification;
QRect desktop = QDesktopWidget().availableGeometry();
float scale = 96.0;
resize(width() * logicalDpiX() / scale, height() * logicalDpiY() / scale);
int space = 10 * logicalDpiY() / scale;
resize(computeSize());
int space = 10 * logicalDpiY() / dpisScale();
m_dest = QPoint(desktop.topRight().x() - width(), desktop.topRight().y() + space + (space + height()) * m_id);
m_start = QPoint(desktop.topRight().x(), m_dest.y());
@ -209,3 +209,10 @@ void NotifyWidget::slotLinkClicked(QString link)
{
QDesktopServices::openUrl( QUrl(link));
}
QSize NotifyWidget::computeSize()
{
int width = 365;
int height = 100;
return QSize(width * logicalDpiX() / dpisScale(), height * logicalDpiY() / dpisScale());
}

View File

@ -62,7 +62,13 @@ private slots:
void slotLinkClicked(QString link);
protected:
QSize computeSize();
inline float dpisScale()
{
return 96.0;
}
private: