fixed size
This commit is contained in:
parent
ff73367efb
commit
432fd89dd3
|
@ -93,10 +93,10 @@ void NotifyWidget::update(const Notification ¬ification)
|
|||
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());
|
||||
}
|
||||
|
|
|
@ -62,7 +62,13 @@ private slots:
|
|||
|
||||
void slotLinkClicked(QString link);
|
||||
|
||||
protected:
|
||||
QSize computeSize();
|
||||
|
||||
inline float dpisScale()
|
||||
{
|
||||
return 96.0;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
|
|
Loading…
Reference in New Issue