X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Ftopicwidget.cpp;h=7d2d90bddbe2ba3985e6e35c4b82d60de777a503;hp=ab901fd6193e17d8aa40d21f99eed0e7bb6359b0;hb=9861cef46e8a052140070b4c643092f9c62aa6df;hpb=5225cf288d73e76905f85380ec52418c3b04efee diff --git a/src/qtui/topicwidget.cpp b/src/qtui/topicwidget.cpp index ab901fd6..7d2d90bd 100644 --- a/src/qtui/topicwidget.cpp +++ b/src/qtui/topicwidget.cpp @@ -32,6 +32,8 @@ TopicWidget::TopicWidget(QWidget *parent) ui.topicLineEdit->hide(); ui.topicLineEdit->installEventFilter(this); ui.topicLabel->show(); + setContentsMargins(0,0,0,0); + parent->setMinimumHeight(layout()->sizeHint().height() + 2*qApp->style()->pixelMetric(QStyle::PM_DockWidgetTitleBarButtonMargin)); } void TopicWidget::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) { @@ -74,6 +76,11 @@ void TopicWidget::switchEditable() { ui.topicEditButton->hide(); ui.topicLineEdit->show(); ui.topicLineEdit->setFocus(); + + setFixedHeight(layout()->sizeHint().height()); + // Update the dock widget too, else it won't resize in all styles... FIXME try to sanitize this + qobject_cast(parent())->setMinimumHeight(height() + 2*qApp->style()->pixelMetric(QStyle::PM_DockWidgetTitleBarButtonMargin)); + qobject_cast(parent())->adjustSize(); } void TopicWidget::switchPlain() { @@ -81,6 +88,10 @@ void TopicWidget::switchPlain() { ui.topicLabel->show(); ui.topicEditButton->show(); ui.topicLineEdit->setText(_topic); + setFixedHeight(layout()->sizeHint().height()); + // Update the dock widget too, else it won't resize in all styles... FIXME try to sanitize this + qobject_cast(parent())->setMinimumHeight(height() + 2*qApp->style()->pixelMetric(QStyle::PM_DockWidgetTitleBarButtonMargin)); + qobject_cast(parent())->adjustSize(); } // filter for the input widget to switch back to normal mode @@ -102,4 +113,3 @@ bool TopicWidget::eventFilter(QObject *obj, QEvent *event) { return false; } -