fix aw geometry

This commit is contained in:
arcan1s 2014-09-21 20:43:27 +04:00
parent 830bab7cb6
commit 17c3383616
2 changed files with 4 additions and 2 deletions

View File

@ -49,6 +49,7 @@ AwesomeWidget::AwesomeWidget(QObject *parent, const QVariantList &args)
setBackgroundHints(DefaultBackground);
setAspectRatioMode(Plasma::IgnoreAspectRatio);
setHasConfigurationInterface(true);
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
// text format init
formatLine.append(QString(""));
formatLine.append(QString(""));
@ -202,9 +203,9 @@ void AwesomeWidget::init()
textLabel = new CustomLabel(this, debug);
QGraphicsProxyWidget *pw = new QGraphicsProxyWidget(this);
pw->setAttribute(Qt::WA_TranslucentBackground, true);
pw->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
pw->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
textLabel->setAttribute(Qt::WA_TranslucentBackground, true);
textLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
textLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
pw->setWidget(textLabel);
mainLayout->addItem(pw, 0, 0);

View File

@ -39,6 +39,7 @@ void AwesomeWidget::reinit()
textLabel->setPopupEnabled(true);
updateText(true);
textLabel->adjustSize();
mainLayout->itemAt(0, 0)->setGeometry(textLabel->geometry());
keys = getKeys();
foundKeys = findKeys();