~lubuntu-dev/lxde/lxqt-notificationd-lxde

« back to all changes in this revision

Viewing changes to src/notificationarea.cpp

  • Committer: Paulo Lieuthier
  • Date: 2014-10-23 00:53:19 UTC
  • Revision ID: git-v1:a6b718550386eefd028a783ad93da561b83e652d
Notifications must not cover the panel. Fixes lxde/lxde-qt#315.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
    connect(m_layout, SIGNAL(allNotificationsClosed()), this, SLOT(close()));
59
59
    connect(m_layout, SIGNAL(notificationAvailable()), this, SLOT(show()));
60
60
    connect(m_layout, SIGNAL(heightChanged(int)), this, SLOT(setHeight(int)));
 
61
    connect(qApp->desktop(), SIGNAL(workAreaResized(int)), SLOT(setHeight()));
61
62
}
62
63
 
63
64
void NotificationArea::setHeight(int contentHeight)
69
70
        return;
70
71
    }
71
72
 
 
73
    if (contentHeight == -1)
 
74
        contentHeight = height();
 
75
 
72
76
    // FIXME: Qt does not seem to update QDesktopWidget::primaryScreen().
73
77
    // After we change the primary screen with xrandr, Qt still returns the same value.
74
78
    // I think it's a bug of Qt.
75
 
    QDesktopWidget* desktop = qApp->desktop();
76
 
    QRect workArea = desktop->availableGeometry(desktop->primaryScreen());
 
79
    QRect workArea = qApp->desktop()->availableGeometry(qApp->desktop()->primaryScreen());
 
80
 
77
81
    int h = workArea.height();
78
82
    int safeHeight = contentHeight > h ? h : contentHeight;
79
83
    int x, y;
119
123
 
120
124
    m_spacing = spacing;
121
125
    m_layout->setSizes(m_spacing, width);
122
 
        
 
126
 
123
127
    this->setHeight(widget()->height());
124
128
}