From 86c3ec269fb444f00e3301eff196106577e035b9 Mon Sep 17 00:00:00 2001 From: Andrea Decorte Date: Sun, 29 May 2011 19:44:03 +0000 Subject: [PATCH] Fix maximum size for pretty OSD when changing fonts --- src/widgets/osdpretty.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/widgets/osdpretty.cpp b/src/widgets/osdpretty.cpp index ae993c917..76dc029a6 100644 --- a/src/widgets/osdpretty.cpp +++ b/src/widgets/osdpretty.cpp @@ -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 }