removed namespaces
This commit is contained in:
@@ -32,7 +32,7 @@ AttachedWindow::AttachedWindow(void *_target, int _yOffset)
|
||||
split->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::MinimumExpanding);
|
||||
layout->addWidget(split);
|
||||
|
||||
util::DebugCount::increase("attached window");
|
||||
DebugCount::increase("attached window");
|
||||
}
|
||||
|
||||
AttachedWindow::~AttachedWindow()
|
||||
@@ -44,7 +44,7 @@ AttachedWindow::~AttachedWindow()
|
||||
}
|
||||
}
|
||||
|
||||
util::DebugCount::decrease("attached window");
|
||||
DebugCount::decrease("attached window");
|
||||
}
|
||||
|
||||
AttachedWindow *AttachedWindow::get(void *target, const GetArgs &args)
|
||||
@@ -179,7 +179,7 @@ void AttachedWindow::updateWindowRect_(void *_attachedPtr)
|
||||
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
|
||||
|
||||
float scale = 1.f;
|
||||
if (auto dpi = util::getWindowDpi(attached)) {
|
||||
if (auto dpi = getWindowDpi(attached)) {
|
||||
scale = dpi.get() / 96.f;
|
||||
|
||||
// for (auto w : this->ui_.split->findChildren<BaseWidget *>()) {
|
||||
|
||||
@@ -41,7 +41,7 @@ protected:
|
||||
|
||||
void setScale(float value);
|
||||
|
||||
singletons::ThemeManager *themeManager;
|
||||
chatterino::ThemeManager *themeManager;
|
||||
|
||||
private:
|
||||
void init();
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
#include "util/NativeEventHelper.hpp"
|
||||
#include "util/PostToThread.hpp"
|
||||
#include "util/WindowsHelper.hpp"
|
||||
#include "widgets/helper/RippleEffectLabel.hpp"
|
||||
#include "widgets/helper/Shortcut.hpp"
|
||||
#include "widgets/Label.hpp"
|
||||
#include "widgets/TooltipWidget.hpp"
|
||||
#include "widgets/helper/RippleEffectLabel.hpp"
|
||||
#include "widgets/helper/Shortcut.hpp"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
@@ -60,7 +60,7 @@ BaseWindow::BaseWindow(QWidget *parent, Flags _flags)
|
||||
|
||||
this->connections_.managedConnect(
|
||||
getApp()->settings->uiScale.getValueChangedSignal(),
|
||||
[this](auto, auto) { util::postToThread([this] { this->updateScale(); }); });
|
||||
[this](auto, auto) { postToThread([this] { this->updateScale(); }); });
|
||||
|
||||
this->updateScale();
|
||||
|
||||
@@ -147,7 +147,7 @@ void BaseWindow::init()
|
||||
}
|
||||
|
||||
// DPI
|
||||
// auto dpi = util::getWindowDpi(this->winId());
|
||||
// auto dpi = getWindowDpi(this->winId());
|
||||
|
||||
// if (dpi) {
|
||||
// this->scale = dpi.value() / 96.f;
|
||||
@@ -171,6 +171,7 @@ void BaseWindow::init()
|
||||
// this->setWindowFlag(Qt::WindowStaysOnTopHint);
|
||||
// }
|
||||
#endif
|
||||
}
|
||||
|
||||
void BaseWindow::setStayInScreenRect(bool value)
|
||||
{
|
||||
@@ -249,10 +250,10 @@ void BaseWindow::wheelEvent(QWheelEvent *event)
|
||||
|
||||
if (event->modifiers() & Qt::ControlModifier) {
|
||||
if (event->delta() > 0) {
|
||||
getApp()->settings->uiScale.setValue(singletons::WindowManager::clampUiScale(
|
||||
getApp()->settings->uiScale.setValue(chatterino::WindowManager::clampUiScale(
|
||||
getApp()->settings->uiScale.getValue() + 1));
|
||||
} else {
|
||||
getApp()->settings->uiScale.setValue(singletons::WindowManager::clampUiScale(
|
||||
getApp()->settings->uiScale.setValue(chatterino::WindowManager::clampUiScale(
|
||||
getApp()->settings->uiScale.getValue() - 1));
|
||||
}
|
||||
}
|
||||
@@ -278,7 +279,7 @@ void BaseWindow::mousePressEvent(QMouseEvent *event)
|
||||
};
|
||||
|
||||
if (!recursiveCheckMouseTracking(widget)) {
|
||||
debug::Log("Start moving");
|
||||
Log("Start moving");
|
||||
this->moving = true;
|
||||
}
|
||||
}
|
||||
@@ -293,7 +294,7 @@ void BaseWindow::mouseReleaseEvent(QMouseEvent *event)
|
||||
#ifndef Q_OS_WIN
|
||||
if (this->flags_ & FramelessDraggable) {
|
||||
if (this->moving) {
|
||||
debug::Log("Stop moving");
|
||||
Log("Stop moving");
|
||||
this->moving = false;
|
||||
}
|
||||
}
|
||||
@@ -438,7 +439,7 @@ bool BaseWindow::nativeEvent(const QByteArray &eventType, void *message, long *r
|
||||
return true;
|
||||
}
|
||||
case WM_SHOWWINDOW: {
|
||||
if (auto dpi = util::getWindowDpi(msg->hwnd)) {
|
||||
if (auto dpi = getWindowDpi(msg->hwnd)) {
|
||||
this->nativeScale_ = dpi.get() / 96.f;
|
||||
this->updateScale();
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ void Scrollbar::unpauseHighlights()
|
||||
this->highlightsPaused_ = false;
|
||||
}
|
||||
|
||||
messages::LimitedQueueSnapshot<ScrollbarHighlight> Scrollbar::getHighlightSnapshot()
|
||||
chatterino::LimitedQueueSnapshot<ScrollbarHighlight> Scrollbar::getHighlightSnapshot()
|
||||
{
|
||||
if (!this->highlightsPaused_) {
|
||||
this->highlightSnapshot_ = this->highlights_.getSnapshot();
|
||||
|
||||
@@ -68,10 +68,10 @@ private:
|
||||
|
||||
QPropertyAnimation currentValueAnimation_;
|
||||
|
||||
messages::LimitedQueue<ScrollbarHighlight> highlights_;
|
||||
chatterino::LimitedQueue<ScrollbarHighlight> highlights_;
|
||||
bool highlightsPaused_{false};
|
||||
messages::LimitedQueueSnapshot<ScrollbarHighlight> highlightSnapshot_;
|
||||
messages::LimitedQueueSnapshot<ScrollbarHighlight> getHighlightSnapshot();
|
||||
chatterino::LimitedQueueSnapshot<ScrollbarHighlight> highlightSnapshot_;
|
||||
chatterino::LimitedQueueSnapshot<ScrollbarHighlight> getHighlightSnapshot();
|
||||
|
||||
bool atBottom_{false};
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace chatterino {
|
||||
|
||||
StreamView::StreamView(ChannelPtr channel, const QUrl &url)
|
||||
{
|
||||
util::LayoutCreator<StreamView> layoutCreator(this);
|
||||
LayoutCreator<StreamView> layoutCreator(this);
|
||||
|
||||
#ifdef USEWEBENGINE
|
||||
auto web = layoutCreator.emplace<QWebEngineView>(this).assign(&this->stream);
|
||||
|
||||
@@ -77,7 +77,7 @@ void TooltipWidget::updateFont()
|
||||
auto app = getApp();
|
||||
|
||||
this->setFont(
|
||||
app->fonts->getFont(singletons::FontManager::Type::ChatMediumSmall, this->getScale()));
|
||||
app->fonts->getFont(chatterino::FontManager::Type::ChatMediumSmall, this->getScale()));
|
||||
}
|
||||
|
||||
void TooltipWidget::setText(QString text)
|
||||
|
||||
@@ -100,7 +100,7 @@ Window::Window(WindowType _type)
|
||||
auto s = new QShortcut(QKeySequence::ZoomIn, this);
|
||||
s->setContext(Qt::WindowShortcut);
|
||||
QObject::connect(s, &QShortcut::activated, this, [] {
|
||||
getApp()->settings->uiScale.setValue(singletons::WindowManager::clampUiScale(
|
||||
getApp()->settings->uiScale.setValue(chatterino::WindowManager::clampUiScale(
|
||||
getApp()->settings->uiScale.getValue() + 1));
|
||||
});
|
||||
}
|
||||
@@ -108,7 +108,7 @@ Window::Window(WindowType _type)
|
||||
auto s = new QShortcut(QKeySequence::ZoomOut, this);
|
||||
s->setContext(Qt::WindowShortcut);
|
||||
QObject::connect(s, &QShortcut::activated, this, [] {
|
||||
getApp()->settings->uiScale.setValue(singletons::WindowManager::clampUiScale(
|
||||
getApp()->settings->uiScale.setValue(chatterino::WindowManager::clampUiScale(
|
||||
getApp()->settings->uiScale.getValue() - 1));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -56,9 +56,9 @@ void EmotePopup::loadChannel(ChannelPtr _channel)
|
||||
|
||||
ChannelPtr emoteChannel(new Channel("", Channel::None));
|
||||
|
||||
auto addEmotes = [&](util::EmoteMap &map, const QString &title, const QString &emoteDesc) {
|
||||
auto addEmotes = [&](EmoteMap &map, const QString &title, const QString &emoteDesc) {
|
||||
// TITLE
|
||||
messages::MessageBuilder builder1;
|
||||
chatterino::MessageBuilder builder1;
|
||||
|
||||
builder1.append(new TextElement(title, MessageElement::Text));
|
||||
|
||||
@@ -66,11 +66,11 @@ void EmotePopup::loadChannel(ChannelPtr _channel)
|
||||
emoteChannel->addMessage(builder1.getMessage());
|
||||
|
||||
// EMOTES
|
||||
messages::MessageBuilder builder2;
|
||||
chatterino::MessageBuilder builder2;
|
||||
builder2.getMessage()->flags |= Message::Centered;
|
||||
builder2.getMessage()->flags |= Message::DisableCompactEmotes;
|
||||
|
||||
map.each([&](const QString &key, const util::EmoteData &value) {
|
||||
map.each([&](const QString &key, const EmoteData &value) {
|
||||
builder2.append((new EmoteElement(value, MessageElement::Flags::AlwaysShow))
|
||||
->setLink(Link(Link::InsertText, key)));
|
||||
});
|
||||
@@ -86,7 +86,7 @@ void EmotePopup::loadChannel(ChannelPtr _channel)
|
||||
// fix this pile of garbage
|
||||
for (const auto &set : app->emotes->twitch.emotes[userID].emoteSets) {
|
||||
// TITLE
|
||||
messages::MessageBuilder builder1;
|
||||
chatterino::MessageBuilder builder1;
|
||||
|
||||
QString setText;
|
||||
if (set->text.isEmpty()) {
|
||||
@@ -105,12 +105,12 @@ void EmotePopup::loadChannel(ChannelPtr _channel)
|
||||
emoteChannel->addMessage(builder1.getMessage());
|
||||
|
||||
// EMOTES
|
||||
messages::MessageBuilder builder2;
|
||||
chatterino::MessageBuilder builder2;
|
||||
builder2.getMessage()->flags |= Message::Centered;
|
||||
builder2.getMessage()->flags |= Message::DisableCompactEmotes;
|
||||
|
||||
for (const auto &emote : set->emotes) {
|
||||
[&](const QString &key, const util::EmoteData &value) {
|
||||
[&](const QString &key, const EmoteData &value) {
|
||||
builder2.append((new EmoteElement(value, MessageElement::Flags::AlwaysShow))
|
||||
->setLink(Link(Link::InsertText, key)));
|
||||
}(emote.code, app->emotes->twitch.getEmoteById(emote.id, emote.code));
|
||||
@@ -137,14 +137,14 @@ void EmotePopup::loadEmojis()
|
||||
ChannelPtr emojiChannel(new Channel("", Channel::None));
|
||||
|
||||
// title
|
||||
messages::MessageBuilder builder1;
|
||||
chatterino::MessageBuilder builder1;
|
||||
|
||||
builder1.append(new TextElement("emojis", MessageElement::Text));
|
||||
builder1.getMessage()->flags |= Message::Centered;
|
||||
emojiChannel->addMessage(builder1.getMessage());
|
||||
|
||||
// emojis
|
||||
messages::MessageBuilder builder;
|
||||
chatterino::MessageBuilder builder;
|
||||
builder.getMessage()->flags |= Message::Centered;
|
||||
builder.getMessage()->flags |= Message::DisableCompactEmotes;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public:
|
||||
void loadChannel(ChannelPtr channel);
|
||||
void loadEmojis();
|
||||
|
||||
pajlada::Signals::Signal<messages::Link> linkClicked;
|
||||
pajlada::Signals::Signal<chatterino::Link> linkClicked;
|
||||
|
||||
private:
|
||||
ChannelView *viewEmotes;
|
||||
|
||||
@@ -16,9 +16,9 @@ LastRunCrashDialog::LastRunCrashDialog()
|
||||
this->setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
||||
this->setWindowTitle("Chatterino");
|
||||
|
||||
auto &updateManager = singletons::UpdateManager::getInstance();
|
||||
auto &updateManager = chatterino::UpdateManager::getInstance();
|
||||
|
||||
auto layout = util::LayoutCreator<LastRunCrashDialog>(this).setLayoutType<QVBoxLayout>();
|
||||
auto layout = LayoutCreator<LastRunCrashDialog>(this).setLayoutType<QVBoxLayout>();
|
||||
|
||||
layout.emplace<QLabel>(
|
||||
"The application wasn't terminated properly the last time it was executed.");
|
||||
@@ -31,7 +31,7 @@ LastRunCrashDialog::LastRunCrashDialog()
|
||||
// auto *installUpdateButton = buttons->addButton("Install Update",
|
||||
// QDialogButtonBox::NoRole); installUpdateButton->setEnabled(false);
|
||||
// QObject::connect(installUpdateButton, &QPushButton::clicked, [this, update]() mutable {
|
||||
// auto &updateManager = singletons::UpdateManager::getInstance();
|
||||
// auto &updateManager = chatterino::UpdateManager::getInstance();
|
||||
|
||||
// updateManager.installUpdates();
|
||||
// this->setEnabled(false);
|
||||
@@ -43,36 +43,36 @@ LastRunCrashDialog::LastRunCrashDialog()
|
||||
|
||||
// Updates
|
||||
// auto updateUpdateLabel = [update]() mutable {
|
||||
// auto &updateManager = singletons::UpdateManager::getInstance();
|
||||
// auto &updateManager = chatterino::UpdateManager::getInstance();
|
||||
|
||||
// switch (updateManager.getStatus()) {
|
||||
// case singletons::UpdateManager::None: {
|
||||
// case chatterino::UpdateManager::None: {
|
||||
// update->setText("Not checking for updates.");
|
||||
// } break;
|
||||
// case singletons::UpdateManager::Searching: {
|
||||
// case chatterino::UpdateManager::Searching: {
|
||||
// update->setText("Checking for updates...");
|
||||
// } break;
|
||||
// case singletons::UpdateManager::UpdateAvailable: {
|
||||
// case chatterino::UpdateManager::UpdateAvailable: {
|
||||
// update->setText("Update available.");
|
||||
// } break;
|
||||
// case singletons::UpdateManager::NoUpdateAvailable: {
|
||||
// case chatterino::UpdateManager::NoUpdateAvailable: {
|
||||
// update->setText("No update abailable.");
|
||||
// } break;
|
||||
// case singletons::UpdateManager::SearchFailed: {
|
||||
// case chatterino::UpdateManager::SearchFailed: {
|
||||
// update->setText("Error while searching for update.\nEither the update service
|
||||
// is "
|
||||
// "temporarily down or there is an issue with your
|
||||
// installation.");
|
||||
// } break;
|
||||
// case singletons::UpdateManager::Downloading: {
|
||||
// case chatterino::UpdateManager::Downloading: {
|
||||
// update->setText(
|
||||
// "Downloading the update. Chatterino will close once the download is
|
||||
// done.");
|
||||
// } break;
|
||||
// case singletons::UpdateManager::DownloadFailed: {
|
||||
// case chatterino::UpdateManager::DownloadFailed: {
|
||||
// update->setText("Download failed.");
|
||||
// } break;
|
||||
// case singletons::UpdateManager::WriteFileFailed: {
|
||||
// case chatterino::UpdateManager::WriteFileFailed: {
|
||||
// update->setText("Writing the update file to the hard drive failed.");
|
||||
// } break;
|
||||
// }
|
||||
@@ -80,7 +80,7 @@ LastRunCrashDialog::LastRunCrashDialog()
|
||||
|
||||
// updateUpdateLabel();
|
||||
// this->managedConnect(updateManager.statusUpdated, [updateUpdateLabel](auto) mutable {
|
||||
// util::postToThread([updateUpdateLabel]() mutable { updateUpdateLabel(); });
|
||||
// postToThread([updateUpdateLabel]() mutable { updateUpdateLabel(); });
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ AdvancedLoginWidget::AdvancedLoginWidget()
|
||||
this->ui.buttonLowerRow.layout.addWidget(&this->ui.buttonLowerRow.fillInUserIDButton);
|
||||
|
||||
connect(&this->ui.buttonLowerRow.fillInUserIDButton, &QPushButton::clicked, [=]() {
|
||||
util::twitch::getUserID(this->ui.usernameInput.text(), this, [=](const QString &userID) {
|
||||
getUserID(this->ui.usernameInput.text(), this, [=](const QString &userID) {
|
||||
this->ui.userIDInput.setText(userID); //
|
||||
});
|
||||
});
|
||||
|
||||
@@ -38,7 +38,7 @@ void NotificationPopup::updatePosition()
|
||||
}
|
||||
}
|
||||
|
||||
void NotificationPopup::addMessage(messages::MessagePtr msg)
|
||||
void NotificationPopup::addMessage(chatterino::MessagePtr msg)
|
||||
{
|
||||
this->channel->addMessage(msg);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ public:
|
||||
enum Location { TopLeft, TopRight, BottomLeft, BottomRight };
|
||||
NotificationPopup();
|
||||
|
||||
void addMessage(messages::MessagePtr msg);
|
||||
void addMessage(chatterino::MessagePtr msg);
|
||||
void updatePosition();
|
||||
|
||||
private:
|
||||
|
||||
@@ -43,9 +43,9 @@ void QualityPopup::okButtonClicked()
|
||||
QString channelURL = "twitch.tv/" + this->channelName;
|
||||
|
||||
try {
|
||||
streamlink::OpenStreamlink(channelURL, this->ui_.selector.currentText());
|
||||
} catch (const streamlink::Exception &ex) {
|
||||
debug::Log("Exception caught trying to open streamlink: {}", ex.what());
|
||||
OpenStreamlink(channelURL, this->ui_.selector.currentText());
|
||||
} catch (const Exception &ex) {
|
||||
Log("Exception caught trying to open streamlink: {}", ex.what());
|
||||
}
|
||||
|
||||
this->close();
|
||||
|
||||
@@ -23,13 +23,13 @@ SelectChannelDialog::SelectChannelDialog(QWidget *parent)
|
||||
|
||||
this->tabFilter.dialog = this;
|
||||
|
||||
util::LayoutCreator<QWidget> layoutWidget(this->getLayoutContainer());
|
||||
LayoutCreator<QWidget> layoutWidget(this->getLayoutContainer());
|
||||
auto layout = layoutWidget.setLayoutType<QVBoxLayout>().withoutMargin();
|
||||
auto notebook = layout.emplace<Notebook>(this).assign(&this->ui_.notebook);
|
||||
|
||||
// twitch
|
||||
{
|
||||
util::LayoutCreator<QWidget> obj(new QWidget());
|
||||
LayoutCreator<QWidget> obj(new QWidget());
|
||||
auto vbox = obj.setLayoutType<QVBoxLayout>();
|
||||
|
||||
// channel_btn
|
||||
@@ -106,7 +106,7 @@ SelectChannelDialog::SelectChannelDialog(QWidget *parent)
|
||||
|
||||
// irc
|
||||
/*{
|
||||
util::LayoutCreator<QWidget> obj(new QWidget());
|
||||
LayoutCreator<QWidget> obj(new QWidget());
|
||||
auto vbox = obj.setLayoutType<QVBoxLayout>();
|
||||
|
||||
auto edit = vbox.emplace<QLabel>("not implemented");
|
||||
|
||||
@@ -36,7 +36,7 @@ SettingsDialog::SettingsDialog()
|
||||
|
||||
void SettingsDialog::initUi()
|
||||
{
|
||||
util::LayoutCreator<SettingsDialog> layoutCreator(this);
|
||||
LayoutCreator<SettingsDialog> layoutCreator(this);
|
||||
|
||||
// tab pages
|
||||
layoutCreator.emplace<QWidget>()
|
||||
@@ -76,34 +76,34 @@ void SettingsDialog::addTabs()
|
||||
{
|
||||
this->ui_.tabContainer->setSpacing(0);
|
||||
|
||||
this->addTab(new settingspages::AccountsPage);
|
||||
this->addTab(new AccountsPage);
|
||||
|
||||
this->ui_.tabContainer->addSpacing(16);
|
||||
|
||||
this->addTab(new settingspages::AppearancePage);
|
||||
this->addTab(new settingspages::BehaviourPage);
|
||||
this->addTab(new AppearancePage);
|
||||
this->addTab(new BehaviourPage);
|
||||
|
||||
this->ui_.tabContainer->addSpacing(16);
|
||||
|
||||
this->addTab(new settingspages::CommandPage);
|
||||
// this->addTab(new settingspages::EmotesPage);
|
||||
this->addTab(new settingspages::HighlightingPage);
|
||||
this->addTab(new settingspages::IgnoreUsersPage);
|
||||
this->addTab(new CommandPage);
|
||||
// this->addTab(new EmotesPage);
|
||||
this->addTab(new HighlightingPage);
|
||||
this->addTab(new IgnoreUsersPage);
|
||||
|
||||
this->ui_.tabContainer->addSpacing(16);
|
||||
|
||||
this->addTab(new settingspages::KeyboardSettingsPage);
|
||||
// this->addTab(new settingspages::LogsPage);
|
||||
this->addTab(new settingspages::ModerationPage);
|
||||
// this->addTab(new settingspages::SpecialChannelsPage);
|
||||
this->addTab(new settingspages::BrowserExtensionPage);
|
||||
this->addTab(new settingspages::ExternalToolsPage);
|
||||
this->addTab(new KeyboardSettingsPage);
|
||||
// this->addTab(new LogsPage);
|
||||
this->addTab(new ModerationPage);
|
||||
// this->addTab(new SpecialChannelsPage);
|
||||
this->addTab(new BrowserExtensionPage);
|
||||
this->addTab(new ExternalToolsPage);
|
||||
|
||||
this->ui_.tabContainer->addStretch(1);
|
||||
this->addTab(new settingspages::AboutPage, Qt::AlignBottom);
|
||||
this->addTab(new AboutPage, Qt::AlignBottom);
|
||||
}
|
||||
|
||||
void SettingsDialog::addTab(settingspages::SettingsPage *page, Qt::Alignment alignment)
|
||||
void SettingsDialog::addTab(SettingsPage *page, Qt::Alignment alignment)
|
||||
{
|
||||
auto tab = new SettingsDialogTab(this, page, page->getIconResource());
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ private:
|
||||
|
||||
void initUi();
|
||||
void addTabs();
|
||||
void addTab(settingspages::SettingsPage *page, Qt::Alignment alignment = Qt::AlignTop);
|
||||
void addTab(SettingsPage *page, Qt::Alignment alignment = Qt::AlignTop);
|
||||
|
||||
void select(SettingsDialogTab *tab);
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ UserInfoPopup::UserInfoPopup()
|
||||
|
||||
auto app = getApp();
|
||||
|
||||
auto layout = util::LayoutCreator<UserInfoPopup>(this).setLayoutType<QVBoxLayout>();
|
||||
auto layout = LayoutCreator<UserInfoPopup>(this).setLayoutType<QVBoxLayout>();
|
||||
|
||||
// first line
|
||||
auto head = layout.emplace<QHBoxLayout>().withoutMargin();
|
||||
@@ -86,8 +86,8 @@ UserInfoPopup::UserInfoPopup()
|
||||
|
||||
// userstate
|
||||
this->userStateChanged.connect([this, mod, unmod]() mutable {
|
||||
providers::twitch::TwitchChannel *twitchChannel =
|
||||
dynamic_cast<providers::twitch::TwitchChannel *>(this->channel_.get());
|
||||
TwitchChannel *twitchChannel =
|
||||
dynamic_cast<TwitchChannel *>(this->channel_.get());
|
||||
|
||||
if (twitchChannel) {
|
||||
qDebug() << this->userName_;
|
||||
@@ -111,8 +111,8 @@ UserInfoPopup::UserInfoPopup()
|
||||
auto timeout = moderation.emplace<TimeoutWidget>();
|
||||
|
||||
this->userStateChanged.connect([this, lineMod, timeout]() mutable {
|
||||
providers::twitch::TwitchChannel *twitchChannel =
|
||||
dynamic_cast<providers::twitch::TwitchChannel *>(this->channel_.get());
|
||||
TwitchChannel *twitchChannel =
|
||||
dynamic_cast<TwitchChannel *>(this->channel_.get());
|
||||
|
||||
if (twitchChannel) {
|
||||
lineMod->setVisible(twitchChannel->hasModRights());
|
||||
@@ -171,10 +171,10 @@ void UserInfoPopup::installEvents()
|
||||
|
||||
this->ui_.follow->setEnabled(false);
|
||||
if (this->ui_.follow->isChecked()) {
|
||||
util::twitch::put(requestUrl,
|
||||
put(requestUrl,
|
||||
[this](QJsonObject) { this->ui_.follow->setEnabled(true); });
|
||||
} else {
|
||||
util::twitch::sendDelete(requestUrl, [this] { this->ui_.follow->setEnabled(true); });
|
||||
sendDelete(requestUrl, [this] { this->ui_.follow->setEnabled(true); });
|
||||
}
|
||||
});
|
||||
|
||||
@@ -234,13 +234,13 @@ void UserInfoPopup::updateUserData()
|
||||
std::weak_ptr<bool> hack = this->hack_;
|
||||
|
||||
// get user info
|
||||
util::twitch::getUserID(this->userName_, this, [this, hack](QString id) {
|
||||
getUserID(this->userName_, this, [this, hack](QString id) {
|
||||
auto currentUser = getApp()->accounts->twitch.getCurrent();
|
||||
|
||||
this->userId_ = id;
|
||||
|
||||
// get channel info
|
||||
util::twitch::get(
|
||||
get(
|
||||
"https://api.twitch.tv/kraken/channels/" + id, this, [this](const QJsonObject &obj) {
|
||||
this->ui_.followerCountLabel->setText(
|
||||
TEXT_FOLLOWERS + QString::number(obj.value("followers").toInt()));
|
||||
@@ -307,7 +307,7 @@ UserInfoPopup::TimeoutWidget::TimeoutWidget()
|
||||
: BaseWidget(nullptr)
|
||||
{
|
||||
auto layout =
|
||||
util::LayoutCreator<TimeoutWidget>(this).setLayoutType<QHBoxLayout>().withoutMargin();
|
||||
LayoutCreator<TimeoutWidget>(this).setLayoutType<QHBoxLayout>().withoutMargin();
|
||||
|
||||
QColor color1(255, 255, 255, 80);
|
||||
QColor color2(255, 255, 255, 0);
|
||||
|
||||
@@ -271,7 +271,7 @@ QString ChannelView::getSelectedText()
|
||||
{
|
||||
QString result = "";
|
||||
|
||||
messages::LimitedQueueSnapshot<MessageLayoutPtr> messagesSnapshot = this->getMessagesSnapshot();
|
||||
chatterino::LimitedQueueSnapshot<MessageLayoutPtr> messagesSnapshot = this->getMessagesSnapshot();
|
||||
|
||||
Selection _selection = this->selection_;
|
||||
|
||||
@@ -317,17 +317,17 @@ bool ChannelView::getEnableScrollingToBottom() const
|
||||
return this->enableScrollingToBottom_;
|
||||
}
|
||||
|
||||
void ChannelView::setOverrideFlags(boost::optional<messages::MessageElement::Flags> value)
|
||||
void ChannelView::setOverrideFlags(boost::optional<chatterino::MessageElement::Flags> value)
|
||||
{
|
||||
this->overrideFlags_ = value;
|
||||
}
|
||||
|
||||
const boost::optional<messages::MessageElement::Flags> &ChannelView::getOverrideFlags() const
|
||||
const boost::optional<chatterino::MessageElement::Flags> &ChannelView::getOverrideFlags() const
|
||||
{
|
||||
return this->overrideFlags_;
|
||||
}
|
||||
|
||||
messages::LimitedQueueSnapshot<MessageLayoutPtr> ChannelView::getMessagesSnapshot()
|
||||
chatterino::LimitedQueueSnapshot<MessageLayoutPtr> ChannelView::getMessagesSnapshot()
|
||||
{
|
||||
if (!this->isPaused() /*|| this->scrollBar_.isVisible()*/) {
|
||||
this->snapshot_ = this->messages.getSnapshot();
|
||||
@@ -435,7 +435,7 @@ void ChannelView::setChannel(ChannelPtr newChannel)
|
||||
MessageLayoutPtr newItem(new MessageLayout(replacement));
|
||||
auto snapshot = this->messages.getSnapshot();
|
||||
if (index >= snapshot.getLength()) {
|
||||
debug::Log("Tried to replace out of bounds message. Index: {}. Length: {}", index,
|
||||
Log("Tried to replace out of bounds message. Index: {}. Length: {}", index,
|
||||
snapshot.getLength());
|
||||
return;
|
||||
}
|
||||
@@ -530,7 +530,7 @@ void ChannelView::setSelection(const SelectionItem &start, const SelectionItem &
|
||||
this->selectionChanged.invoke();
|
||||
}
|
||||
|
||||
messages::MessageElement::Flags ChannelView::getFlags() const
|
||||
chatterino::MessageElement::Flags ChannelView::getFlags() const
|
||||
{
|
||||
auto app = getApp();
|
||||
|
||||
@@ -598,11 +598,11 @@ void ChannelView::drawMessages(QPainter &painter)
|
||||
int y = int(-(messagesSnapshot[start].get()->getHeight() *
|
||||
(fmod(this->scrollBar_.getCurrentValue(), 1))));
|
||||
|
||||
messages::MessageLayout *end = nullptr;
|
||||
chatterino::MessageLayout *end = nullptr;
|
||||
bool windowFocused = this->window() == QApplication::activeWindow();
|
||||
|
||||
for (size_t i = start; i < messagesSnapshot.getLength(); ++i) {
|
||||
messages::MessageLayout *layout = messagesSnapshot[i].get();
|
||||
chatterino::MessageLayout *layout = messagesSnapshot[i].get();
|
||||
|
||||
bool isLastMessage = false;
|
||||
if (app->settings->showLastMessageIndicator) {
|
||||
@@ -633,7 +633,7 @@ void ChannelView::drawMessages(QPainter &painter)
|
||||
}
|
||||
|
||||
// delete the message buffers that aren't on screen
|
||||
for (const std::shared_ptr<messages::MessageLayout> &item : this->messagesOnScreen_) {
|
||||
for (const std::shared_ptr<chatterino::MessageLayout> &item : this->messagesOnScreen_) {
|
||||
item->deleteBuffer();
|
||||
}
|
||||
|
||||
@@ -641,7 +641,7 @@ void ChannelView::drawMessages(QPainter &painter)
|
||||
|
||||
// add all messages on screen to the map
|
||||
for (size_t i = start; i < messagesSnapshot.getLength(); ++i) {
|
||||
std::shared_ptr<messages::MessageLayout> layout = messagesSnapshot[i];
|
||||
std::shared_ptr<chatterino::MessageLayout> layout = messagesSnapshot[i];
|
||||
|
||||
this->messagesOnScreen_.insert(layout);
|
||||
|
||||
@@ -758,7 +758,7 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
|
||||
}
|
||||
|
||||
auto tooltipWidget = TooltipWidget::getInstance();
|
||||
std::shared_ptr<messages::MessageLayout> layout;
|
||||
std::shared_ptr<chatterino::MessageLayout> layout;
|
||||
QPoint relativePos;
|
||||
int messageIndex;
|
||||
|
||||
@@ -787,7 +787,7 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
|
||||
}
|
||||
|
||||
// check if word underneath cursor
|
||||
const messages::MessageLayoutElement *hoverLayoutElement = layout->getElementAt(relativePos);
|
||||
const chatterino::MessageLayoutElement *hoverLayoutElement = layout->getElementAt(relativePos);
|
||||
|
||||
if (hoverLayoutElement == nullptr) {
|
||||
this->setCursor(Qt::ArrowCursor);
|
||||
@@ -820,7 +820,7 @@ void ChannelView::mousePressEvent(QMouseEvent *event)
|
||||
|
||||
this->mouseDown.invoke(event);
|
||||
|
||||
std::shared_ptr<messages::MessageLayout> layout;
|
||||
std::shared_ptr<chatterino::MessageLayout> layout;
|
||||
QPoint relativePos;
|
||||
int messageIndex;
|
||||
|
||||
@@ -882,7 +882,7 @@ void ChannelView::mouseReleaseEvent(QMouseEvent *event)
|
||||
if (this->isMouseDown_) {
|
||||
this->isMouseDown_ = false;
|
||||
|
||||
if (fabsf(util::distanceBetweenPoints(this->lastPressPosition_, event->screenPos())) >
|
||||
if (fabsf(distanceBetweenPoints(this->lastPressPosition_, event->screenPos())) >
|
||||
15.f) {
|
||||
return;
|
||||
}
|
||||
@@ -893,7 +893,7 @@ void ChannelView::mouseReleaseEvent(QMouseEvent *event)
|
||||
if (this->isRightMouseDown_) {
|
||||
this->isRightMouseDown_ = false;
|
||||
|
||||
if (fabsf(util::distanceBetweenPoints(this->lastRightPressPosition_,
|
||||
if (fabsf(distanceBetweenPoints(this->lastRightPressPosition_,
|
||||
event->screenPos())) > 15.f) {
|
||||
return;
|
||||
}
|
||||
@@ -908,7 +908,7 @@ void ChannelView::mouseReleaseEvent(QMouseEvent *event)
|
||||
// find message
|
||||
this->layoutMessages();
|
||||
|
||||
std::shared_ptr<messages::MessageLayout> layout;
|
||||
std::shared_ptr<chatterino::MessageLayout> layout;
|
||||
QPoint relativePos;
|
||||
int messageIndex;
|
||||
|
||||
@@ -927,7 +927,7 @@ void ChannelView::mouseReleaseEvent(QMouseEvent *event)
|
||||
return;
|
||||
}
|
||||
|
||||
const messages::MessageLayoutElement *hoverLayoutElement = layout->getElementAt(relativePos);
|
||||
const chatterino::MessageLayoutElement *hoverLayoutElement = layout->getElementAt(relativePos);
|
||||
|
||||
if (hoverLayoutElement == nullptr) {
|
||||
return;
|
||||
@@ -938,8 +938,8 @@ void ChannelView::mouseReleaseEvent(QMouseEvent *event)
|
||||
}
|
||||
|
||||
void ChannelView::handleMouseClick(QMouseEvent *event,
|
||||
const messages::MessageLayoutElement *hoveredElement,
|
||||
messages::MessageLayout *layout)
|
||||
const chatterino::MessageLayoutElement *hoveredElement,
|
||||
chatterino::MessageLayout *layout)
|
||||
{
|
||||
switch (event->button()) {
|
||||
case Qt::LeftButton: {
|
||||
@@ -971,8 +971,8 @@ void ChannelView::handleMouseClick(QMouseEvent *event,
|
||||
}
|
||||
}
|
||||
|
||||
void ChannelView::addContextMenuItems(const messages::MessageLayoutElement *hoveredElement,
|
||||
messages::MessageLayout *layout)
|
||||
void ChannelView::addContextMenuItems(const chatterino::MessageLayoutElement *hoveredElement,
|
||||
chatterino::MessageLayout *layout)
|
||||
{
|
||||
const auto &creator = hoveredElement->getCreator();
|
||||
auto creatorFlags = creator.getFlags();
|
||||
@@ -982,7 +982,7 @@ void ChannelView::addContextMenuItems(const messages::MessageLayoutElement *hove
|
||||
|
||||
// Emote actions
|
||||
if (creatorFlags & (MessageElement::Flags::EmoteImages | MessageElement::Flags::EmojiImage)) {
|
||||
const auto &emoteElement = static_cast<const messages::EmoteElement &>(creator);
|
||||
const auto &emoteElement = static_cast<const chatterino::EmoteElement &>(creator);
|
||||
|
||||
// TODO: We might want to add direct "Open image" variants alongside the Copy
|
||||
// actions
|
||||
@@ -1099,7 +1099,7 @@ void ChannelView::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
auto app = getApp();
|
||||
|
||||
if (app->settings->linksDoubleClickOnly) {
|
||||
std::shared_ptr<messages::MessageLayout> layout;
|
||||
std::shared_ptr<chatterino::MessageLayout> layout;
|
||||
QPoint relativePos;
|
||||
int messageIndex;
|
||||
|
||||
@@ -1112,7 +1112,7 @@ void ChannelView::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
return;
|
||||
}
|
||||
|
||||
const messages::MessageLayoutElement *hoverLayoutElement =
|
||||
const chatterino::MessageLayoutElement *hoverLayoutElement =
|
||||
layout->getElementAt(relativePos);
|
||||
|
||||
if (hoverLayoutElement == nullptr) {
|
||||
@@ -1133,15 +1133,15 @@ void ChannelView::hideEvent(QHideEvent *)
|
||||
this->messagesOnScreen_.clear();
|
||||
}
|
||||
|
||||
void ChannelView::handleLinkClick(QMouseEvent *event, const messages::Link &link,
|
||||
messages::MessageLayout *layout)
|
||||
void ChannelView::handleLinkClick(QMouseEvent *event, const chatterino::Link &link,
|
||||
chatterino::MessageLayout *layout)
|
||||
{
|
||||
if (event->button() != Qt::LeftButton) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (link.type) {
|
||||
case messages::Link::UserInfo: {
|
||||
case chatterino::Link::UserInfo: {
|
||||
auto user = link.value;
|
||||
|
||||
auto *userPopup = new UserInfoPopup;
|
||||
@@ -1155,12 +1155,12 @@ void ChannelView::handleLinkClick(QMouseEvent *event, const messages::Link &link
|
||||
break;
|
||||
}
|
||||
|
||||
case messages::Link::Url: {
|
||||
case chatterino::Link::Url: {
|
||||
QDesktopServices::openUrl(QUrl(link.value));
|
||||
break;
|
||||
}
|
||||
|
||||
case messages::Link::UserAction: {
|
||||
case chatterino::Link::UserAction: {
|
||||
QString value = link.value;
|
||||
value.replace("{user}", layout->getMessage()->loginName);
|
||||
this->channel_->sendMessage(value);
|
||||
@@ -1170,7 +1170,7 @@ void ChannelView::handleLinkClick(QMouseEvent *event, const messages::Link &link
|
||||
}
|
||||
}
|
||||
|
||||
bool ChannelView::tryGetMessageAt(QPoint p, std::shared_ptr<messages::MessageLayout> &_message,
|
||||
bool ChannelView::tryGetMessageAt(QPoint p, std::shared_ptr<chatterino::MessageLayout> &_message,
|
||||
QPoint &relativePos, int &index)
|
||||
{
|
||||
auto messagesSnapshot = this->getMessagesSnapshot();
|
||||
|
||||
@@ -36,13 +36,13 @@ public:
|
||||
void clearSelection();
|
||||
void setEnableScrollingToBottom(bool);
|
||||
bool getEnableScrollingToBottom() const;
|
||||
void setOverrideFlags(boost::optional<messages::MessageElement::Flags> value);
|
||||
const boost::optional<messages::MessageElement::Flags> &getOverrideFlags() const;
|
||||
void setOverrideFlags(boost::optional<chatterino::MessageElement::Flags> value);
|
||||
const boost::optional<chatterino::MessageElement::Flags> &getOverrideFlags() const;
|
||||
void pause(int msecTimeout);
|
||||
void updateLastReadMessage();
|
||||
|
||||
void setChannel(ChannelPtr channel_);
|
||||
messages::LimitedQueueSnapshot<messages::MessageLayoutPtr> getMessagesSnapshot();
|
||||
chatterino::LimitedQueueSnapshot<chatterino::MessageLayoutPtr> getMessagesSnapshot();
|
||||
void layoutMessages();
|
||||
|
||||
void clearMessages();
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
pajlada::Signals::Signal<QMouseEvent *> mouseDown;
|
||||
pajlada::Signals::NoArgSignal selectionChanged;
|
||||
pajlada::Signals::Signal<HighlightState> tabHighlightRequested;
|
||||
pajlada::Signals::Signal<const messages::Link &> linkClicked;
|
||||
pajlada::Signals::Signal<const chatterino::Link &> linkClicked;
|
||||
|
||||
protected:
|
||||
void themeRefreshEvent() override;
|
||||
@@ -70,10 +70,10 @@ protected:
|
||||
|
||||
void hideEvent(QHideEvent *) override;
|
||||
|
||||
void handleLinkClick(QMouseEvent *event, const messages::Link &link,
|
||||
messages::MessageLayout *layout);
|
||||
void handleLinkClick(QMouseEvent *event, const chatterino::Link &link,
|
||||
chatterino::MessageLayout *layout);
|
||||
|
||||
bool tryGetMessageAt(QPoint p, std::shared_ptr<messages::MessageLayout> &message,
|
||||
bool tryGetMessageAt(QPoint p, std::shared_ptr<chatterino::MessageLayout> &message,
|
||||
QPoint &relativePos, int &index);
|
||||
|
||||
private:
|
||||
@@ -92,24 +92,24 @@ private:
|
||||
int messagesAddedSinceSelectionPause_ = 0;
|
||||
|
||||
QTimer pauseTimeout_;
|
||||
boost::optional<messages::MessageElement::Flags> overrideFlags_;
|
||||
messages::MessageLayoutPtr lastReadMessage_;
|
||||
boost::optional<chatterino::MessageElement::Flags> overrideFlags_;
|
||||
chatterino::MessageLayoutPtr lastReadMessage_;
|
||||
|
||||
messages::LimitedQueueSnapshot<messages::MessageLayoutPtr> snapshot_;
|
||||
chatterino::LimitedQueueSnapshot<chatterino::MessageLayoutPtr> snapshot_;
|
||||
|
||||
void detachChannel();
|
||||
void actuallyLayoutMessages(bool causedByScollbar = false);
|
||||
|
||||
void drawMessages(QPainter &painter);
|
||||
void setSelection(const messages::SelectionItem &start, const messages::SelectionItem &end);
|
||||
messages::MessageElement::Flags getFlags() const;
|
||||
void setSelection(const chatterino::SelectionItem &start, const chatterino::SelectionItem &end);
|
||||
chatterino::MessageElement::Flags getFlags() const;
|
||||
bool isPaused();
|
||||
|
||||
void handleMouseClick(QMouseEvent *event,
|
||||
const messages::MessageLayoutElement *hoverLayoutElement,
|
||||
messages::MessageLayout *layout);
|
||||
void addContextMenuItems(const messages::MessageLayoutElement *hoveredElement,
|
||||
messages::MessageLayout *layout);
|
||||
const chatterino::MessageLayoutElement *hoverLayoutElement,
|
||||
chatterino::MessageLayout *layout);
|
||||
void addContextMenuItems(const chatterino::MessageLayoutElement *hoveredElement,
|
||||
chatterino::MessageLayout *layout);
|
||||
|
||||
// void beginPause();
|
||||
// void endPause();
|
||||
@@ -132,10 +132,10 @@ private:
|
||||
QPointF lastPressPosition_;
|
||||
QPointF lastRightPressPosition_;
|
||||
|
||||
messages::Selection selection_;
|
||||
chatterino::Selection selection_;
|
||||
bool selecting_ = false;
|
||||
|
||||
messages::LimitedQueue<messages::MessageLayoutPtr> messages;
|
||||
chatterino::LimitedQueue<chatterino::MessageLayoutPtr> messages;
|
||||
|
||||
pajlada::Signals::Connection messageAppendedConnection_;
|
||||
pajlada::Signals::Connection messageAddedAtStartConnection_;
|
||||
@@ -147,7 +147,7 @@ private:
|
||||
std::vector<pajlada::Signals::ScopedConnection> connections_;
|
||||
std::vector<pajlada::Signals::ScopedConnection> channelConnections_;
|
||||
|
||||
std::unordered_set<std::shared_ptr<messages::MessageLayout>> messagesOnScreen_;
|
||||
std::unordered_set<std::shared_ptr<chatterino::MessageLayout>> messagesOnScreen_;
|
||||
|
||||
int getLayoutWidth() const;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ DebugPopup::DebugPopup()
|
||||
|
||||
timer->setInterval(1000);
|
||||
QObject::connect(timer, &QTimer::timeout,
|
||||
[text] { text->setText(util::DebugCount::getDebugText()); });
|
||||
[text] { text->setText(DebugCount::getDebugText()); });
|
||||
timer->start();
|
||||
|
||||
text->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
|
||||
|
||||
@@ -60,7 +60,7 @@ NotebookTab::NotebookTab(Notebook *notebook)
|
||||
|
||||
// QObject::connect(enableHighlightsOnNewMessageAction, &QAction::toggled, [this](bool
|
||||
// newValue) {
|
||||
// debug::Log("New value is {}", newValue); //
|
||||
// Log("New value is {}", newValue); //
|
||||
// });
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ void NotebookTab::updateSize()
|
||||
width = (metrics.width(this->getTitle()) + int(16 * scale));
|
||||
}
|
||||
|
||||
width = util::clamp(width, this->height(), int(150 * scale));
|
||||
width = clamp(width, this->height(), int(150 * scale));
|
||||
|
||||
if (this->width() != width) {
|
||||
this->resize(width, int(NOTEBOOK_TAB_HEIGHT * scale));
|
||||
@@ -221,8 +221,8 @@ void NotebookTab::paintEvent(QPaintEvent *)
|
||||
// int fullHeight = (int)(scale * 48);
|
||||
|
||||
// select the right tab colors
|
||||
singletons::ThemeManager::TabColors colors;
|
||||
singletons::ThemeManager::TabColors regular = this->themeManager->tabs.regular;
|
||||
chatterino::ThemeManager::TabColors colors;
|
||||
chatterino::ThemeManager::TabColors regular = this->themeManager->tabs.regular;
|
||||
|
||||
if (this->selected_) {
|
||||
colors = this->themeManager->tabs.selected;
|
||||
|
||||
@@ -73,7 +73,7 @@ void SearchPopup::performSearch()
|
||||
ChannelPtr channel(new Channel("search", Channel::None));
|
||||
|
||||
for (size_t i = 0; i < this->snapshot.getLength(); i++) {
|
||||
messages::MessagePtr message = this->snapshot[i];
|
||||
chatterino::MessagePtr message = this->snapshot[i];
|
||||
|
||||
if (text.isEmpty() ||
|
||||
message->searchText.indexOf(this->searchInput->text(), 0, Qt::CaseInsensitive) != -1) {
|
||||
|
||||
@@ -21,7 +21,7 @@ public:
|
||||
void setChannel(std::shared_ptr<Channel> channel);
|
||||
|
||||
private:
|
||||
messages::LimitedQueueSnapshot<messages::MessagePtr> snapshot;
|
||||
chatterino::LimitedQueueSnapshot<chatterino::MessagePtr> snapshot;
|
||||
QLineEdit *searchInput;
|
||||
ChannelView *channelView;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
SettingsDialogTab::SettingsDialogTab(SettingsDialog *_dialog, settingspages::SettingsPage *_page,
|
||||
SettingsDialogTab::SettingsDialogTab(SettingsDialog *_dialog, SettingsPage *_page,
|
||||
QString imageFileName)
|
||||
: BaseWidget(_dialog)
|
||||
, dialog(_dialog)
|
||||
@@ -33,7 +33,7 @@ void SettingsDialogTab::setSelected(bool _selected)
|
||||
emit selectedChanged(selected);
|
||||
}
|
||||
|
||||
settingspages::SettingsPage *SettingsDialogTab::getSettingsPage()
|
||||
SettingsPage *SettingsDialogTab::getSettingsPage()
|
||||
{
|
||||
return this->page;
|
||||
}
|
||||
|
||||
@@ -16,11 +16,11 @@ class SettingsDialogTab : public BaseWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SettingsDialogTab(SettingsDialog *dialog, settingspages::SettingsPage *page,
|
||||
SettingsDialogTab(SettingsDialog *dialog, SettingsPage *page,
|
||||
QString imageFileName);
|
||||
|
||||
void setSelected(bool selected);
|
||||
settingspages::SettingsPage *getSettingsPage();
|
||||
SettingsPage *getSettingsPage();
|
||||
|
||||
signals:
|
||||
void selectedChanged(bool);
|
||||
@@ -36,7 +36,7 @@ private:
|
||||
|
||||
// Parent settings dialog
|
||||
SettingsDialog *dialog;
|
||||
settingspages::SettingsPage *page;
|
||||
SettingsPage *page;
|
||||
|
||||
bool selected = false;
|
||||
};
|
||||
|
||||
@@ -17,11 +17,11 @@ namespace chatterino {
|
||||
AboutPage::AboutPage()
|
||||
: SettingsPage("About", ":/images/about.svg")
|
||||
{
|
||||
util::LayoutCreator<AboutPage> layoutCreator(this);
|
||||
LayoutCreator<AboutPage> layoutCreator(this);
|
||||
|
||||
auto scroll = layoutCreator.emplace<QScrollArea>();
|
||||
auto widget = scroll.emplaceScrollAreaWidget();
|
||||
util::removeScrollAreaBackground(scroll.getElement(), widget.getElement());
|
||||
removeScrollAreaBackground(scroll.getElement(), widget.getElement());
|
||||
|
||||
auto layout = widget.setLayoutType<QVBoxLayout>();
|
||||
{
|
||||
|
||||
@@ -21,11 +21,11 @@ AccountsPage::AccountsPage()
|
||||
{
|
||||
auto *app = getApp();
|
||||
|
||||
util::LayoutCreator<AccountsPage> layoutCreator(this);
|
||||
LayoutCreator<AccountsPage> layoutCreator(this);
|
||||
auto layout = layoutCreator.emplace<QVBoxLayout>().withoutMargin();
|
||||
|
||||
helper::EditableModelView *view =
|
||||
layout.emplace<helper::EditableModelView>(app->accounts->createModel(nullptr)).getElement();
|
||||
EditableModelView *view =
|
||||
layout.emplace<EditableModelView>(app->accounts->createModel(nullptr)).getElement();
|
||||
|
||||
view->getTableView()->horizontalHeader()->setVisible(false);
|
||||
view->getTableView()->horizontalHeader()->setStretchLastSection(true);
|
||||
|
||||
@@ -35,11 +35,11 @@ AppearancePage::AppearancePage()
|
||||
: SettingsPage("Look", ":/images/theme.svg")
|
||||
{
|
||||
auto app = getApp();
|
||||
util::LayoutCreator<AppearancePage> layoutCreator(this);
|
||||
LayoutCreator<AppearancePage> layoutCreator(this);
|
||||
|
||||
auto scroll = layoutCreator.emplace<QScrollArea>();
|
||||
auto widget = scroll.emplaceScrollAreaWidget();
|
||||
util::removeScrollAreaBackground(scroll.getElement(), widget.getElement());
|
||||
removeScrollAreaBackground(scroll.getElement(), widget.getElement());
|
||||
|
||||
auto layout = widget.setLayoutType<QVBoxLayout>();
|
||||
|
||||
@@ -226,7 +226,7 @@ QLayout *AppearancePage::createFontChanger()
|
||||
button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Policy::Fixed);
|
||||
|
||||
QObject::connect(button, &QPushButton::clicked, [=]() {
|
||||
QFontDialog dialog(app->fonts->getFont(singletons::FontManager::ChatMedium, 1.));
|
||||
QFontDialog dialog(app->fonts->getFont(chatterino::FontManager::ChatMedium, 1.));
|
||||
|
||||
dialog.setWindowFlag(Qt::WindowStaysOnTopHint);
|
||||
|
||||
@@ -250,10 +250,10 @@ QLayout *AppearancePage::createUiScaleSlider()
|
||||
layout->addWidget(slider);
|
||||
layout->addWidget(label);
|
||||
|
||||
slider->setMinimum(singletons::WindowManager::uiScaleMin);
|
||||
slider->setMaximum(singletons::WindowManager::uiScaleMax);
|
||||
slider->setMinimum(chatterino::WindowManager::uiScaleMin);
|
||||
slider->setMaximum(chatterino::WindowManager::uiScaleMax);
|
||||
slider->setValue(
|
||||
singletons::WindowManager::clampUiScale(getApp()->settings->uiScale.getValue()));
|
||||
chatterino::WindowManager::clampUiScale(getApp()->settings->uiScale.getValue()));
|
||||
|
||||
label->setMinimumWidth(100);
|
||||
|
||||
@@ -262,7 +262,7 @@ QLayout *AppearancePage::createUiScaleSlider()
|
||||
|
||||
getApp()->settings->uiScale.connect(
|
||||
[label](auto, auto) {
|
||||
label->setText(QString::number(singletons::WindowManager::getUiScaleValue()));
|
||||
label->setText(QString::number(chatterino::WindowManager::getUiScaleValue()));
|
||||
},
|
||||
this->connections_);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ BehaviourPage::BehaviourPage()
|
||||
: SettingsPage("Feel", ":/images/behave.svg")
|
||||
{
|
||||
auto app = getApp();
|
||||
util::LayoutCreator<BehaviourPage> layoutCreator(this);
|
||||
LayoutCreator<BehaviourPage> layoutCreator(this);
|
||||
|
||||
auto layout = layoutCreator.setLayoutType<QVBoxLayout>();
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace chatterino {
|
||||
BrowserExtensionPage::BrowserExtensionPage()
|
||||
: SettingsPage("Browser Extension", "")
|
||||
{
|
||||
auto layout = util::LayoutCreator<BrowserExtensionPage>(this).setLayoutType<QVBoxLayout>();
|
||||
auto layout = LayoutCreator<BrowserExtensionPage>(this).setLayoutType<QVBoxLayout>();
|
||||
|
||||
auto label =
|
||||
layout.emplace<QLabel>("The browser extension will replace the default Twitch.tv chat with "
|
||||
|
||||
@@ -31,17 +31,17 @@ CommandPage::CommandPage()
|
||||
{
|
||||
auto app = getApp();
|
||||
|
||||
util::LayoutCreator<CommandPage> layoutCreator(this);
|
||||
LayoutCreator<CommandPage> layoutCreator(this);
|
||||
auto layout = layoutCreator.emplace<QVBoxLayout>().withoutMargin();
|
||||
|
||||
helper::EditableModelView *view =
|
||||
layout.emplace<helper::EditableModelView>(app->commands->createModel(nullptr)).getElement();
|
||||
EditableModelView *view =
|
||||
layout.emplace<EditableModelView>(app->commands->createModel(nullptr)).getElement();
|
||||
|
||||
view->setTitles({"Trigger", "Command"});
|
||||
view->getTableView()->horizontalHeader()->setStretchLastSection(true);
|
||||
view->addButtonPressed.connect([] {
|
||||
getApp()->commands->items.appendItem(
|
||||
controllers::commands::Command{"/command", "I made a new command HeyGuys"});
|
||||
Command{"/command", "I made a new command HeyGuys"});
|
||||
});
|
||||
|
||||
layout.append(this->createCheckBox("Also match the trigger at the end of the message",
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace chatterino {
|
||||
EmotesPage::EmotesPage()
|
||||
: SettingsPage("Emotes", ":/images/emote.svg")
|
||||
{
|
||||
// singletons::SettingManager &settings = singletons::SettingManager::getInstance();
|
||||
// util::LayoutCreator<EmotesPage> layoutCreator(this);
|
||||
// chatterino::SettingManager &settings = chatterino::SettingManager::getInstance();
|
||||
// LayoutCreator<EmotesPage> layoutCreator(this);
|
||||
// auto layout = layoutCreator.emplace<QVBoxLayout>().withoutMargin();
|
||||
|
||||
// // clang-format off
|
||||
|
||||
@@ -23,7 +23,7 @@ ExternalToolsPage::ExternalToolsPage()
|
||||
{
|
||||
auto app = getApp();
|
||||
|
||||
util::LayoutCreator<ExternalToolsPage> layoutCreator(this);
|
||||
LayoutCreator<ExternalToolsPage> layoutCreator(this);
|
||||
auto layout = layoutCreator.setLayoutType<QVBoxLayout>();
|
||||
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ HighlightingPage::HighlightingPage()
|
||||
: SettingsPage("Highlights", ":/images/notifications.svg")
|
||||
{
|
||||
auto app = getApp();
|
||||
util::LayoutCreator<HighlightingPage> layoutCreator(this);
|
||||
LayoutCreator<HighlightingPage> layoutCreator(this);
|
||||
|
||||
auto layout = layoutCreator.emplace<QVBoxLayout>().withoutMargin();
|
||||
{
|
||||
@@ -43,9 +43,9 @@ HighlightingPage::HighlightingPage()
|
||||
// HIGHLIGHTS
|
||||
auto highlights = tabs.appendTab(new QVBoxLayout, "Highlights");
|
||||
{
|
||||
helper::EditableModelView *view =
|
||||
EditableModelView *view =
|
||||
highlights
|
||||
.emplace<helper::EditableModelView>(app->highlights->createModel(nullptr))
|
||||
.emplace<EditableModelView>(app->highlights->createModel(nullptr))
|
||||
.getElement();
|
||||
|
||||
view->setTitles({"Pattern", "Flash taskbar", "Play sound", "Regex"});
|
||||
@@ -61,7 +61,7 @@ HighlightingPage::HighlightingPage()
|
||||
|
||||
view->addButtonPressed.connect([] {
|
||||
getApp()->highlights->phrases.appendItem(
|
||||
controllers::highlights::HighlightPhrase{"my phrase", true, false, false});
|
||||
HighlightPhrase{"my phrase", true, false, false});
|
||||
});
|
||||
}
|
||||
auto disabledUsers = tabs.appendTab(new QVBoxLayout, "Disabled Users");
|
||||
|
||||
@@ -28,7 +28,7 @@ IgnoreUsersPage::IgnoreUsersPage()
|
||||
{
|
||||
auto app = getApp();
|
||||
|
||||
util::LayoutCreator<IgnoreUsersPage> layoutCreator(this);
|
||||
LayoutCreator<IgnoreUsersPage> layoutCreator(this);
|
||||
auto layout = layoutCreator.setLayoutType<QVBoxLayout>();
|
||||
|
||||
// auto group = layout.emplace<QGroupBox>("Ignored users").setLayoutType<QVBoxLayout>();
|
||||
@@ -63,8 +63,8 @@ IgnoreUsersPage::IgnoreUsersPage()
|
||||
// messages
|
||||
auto messages = tabs.appendTab(new QVBoxLayout, "Messages");
|
||||
{
|
||||
helper::EditableModelView *view =
|
||||
messages.emplace<helper::EditableModelView>(app->ignores->createModel(nullptr))
|
||||
EditableModelView *view =
|
||||
messages.emplace<EditableModelView>(app->ignores->createModel(nullptr))
|
||||
.getElement();
|
||||
view->setTitles({"Pattern", "Regex"});
|
||||
view->getTableView()->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed);
|
||||
@@ -78,7 +78,7 @@ IgnoreUsersPage::IgnoreUsersPage()
|
||||
|
||||
view->addButtonPressed.connect([] {
|
||||
getApp()->ignores->phrases.appendItem(
|
||||
controllers::ignores::IgnorePhrase{"my phrase", false});
|
||||
IgnorePhrase{"my phrase", false});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace chatterino {
|
||||
KeyboardSettingsPage::KeyboardSettingsPage()
|
||||
: SettingsPage("Keybindings", "")
|
||||
{
|
||||
auto layout = util::LayoutCreator<KeyboardSettingsPage>(this).setLayoutType<QVBoxLayout>();
|
||||
auto layout = LayoutCreator<KeyboardSettingsPage>(this).setLayoutType<QVBoxLayout>();
|
||||
|
||||
auto form = layout.emplace<QFormLayout>();
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
//{
|
||||
// auto app = getApp();
|
||||
|
||||
// util::LayoutCreator<LogsPage> layoutCreator(this);
|
||||
// LayoutCreator<LogsPage> layoutCreator(this);
|
||||
// auto layout = layoutCreator.emplace<QVBoxLayout>().withoutMargin();
|
||||
|
||||
// auto logPath = app->paths->logsFolderPath;
|
||||
|
||||
@@ -35,7 +35,7 @@ ModerationPage::ModerationPage()
|
||||
: SettingsPage("Moderation", "")
|
||||
{
|
||||
auto app = getApp();
|
||||
util::LayoutCreator<ModerationPage> layoutCreator(this);
|
||||
LayoutCreator<ModerationPage> layoutCreator(this);
|
||||
|
||||
auto tabs = layoutCreator.emplace<QTabWidget>();
|
||||
|
||||
@@ -119,7 +119,7 @@ ModerationPage::ModerationPage()
|
||||
|
||||
/*auto taggedUsers = tabs.appendTab(new QVBoxLayout, "Tagged users");
|
||||
{
|
||||
helper::EditableModelView *view = *taggedUsers.emplace<helper::EditableModelView>(
|
||||
EditableModelView *view = *taggedUsers.emplace<EditableModelView>(
|
||||
app->taggedUsers->createModel(nullptr));
|
||||
|
||||
view->setTitles({"Name"});
|
||||
@@ -127,7 +127,7 @@ ModerationPage::ModerationPage()
|
||||
|
||||
view->addButtonPressed.connect([] {
|
||||
getApp()->taggedUsers->users.appendItem(
|
||||
controllers::taggedusers::TaggedUser(ProviderId::Twitch, "example", "xD"));
|
||||
TaggedUser(ProviderId::Twitch, "example", "xD"));
|
||||
});
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ SpecialChannelsPage::SpecialChannelsPage()
|
||||
{
|
||||
auto app = getApp();
|
||||
|
||||
util::LayoutCreator<SpecialChannelsPage> layoutCreator(this);
|
||||
LayoutCreator<SpecialChannelsPage> layoutCreator(this);
|
||||
auto layout = layoutCreator.setLayoutType<QVBoxLayout>();
|
||||
|
||||
auto mentions = layout.emplace<QGroupBox>("Mentions channel").setLayoutType<QVBoxLayout>();
|
||||
|
||||
@@ -416,9 +416,9 @@ void Split::doOpenPopupPlayer()
|
||||
void Split::doOpenStreamlink()
|
||||
{
|
||||
try {
|
||||
streamlink::Start(this->getChannel()->name);
|
||||
} catch (const streamlink::Exception &ex) {
|
||||
debug::Log("Error in doOpenStreamlink: {}", ex.what());
|
||||
Start(this->getChannel()->name);
|
||||
} catch (const Exception &ex) {
|
||||
Log("Error in doOpenStreamlink: {}", ex.what());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -449,7 +449,7 @@ void Split::doOpenViewerList()
|
||||
}
|
||||
auto loadingLabel = new QLabel("Loading...");
|
||||
|
||||
util::twitch::get("https://tmi.twitch.tv/group/user/" + this->getChannel()->name + "/chatters",
|
||||
get("https://tmi.twitch.tv/group/user/" + this->getChannel()->name + "/chatters",
|
||||
this, [=](QJsonObject obj) {
|
||||
QJsonObject chattersObj = obj.value("chatters").toObject();
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@ class SplitColumn
|
||||
public:
|
||||
SplitColumn() = default;
|
||||
|
||||
void insert(widgets::Split *split, int index = -1);
|
||||
void insert(Split *split, int index = -1);
|
||||
void remove(int index);
|
||||
double getFlex();
|
||||
void setFlex(double flex);
|
||||
|
||||
private:
|
||||
std::vector<widgets::Split> items;
|
||||
std::vector<Split> items;
|
||||
};
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -104,7 +104,7 @@ void SplitContainer::resetMouseStatus()
|
||||
|
||||
void SplitContainer::appendNewSplit(bool openChannelNameDialog)
|
||||
{
|
||||
util::assertInGuiThread();
|
||||
assertInGuiThread();
|
||||
|
||||
Split *split = new Split(this);
|
||||
this->appendSplit(split);
|
||||
@@ -138,7 +138,7 @@ void SplitContainer::insertSplit(Split *split, Direction direction, Split *relat
|
||||
|
||||
void SplitContainer::insertSplit(Split *split, Direction direction, Node *relativeTo)
|
||||
{
|
||||
util::assertInGuiThread();
|
||||
assertInGuiThread();
|
||||
|
||||
split->setContainer(this);
|
||||
|
||||
@@ -161,7 +161,7 @@ void SplitContainer::insertSplit(Split *split, Direction direction, Node *relati
|
||||
|
||||
void SplitContainer::addSplit(Split *split)
|
||||
{
|
||||
util::assertInGuiThread();
|
||||
assertInGuiThread();
|
||||
|
||||
split->setParent(this);
|
||||
split->show();
|
||||
@@ -202,7 +202,7 @@ void SplitContainer::setPreferedTargetRecursive(Node *node)
|
||||
|
||||
SplitContainer::Position SplitContainer::releaseSplit(Split *split)
|
||||
{
|
||||
util::assertInGuiThread();
|
||||
assertInGuiThread();
|
||||
|
||||
Node *node = this->baseNode.findNodeContainingSplit(split);
|
||||
assert(node != nullptr);
|
||||
@@ -230,7 +230,7 @@ SplitContainer::Position SplitContainer::releaseSplit(Split *split)
|
||||
|
||||
SplitContainer::Position SplitContainer::deleteSplit(Split *split)
|
||||
{
|
||||
util::assertInGuiThread();
|
||||
assertInGuiThread();
|
||||
assert(split != nullptr);
|
||||
|
||||
split->deleteLater();
|
||||
@@ -239,7 +239,7 @@ SplitContainer::Position SplitContainer::deleteSplit(Split *split)
|
||||
|
||||
void SplitContainer::selectNextSplit(Direction direction)
|
||||
{
|
||||
util::assertInGuiThread();
|
||||
assertInGuiThread();
|
||||
|
||||
if (Node *node = this->baseNode.findNodeContainingSplit(this->selected)) {
|
||||
this->selectSplitRecursive(node, direction);
|
||||
@@ -565,7 +565,7 @@ void SplitContainer::decodeNodeRecusively(QJsonObject &obj, Node *node)
|
||||
|
||||
if (type == "split") {
|
||||
auto *split = new Split(this);
|
||||
split->setChannel(singletons::WindowManager::decodeChannel(obj.value("data").toObject()));
|
||||
split->setChannel(chatterino::WindowManager::decodeChannel(obj.value("data").toObject()));
|
||||
|
||||
this->appendSplit(split);
|
||||
} else if (type == "horizontal" || type == "vertical") {
|
||||
@@ -582,7 +582,7 @@ void SplitContainer::decodeNodeRecusively(QJsonObject &obj, Node *node)
|
||||
if (_type == "split") {
|
||||
auto *split = new Split(this);
|
||||
split->setChannel(
|
||||
singletons::WindowManager::decodeChannel(_obj.value("data").toObject()));
|
||||
chatterino::WindowManager::decodeChannel(_obj.value("data").toObject()));
|
||||
|
||||
Node *_node = new Node();
|
||||
_node->parent = node;
|
||||
@@ -606,7 +606,7 @@ void SplitContainer::decodeNodeRecusively(QJsonObject &obj, Node *node)
|
||||
if (node->getChildren().size() < 2) {
|
||||
auto *split = new Split(this);
|
||||
split->setChannel(
|
||||
singletons::WindowManager::decodeChannel(obj.value("data").toObject()));
|
||||
chatterino::WindowManager::decodeChannel(obj.value("data").toObject()));
|
||||
|
||||
this->insertSplit(split, direction, node);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ SplitHeader::SplitHeader(Split *_split)
|
||||
|
||||
auto app = getApp();
|
||||
|
||||
util::LayoutCreator<SplitHeader> layoutCreator(this);
|
||||
LayoutCreator<SplitHeader> layoutCreator(this);
|
||||
auto layout = layoutCreator.emplace<QHBoxLayout>().withoutMargin();
|
||||
{
|
||||
// dropdown label
|
||||
@@ -234,7 +234,7 @@ void SplitHeader::scaleChangedEvent(float scale)
|
||||
this->dropdownButton->setFixedWidth(w);
|
||||
this->moderationButton->setFixedWidth(w);
|
||||
// this->titleLabel->setFont(
|
||||
// singletons::FontManager::getInstance().getFont(FontStyle::Medium, scale));
|
||||
// chatterino::FontManager::getInstance().getFont(FontStyle::Medium, scale));
|
||||
}
|
||||
|
||||
void SplitHeader::updateChannelText()
|
||||
|
||||
@@ -40,7 +40,7 @@ SplitInput::SplitInput(Split *_chatWidget)
|
||||
void SplitInput::initLayout()
|
||||
{
|
||||
auto app = getApp();
|
||||
util::LayoutCreator<SplitInput> layoutCreator(this);
|
||||
LayoutCreator<SplitInput> layoutCreator(this);
|
||||
|
||||
auto layout =
|
||||
layoutCreator.setLayoutType<QHBoxLayout>().withoutMargin().assign(&this->ui_.hbox);
|
||||
@@ -67,19 +67,19 @@ void SplitInput::initLayout()
|
||||
|
||||
// set edit font
|
||||
this->ui_.textEdit->setFont(
|
||||
app->fonts->getFont(singletons::FontManager::Type::ChatMedium, this->getScale()));
|
||||
app->fonts->getFont(chatterino::FontManager::Type::ChatMedium, this->getScale()));
|
||||
|
||||
this->managedConnections_.push_back(app->fonts->fontChanged.connect([=]() {
|
||||
this->ui_.textEdit->setFont(
|
||||
app->fonts->getFont(singletons::FontManager::Type::ChatMedium, this->getScale()));
|
||||
app->fonts->getFont(chatterino::FontManager::Type::ChatMedium, this->getScale()));
|
||||
}));
|
||||
|
||||
// open emote popup
|
||||
QObject::connect(this->ui_.emoteButton, &RippleEffectLabel::clicked, [this] {
|
||||
if (!this->emotePopup_) {
|
||||
this->emotePopup_ = std::make_unique<EmotePopup>();
|
||||
this->emotePopup_->linkClicked.connect([this](const messages::Link &link) {
|
||||
if (link.type == messages::Link::InsertText) {
|
||||
this->emotePopup_->linkClicked.connect([this](const chatterino::Link &link) {
|
||||
if (link.type == chatterino::Link::InsertText) {
|
||||
this->insertText(link.value + " ");
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user