diff --git a/src/common/Credentials.cpp b/src/common/Credentials.cpp index 16efc4484..f9d12b72e 100644 --- a/src/common/Credentials.cpp +++ b/src/common/Credentials.cpp @@ -166,11 +166,12 @@ void Credentials::get(const QString &provider, const QString &name_, auto job = new QKeychain::ReadPasswordJob("chatterino"); job->setAutoDelete(true); job->setKey(name); - QObject::connect(job, &QKeychain::Job::finished, receiver, - [job, onLoaded = std::move(onLoaded)](auto) mutable { - onLoaded(job->textData()); - }, - Qt::DirectConnection); + QObject::connect( + job, &QKeychain::Job::finished, receiver, + [job, onLoaded = std::move(onLoaded)](auto) mutable { + onLoaded(job->textData()); + }, + Qt::DirectConnection); job->start(); } else diff --git a/src/common/DownloadManager.cpp b/src/common/DownloadManager.cpp index 5adc8ef32..a579d37a1 100644 --- a/src/common/DownloadManager.cpp +++ b/src/common/DownloadManager.cpp @@ -48,13 +48,11 @@ void DownloadManager::onFinished(QNetworkReply *reply) { switch (reply->error()) { - case QNetworkReply::NoError: - { + case QNetworkReply::NoError: { qDebug("file is downloaded successfully."); } break; - default: - { + default: { qDebug() << reply->errorString().toLatin1(); }; } diff --git a/src/controllers/accounts/AccountController.cpp b/src/controllers/accounts/AccountController.cpp index 1af0cc338..cdaa53285 100644 --- a/src/controllers/accounts/AccountController.cpp +++ b/src/controllers/accounts/AccountController.cpp @@ -27,8 +27,7 @@ AccountController::AccountController() this->accounts_.itemRemoved.connect([this](const auto &args) { switch (args.item->getProviderId()) { - case ProviderId::Twitch: - { + case ProviderId::Twitch: { if (args.caller != this) { auto accs = this->twitch.accounts.cloneVector(); diff --git a/src/controllers/highlights/HighlightModel.cpp b/src/controllers/highlights/HighlightModel.cpp index 7f0cc5997..85950dd07 100644 --- a/src/controllers/highlights/HighlightModel.cpp +++ b/src/controllers/highlights/HighlightModel.cpp @@ -70,8 +70,7 @@ void HighlightModel::customRowSetData(const std::vector &row, { switch (column) { - case 0: - { + case 0: { if (role == Qt::CheckStateRole) { if (rowIndex == 0) @@ -86,8 +85,7 @@ void HighlightModel::customRowSetData(const std::vector &row, } } break; - case 1: - { + case 1: { if (role == Qt::CheckStateRole) { if (rowIndex == 0) @@ -103,8 +101,7 @@ void HighlightModel::customRowSetData(const std::vector &row, } } break; - case 2: - { + case 2: { if (role == Qt::CheckStateRole) { if (rowIndex == 0) @@ -120,8 +117,7 @@ void HighlightModel::customRowSetData(const std::vector &row, } } break; - case 3: - { + case 3: { // empty element } break; diff --git a/src/controllers/highlights/HighlightPhrase.hpp b/src/controllers/highlights/HighlightPhrase.hpp index c206e3649..e1877bc42 100644 --- a/src/controllers/highlights/HighlightPhrase.hpp +++ b/src/controllers/highlights/HighlightPhrase.hpp @@ -119,8 +119,8 @@ struct Deserialize { chatterino::rj::getSafe(value, "regex", _isRegex); chatterino::rj::getSafe(value, "case", _caseSensitive); - return chatterino::HighlightPhrase(_pattern, _alert, _sound, - _isRegex, _caseSensitive); + return chatterino::HighlightPhrase(_pattern, _alert, _sound, _isRegex, + _caseSensitive); } }; diff --git a/src/messages/MessageBuilder.cpp b/src/messages/MessageBuilder.cpp index e24b22f9e..6e4b8115e 100644 --- a/src/messages/MessageBuilder.cpp +++ b/src/messages/MessageBuilder.cpp @@ -32,9 +32,8 @@ std::pair makeAutomodMessage( builder.message().flags.set(MessageFlag::PubSub); builder - .emplace( - Image::fromPixmap(getResources().twitch.automod), - MessageElementFlag::BadgeChannelAuthority) + .emplace(Image::fromPixmap(getResources().twitch.automod), + MessageElementFlag::BadgeChannelAuthority) ->setTooltip("AutoMod"); builder.emplace("AutoMod:", MessageElementFlag::BoldUsername, MessageColor(QColor("blue")), @@ -258,40 +257,35 @@ MessageBuilder::MessageBuilder(const AutomodUserAction &action) QString text; switch (action.type) { - case AutomodUserAction::AddPermitted: - { + case AutomodUserAction::AddPermitted: { text = QString("%1 added %2 as a permitted term on AutoMod.") .arg(action.source.name) .arg(action.message); } break; - case AutomodUserAction::AddBlocked: - { + case AutomodUserAction::AddBlocked: { text = QString("%1 added %2 as a blocked term on AutoMod.") .arg(action.source.name) .arg(action.message); } break; - case AutomodUserAction::RemovePermitted: - { + case AutomodUserAction::RemovePermitted: { text = QString("%1 removed %2 as a permitted term term on AutoMod.") .arg(action.source.name) .arg(action.message); } break; - case AutomodUserAction::RemoveBlocked: - { + case AutomodUserAction::RemoveBlocked: { text = QString("%1 removed %2 as a blocked term on AutoMod.") .arg(action.source.name) .arg(action.message); } break; - case AutomodUserAction::Properties: - { + case AutomodUserAction::Properties: { text = QString("%1 modified the AutoMod properties.") .arg(action.source.name); } diff --git a/src/providers/irc/IrcServer.cpp b/src/providers/irc/IrcServer.cpp index 58400b82a..dd7505ff9 100644 --- a/src/providers/irc/IrcServer.cpp +++ b/src/providers/irc/IrcServer.cpp @@ -182,8 +182,7 @@ void IrcServer::readConnectionMessageReceived(Communi::IrcMessage *message) switch (message->type()) { - case Communi::IrcMessage::Join: - { + case Communi::IrcMessage::Join: { auto x = static_cast(message); if (auto it = @@ -208,8 +207,7 @@ void IrcServer::readConnectionMessageReceived(Communi::IrcMessage *message) return; } - case Communi::IrcMessage::Part: - { + case Communi::IrcMessage::Part: { auto x = static_cast(message); if (auto it = diff --git a/src/providers/twitch/TwitchAccountManager.cpp b/src/providers/twitch/TwitchAccountManager.cpp index f201e9db7..b37a67da2 100644 --- a/src/providers/twitch/TwitchAccountManager.cpp +++ b/src/providers/twitch/TwitchAccountManager.cpp @@ -102,14 +102,12 @@ void TwitchAccountManager::reloadUsers() switch (this->addUser(userData)) { - case AddUserResponse::UserAlreadyExists: - { + case AddUserResponse::UserAlreadyExists: { log("User {} already exists", userData.username); // Do nothing } break; - case AddUserResponse::UserValuesUpdated: - { + case AddUserResponse::UserValuesUpdated: { log("User {} already exists, and values updated!", userData.username); if (userData.username == this->getCurrent()->getUserName()) @@ -120,8 +118,7 @@ void TwitchAccountManager::reloadUsers() } } break; - case AddUserResponse::UserAdded: - { + case AddUserResponse::UserAdded: { log("Added user {}", userData.username); listUpdated = true; } diff --git a/src/providers/twitch/TwitchMessageBuilder.cpp b/src/providers/twitch/TwitchMessageBuilder.cpp index 5caa56fbd..f54d3a644 100644 --- a/src/providers/twitch/TwitchMessageBuilder.cpp +++ b/src/providers/twitch/TwitchMessageBuilder.cpp @@ -617,14 +617,12 @@ void TwitchMessageBuilder::appendUsername() switch (usernameDisplayMode.getValue()) { - case UsernameDisplayMode::Username: - { + case UsernameDisplayMode::Username: { usernameText = username; } break; - case UsernameDisplayMode::LocalizedName: - { + case UsernameDisplayMode::LocalizedName: { if (hasLocalizedName) { usernameText = localizedName; @@ -637,8 +635,7 @@ void TwitchMessageBuilder::appendUsername() break; default: - case UsernameDisplayMode::UsernameAndLocalizedName: - { + case UsernameDisplayMode::UsernameAndLocalizedName: { if (hasLocalizedName) { usernameText = username + "(" + localizedName + ")"; @@ -1240,8 +1237,7 @@ void TwitchMessageBuilder::appendTwitchBadges() int index = badge.midRef(8).toInt(); switch (index) { - case 1: - { + case 1: { this->emplace( Image::fromPixmap(getResources().twitch.verified, 0.25), @@ -1249,8 +1245,7 @@ void TwitchMessageBuilder::appendTwitchBadges() ->setTooltip("Twitch Verified"); } break; - default: - { + default: { printf("[TwitchMessageBuilder] Unhandled partner badge " "index: %d\n", index); diff --git a/src/singletons/Toasts.cpp b/src/singletons/Toasts.cpp index e550b633c..def5df00f 100644 --- a/src/singletons/Toasts.cpp +++ b/src/singletons/Toasts.cpp @@ -134,8 +134,7 @@ public: } QDesktopServices::openUrl(QUrl(link)); break; - case ToastReaction::OpenInStreamlink: - { + case ToastReaction::OpenInStreamlink: { openStreamlinkForChannel(channelName_); break; } diff --git a/src/util/InitUpdateButton.cpp b/src/util/InitUpdateButton.cpp index 95264503f..563f3654d 100644 --- a/src/util/InitUpdateButton.cpp +++ b/src/util/InitUpdateButton.cpp @@ -22,13 +22,11 @@ void initUpdateButton(Button &button, dialog->buttonClicked.connect([&button](auto buttonType) { switch (buttonType) { - case UpdateDialog::Dismiss: - { + case UpdateDialog::Dismiss: { button.hide(); } break; - case UpdateDialog::Install: - { + case UpdateDialog::Install: { Updates::getInstance().installUpdates(); } break; diff --git a/src/util/IrcHelpers.hpp b/src/util/IrcHelpers.hpp index 1c605c941..9fb8ce2b4 100644 --- a/src/util/IrcHelpers.hpp +++ b/src/util/IrcHelpers.hpp @@ -19,38 +19,32 @@ inline QString parseTagString(const QString &input) switch (c.cell()) { - case 'n': - { + case 'n': { output.replace(i, 2, '\n'); } break; - case 'r': - { + case 'r': { output.replace(i, 2, '\r'); } break; - case 's': - { + case 's': { output.replace(i, 2, ' '); } break; - case '\\': - { + case '\\': { output.replace(i, 2, '\\'); } break; - case ':': - { + case ':': { output.replace(i, 2, ';'); } break; - default: - { + default: { output.remove(i, 1); } break; diff --git a/src/util/QObjectRef.hpp b/src/util/QObjectRef.hpp index 4a15545d1..bd469d661 100644 --- a/src/util/QObjectRef.hpp +++ b/src/util/QObjectRef.hpp @@ -61,10 +61,10 @@ private: // new if (other) { - this->conn_ = - QObject::connect(other, &QObject::destroyed, qApp, - [this](QObject *) { this->set(nullptr); }, - Qt::DirectConnection); + this->conn_ = QObject::connect( + other, &QObject::destroyed, qApp, + [this](QObject *) { this->set(nullptr); }, + Qt::DirectConnection); } this->t_ = other; diff --git a/src/widgets/Scrollbar.cpp b/src/widgets/Scrollbar.cpp index 4c7efeede..30253e484 100644 --- a/src/widgets/Scrollbar.cpp +++ b/src/widgets/Scrollbar.cpp @@ -297,15 +297,13 @@ void Scrollbar::paintEvent(QPaintEvent *) switch (highlight.getStyle()) { - case ScrollbarHighlight::Default: - { + case ScrollbarHighlight::Default: { painter.fillRect(w / 8 * 3, int(y), w / 4, highlightHeight, color); } break; - case ScrollbarHighlight::Line: - { + case ScrollbarHighlight::Line: { painter.fillRect(0, int(y), w, 1, color); } break; diff --git a/src/widgets/Window.cpp b/src/widgets/Window.cpp index 4427f64b3..75432e78d 100644 --- a/src/widgets/Window.cpp +++ b/src/widgets/Window.cpp @@ -85,8 +85,7 @@ bool Window::event(QEvent *event) case QEvent::WindowActivate: break; - case QEvent::WindowDeactivate: - { + case QEvent::WindowDeactivate: { auto page = this->notebook_->getOrAddSelectedPage(); if (page != nullptr) diff --git a/src/widgets/dialogs/NotificationPopup.cpp b/src/widgets/dialogs/NotificationPopup.cpp index e8ed2d82e..539da739a 100644 --- a/src/widgets/dialogs/NotificationPopup.cpp +++ b/src/widgets/dialogs/NotificationPopup.cpp @@ -35,8 +35,7 @@ void NotificationPopup::updatePosition() switch (location) { - case BottomRight: - { + case BottomRight: { this->move(rect.right() - this->width(), rect.bottom() - this->height()); } diff --git a/src/widgets/dialogs/SelectChannelDialog.cpp b/src/widgets/dialogs/SelectChannelDialog.cpp index d6470c489..30df13a8d 100644 --- a/src/widgets/dialogs/SelectChannelDialog.cpp +++ b/src/widgets/dialogs/SelectChannelDialog.cpp @@ -258,33 +258,28 @@ void SelectChannelDialog::setSelectedChannel(IndirectChannel _channel) switch (_channel.getType()) { - case Channel::Type::Twitch: - { + case Channel::Type::Twitch: { this->ui_.notebook->selectIndex(TAB_TWITCH); this->ui_.twitch.channel->setFocus(); this->ui_.twitch.channelName->setText(channel->getName()); } break; - case Channel::Type::TwitchWatching: - { + case Channel::Type::TwitchWatching: { this->ui_.notebook->selectIndex(TAB_TWITCH); this->ui_.twitch.watching->setFocus(); } break; - case Channel::Type::TwitchMentions: - { + case Channel::Type::TwitchMentions: { this->ui_.notebook->selectIndex(TAB_TWITCH); this->ui_.twitch.mentions->setFocus(); } break; - case Channel::Type::TwitchWhispers: - { + case Channel::Type::TwitchWhispers: { this->ui_.notebook->selectIndex(TAB_TWITCH); this->ui_.twitch.whispers->setFocus(); } break; - case Channel::Type::Irc: - { + case Channel::Type::Irc: { this->ui_.notebook->selectIndex(TAB_IRC); this->ui_.irc.channel->setText(_channel.get()->getName()); @@ -309,8 +304,7 @@ void SelectChannelDialog::setSelectedChannel(IndirectChannel _channel) this->ui_.irc.channel->setFocus(); } break; - default: - { + default: { this->ui_.notebook->selectIndex(TAB_TWITCH); this->ui_.twitch.channel->setFocus(); } @@ -330,8 +324,7 @@ IndirectChannel SelectChannelDialog::getSelectedChannel() const switch (this->ui_.notebook->getSelectedIndex()) { - case TAB_TWITCH: - { + case TAB_TWITCH: { if (this->ui_.twitch.channel->isChecked()) { return app->twitch.server->getOrAddChannel( @@ -351,8 +344,7 @@ IndirectChannel SelectChannelDialog::getSelectedChannel() const } } break; - case TAB_IRC: - { + case TAB_IRC: { int row = this->ui_.irc.servers->getTableView() ->selectionModel() ->currentIndex() diff --git a/src/widgets/dialogs/UpdateDialog.cpp b/src/widgets/dialogs/UpdateDialog.cpp index bc84e6678..1099912f8 100644 --- a/src/widgets/dialogs/UpdateDialog.cpp +++ b/src/widgets/dialogs/UpdateDialog.cpp @@ -48,8 +48,7 @@ void UpdateDialog::updateStatusChanged(Updates::Status status) switch (status) { - case Updates::UpdateAvailable: - { + case Updates::UpdateAvailable: { this->ui_.label->setText( QString("An update (%1) is available.\n\nDo you want to " "download and install it?") @@ -58,28 +57,24 @@ void UpdateDialog::updateStatusChanged(Updates::Status status) } break; - case Updates::SearchFailed: - { + case Updates::SearchFailed: { this->ui_.label->setText("Failed to load version information."); } break; - case Updates::Downloading: - { + case Updates::Downloading: { this->ui_.label->setText( "Downloading updates.\n\nChatterino will restart " "automatically when the download is done."); } break; - case Updates::DownloadFailed: - { + case Updates::DownloadFailed: { this->ui_.label->setText("Failed to download the update."); } break; - case Updates::WriteFileFailed: - { + case Updates::WriteFileFailed: { this->ui_.label->setText("Failed to save the update to disk."); } break; diff --git a/src/widgets/dialogs/UserInfoPopup.cpp b/src/widgets/dialogs/UserInfoPopup.cpp index 4a7d4f681..685b4e053 100644 --- a/src/widgets/dialogs/UserInfoPopup.cpp +++ b/src/widgets/dialogs/UserInfoPopup.cpp @@ -191,16 +191,14 @@ UserInfoPopup::UserInfoPopup() switch (action) { - case TimeoutWidget::Ban: - { + case TimeoutWidget::Ban: { if (this->channel_) { this->channel_->sendMessage("/ban " + this->userName_); } } break; - case TimeoutWidget::Unban: - { + case TimeoutWidget::Unban: { if (this->channel_) { this->channel_->sendMessage("/unban " + @@ -208,8 +206,7 @@ UserInfoPopup::UserInfoPopup() } } break; - case TimeoutWidget::Timeout: - { + case TimeoutWidget::Timeout: { if (this->channel_) { this->channel_->sendMessage("/timeout " + diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index c6c60597e..d4c3bc00e 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -1335,8 +1335,7 @@ void ChannelView::mousePressEvent(QMouseEvent *event) // check if message is collapsed switch (event->button()) { - case Qt::LeftButton: - { + case Qt::LeftButton: { this->lastPressPosition_ = event->screenPos(); this->isMouseDown_ = true; @@ -1354,8 +1353,7 @@ void ChannelView::mousePressEvent(QMouseEvent *event) } break; - case Qt::RightButton: - { + case Qt::RightButton: { this->lastRightPressPosition_ = event->screenPos(); this->isRightMouseDown_ = true; } @@ -1473,8 +1471,7 @@ void ChannelView::handleMouseClick(QMouseEvent *event, { switch (event->button()) { - case Qt::LeftButton: - { + case Qt::LeftButton: { if (this->selecting_) { // this->pausedBySelection = false; @@ -1498,8 +1495,7 @@ void ChannelView::handleMouseClick(QMouseEvent *event, } } break; - case Qt::RightButton: - { + case Qt::RightButton: { auto insertText = [=](QString text) { if (auto split = dynamic_cast(this->parentWidget())) { @@ -1714,16 +1710,14 @@ void ChannelView::handleLinkClick(QMouseEvent *event, const Link &link, switch (link.type) { case Link::UserWhisper: - case Link::UserInfo: - { + case Link::UserInfo: { auto user = link.value; this->showUserInfoPopup(user); qDebug() << "Clicked " << user << "s message"; } break; - case Link::Url: - { + case Link::Url: { if (getSettings()->openLinksIncognito && supportsIncognitoLinks()) openLinkIncognito(link.value); else @@ -1731,8 +1725,7 @@ void ChannelView::handleLinkClick(QMouseEvent *event, const Link &link, } break; - case Link::UserAction: - { + case Link::UserAction: { QString value = link.value; value.replace("{user}", layout->getMessage()->loginName) @@ -1744,14 +1737,12 @@ void ChannelView::handleLinkClick(QMouseEvent *event, const Link &link, } break; - case Link::AutoModAllow: - { + case Link::AutoModAllow: { getApp()->accounts->twitch.getCurrent()->autoModAllow(link.value); } break; - case Link::AutoModDeny: - { + case Link::AutoModDeny: { getApp()->accounts->twitch.getCurrent()->autoModDeny(link.value); } diff --git a/src/widgets/helper/NotebookButton.cpp b/src/widgets/helper/NotebookButton.cpp index 4ed9a37d7..3b76adcaa 100644 --- a/src/widgets/helper/NotebookButton.cpp +++ b/src/widgets/helper/NotebookButton.cpp @@ -62,8 +62,7 @@ void NotebookButton::paintEvent(QPaintEvent *event) switch (icon_) { - case Plus: - { + case Plus: { painter.setPen([&] { QColor tmp = foreground; if (SplitContainer::isDraggingSplit) @@ -90,8 +89,7 @@ void NotebookButton::paintEvent(QPaintEvent *event) } break; - case User: - { + case User: { painter.setRenderHint(QPainter::Antialiasing); painter.setRenderHint(QPainter::HighQualityAntialiasing); @@ -111,8 +109,7 @@ void NotebookButton::paintEvent(QPaintEvent *event) } break; - case Settings: - { + case Settings: { painter.setRenderHint(QPainter::Antialiasing); painter.setRenderHint(QPainter::HighQualityAntialiasing); diff --git a/src/widgets/helper/NotebookTab.cpp b/src/widgets/helper/NotebookTab.cpp index e88cbfbac..faaa1d6bf 100644 --- a/src/widgets/helper/NotebookTab.cpp +++ b/src/widgets/helper/NotebookTab.cpp @@ -432,8 +432,7 @@ void NotebookTab::mousePressEvent(QMouseEvent *event) { switch (event->button()) { - case Qt::RightButton: - { + case Qt::RightButton: { this->menu_.popup(event->globalPos()); } break; diff --git a/src/widgets/settingspages/AboutPage.cpp b/src/widgets/settingspages/AboutPage.cpp index fd1ce1d3f..eee74c737 100644 --- a/src/widgets/settingspages/AboutPage.cpp +++ b/src/widgets/settingspages/AboutPage.cpp @@ -83,7 +83,9 @@ AboutPage::AboutPage() "chatterino2/commit/" + version.getCommitHash() + "\">" + version.getCommitHash() + "") - .arg(Modes::getInstance().isNightly ? ", " + version.getDateOfBuild() : ""); + .arg(Modes::getInstance().isNightly + ? ", " + version.getDateOfBuild() + : ""); auto versionLabel = versionInfo.emplace(text); versionLabel->setOpenExternalLinks(true); diff --git a/src/widgets/splits/Split.cpp b/src/widgets/splits/Split.cpp index 209baa028..c3df3cd60 100644 --- a/src/widgets/splits/Split.cpp +++ b/src/widgets/splits/Split.cpp @@ -6,8 +6,8 @@ #include "debug/Log.hpp" #include "providers/twitch/EmoteValue.hpp" #include "providers/twitch/TwitchChannel.hpp" -#include "providers/twitch/TwitchMessageBuilder.hpp" #include "providers/twitch/TwitchIrcServer.hpp" +#include "providers/twitch/TwitchMessageBuilder.hpp" #include "singletons/Settings.hpp" #include "singletons/Theme.hpp" #include "singletons/WindowManager.hpp" diff --git a/src/widgets/splits/SplitContainer.cpp b/src/widgets/splits/SplitContainer.cpp index 9fce4158b..004cb0d1e 100644 --- a/src/widgets/splits/SplitContainer.cpp +++ b/src/widgets/splits/SplitContainer.cpp @@ -339,15 +339,13 @@ void SplitContainer::focusSplitRecursive(Node *node, Direction direction) { switch (node->type_) { - case Node::_Split: - { + case Node::_Split: { node->split_->giveFocus(Qt::OtherFocusReason); } break; case Node::HorizontalContainer: - case Node::VerticalContainer: - { + case Node::VerticalContainer: { auto &children = node->children_; auto it = std::find_if( @@ -898,23 +896,19 @@ void SplitContainer::Node::insertSplitRelative(Split *_split, { switch (this->type_) { - case Node::EmptyRoot: - { + case Node::EmptyRoot: { this->setSplit(_split); } break; - case Node::_Split: - { + case Node::_Split: { this->nestSplitIntoCollection(_split, _direction); } break; - case Node::HorizontalContainer: - { + case Node::HorizontalContainer: { this->nestSplitIntoCollection(_split, _direction); } break; - case Node::VerticalContainer: - { + case Node::VerticalContainer: { this->nestSplitIntoCollection(_split, _direction); } break; @@ -1110,16 +1104,14 @@ void SplitContainer::Node::layout(bool addSpacing, float _scale, switch (this->type_) { - case Node::_Split: - { + case Node::_Split: { QRect rect = this->geometry_.toRect(); this->split_->setGeometry( rect.marginsRemoved(QMargins(1, 1, 0, 0))); } break; case Node::VerticalContainer: - case Node::HorizontalContainer: - { + case Node::HorizontalContainer: { bool isVertical = this->type_ == Node::VerticalContainer; // vars diff --git a/src/widgets/splits/SplitHeader.cpp b/src/widgets/splits/SplitHeader.cpp index 504821e44..60875567d 100644 --- a/src/widgets/splits/SplitHeader.cpp +++ b/src/widgets/splits/SplitHeader.cpp @@ -301,7 +301,6 @@ std::unique_ptr SplitHeader::createMainMenu() // sub menu auto moreMenu = new QMenu("More", this); - moreMenu->addAction("Toggle moderation mode", this->split_, [this]() { this->split_->setModerationMode(!this->split_->getModerationMode()); }); @@ -591,16 +590,14 @@ void SplitHeader::mousePressEvent(QMouseEvent *event) { switch (event->button()) { - case Qt::LeftButton: - { + case Qt::LeftButton: { this->dragging_ = true; this->dragStart_ = event->pos(); } break; - case Qt::RightButton: - { + case Qt::RightButton: { this->mainMenu_->popup(this->mapToGlobal(event->pos())); } break; @@ -718,8 +715,7 @@ void SplitHeader::themeChangedEvent() } else { - this->dropdownButton_->setPixmap( - getResources().buttons.menuLight); + this->dropdownButton_->setPixmap(getResources().buttons.menuLight); this->addButton_->setPixmap(getResources().buttons.addSplitDark); } } diff --git a/src/widgets/splits/SplitOverlay.cpp b/src/widgets/splits/SplitOverlay.cpp index 3a6c790bc..b4c293034 100644 --- a/src/widgets/splits/SplitOverlay.cpp +++ b/src/widgets/splits/SplitOverlay.cpp @@ -35,8 +35,7 @@ SplitOverlay::SplitOverlay(Split *parent) new QPushButton(getResources().split.left, QString()); auto *right = this->right_ = new QPushButton(getResources().split.right, QString()); - auto *up = this->up_ = - new QPushButton(getResources().split.up, QString()); + auto *up = this->up_ = new QPushButton(getResources().split.up, QString()); auto *down = this->down_ = new QPushButton(getResources().split.down, QString()); @@ -107,27 +106,23 @@ void SplitOverlay::paintEvent(QPaintEvent *) QRect rect; switch (this->hoveredElement_) { - case SplitLeft: - { + case SplitLeft: { rect = QRect(0, 0, this->width() / 2, this->height()); } break; - case SplitRight: - { + case SplitRight: { rect = QRect(this->width() / 2, 0, this->width() / 2, this->height()); } break; - case SplitUp: - { + case SplitUp: { rect = QRect(0, 0, this->width(), this->height() / 2); } break; - case SplitDown: - { + case SplitDown: { rect = QRect(0, this->height() / 2, this->width(), this->height() / 2); } @@ -184,8 +179,7 @@ bool SplitOverlay::ButtonEventFilter::eventFilter(QObject *watched, { switch (event->type()) { - case QEvent::Enter: - { + case QEvent::Enter: { QGraphicsOpacityEffect *effect = dynamic_cast( ((QWidget *)watched)->graphicsEffect()); @@ -199,8 +193,7 @@ bool SplitOverlay::ButtonEventFilter::eventFilter(QObject *watched, this->parent->update(); } break; - case QEvent::Leave: - { + case QEvent::Leave: { QGraphicsOpacityEffect *effect = dynamic_cast( ((QWidget *)watched)->graphicsEffect()); @@ -214,8 +207,7 @@ bool SplitOverlay::ButtonEventFilter::eventFilter(QObject *watched, this->parent->update(); } break; - case QEvent::MouseButtonPress: - { + case QEvent::MouseButtonPress: { if (this->hoveredElement == HoveredElement::SplitMove) { QMouseEvent *mouseEvent = static_cast(event); @@ -227,8 +219,7 @@ bool SplitOverlay::ButtonEventFilter::eventFilter(QObject *watched, } } break; - case QEvent::MouseButtonRelease: - { + case QEvent::MouseButtonRelease: { if (this->hoveredElement != HoveredElement::SplitMove) { SplitContainer *container =