mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
adf3ff3075
cstdint) Make MessageElement to a class to fit better with the derived classes. Make MessageLayoutElement to a class to fit better with the derived classes. Remove virtual from override functions Replace all instances of boost::signals2 with pajlada::Signals. This lets us properly use clang code model to check for issues. Add missing virtual destructor to AbstractIrcServer Add missing virtual destructor to MessageLayoutElement Remove unused "connectedConnection" connection in TwitchChannel Fix typo in TrimChannelName function Fix typo in MessageParseArgs Replace some raw pointers with unique pointers where it made more sense. This allowed us to remove some manually written destructors whose only purpose was to delete that raw pointer. Reformat: Add namespace comments Reformat: Add empty empty lines between main namespace beginning and end Reformat: Re-order includes Reformat: Fix some includes that used quotes where they should use angle brackets Reformat: Replace some typedef's with using's Filter out more useless warnings
60 lines
1.5 KiB
C++
60 lines
1.5 KiB
C++
#include "widgets/accountswitchpopupwidget.hpp"
|
|
#include "debug/log.hpp"
|
|
#include "widgets/settingsdialog.hpp"
|
|
|
|
#include <QHBoxLayout>
|
|
#include <QLayout>
|
|
#include <QPainter>
|
|
#include <QPushButton>
|
|
#include <QVBoxLayout>
|
|
|
|
namespace chatterino {
|
|
namespace widgets {
|
|
|
|
AccountSwitchPopupWidget::AccountSwitchPopupWidget(QWidget *parent)
|
|
: QWidget(parent)
|
|
{
|
|
this->setWindowFlags(Qt::FramelessWindowHint);
|
|
|
|
this->setContentsMargins(0, 0, 0, 0);
|
|
|
|
this->ui.accountSwitchWidget = new AccountSwitchWidget(this);
|
|
QVBoxLayout *vbox = new QVBoxLayout(this);
|
|
this->ui.accountSwitchWidget->setFocusPolicy(Qt::NoFocus);
|
|
vbox->addWidget(this->ui.accountSwitchWidget);
|
|
|
|
// vbox->setSizeConstraint(QLayout::SetMinimumSize);
|
|
|
|
auto hbox = new QHBoxLayout();
|
|
auto manageAccountsButton = new QPushButton(this);
|
|
manageAccountsButton->setText("Manage Accounts");
|
|
hbox->addWidget(manageAccountsButton);
|
|
vbox->addLayout(hbox);
|
|
|
|
connect(manageAccountsButton, &QPushButton::clicked, []() {
|
|
SettingsDialog::showDialog(SettingsDialog::PreferredTab::Accounts); //
|
|
});
|
|
|
|
this->setLayout(vbox);
|
|
}
|
|
|
|
void AccountSwitchPopupWidget::refresh()
|
|
{
|
|
this->ui.accountSwitchWidget->refresh();
|
|
}
|
|
|
|
void AccountSwitchPopupWidget::focusOutEvent(QFocusEvent *)
|
|
{
|
|
this->hide();
|
|
}
|
|
|
|
void AccountSwitchPopupWidget::paintEvent(QPaintEvent *event)
|
|
{
|
|
QPainter painter(this);
|
|
|
|
painter.fillRect(this->rect(), QColor(255, 255, 255));
|
|
}
|
|
|
|
} // namespace widgets
|
|
} // namespace chatterino
|