Skip to content

Commit f09753c

Browse files
committed
Clang format
1 parent 3d37c28 commit f09753c

2 files changed

Lines changed: 21 additions & 25 deletions

File tree

src/widgets/SplitTabWidget.cpp

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "SplitTabWidget.h"
55
#include <QApplication>
6+
#include <QDebug>
67
#include <QDrag>
78
#include <QDragEnterEvent>
89
#include <QEvent>
@@ -17,7 +18,6 @@
1718
#include <QTabBar>
1819
#include <QTabWidget>
1920
#include <QTimer>
20-
#include <QDebug>
2121

2222
DropIndicatorWidget::DropIndicatorWidget(QWidget *parent) : QWidget(parent) {
2323
setAttribute(Qt::WA_TransparentForMouseEvents);
@@ -149,7 +149,7 @@ void DraggableTabBar::dragMoveEvent(QDragMoveEvent *event) {
149149

150150
auto dropPos = event->position().toPoint();
151151
auto newIndex = tabAt(dropPos);
152-
152+
153153
if (newIndex >= 0) {
154154
QRect rect = tabRect(newIndex);
155155
bool after = dropPos.x() > rect.center().x();
@@ -158,7 +158,7 @@ void DraggableTabBar::dragMoveEvent(QDragMoveEvent *event) {
158158
QRect rect = tabRect(count() - 1);
159159
dropIndicator->showAt(rect, true);
160160
}
161-
161+
162162
event->acceptProposedAction();
163163
}
164164

@@ -178,9 +178,10 @@ void DraggableTabBar::dropEvent(QDropEvent *event) {
178178
}
179179

180180
// Forward the drop event to the tab widget
181-
QDropEvent newEvent(event->position(), event->dropAction(), event->mimeData(), event->buttons(), event->modifiers());
181+
QDropEvent newEvent(event->position(), event->dropAction(), event->mimeData(), event->buttons(),
182+
event->modifiers());
182183
tabWidget->dropEvent(&newEvent);
183-
184+
184185
dropIndicator->hide();
185186
}
186187

@@ -226,7 +227,7 @@ void DraggableTabWidget::dropEvent(QDropEvent *event) {
226227
auto oldIndex = indexOf(widget);
227228
auto dropPos = event->position().toPoint();
228229
auto newIndex = tabBar()->tabAt(dropPos);
229-
230+
230231
if (newIndex >= 0) {
231232
auto tabRect = tabBar()->tabRect(newIndex);
232233
if (dropPos.x() > tabRect.center().x()) {
@@ -290,9 +291,7 @@ SplitTabWidget::SplitTabWidget(QWidget *parent)
290291
if (tab) {
291292
auto count = splitter->count();
292293
onNewSplitCreated(tab, count);
293-
QTimer::singleShot(0, this, [this]() {
294-
onSplitCountMaybeChanged();
295-
});
294+
QTimer::singleShot(0, this, [this]() { onSplitCountMaybeChanged(); });
296295
}
297296
});
298297

@@ -394,9 +393,7 @@ void SplitTabWidget::closeSplitWithTabWidget(QTabWidget *tab) {
394393
equalizeWidths();
395394

396395
// Defer the split count check to after the event loop processes the deletion
397-
QTimer::singleShot(0, this, [this]() {
398-
onSplitCountMaybeChanged();
399-
});
396+
QTimer::singleShot(0, this, [this]() { onSplitCountMaybeChanged(); });
400397
}
401398

402399
void SplitTabWidget::addTabToCurrentSplit(QWidget *widget, const QString &label,
@@ -593,7 +590,7 @@ void SplitTabWidget::onTabFocusChanged(QWidget *widget, bool focused) {
593590
tab->currentWidget()->setFocus();
594591
onTabFocusChanged(tab->currentWidget(), true);
595592
}
596-
}
593+
}
597594
if (widget && focused) {
598595
widget->setFocus();
599596
}
@@ -608,10 +605,9 @@ void SplitTabWidget::onNewSplitCreated(QTabWidget *tabWidget, int count) {
608605
}
609606

610607
if (auto tabBar = qobject_cast<DraggableTabBar *>(tabWidget->tabBar())) {
611-
connect(tabBar, &DraggableTabBar::emptyAreaDoubleClicked, this,
612-
[this, tabWidget](const QPoint &pos) {
613-
emit emptyAreaDoubleClicked(tabWidget, pos);
614-
});
608+
connect(
609+
tabBar, &DraggableTabBar::emptyAreaDoubleClicked, this,
610+
[this, tabWidget](const QPoint &pos) { emit emptyAreaDoubleClicked(tabWidget, pos); });
615611
}
616612
}
617613

src/widgets/SplitTabWidget.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@
44
#pragma once
55

66
#include <QChildEvent>
7+
#include <QPainter>
8+
#include <QPen>
79
#include <QSplitter>
810
#include <QTabBar>
911
#include <QTabWidget>
1012
#include <QWidget>
11-
#include <QPainter>
12-
#include <QPen>
1313

1414
class QTabWidget;
1515
class SplitTabWidget;
1616

1717
class DropIndicatorWidget : public QWidget {
1818
Q_OBJECT
19-
public:
20-
explicit DropIndicatorWidget(QWidget *parent = nullptr);
21-
void showAt(const QRect &rect, bool after);
19+
public:
20+
explicit DropIndicatorWidget(QWidget *parent = nullptr);
21+
void showAt(const QRect &rect, bool after);
2222

23-
protected:
24-
void paintEvent(QPaintEvent *) override;
23+
protected:
24+
void paintEvent(QPaintEvent *) override;
2525

26-
private:
26+
private:
2727
QRect m_rect;
2828
bool m_after = false;
2929
};

0 commit comments

Comments
 (0)