mirror-chatterino2/src/widgets/Window.hpp

60 lines
1.2 KiB
C++
Raw Normal View History

#pragma once
2016-12-29 17:31:07 +01:00
2018-06-26 14:09:39 +02:00
#include "util/Helpers.hpp"
#include "widgets/BaseWindow.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/dialogs/UpdateDialog.hpp"
2016-12-29 17:31:07 +01:00
//#ifdef USEWINSDK
//#include <platform/borderless/qwinwidget.h>
//#endif
2017-04-18 02:07:14 +02:00
#include <pajlada/settings/setting.hpp>
#include <pajlada/signals/signal.hpp>
2018-07-05 11:42:40 +02:00
#include <pajlada/signals/signalholder.hpp>
2017-01-18 04:52:47 +01:00
2017-04-14 17:52:22 +02:00
namespace chatterino {
2018-06-28 20:03:04 +02:00
class Theme;
2017-01-18 21:30:23 +01:00
class Window : public BaseWindow
2016-12-29 17:31:07 +01:00
{
Q_OBJECT
public:
2018-07-06 17:02:26 +02:00
enum class Type { Main, Popup, Attached };
2018-07-06 17:02:26 +02:00
explicit Window(Window::Type type);
2018-07-06 17:02:26 +02:00
Type getType();
2018-05-23 04:22:17 +02:00
SplitNotebook &getNotebook();
2018-07-06 17:02:26 +02:00
void repaintVisibleChatWidgets(Channel *channel = nullptr);
pajlada::Signals::NoArgSignal closed;
2017-12-14 00:25:06 +01:00
protected:
2018-06-21 22:02:35 +02:00
void showEvent(QShowEvent *) override;
void closeEvent(QCloseEvent *event) override;
bool event(QEvent *event) override;
private:
2018-07-05 11:42:40 +02:00
void addCustomTitlebarButtons();
2018-07-06 17:02:26 +02:00
void addDebugStuff();
void addShortcuts();
void addLayout();
void onAccountSelected();
2018-07-05 11:42:40 +02:00
2018-07-06 17:02:26 +02:00
Type type_;
2018-05-25 13:53:55 +02:00
2018-07-06 17:02:26 +02:00
SplitNotebook notebook_;
RippleEffectLabel *userLabel_ = nullptr;
std::unique_ptr<UpdateDialog> updateDialogHandle_;
pajlada::Signals::SignalHolder signalHolder_;
2018-07-05 11:42:40 +02:00
2018-05-23 11:59:37 +02:00
friend class Notebook;
2016-12-29 17:31:07 +01:00
};
2017-04-14 17:52:22 +02:00
} // namespace chatterino