From 88f5c4745cff202e67fb23018134f2045ca054bb Mon Sep 17 00:00:00 2001 From: borgmanJeremy <46930769+borgmanJeremy@users.noreply.github.com> Date: Mon, 11 Jul 2022 20:03:00 -0500 Subject: [PATCH] cleaned up some PR formatting / names, removed old size indicator (#2778) * cleaned up some PR formatting / names, removed old size indicator * fixed clang format * fixed clang format --- src/config/generalconf.cpp | 14 +++--- src/config/generalconf.h | 2 +- src/tools/CMakeLists.txt | 1 - src/tools/sizeindicator/sizeindicatortool.cpp | 44 ------------------- src/tools/sizeindicator/sizeindicatortool.h | 27 ------------ src/tools/toolfactory.cpp | 2 - src/utils/confighandler.h | 2 +- src/widgets/capture/capturetoolbutton.cpp | 1 - 8 files changed, 8 insertions(+), 85 deletions(-) delete mode 100644 src/tools/sizeindicator/sizeindicatortool.cpp delete mode 100644 src/tools/sizeindicator/sizeindicatortool.h diff --git a/src/config/generalconf.cpp b/src/config/generalconf.cpp index e27f8aaa..c8c1cad0 100644 --- a/src/config/generalconf.cpp +++ b/src/config/generalconf.cpp @@ -56,7 +56,7 @@ GeneralConf::GeneralConf(QWidget* parent) initUndoLimit(); initUploadClientSecret(); initPredefinedColorPaletteLarge(); - initshowSelectionGeometry(); + initShowSelectionGeometry(); m_layout->addStretch(); @@ -105,8 +105,6 @@ void GeneralConf::_updateComponents(bool allowEmptySavePath) #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) m_showTray->setChecked(!config.disabledTrayIcon()); #endif - // m_showSelectionGeometry->setChecked( - // config.value("showSelectionGeometry").toBool()); } void GeneralConf::updateComponents() @@ -711,7 +709,7 @@ void GeneralConf::initSquareMagnifier() }); } -void GeneralConf::initshowSelectionGeometry() +void GeneralConf::initShowSelectionGeometry() { auto* tobox = new QHBoxLayout(); @@ -737,8 +735,8 @@ void GeneralConf::initshowSelectionGeometry() auto* vboxLayout = new QVBoxLayout(); box->setLayout(vboxLayout); - auto* selgeoLayout = new QHBoxLayout(); - selgeoLayout->addWidget(new QLabel(tr("Display Location"))); + auto* selGeoLayout = new QHBoxLayout(); + selGeoLayout->addWidget(new QLabel(tr("Display Location"))); m_selectGeometryLocation = new QComboBox(this); m_selectGeometryLocation->addItem(tr("None"), GeneralConf::xywh_none); @@ -762,8 +760,8 @@ void GeneralConf::initshowSelectionGeometry() this, SLOT(setGeometryLocation(int))); - selgeoLayout->addWidget(m_selectGeometryLocation); - vboxLayout->addLayout(selgeoLayout); + selGeoLayout->addWidget(m_selectGeometryLocation); + vboxLayout->addLayout(selGeoLayout); vboxLayout->addStretch(); } diff --git a/src/config/generalconf.h b/src/config/generalconf.h index fe4c6b52..278ab0e7 100644 --- a/src/config/generalconf.h +++ b/src/config/generalconf.h @@ -85,7 +85,7 @@ private: void initUploadHistoryMax(); void initUploadClientSecret(); void initSaveLastRegion(); - void initshowSelectionGeometry(); + void initShowSelectionGeometry(); void _updateComponents(bool allowEmptySavePath); diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 95a13ccd..d2a62924 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -44,7 +44,6 @@ target_sources(flameshot PRIVATE save/savetool.h save/savetool.cpp) target_sources(flameshot PRIVATE accept/accepttool.h accept/accepttool.cpp) target_sources(flameshot PRIVATE invert/inverttool.h invert/inverttool.cpp) target_sources(flameshot PRIVATE selection/selectiontool.h selection/selectiontool.cpp) -target_sources(flameshot PRIVATE sizeindicator/sizeindicatortool.h sizeindicator/sizeindicatortool.cpp) target_sources( flameshot PRIVATE text/textconfig.h diff --git a/src/tools/sizeindicator/sizeindicatortool.cpp b/src/tools/sizeindicator/sizeindicatortool.cpp deleted file mode 100644 index 59ee5079..00000000 --- a/src/tools/sizeindicator/sizeindicatortool.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -// SPDX-FileCopyrightText: 2017-2019 Alejandro Sirgo Rica & Contributors - -#include "sizeindicatortool.h" -#include - -SizeIndicatorTool::SizeIndicatorTool(QObject* parent) - : AbstractActionTool(parent) -{} - -bool SizeIndicatorTool::closeOnButtonPressed() const -{ - return false; -} - -QIcon SizeIndicatorTool::icon(const QColor& background, bool inEditor) const -{ - return inEditor ? QIcon() - : QIcon(iconPath(background) + "size_indicator.svg"); -} -QString SizeIndicatorTool::name() const -{ - return tr("Selection Size Indicator"); -} - -CaptureTool::Type SizeIndicatorTool::type() const -{ - return CaptureTool::TYPE_SELECTIONINDICATOR; -} - -QString SizeIndicatorTool::description() const -{ - return tr("Show X and Y dimensions of the selection"); -} - -CaptureTool* SizeIndicatorTool::copy(QObject* parent) -{ - return new SizeIndicatorTool(parent); -} - -void SizeIndicatorTool::pressed(CaptureContext& context) -{ - Q_UNUSED(context) -} diff --git a/src/tools/sizeindicator/sizeindicatortool.h b/src/tools/sizeindicator/sizeindicatortool.h deleted file mode 100644 index e50ff305..00000000 --- a/src/tools/sizeindicator/sizeindicatortool.h +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -// SPDX-FileCopyrightText: 2017-2019 Alejandro Sirgo Rica & Contributors - -#pragma once - -#include "src/tools/abstractactiontool.h" - -class SizeIndicatorTool : public AbstractActionTool -{ - Q_OBJECT -public: - explicit SizeIndicatorTool(QObject* parent = nullptr); - - bool closeOnButtonPressed() const override; - - QIcon icon(const QColor& background, bool inEditor) const override; - QString name() const override; - QString description() const override; - - CaptureTool* copy(QObject* parent = nullptr) override; - -protected: - CaptureTool::Type type() const override; - -public slots: - void pressed(CaptureContext& context) override; -}; diff --git a/src/tools/toolfactory.cpp b/src/tools/toolfactory.cpp index edeb2bc0..98ed0ab3 100644 --- a/src/tools/toolfactory.cpp +++ b/src/tools/toolfactory.cpp @@ -23,7 +23,6 @@ #include "selection/selectiontool.h" #include "sizedecrease/sizedecreasetool.h" #include "sizeincrease/sizeincreasetool.h" -#include "sizeindicator/sizeindicatortool.h" #include "text/texttool.h" #include "undo/undotool.h" @@ -45,7 +44,6 @@ CaptureTool* ToolFactory::CreateTool(CaptureTool::Type t, QObject* parent) if_TYPE_return_TOOL(TYPE_RECTANGLE, RectangleTool); if_TYPE_return_TOOL(TYPE_CIRCLE, CircleTool); if_TYPE_return_TOOL(TYPE_MARKER, MarkerTool); - if_TYPE_return_TOOL(TYPE_SELECTIONINDICATOR, SizeIndicatorTool); if_TYPE_return_TOOL(TYPE_MOVESELECTION, MoveTool); if_TYPE_return_TOOL(TYPE_UNDO, UndoTool); if_TYPE_return_TOOL(TYPE_COPY, CopyTool); diff --git a/src/utils/confighandler.h b/src/utils/confighandler.h index cd87c8db..73e51cea 100644 --- a/src/utils/confighandler.h +++ b/src/utils/confighandler.h @@ -120,7 +120,7 @@ public: CONFIG_GETTER_SETTER(copyOnDoubleClick, setCopyOnDoubleClick, bool) CONFIG_GETTER_SETTER(uploadClientSecret, setUploadClientSecret, QString) CONFIG_GETTER_SETTER(saveLastRegion, setSaveLastRegion, bool) - CONFIG_GETTER_SETTER(showSelectionGeometry, setshowSelectionGeometry, int) + CONFIG_GETTER_SETTER(showSelectionGeometry, setShowSelectionGeometry, int) // SPECIAL CASES bool startupLaunch(); void setStartupLaunch(const bool); diff --git a/src/widgets/capture/capturetoolbutton.cpp b/src/widgets/capture/capturetoolbutton.cpp index 12946181..97492c61 100644 --- a/src/widgets/capture/capturetoolbutton.cpp +++ b/src/widgets/capture/capturetoolbutton.cpp @@ -171,7 +171,6 @@ QList CaptureToolButton::iterableButtonTypes = { CaptureTool::TYPE_RECTANGLE, CaptureTool::TYPE_CIRCLE, CaptureTool::TYPE_MARKER, CaptureTool::TYPE_TEXT, CaptureTool::TYPE_CIRCLECOUNT, CaptureTool::TYPE_PIXELATE, - CaptureTool::TYPE_INVERT, CaptureTool::TYPE_SELECTIONINDICATOR, CaptureTool::TYPE_MOVESELECTION, CaptureTool::TYPE_UNDO, CaptureTool::TYPE_REDO, CaptureTool::TYPE_COPY, CaptureTool::TYPE_SAVE, CaptureTool::TYPE_EXIT,