Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use custom frame for main window only #4914

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/widgets/BasePopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

namespace chatterino {

BasePopup::BasePopup(FlagsEnum<Flags> _flags, QWidget *parent)
: BaseWindow(_flags | Dialog, parent)
BasePopup::BasePopup(FlagsEnum<Flags> flags_, QWidget *parent,
bool addDialogFlag)
: BaseWindow(addDialogFlag ? flags_ | Dialog : flags_, parent)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/widgets/BasePopup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class BasePopup : public BaseWindow
{
public:
explicit BasePopup(FlagsEnum<BaseWindow::Flags> flags_ = None,
kornes marked this conversation as resolved.
Show resolved Hide resolved
QWidget *parent = nullptr);
QWidget *parent = nullptr, bool addDialogFlag = true);

protected:
void keyPressEvent(QKeyEvent *e) override;
Expand Down
7 changes: 1 addition & 6 deletions src/widgets/DraggablePopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,13 @@ namespace {
#ifdef Q_OS_LINUX
FlagsEnum<BaseWindow::Flags> popupFlags{
BaseWindow::Dialog,
BaseWindow::EnableCustomFrame,
};
FlagsEnum<BaseWindow::Flags> popupFlagsCloseAutomatically{
BaseWindow::Dialog,
BaseWindow::EnableCustomFrame,
};
#else
FlagsEnum<BaseWindow::Flags> popupFlags{
BaseWindow::EnableCustomFrame,
};
FlagsEnum<BaseWindow::Flags> popupFlags{};
FlagsEnum<BaseWindow::Flags> popupFlagsCloseAutomatically{
BaseWindow::EnableCustomFrame,
BaseWindow::Frameless,
BaseWindow::FramelessDraggable,
};
Expand Down
3 changes: 1 addition & 2 deletions src/widgets/dialogs/ColorPickerDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
namespace chatterino {

ColorPickerDialog::ColorPickerDialog(const QColor &initial, QWidget *parent)
: BasePopup({BaseWindow::EnableCustomFrame, BaseWindow::DisableLayoutSave},
parent)
: BasePopup({BaseWindow::DisableLayoutSave}, parent)
, color_()
, dialogConfirmed_(false)
{
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/dialogs/EmotePopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ EmoteMap filterEmoteMap(const QString &text,
namespace chatterino {

EmotePopup::EmotePopup(QWidget *parent)
: BasePopup(BaseWindow::EnableCustomFrame, parent)
: BasePopup({}, parent, false)
, search_(new QLineEdit())
, notebook_(new Notebook(this))
{
Expand Down
3 changes: 1 addition & 2 deletions src/widgets/dialogs/SelectChannelDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
namespace chatterino {

SelectChannelDialog::SelectChannelDialog(QWidget *parent)
: BaseWindow({BaseWindow::Flags::EnableCustomFrame,
BaseWindow::Flags::Dialog, BaseWindow::DisableLayoutSave},
: BaseWindow({BaseWindow::Flags::Dialog, BaseWindow::DisableLayoutSave},
parent)
, selectedChannel_(Channel::getEmpty())
{
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/dialogs/UpdateDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace chatterino {

UpdateDialog::UpdateDialog()
: BaseWindow({BaseWindow::Frameless, BaseWindow::TopMost,
BaseWindow::EnableCustomFrame, BaseWindow::DisableLayoutSave})
BaseWindow::DisableLayoutSave})
{
auto layout =
LayoutCreator<UpdateDialog>(this).setLayoutType<QVBoxLayout>();
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/dialogs/WelcomeDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace chatterino {

WelcomeDialog::WelcomeDialog()
: BaseWindow({BaseWindow::EnableCustomFrame, BaseWindow::DisableLayoutSave})
: BaseWindow(BaseWindow::DisableLayoutSave)
{
this->setWindowTitle("Chatterino quick setup");
}
Expand Down
5 changes: 2 additions & 3 deletions src/widgets/settingspages/AboutPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,8 @@ void AboutPage::addLicense(QFormLayout *form, const QString &name,
auto *b = new QLabel("<a href=\"" + licenseLink + "\">show license</a>");
QObject::connect(
b, &QLabel::linkActivated, [parent = this, name, licenseLink] {
auto window = new BasePopup({BaseWindow::Flags::EnableCustomFrame,
BaseWindow::DisableLayoutSave},
parent);
auto *window =
new BasePopup({BaseWindow::DisableLayoutSave}, parent);
window->setWindowTitle("Chatterino - License for " + name);
window->setAttribute(Qt::WA_DeleteOnClose);
auto layout = new QVBoxLayout();
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/splits/InputCompletionPopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
namespace chatterino {

InputCompletionPopup::InputCompletionPopup(QWidget *parent)
: BasePopup({BasePopup::EnableCustomFrame, BasePopup::Frameless,
BasePopup::DontFocus, BaseWindow::DisableLayoutSave},
: BasePopup({BasePopup::Frameless, BasePopup::DontFocus,
BaseWindow::DisableLayoutSave},
parent)
, model_(this)
{
Expand Down
3 changes: 1 addition & 2 deletions src/widgets/splits/Split.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ namespace {
void showTutorialVideo(QWidget *parent, const QString &source,
const QString &title, const QString &description)
{
auto window =
new BasePopup(BaseWindow::Flags::EnableCustomFrame, parent);
auto *window = new BasePopup({}, parent);
window->setWindowTitle("Chatterino - " + title);
window->setAttribute(Qt::WA_DeleteOnClose);
auto layout = new QVBoxLayout();
Expand Down