Formatting

This commit is contained in:
Jonas Kvinge
2025-12-08 23:49:48 +01:00
parent 109ff90401
commit 93af866185
179 changed files with 1187 additions and 1269 deletions

View File

@@ -129,7 +129,7 @@ void AutoExpandingTreeView::mousePressEvent(QMouseEvent *event) {
QTreeView::mousePressEvent(event);
//enqueue to playlist with middleClick
// enqueue to playlist with middleClick
if (event->button() == Qt::MiddleButton) {
QMimeData *q_mimedata = model()->mimeData(selectedIndexes());
if (MimeData *mimedata = qobject_cast<MimeData*>(q_mimedata)) {

View File

@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#include "clickablelabel.h"

View File

@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#ifndef CLICKABLELABEL_H
#define CLICKABLELABEL_H

View File

@@ -43,9 +43,9 @@ namespace {
constexpr int TabSize_LargeSidebarMinWidth = 70;
} // namespace
FancyTabBar::FancyTabBar(QWidget *parent) :
QTabBar(parent),
mouseHoverTabIndex(-1) {
FancyTabBar::FancyTabBar(QWidget *parent)
: QTabBar(parent),
mouseHoverTabIndex(-1) {
setMouseTracking(true);
@@ -180,7 +180,7 @@ void FancyTabBar::paintEvent(QPaintEvent *pe) {
QLinearGradient grad(selectionRect.topLeft(), selectionRect.topRight());
grad.setColorAt(0, QColor(255, 255, 255, 140));
grad.setColorAt(1, QColor(255, 255, 255, 210));
p.fillRect(selectionRect.adjusted(0,0,0,-1), grad);
p.fillRect(selectionRect.adjusted(0, 0, 0, -1), grad);
p.restore();
// shadow lines

View File

@@ -91,7 +91,7 @@ void FancyTabWidget::LoadSettings(const QString &settings_group) {
Settings s;
s.beginGroup(settings_group);
QMultiMap <int, FancyTabData*> tabs;
QMultiMap<int, FancyTabData*> tabs;
for (FancyTabData *tab : std::as_const(tabs_)) {
int idx = s.value(u"tab_"_s + tab->name(), tab->index()).toInt();
while (tabs.contains(idx)) { ++idx; }

View File

@@ -32,7 +32,7 @@ ForceScrollPerPixel::ForceScrollPerPixel(QAbstractItemView *item_view, QObject *
bool ForceScrollPerPixel::eventFilter(QObject *object, QEvent *event) {
if (object == item_view_ && event->type() != QEvent::Destroy && event->type() != QEvent::WinIdChange) {
//event->type() != QEvent::AccessibilityPrepare)
// event->type() != QEvent::AccessibilityPrepare)
item_view_->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
item_view_->verticalScrollBar()->setSingleStep(20);
}

View File

@@ -233,7 +233,7 @@ QModelIndex GroupedIconView::indexAt(const QPoint &p) const {
const QPoint viewport_p = p + QPoint(horizontalOffset(), verticalOffset());
const int count = static_cast<int>(visual_rects_.count());
for (int i = 0; i<count; ++i) {
for (int i = 0; i < count; ++i) {
if (visual_rects_[i].contains(viewport_p)) {
return model()->index(i, 0);
}
@@ -265,7 +265,7 @@ void GroupedIconView::paintEvent(QPaintEvent *e) {
const QItemSelectionModel *selections = selectionModel();
const bool focus = (hasFocus() || viewport()->hasFocus()) && current.isValid();
const QStyle::State opt_state = option.state;
const bool enabled = (opt_state & QStyle::State_Enabled) != 0;
const bool enabled = (opt_state &QStyle::State_Enabled) != 0;
int maxSize = (flow() == TopToBottom) ? viewport()->size().width() - 2 * spacing() : viewport()->size().height() - 2 * spacing();
@@ -381,10 +381,10 @@ QModelIndex GroupedIconView::moveCursor(CursorAction action, const Qt::KeyboardM
switch (action) {
case MoveUp: ret = IndexAboveOrBelow(ret, -1); break;
case MovePrevious:
case MoveLeft: ret --; break;
case MoveLeft: ret--; break;
case MoveDown: ret = IndexAboveOrBelow(ret, +1); break;
case MoveNext:
case MoveRight: ret ++; break;
case MoveRight: ret++; break;
case MovePageUp:
case MoveHome: ret = 0; break;
case MovePageDown:

View File

@@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License
along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#include "loginstatewidget.h"
#include "ui_loginstatewidget.h"

View File

@@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License
along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#ifndef LOGINSTATEWIDGET_H
#define LOGINSTATEWIDGET_H

View File

@@ -497,7 +497,7 @@ void PlayingWidget::FadePreviousTrack(const qreal value) {
void PlayingWidget::resizeEvent(QResizeEvent *e) {
//if (visible_ && e->oldSize() != e->size()) {
// if (visible_ && e->oldSize() != e->size()) {
if (e->oldSize() != e->size()) {
if (mode_ == Mode::LargeSongDetails) {
UpdateHeight();

View File

@@ -1,23 +1,23 @@
/***************************************************************************
prettyslider.cpp
-------------------
begin : Dec 15 2003
copyright : (C) 2003 by Mark Kretschmann
email : markey@web.de
copyright : (C) 2005 by Gábor Lehel
email : illissius@gmail.com
copyright : (C) 2018-2023 by Jonas Kvinge
email : jonas@jkvinge.net
***************************************************************************/
begin : Dec 15 2003
copyright : (C) 2003 by Mark Kretschmann
email : markey@web.de
copyright : (C) 2005 by Gábor Lehel
email : illissius@gmail.com
copyright : (C) 2018-2023 by Jonas Kvinge
email : jonas@jkvinge.net
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include <QSlider>
#include <QStyle>

View File

@@ -1,23 +1,23 @@
/***************************************************************************
prettyslider.h
-------------------
begin : Dec 15 2003
copyright : (C) 2003 by Mark Kretschmann
email : markey@web.de
copyright : (C) 2005 by Gábor Lehel
email : illissius@gmail.com
copyright : (C) 2018-2023 by Jonas Kvinge
email : jonas@jkvinge.net
***************************************************************************/
begin : Dec 15 2003
copyright : (C) 2003 by Mark Kretschmann
email : markey@web.de
copyright : (C) 2005 by Gábor Lehel
email : illissius@gmail.com
copyright : (C) 2018-2023 by Jonas Kvinge
email : jonas@jkvinge.net
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef PRETTYSLIDER_H
#define PRETTYSLIDER_H

View File

@@ -44,8 +44,8 @@ void RenameTabLineEdit::focusOutEvent(QFocusEvent *e) {
Q_UNUSED(e);
//if the user hasn't explicitly accepted, discard the value
// if the user hasn't explicitly accepted, discard the value
Q_EMIT EditingCanceled();
//we don't call the default event since it will trigger editingFished()
// we don't call the default event since it will trigger editingFished()
}

View File

@@ -29,7 +29,7 @@ THE SOFTWARE.
#include "searchfield.h"
SearchFieldPrivate::SearchFieldPrivate(SearchField *searchField, QLineEdit *lineedit, QPushButton *clearbutton)
: QObject(searchField), lineedit_(lineedit), clearbutton_(clearbutton) {}
: QObject(searchField), lineedit_(lineedit), clearbutton_(clearbutton) {}
int SearchFieldPrivate::lineEditFrameWidth() const {
return lineedit_->style()->pixelMetric(QStyle::PM_DefaultFrameWidth);

View File

@@ -1,23 +1,23 @@
/***************************************************************************
sliderslider.cpp
-------------------
begin : Dec 15 2003
copyright : (C) 2003 by Mark Kretschmann
email : markey@web.de
copyright : (C) 2005 by Gábor Lehel
email : illissius@gmail.com
copyright : (C) 2018-2023 by Jonas Kvinge
email : jonas@jkvinge.net
***************************************************************************/
begin : Dec 15 2003
copyright : (C) 2003 by Mark Kretschmann
email : markey@web.de
copyright : (C) 2005 by Gábor Lehel
email : illissius@gmail.com
copyright : (C) 2018-2023 by Jonas Kvinge
email : jonas@jkvinge.net
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include <QApplication>
#include <QSlider>

View File

@@ -1,23 +1,23 @@
/***************************************************************************
sliderslider.h
-------------------
begin : Dec 15 2003
copyright : (C) 2003 by Mark Kretschmann
email : markey@web.de
copyright : (C) 2005 by Gábor Lehel
email : illissius@gmail.com
copyright : (C) 2018-2023 by Jonas Kvinge
email : jonas@jkvinge.net
***************************************************************************/
begin : Dec 15 2003
copyright : (C) 2003 by Mark Kretschmann
email : markey@web.de
copyright : (C) 2005 by Gábor Lehel
email : illissius@gmail.com
copyright : (C) 2018-2023 by Jonas Kvinge
email : jonas@jkvinge.net
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef SLIDERSLIDER_H
#define SLIDERSLIDER_H

View File

@@ -1,23 +1,23 @@
/***************************************************************************
volumeslider.cpp
-------------------
begin : Dec 15 2003
copyright : (C) 2003 by Mark Kretschmann
email : markey@web.de
copyright : (C) 2005 by Gábor Lehel
email : illissius@gmail.com
copyright : (C) 2018-2023 by Jonas Kvinge
email : jonas@jkvinge.net
***************************************************************************/
begin : Dec 15 2003
copyright : (C) 2003 by Mark Kretschmann
email : markey@web.de
copyright : (C) 2005 by Gábor Lehel
email : illissius@gmail.com
copyright : (C) 2018-2023 by Jonas Kvinge
email : jonas@jkvinge.net
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include <QSlider>
#include <QHash>

View File

@@ -1,23 +1,23 @@
/***************************************************************************
volumeslider.h
-------------------
begin : Dec 15 2003
copyright : (C) 2003 by Mark Kretschmann
email : markey@web.de
copyright : (C) 2005 by Gábor Lehel
email : illissius@gmail.com
copyright : (C) 2018-2023 by Jonas Kvinge
email : jonas@jkvinge.net
***************************************************************************/
begin : Dec 15 2003
copyright : (C) 2003 by Mark Kretschmann
email : markey@web.de
copyright : (C) 2005 by Gábor Lehel
email : illissius@gmail.com
copyright : (C) 2018-2023 by Jonas Kvinge
email : jonas@jkvinge.net
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef VOLUMESLIDER_H
#define VOLUMESLIDER_H