From cd5972522b2946065517fa9731e17c03bbf505bf Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sun, 11 Aug 2019 21:08:18 +0200 Subject: [PATCH] reformat --- src/messages/MessageElement.cpp | 3 +- src/providers/twitch/TwitchMessageBuilder.cpp | 3 +- src/widgets/helper/NotebookTab.cpp | 5 ++- src/widgets/splits/Split.cpp | 23 ++++++------ src/widgets/splits/SplitHeader.cpp | 35 +++++++++---------- 5 files changed, 32 insertions(+), 37 deletions(-) diff --git a/src/messages/MessageElement.cpp b/src/messages/MessageElement.cpp index 774d569b9..a9db2ab95 100644 --- a/src/messages/MessageElement.cpp +++ b/src/messages/MessageElement.cpp @@ -347,8 +347,7 @@ void TwitchModerationElement::addToContainer(MessageLayoutContainer &container, QSize size(int(container.getScale() * 16), int(container.getScale() * 16)); - for (const auto &action : - getApp()->moderationActions->items) + for (const auto &action : getApp()->moderationActions->items) { if (auto image = action.getImage()) { diff --git a/src/providers/twitch/TwitchMessageBuilder.cpp b/src/providers/twitch/TwitchMessageBuilder.cpp index 9098ffed9..d0880bf75 100644 --- a/src/providers/twitch/TwitchMessageBuilder.cpp +++ b/src/providers/twitch/TwitchMessageBuilder.cpp @@ -509,8 +509,7 @@ void TwitchMessageBuilder::parseUsername() { this->usernameColor_ = QColor(color); } - else if (getSettings()->colorizeNicknames && - this->tags.contains("user-id")) + else if (getSettings()->colorizeNicknames && this->tags.contains("user-id")) { this->usernameColor_ = getRandomColor(this->tags.value("user-id")); } diff --git a/src/widgets/helper/NotebookTab.cpp b/src/widgets/helper/NotebookTab.cpp index 96eb61948..e88cbfbac 100644 --- a/src/widgets/helper/NotebookTab.cpp +++ b/src/widgets/helper/NotebookTab.cpp @@ -562,9 +562,8 @@ void NotebookTab::wheelEvent(QWheelEvent *event) const auto defaultMouseDelta = 120; const auto delta = event->delta(); const auto selectTab = [this](int delta) { - delta > 0 - ? this->notebook_->selectPreviousTab() - : this->notebook_->selectNextTab(); + delta > 0 ? this->notebook_->selectPreviousTab() + : this->notebook_->selectNextTab(); }; // If it's true // Then the user uses the trackpad or perhaps the most accurate mouse diff --git a/src/widgets/splits/Split.cpp b/src/widgets/splits/Split.cpp index 58fd15c23..d610b5226 100644 --- a/src/widgets/splits/Split.cpp +++ b/src/widgets/splits/Split.cpp @@ -175,18 +175,19 @@ Split::Split(QWidget *parent) this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - this->managedConnect(modifierStatusChanged, - [this](Qt::KeyboardModifiers status) { - if ((status == showSplitOverlayModifiers /*|| status == showAddSplitRegions*/) && + this->managedConnect(modifierStatusChanged, [this](Qt::KeyboardModifiers + status) { + if ((status == + showSplitOverlayModifiers /*|| status == showAddSplitRegions*/) && this->isMouseOver_) - { - this->overlay_->show(); - } - else - { - this->overlay_->hide(); - } - }); + { + this->overlay_->show(); + } + else + { + this->overlay_->hide(); + } + }); this->input_->ui_.textEdit->focused.connect( [this] { this->focused.invoke(); }); diff --git a/src/widgets/splits/SplitHeader.cpp b/src/widgets/splits/SplitHeader.cpp index 8ee3e34b0..d77118ebe 100644 --- a/src/widgets/splits/SplitHeader.cpp +++ b/src/widgets/splits/SplitHeader.cpp @@ -176,9 +176,7 @@ void SplitHeader::initializeLayout() switch (button) { case Qt::LeftButton: - if (getApp() - ->moderationActions->items - .empty()) + if (getApp()->moderationActions->items.empty()) { getApp()->windows->showSettingsDialog( SettingsDialogPreference:: @@ -222,19 +220,19 @@ void SplitHeader::initializeLayout() }); // update moderation button when items changed - this->managedConnect( - getApp()->moderationActions->items.delayedItemsChanged, [this] { - if (getApp()->moderationActions->items.empty()) - { - if (this->split_->getModerationMode()) - this->split_->setModerationMode(true); - } - else - { - if (this->split_->getModerationMode()) - this->split_->setModerationMode(true); - } - }); + this->managedConnect(getApp()->moderationActions->items.delayedItemsChanged, + [this] { + if (getApp()->moderationActions->items.empty()) + { + if (this->split_->getModerationMode()) + this->split_->setModerationMode(true); + } + else + { + if (this->split_->getModerationMode()) + this->split_->setModerationMode(true); + } + }); layout->setMargin(0); layout->setSpacing(0); @@ -507,9 +505,8 @@ void SplitHeader::updateChannelText() void SplitHeader::updateModerationModeIcon() { - auto moderationMode = - this->split_->getModerationMode() && - !getApp()->moderationActions->items.empty(); + auto moderationMode = this->split_->getModerationMode() && + !getApp()->moderationActions->items.empty(); this->moderationButton_->setPixmap( moderationMode ? getApp()->resources->buttons.modModeEnabled