#pragma once #include "util/helpers.hpp" #include "widgets/basewidget.hpp" #include "widgets/notebook.hpp" #include "widgets/titlebar.hpp" //#ifdef USEWINSDK //#include //#endif #include #include namespace chatterino { class ChannelManager; class ColorScheme; class CompletionManager; namespace widgets { struct WindowGeometry { WindowGeometry(const std::string &settingPrefix) : x(fS("{}/geometry/x", settingPrefix)) , y(fS("{}/geometry/y", settingPrefix)) , width(fS("{}/geometry/width", settingPrefix)) , height(fS("{}/geometry/height", settingPrefix)) { } pajlada::Settings::Setting x; pajlada::Settings::Setting y; pajlada::Settings::Setting width; pajlada::Settings::Setting height; }; class Window : public BaseWidget { Q_OBJECT std::string settingRoot; WindowGeometry windowGeometry; public: explicit Window(const QString &windowName, ChannelManager &_channelManager, ColorScheme &_colorScheme, bool isMainWindow); void repaintVisibleChatWidgets(Channel *channel = nullptr); Notebook &getNotebook(); void refreshWindowTitle(const QString &username); boost::signals2::signal closed; protected: virtual void closeEvent(QCloseEvent *event) override; private: float dpi; virtual void refreshTheme() override; void loadGeometry(); ChannelManager &channelManager; ColorScheme &colorScheme; Notebook notebook; TitleBar titleBar; friend class Notebook; public: void save(); }; } // namespace widgets } // namespace chatterino