Apply clang-format

This commit is contained in:
Martchus 2021-10-15 22:18:54 +02:00
parent 0651323da4
commit 9e3cd95b13
4 changed files with 13 additions and 11 deletions

View File

@ -4,8 +4,8 @@
#include <syncthingmodel/syncthingdevicemodel.h> #include <syncthingmodel/syncthingdevicemodel.h>
#include <syncthingmodel/syncthingicons.h> #include <syncthingmodel/syncthingicons.h>
#include <qtforkawesome/renderer.h>
#include <qtforkawesome/icon.h> #include <qtforkawesome/icon.h>
#include <qtforkawesome/renderer.h>
#include <QApplication> #include <QApplication>
#include <QBrush> #include <QBrush>
@ -57,7 +57,9 @@ void DevButtonsItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem
return; return;
} }
const int buttonY = option.rect.y() + centerObj(option.rect.height(), 16); const int buttonY = option.rect.y() + centerObj(option.rect.height(), 16);
IconManager::instance().forkAwesomeRenderer().render(index.data(SyncthingDeviceModel::DevicePaused).toBool() ? QtForkAwesome::Icon::Play : QtForkAwesome::Icon::Pause, painter, QRect(option.rect.right() - 16, buttonY, 16, 16), QGuiApplication::palette().color(QPalette::Text)); IconManager::instance().forkAwesomeRenderer().render(
index.data(SyncthingDeviceModel::DevicePaused).toBool() ? QtForkAwesome::Icon::Play : QtForkAwesome::Icon::Pause, painter,
QRect(option.rect.right() - 16, buttonY, 16, 16), QGuiApplication::palette().color(QPalette::Text));
} }
} }
} // namespace QtGui } // namespace QtGui

View File

@ -3,8 +3,8 @@
#include <syncthingmodel/syncthingdirectorymodel.h> #include <syncthingmodel/syncthingdirectorymodel.h>
#include <syncthingmodel/syncthingicons.h> #include <syncthingmodel/syncthingicons.h>
#include <qtforkawesome/renderer.h>
#include <qtforkawesome/icon.h> #include <qtforkawesome/icon.h>
#include <qtforkawesome/renderer.h>
#include <QApplication> #include <QApplication>
#include <QBrush> #include <QBrush>
@ -59,7 +59,8 @@ void DirButtonsItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem
if (!dirPaused) { if (!dirPaused) {
forkAwesomeRenderer.render(QtForkAwesome::Icon::Refresh, painter, QRect(option.rect.right() - 52, buttonY, 16, 16), iconColor); forkAwesomeRenderer.render(QtForkAwesome::Icon::Refresh, painter, QRect(option.rect.right() - 52, buttonY, 16, 16), iconColor);
} }
forkAwesomeRenderer.render(dirPaused ? QtForkAwesome::Icon::Play : QtForkAwesome::Icon::Pause, painter, QRect(option.rect.right() - 34, buttonY, 16, 16), iconColor); forkAwesomeRenderer.render(
dirPaused ? QtForkAwesome::Icon::Play : QtForkAwesome::Icon::Pause, painter, QRect(option.rect.right() - 34, buttonY, 16, 16), iconColor);
forkAwesomeRenderer.render(QtForkAwesome::Icon::Folder, painter, QRect(option.rect.right() - 16, buttonY, 16, 16), iconColor); forkAwesomeRenderer.render(QtForkAwesome::Icon::Folder, painter, QRect(option.rect.right() - 16, buttonY, 16, 16), iconColor);
} }
} }

View File

@ -3,8 +3,8 @@
#include <syncthingmodel/syncthingdownloadmodel.h> #include <syncthingmodel/syncthingdownloadmodel.h>
#include <syncthingmodel/syncthingicons.h> #include <syncthingmodel/syncthingicons.h>
#include <qtforkawesome/renderer.h>
#include <qtforkawesome/icon.h> #include <qtforkawesome/icon.h>
#include <qtforkawesome/renderer.h>
#include <QApplication> #include <QApplication>
#include <QBrush> #include <QBrush>
@ -83,7 +83,8 @@ void DownloadItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
if (!index.parent().isValid()) { if (!index.parent().isValid()) {
buttonY += centerObj(progressBarOption.rect.height(), 16); buttonY += centerObj(progressBarOption.rect.height(), 16);
} }
IconManager::instance().forkAwesomeRenderer().render(QtForkAwesome::Icon::Folder, painter, QRect(option.rect.right() - 16, buttonY, 16, 16), QGuiApplication::palette().color(QPalette::Text)); IconManager::instance().forkAwesomeRenderer().render(
QtForkAwesome::Icon::Folder, painter, QRect(option.rect.right() - 16, buttonY, 16, 16), QGuiApplication::palette().color(QPalette::Text));
// draw file icon // draw file icon
if (index.parent().isValid()) { if (index.parent().isValid()) {

View File

@ -49,8 +49,8 @@ TrayIcon::TrayIcon(const QString &connectionConfig, QObject *parent)
// set context menu // set context menu
#ifndef SYNCTHINGTRAY_UNIFY_TRAY_MENUS #ifndef SYNCTHINGTRAY_UNIFY_TRAY_MENUS
connect(m_contextMenu.addAction(QIcon(QStringLiteral("syncthing.fa")), tr("Open Syncthing")), connect(
&QAction::triggered, &widget, &TrayWidget::showWebUi); m_contextMenu.addAction(QIcon(QStringLiteral("syncthing.fa")), tr("Open Syncthing")), &QAction::triggered, &widget, &TrayWidget::showWebUi);
connect(m_contextMenu.addAction( connect(m_contextMenu.addAction(
QIcon::fromTheme(QStringLiteral("preferences-other"), QIcon(QStringLiteral(":/icons/hicolor/scalable/apps/preferences-other.svg"))), QIcon::fromTheme(QStringLiteral("preferences-other"), QIcon(QStringLiteral(":/icons/hicolor/scalable/apps/preferences-other.svg"))),
tr("Settings")), tr("Settings")),
@ -59,9 +59,7 @@ TrayIcon::TrayIcon(const QString &connectionConfig, QObject *parent)
QIcon::fromTheme(QStringLiteral("folder-sync"), QIcon(QStringLiteral(":/icons/hicolor/scalable/actions/folder-sync.svg"))), QIcon::fromTheme(QStringLiteral("folder-sync"), QIcon(QStringLiteral(":/icons/hicolor/scalable/actions/folder-sync.svg"))),
tr("Rescan all")), tr("Rescan all")),
&QAction::triggered, &widget.connection(), &SyncthingConnection::rescanAllDirs); &QAction::triggered, &widget.connection(), &SyncthingConnection::rescanAllDirs);
connect(m_contextMenu.addAction(QIcon(QStringLiteral("file-code-o.fa")), connect(m_contextMenu.addAction(QIcon(QStringLiteral("file-code-o.fa")), tr("Log")), &QAction::triggered, &widget, &TrayWidget::showLog);
tr("Log")),
&QAction::triggered, &widget, &TrayWidget::showLog);
m_errorsAction = m_contextMenu.addAction( m_errorsAction = m_contextMenu.addAction(
QIcon::fromTheme(QStringLiteral("emblem-error"), QIcon(QStringLiteral(":/icons/hicolor/scalable/emblems/8/emblem-error.svg"))), QIcon::fromTheme(QStringLiteral("emblem-error"), QIcon(QStringLiteral(":/icons/hicolor/scalable/emblems/8/emblem-error.svg"))),
tr("Show internal errors")); tr("Show internal errors"));