formatted all files with clang 9

This commit is contained in:
fourtf
2019-09-26 00:51:05 +02:00
parent e47a043a27
commit 9874bd779a
27 changed files with 102 additions and 185 deletions
+1 -1
View File
@@ -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"
+8 -16
View File
@@ -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
+3 -7
View File
@@ -301,7 +301,6 @@ std::unique_ptr<QMenu> 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);
}
}
+9 -18
View File
@@ -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<QGraphicsOpacityEffect *>(
((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<QGraphicsOpacityEffect *>(
((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<QMouseEvent *>(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 =