Skip to content

Commit

Permalink
clang-format: Increase column limit from 80 to 120
Browse files Browse the repository at this point in the history
  • Loading branch information
RytoEX committed Oct 4, 2024
1 parent 109f64c commit a1fbf10
Show file tree
Hide file tree
Showing 736 changed files with 22,902 additions and 45,653 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakStringLiterals: false # apparently unpredictable
ColumnLimit: 80
ColumnLimit: 120
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 8
Expand Down
20 changes: 7 additions & 13 deletions UI/absolute-slider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ AbsoluteSlider::AbsoluteSlider(QWidget *parent) : SliderIgnoreScroll(parent)
setMouseTracking(true);
}

AbsoluteSlider::AbsoluteSlider(Qt::Orientation orientation, QWidget *parent)
: SliderIgnoreScroll(orientation, parent)
AbsoluteSlider::AbsoluteSlider(Qt::Orientation orientation, QWidget *parent) : SliderIgnoreScroll(orientation, parent)
{
installEventFilter(this);
setMouseTracking(true);
}

void AbsoluteSlider::mousePressEvent(QMouseEvent *event)
{
dragging = (event->buttons() & Qt::LeftButton ||
event->buttons() & Qt::MiddleButton);
dragging = (event->buttons() & Qt::LeftButton || event->buttons() & Qt::MiddleButton);

if (dragging) {
setSliderDown(true);
Expand Down Expand Up @@ -59,8 +57,7 @@ bool AbsoluteSlider::eventFilter(QObject *obj, QEvent *event)
if (event->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);

if (keyEvent->key() == Qt::Key_Up ||
keyEvent->key() == Qt::Key_Down) {
if (keyEvent->key() == Qt::Key_Up || keyEvent->key() == Qt::Key_Down) {
return true;
}
}
Expand All @@ -78,10 +75,8 @@ int AbsoluteSlider::posToRangeValue(QMouseEvent *event)
int sliderMax;
int handleLength;

const QRect groove = style()->subControlRect(
QStyle::CC_Slider, &opt, QStyle::SC_SliderGroove, this);
const QRect handle = style()->subControlRect(
QStyle::CC_Slider, &opt, QStyle::SC_SliderHandle, this);
const QRect groove = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderGroove, this);
const QRect handle = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderHandle, this);

if (orientation() == Qt::Horizontal) {
pos = event->pos().x();
Expand All @@ -95,9 +90,8 @@ int AbsoluteSlider::posToRangeValue(QMouseEvent *event)
sliderMax = groove.bottom() - (handleLength / 2) + 1;
}

int sliderValue = style()->sliderValueFromPosition(
minimum(), maximum(), pos - sliderMin, sliderMax - sliderMin,
opt.upsideDown);
int sliderValue = style()->sliderValueFromPosition(minimum(), maximum(), pos - sliderMin, sliderMax - sliderMin,
opt.upsideDown);

return sliderValue;
}
Loading

0 comments on commit a1fbf10

Please sign in to comment.