mirror-chatterino2/src/widgets/window.hpp

60 lines
1.1 KiB
C++
Raw Normal View History

#pragma once
2016-12-29 17:31:07 +01:00
#include "util/helpers.hpp"
#include "widgets/basewindow.hpp"
2017-06-11 09:31:45 +02:00
#include "widgets/notebook.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>
2017-01-18 04:52:47 +01:00
2017-04-14 17:52:22 +02:00
namespace chatterino {
2017-12-31 22:58:35 +01:00
namespace singletons {
2017-12-31 00:50:07 +01:00
class ThemeManager;
} // namespace singletons
2017-04-14 17:52:22 +02:00
namespace widgets {
2017-01-18 21:30:23 +01:00
class Window : public BaseWindow
2016-12-29 17:31:07 +01:00
{
Q_OBJECT
public:
enum WindowType { Main, Popup, Attached };
explicit Window(singletons::ThemeManager &_themeManager, WindowType type);
2017-04-12 17:46:44 +02:00
void repaintVisibleChatWidgets(Channel *channel = nullptr);
2017-04-12 17:46:44 +02:00
Notebook &getNotebook();
void refreshWindowTitle(const QString &username);
pajlada::Signals::NoArgSignal closed;
2017-12-14 00:25:06 +01:00
WindowType getType();
protected:
void closeEvent(QCloseEvent *event) override;
bool event(QEvent *event) override;
private:
WindowType type;
2017-09-22 00:50:43 +02:00
float dpi;
void loadGeometry();
Notebook notebook;
friend class Notebook;
public:
void save();
2016-12-29 17:31:07 +01:00
};
2017-04-14 17:52:22 +02:00
} // namespace widgets
} // namespace chatterino