refactor: turn StreamerMode into a singleton(-like thing) (#5216)
This commit is contained in:
@@ -7,10 +7,10 @@
|
||||
#include "controllers/hotkeys/HotkeyController.hpp"
|
||||
#include "singletons/Resources.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "singletons/StreamerMode.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "singletons/WindowManager.hpp"
|
||||
#include "util/InitUpdateButton.hpp"
|
||||
#include "util/StreamerMode.hpp"
|
||||
#include "widgets/dialogs/SettingsDialog.hpp"
|
||||
#include "widgets/helper/ChannelView.hpp"
|
||||
#include "widgets/helper/NotebookButton.hpp"
|
||||
@@ -1437,9 +1437,8 @@ void SplitNotebook::addCustomButtons()
|
||||
getIApp()->getWindows()->showSettingsDialog(
|
||||
this, SettingsDialogPreference::StreamerMode);
|
||||
});
|
||||
this->signalHolder_.managedConnect(getApp()->streamerModeChanged, [this]() {
|
||||
this->updateStreamerModeIcon();
|
||||
});
|
||||
QObject::connect(getIApp()->getStreamerMode(), &IStreamerMode::changed,
|
||||
this, &SplitNotebook::updateStreamerModeIcon);
|
||||
this->updateStreamerModeIcon();
|
||||
}
|
||||
|
||||
@@ -1462,7 +1461,8 @@ void SplitNotebook::updateStreamerModeIcon()
|
||||
this->streamerModeIcon_->setPixmap(
|
||||
getResources().buttons.streamerModeEnabledDark);
|
||||
}
|
||||
this->streamerModeIcon_->setVisible(isInStreamerMode());
|
||||
this->streamerModeIcon_->setVisible(
|
||||
getIApp()->getStreamerMode()->isEnabled());
|
||||
}
|
||||
|
||||
void SplitNotebook::themeChangedEvent()
|
||||
|
||||
Reference in New Issue
Block a user