Fix maximum size for pretty OSD when changing fonts

This commit is contained in:
Andrea Decorte 2011-05-29 19:44:03 +00:00
parent 7de618beff
commit 86c3ec269f
1 changed files with 8 additions and 0 deletions

View File

@ -117,6 +117,14 @@ OSDPretty::OSDPretty(Mode mode, QWidget *parent)
int margin = l->margin() + kDropShadowSize;
l->setMargin(margin);
// Get current screen resolution
QRect screenResolution = QApplication::desktop()->screenGeometry();
// Leave 200 px for icon
ui_->summary->setMaximumWidth(screenResolution.width()-200);
ui_->message->setMaximumWidth(screenResolution.width()-200);
// Set maximum size for the OSD, a little margin here too
setMaximumSize(screenResolution.width()-100,screenResolution.height()-100);
// Don't load settings here, they will be reloaded anyway on creation
}