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
@@ -13,6 +13,7 @@
#include "util/LayoutCreator.hpp"
#include "widgets/helper/Button.hpp"
#include "widgets/helper/ChannelView.hpp"
#include "widgets/helper/InvisibleSizeGrip.hpp"
#include "widgets/Scrollbar.hpp"
#include "widgets/splits/Split.hpp"
#include "widgets/splits/SplitInput.hpp"
@@ -120,8 +121,10 @@ ReplyThreadPopup::ReplyThreadPopup(bool closeAutomatically, QWidget *parent,
}
});
auto layout = LayoutCreator<QWidget>(this->getLayoutContainer())
.setLayoutType<QVBoxLayout>();
auto layers = LayoutCreator<QWidget>(this->getLayoutContainer())
.setLayoutType<QGridLayout>()
.withoutMargin();
auto layout = layers.emplace<QVBoxLayout>();
layout->setSpacing(0);
// provide draggable margin if frameless
@@ -174,6 +177,13 @@ ReplyThreadPopup::ReplyThreadPopup(bool closeAutomatically, QWidget *parent,
layout->addWidget(this->ui_.threadView, 1);
layout->addWidget(this->ui_.replyInput);
// size grip
if (closeAutomatically)
{
layers->addWidget(new InvisibleSizeGrip(this), 0, 0,
Qt::AlignRight | Qt::AlignBottom);
}
}
void ReplyThreadPopup::setThread(std::shared_ptr<MessageThread> thread)