BaseWindow smol refactor

This commit is contained in:
fourtf
2019-09-08 21:45:46 +02:00
parent 3158ed4085
commit 4f356f80cf
14 changed files with 43 additions and 49 deletions
-1
View File
@@ -80,7 +80,6 @@ void WindowManager::showAccountSelectPopup(QPoint point)
QPoint buttonPos = point;
w->move(buttonPos.x() - 30, buttonPos.y());
w->show();
w->setFocus();
}
+1 -4
View File
@@ -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");
+1 -1
View File
@@ -39,7 +39,7 @@
namespace chatterino {
Window::Window(WindowType type)
: BaseWindow(nullptr, BaseWindow::EnableCustomFrame)
: BaseWindow(BaseWindow::EnableCustomFrame)
, type_(type)
, notebook_(new SplitNotebook(this))
{
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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))
{
+1 -1
View File
@@ -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");
+2 -2
View File
@@ -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();
+2 -3
View File
@@ -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>();
+1 -2
View File
@@ -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);
+1 -1
View File
@@ -3,7 +3,7 @@
namespace chatterino {
WelcomeDialog::WelcomeDialog()
: BaseWindow(nullptr, BaseWindow::EnableCustomFrame)
: BaseWindow(BaseWindow::EnableCustomFrame)
{
this->setWindowTitle("Chatterino quick setup");
}
+1 -1
View File
@@ -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();