diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c50d97a..c93d899f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ - Dev: Use `QMetaObject::invokeMethod` to run code on a specific thread. (#6203) - Dev: Added a `run-and-kill.sh` script to help debug crash-on-exit bugs. (#6188) - Dev: Refactored the `TimeoutStackStyle` enum into its own file. (#6216) +- Dev: Refactored `Notebook`-related enums into their own file. (#6220) - Dev: Refactored event API initialization away from Application and into TwitchIrcServer. (#6198) - Dev: Updated GoogleTest to v1.17.0. (#6180) - Dev: Mini refactor of `TwitchAccount`. (#6182) diff --git a/src/controllers/hotkeys/HotkeyController.cpp b/src/controllers/hotkeys/HotkeyController.cpp index 48a57211..447c6b76 100644 --- a/src/controllers/hotkeys/HotkeyController.cpp +++ b/src/controllers/hotkeys/HotkeyController.cpp @@ -4,9 +4,12 @@ #include "controllers/hotkeys/Hotkey.hpp" #include "controllers/hotkeys/HotkeyCategory.hpp" #include "controllers/hotkeys/HotkeyModel.hpp" -#include "singletons/Settings.hpp" +#include "util/RapidJsonSerializeQString.hpp" // IWYU pragma: keep +#include +#include #include +#include namespace { diff --git a/src/controllers/plugins/PluginController.hpp b/src/controllers/plugins/PluginController.hpp index 4c3a9aae..06fe5a1a 100644 --- a/src/controllers/plugins/PluginController.hpp +++ b/src/controllers/plugins/PluginController.hpp @@ -13,16 +13,15 @@ # include # include -# include # include # include # include -# include struct lua_State; namespace chatterino { +class Settings; class Paths; class PluginController diff --git a/src/singletons/Settings.hpp b/src/singletons/Settings.hpp index 25e84c21..467b9b47 100644 --- a/src/singletons/Settings.hpp +++ b/src/singletons/Settings.hpp @@ -15,8 +15,8 @@ #include "controllers/nicknames/Nickname.hpp" #include "controllers/sound/ISoundController.hpp" #include "singletons/Toasts.hpp" -#include "util/RapidJsonSerializeQString.hpp" -#include "widgets/Notebook.hpp" +#include "util/RapidJsonSerializeQString.hpp" // IWYU pragma: keep +#include "widgets/NotebookEnums.hpp" #include #include diff --git a/src/util/StreamLink.cpp b/src/util/StreamLink.cpp index 33e7b5a4..6e3edc15 100644 --- a/src/util/StreamLink.cpp +++ b/src/util/StreamLink.cpp @@ -5,8 +5,8 @@ #include "common/Version.hpp" #include "singletons/Settings.hpp" #include "singletons/WindowManager.hpp" -#include "util/Helpers.hpp" #include "widgets/dialogs/QualityPopup.hpp" +#include "widgets/Notebook.hpp" #include "widgets/splits/Split.hpp" #include "widgets/Window.hpp" diff --git a/src/widgets/Notebook.hpp b/src/widgets/Notebook.hpp index 2f2a3c54..f5592d2e 100644 --- a/src/widgets/Notebook.hpp +++ b/src/widgets/Notebook.hpp @@ -1,6 +1,7 @@ #pragma once #include "widgets/BaseWidget.hpp" +#include "widgets/NotebookEnums.hpp" #include #include @@ -21,17 +22,6 @@ class NotebookTab; class SplitContainer; class Split; -enum NotebookTabLocation { Top = 0, Left = 1, Right = 2, Bottom = 3 }; - -// Controls the visibility of tabs in this notebook -enum NotebookTabVisibility : int { - // Show all tabs - AllTabs = 0, - - // Only show tabs containing splits that are live - LiveOnly = 1, -}; - using TabVisibilityFilter = std::function; class Notebook : public BaseWidget diff --git a/src/widgets/NotebookEnums.hpp b/src/widgets/NotebookEnums.hpp new file mode 100644 index 00000000..16692738 --- /dev/null +++ b/src/widgets/NotebookEnums.hpp @@ -0,0 +1,16 @@ +#pragma once + +namespace chatterino { + +enum NotebookTabLocation { Top = 0, Left = 1, Right = 2, Bottom = 3 }; + +// Controls the visibility of tabs in this notebook +enum NotebookTabVisibility : int { + // Show all tabs + AllTabs = 0, + + // Only show tabs containing splits that are live + LiveOnly = 1, +}; + +} // namespace chatterino diff --git a/src/widgets/OverlayWindow.cpp b/src/widgets/OverlayWindow.cpp index 076776b8..ec54f0d2 100644 --- a/src/widgets/OverlayWindow.cpp +++ b/src/widgets/OverlayWindow.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #ifdef Q_OS_WIN diff --git a/src/widgets/dialogs/UserInfoPopup.cpp b/src/widgets/dialogs/UserInfoPopup.cpp index 4e673fa0..dd1241bb 100644 --- a/src/widgets/dialogs/UserInfoPopup.cpp +++ b/src/widgets/dialogs/UserInfoPopup.cpp @@ -3,7 +3,6 @@ #include "Application.hpp" #include "common/Channel.hpp" #include "common/Literals.hpp" -#include "common/network/NetworkRequest.hpp" #include "common/QLogging.hpp" #include "controllers/accounts/AccountController.hpp" #include "controllers/commands/CommandController.hpp" @@ -15,7 +14,6 @@ #include "providers/IvrApi.hpp" #include "providers/pronouns/Pronouns.hpp" #include "providers/twitch/api/Helix.hpp" -#include "providers/twitch/ChannelPointReward.hpp" #include "providers/twitch/TwitchAccount.hpp" #include "providers/twitch/TwitchChannel.hpp" #include "providers/twitch/TwitchIrcServer.hpp" @@ -34,6 +32,7 @@ #include "widgets/helper/InvisibleSizeGrip.hpp" #include "widgets/helper/Line.hpp" #include "widgets/Label.hpp" +#include "widgets/Notebook.hpp" #include "widgets/Scrollbar.hpp" #include "widgets/splits/Split.hpp" #include "widgets/Window.hpp" diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index f11e9d5f..65a95a6a 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -41,6 +41,7 @@ #include "widgets/helper/EffectLabel.hpp" #include "widgets/helper/ScrollbarHighlight.hpp" #include "widgets/helper/SearchPopup.hpp" +#include "widgets/Notebook.hpp" #include "widgets/Scrollbar.hpp" #include "widgets/splits/Split.hpp" #include "widgets/splits/SplitInput.hpp" diff --git a/src/widgets/settingspages/FiltersPage.cpp b/src/widgets/settingspages/FiltersPage.cpp index 6789f4ea..67138b4c 100644 --- a/src/widgets/settingspages/FiltersPage.cpp +++ b/src/widgets/settingspages/FiltersPage.cpp @@ -10,6 +10,7 @@ #include "widgets/helper/EditableModelView.hpp" #include +#include #include namespace chatterino { diff --git a/src/widgets/settingspages/GeneralPage.cpp b/src/widgets/settingspages/GeneralPage.cpp index 4548f7a2..ab2b68f6 100644 --- a/src/widgets/settingspages/GeneralPage.cpp +++ b/src/widgets/settingspages/GeneralPage.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include namespace {