Add option to subscribe to and pin reply threads (#4680)
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
#include "DraggablePopup.hpp"
|
||||
#include "widgets/DraggablePopup.hpp"
|
||||
|
||||
#include "singletons/Resources.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "widgets/helper/Button.hpp"
|
||||
|
||||
#include <QMouseEvent>
|
||||
|
||||
@@ -90,4 +94,29 @@ void DraggablePopup::mouseMoveEvent(QMouseEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
Button *DraggablePopup::createPinButton()
|
||||
{
|
||||
auto *button = new Button(this);
|
||||
button->setPixmap(getTheme()->buttons.pin);
|
||||
button->setScaleIndependantSize(18, 18);
|
||||
button->setToolTip("Pin Window");
|
||||
|
||||
bool pinned = false;
|
||||
QObject::connect(
|
||||
button, &Button::leftClicked, [this, button, pinned]() mutable {
|
||||
pinned = !pinned;
|
||||
if (pinned)
|
||||
{
|
||||
this->setActionOnFocusLoss(BaseWindow::Nothing);
|
||||
button->setPixmap(getResources().buttons.pinEnabled);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->setActionOnFocusLoss(BaseWindow::Delete);
|
||||
button->setPixmap(getTheme()->buttons.pin);
|
||||
}
|
||||
});
|
||||
return button;
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
Reference in New Issue
Block a user