Added setting to auto close user popup (#1833)

* Set autoclose as true by default to match stable version (2.1.7) behavior
This commit is contained in:
mmb L 2020-08-08 20:43:26 +08:00 committed by GitHub
parent db666c4946
commit 208f9b093c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View file

@ -126,6 +126,7 @@ public:
BoolSetting showParts = {"/behaviour/showParts", false}; BoolSetting showParts = {"/behaviour/showParts", false};
FloatSetting mouseScrollMultiplier = {"/behaviour/mouseScrollMultiplier", FloatSetting mouseScrollMultiplier = {"/behaviour/mouseScrollMultiplier",
1.0}; 1.0};
BoolSetting autoCloseUserPopup = {"/behaviour/autoCloseUserPopup", true};
// BoolSetting twitchSeperateWriteConnection = // BoolSetting twitchSeperateWriteConnection =
// {"/behaviour/twitchSeperateWriteConnection", false}; // {"/behaviour/twitchSeperateWriteConnection", false};

View file

@ -1817,6 +1817,10 @@ void ChannelView::hideEvent(QHideEvent *)
void ChannelView::showUserInfoPopup(const QString &userName) void ChannelView::showUserInfoPopup(const QString &userName)
{ {
auto *userPopup = new UserInfoPopup; auto *userPopup = new UserInfoPopup;
if (getSettings()->autoCloseUserPopup)
{
userPopup->setActionOnFocusLoss(BaseWindow::Delete);
}
userPopup->setData(userName, this->hasSourceChannel() ? this->sourceChannel_ userPopup->setData(userName, this->hasSourceChannel() ? this->sourceChannel_
: this->channel_); : this->channel_);
QPoint offset(int(150 * this->scale()), int(70 * this->scale())); QPoint offset(int(150 * this->scale()), int(70 * this->scale()));

View file

@ -509,6 +509,8 @@ void GeneralPage::initLayout(SettingsLayout &layout)
s.mentionUsersWithComma); s.mentionUsersWithComma);
layout.addCheckbox("Show joined users (< 1000 chatters)", s.showJoins); layout.addCheckbox("Show joined users (< 1000 chatters)", s.showJoins);
layout.addCheckbox("Show parted users (< 1000 chatters)", s.showParts); layout.addCheckbox("Show parted users (< 1000 chatters)", s.showParts);
layout.addCheckbox("Automatically close user popup when it loses focus",
s.autoCloseUserPopup);
layout.addCheckbox("Lowercase domains (anti-phishing)", s.lowercaseDomains); layout.addCheckbox("Lowercase domains (anti-phishing)", s.lowercaseDomains);
layout.addCheckbox("Bold @usernames", s.boldUsernames); layout.addCheckbox("Bold @usernames", s.boldUsernames);
layout.addCheckbox("Try to find usernames without @ prefix", layout.addCheckbox("Try to find usernames without @ prefix",