BaseWindow smol refactor
This commit is contained in:
@@ -11,8 +11,7 @@
|
||||
namespace chatterino {
|
||||
|
||||
AccountSwitchPopup::AccountSwitchPopup(QWidget *parent)
|
||||
: BaseWindow(parent,
|
||||
BaseWindow::Flags(BaseWindow::TopMost | BaseWindow::Frameless))
|
||||
: BaseWindow({BaseWindow::TopMost, BaseWindow::Frameless}, parent)
|
||||
{
|
||||
#ifdef Q_OS_LINUX
|
||||
this->setWindowFlag(Qt::Popup);
|
||||
@@ -25,8 +24,6 @@ AccountSwitchPopup::AccountSwitchPopup(QWidget *parent)
|
||||
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");
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
namespace chatterino {
|
||||
|
||||
Window::Window(WindowType type)
|
||||
: BaseWindow(nullptr, BaseWindow::EnableCustomFrame)
|
||||
: BaseWindow(BaseWindow::EnableCustomFrame)
|
||||
, type_(type)
|
||||
, notebook_(new SplitNotebook(this))
|
||||
{
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace {
|
||||
} // namespace
|
||||
|
||||
EmotePopup::EmotePopup(QWidget *parent)
|
||||
: BaseWindow(parent, BaseWindow::EnableCustomFrame)
|
||||
: BaseWindow(BaseWindow::EnableCustomFrame, parent)
|
||||
{
|
||||
auto layout = new QVBoxLayout(this);
|
||||
this->getLayoutContainer()->setLayout(layout);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace chatterino {
|
||||
|
||||
NotificationPopup::NotificationPopup()
|
||||
: BaseWindow((QWidget *)nullptr, BaseWindow::Frameless)
|
||||
: BaseWindow(BaseWindow::Frameless)
|
||||
, channel_(std::make_shared<Channel>("notifications", Channel::Type::None))
|
||||
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
namespace chatterino {
|
||||
|
||||
SelectChannelDialog::SelectChannelDialog(QWidget *parent)
|
||||
: BaseWindow(parent, BaseWindow::EnableCustomFrame)
|
||||
: BaseWindow(BaseWindow::EnableCustomFrame, parent)
|
||||
, selectedChannel_(Channel::getEmpty())
|
||||
{
|
||||
this->setWindowTitle("Select a channel to join");
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace chatterino {
|
||||
SettingsDialog *SettingsDialog::handle = nullptr;
|
||||
|
||||
SettingsDialog::SettingsDialog()
|
||||
: BaseWindow(nullptr, BaseWindow::DisableCustomScaling)
|
||||
: BaseWindow(BaseWindow::DisableCustomScaling)
|
||||
{
|
||||
this->setWindowTitle("Chatterino Settings");
|
||||
|
||||
@@ -41,7 +41,7 @@ SettingsDialog::SettingsDialog()
|
||||
|
||||
void SettingsDialog::initUi()
|
||||
{
|
||||
auto outerBox = LayoutCreator<SettingsDialog>(this)
|
||||
auto outerBox = LayoutCreator<QWidget>(this->getLayoutContainer())
|
||||
.setLayoutType<QVBoxLayout>()
|
||||
.withoutSpacing();
|
||||
|
||||
|
||||
@@ -11,9 +11,8 @@
|
||||
namespace chatterino {
|
||||
|
||||
UpdateDialog::UpdateDialog()
|
||||
: BaseWindow(nullptr,
|
||||
BaseWindow::Flags(BaseWindow::Frameless | BaseWindow::TopMost |
|
||||
BaseWindow::EnableCustomFrame))
|
||||
: BaseWindow({BaseWindow::Frameless, BaseWindow::TopMost,
|
||||
BaseWindow::EnableCustomFrame})
|
||||
{
|
||||
auto layout =
|
||||
LayoutCreator<UpdateDialog>(this).setLayoutType<QVBoxLayout>();
|
||||
|
||||
@@ -43,8 +43,7 @@ namespace {
|
||||
} // namespace
|
||||
|
||||
UserInfoPopup::UserInfoPopup()
|
||||
: BaseWindow(nullptr, BaseWindow::Flags(BaseWindow::Frameless |
|
||||
BaseWindow::FramelessDraggable))
|
||||
: BaseWindow({BaseWindow::Frameless, BaseWindow::FramelessDraggable})
|
||||
, hack_(new bool)
|
||||
{
|
||||
this->setStayInScreenRect(true);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace chatterino {
|
||||
|
||||
WelcomeDialog::WelcomeDialog()
|
||||
: BaseWindow(nullptr, BaseWindow::EnableCustomFrame)
|
||||
: BaseWindow(BaseWindow::EnableCustomFrame)
|
||||
{
|
||||
this->setWindowTitle("Chatterino quick setup");
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace {
|
||||
const QString &title, const QString &description)
|
||||
{
|
||||
auto window =
|
||||
new BaseWindow(parent, BaseWindow::Flags::EnableCustomFrame);
|
||||
new BaseWindow(BaseWindow::Flags::EnableCustomFrame, parent);
|
||||
window->setWindowTitle("Chatterino - " + title);
|
||||
window->setAttribute(Qt::WA_DeleteOnClose);
|
||||
auto layout = new QVBoxLayout();
|
||||
|
||||
Reference in New Issue
Block a user