Add (invisible) resize handle to frameless usercards and reply threads (#4795)

* feat: add resize handle to usercards&reply threads

* Add changelog entry

---------

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
nerix
2023-09-17 13:27:20 +02:00
committed by GitHub
parent f13a3b9685
commit dc62e8248b
6 changed files with 59 additions and 4 deletions
+12 -2
View File
@@ -26,6 +26,7 @@
#include "util/StreamerMode.hpp"
#include "widgets/helper/ChannelView.hpp"
#include "widgets/helper/EffectLabel.hpp"
#include "widgets/helper/InvisibleSizeGrip.hpp"
#include "widgets/helper/Line.hpp"
#include "widgets/Label.hpp"
#include "widgets/Scrollbar.hpp"
@@ -246,8 +247,10 @@ UserInfoPopup::UserInfoPopup(bool closeAutomatically, QWidget *parent,
this->shortcuts_ = getApp()->hotkeys->shortcutsForCategory(
HotkeyCategory::PopupWindow, actions, this);
auto layout = LayoutCreator<QWidget>(this->getLayoutContainer())
.setLayoutType<QVBoxLayout>();
auto layers = LayoutCreator<QWidget>(this->getLayoutContainer())
.setLayoutType<QGridLayout>()
.withoutMargin();
auto layout = layers.emplace<QVBoxLayout>();
// first line
auto head = layout.emplace<QHBoxLayout>().withoutMargin();
@@ -552,6 +555,13 @@ UserInfoPopup::UserInfoPopup(bool closeAutomatically, QWidget *parent,
logs->setAlignment(this->ui_.noMessagesLabel, Qt::AlignHCenter);
}
// size grip
if (closeAutomatically)
{
layers->addWidget(new InvisibleSizeGrip(this), 0, 0,
Qt::AlignRight | Qt::AlignBottom);
}
this->installEvents();
this->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Policy::Ignored);
}