Add "pin" action to usercards and reply threads (#4692)

This commit is contained in:
Mm2PL
2023-07-01 16:38:55 +00:00
committed by GitHub
parent 61566e2f4f
commit f915eab1a2
7 changed files with 43 additions and 23 deletions
+5
View File
@@ -62,6 +62,11 @@ ReplyThreadPopup::ReplyThreadPopup(bool closeAutomatically, QWidget *parent,
}
return "";
}},
{"pin",
[this](std::vector<QString> /*arguments*/) -> QString {
this->togglePinned();
return "";
}},
// these actions make no sense in the context of a reply thread, so they aren't implemented
{"execModeratorAction", nullptr},
+5
View File
@@ -231,6 +231,11 @@ UserInfoPopup::UserInfoPopup(bool closeAutomatically, QWidget *parent,
this->underlyingChannel_->sendMessage(msg);
return "";
}},
{"pin",
[this](std::vector<QString> /*arguments*/) -> QString {
this->togglePinned();
return "";
}},
// these actions make no sense in the context of a usercard, so they aren't implemented
{"reject", nullptr},
+3 -3
View File
@@ -59,9 +59,9 @@ private:
std::unique_ptr<pajlada::Signals::ScopedConnection> refreshConnection_;
// If we should close the dialog automatically if the user clicks out
// Initially set based on the "Automatically close usercard when it loses focus" setting
// If that setting is enabled, this can be toggled on and off using the pin in the top-right corner
bool closeAutomatically_;
// Set based on the "Automatically close usercard when it loses focus" setting
// Pinned status is tracked in DraggablePopup::isPinned_.
const bool closeAutomatically_;
struct {
Button *avatarButton = nullptr;