Code refactoring - change code style to the new clang-format rules
This commit is contained in:
@@ -15,24 +15,26 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Flameshot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// Based on Lightscreen areadialog.h, Copyright 2017 Christian Kaiser <info@ckaiser.com.ar>
|
||||
// released under the GNU GPL2 <https://www.gnu.org/licenses/gpl-2.0.txt>
|
||||
// Based on Lightscreen areadialog.h, Copyright 2017 Christian Kaiser
|
||||
// <info@ckaiser.com.ar> released under the GNU GPL2
|
||||
// <https://www.gnu.org/licenses/gpl-2.0.txt>
|
||||
|
||||
// Based on KDE's KSnapshot regiongrabber.cpp, revision 796531, Copyright 2007 Luca Gugelmann <lucag@student.ethz.ch>
|
||||
// released under the GNU LGPL <http://www.gnu.org/licenses/old-licenses/library.txt>
|
||||
// Based on KDE's KSnapshot regiongrabber.cpp, revision 796531, Copyright 2007
|
||||
// Luca Gugelmann <lucag@student.ethz.ch> released under the GNU LGPL
|
||||
// <http://www.gnu.org/licenses/old-licenses/library.txt>
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "buttonhandler.h"
|
||||
#include "capturebutton.h"
|
||||
#include "src/tools/capturecontext.h"
|
||||
#include "src/tools/capturetool.h"
|
||||
#include "src/utils/confighandler.h"
|
||||
#include "src/widgets/capture/selectionwidget.h"
|
||||
#include "src/widgets/panel/utilitypanel.h"
|
||||
#include "buttonhandler.h"
|
||||
#include <QWidget>
|
||||
#include <QUndoStack>
|
||||
#include <QPointer>
|
||||
#include <QUndoStack>
|
||||
#include <QWidget>
|
||||
|
||||
class QPaintEvent;
|
||||
class QResizeEvent;
|
||||
@@ -45,18 +47,17 @@ class Screenshot;
|
||||
class NotifierBox;
|
||||
class HoverEventFilter;
|
||||
|
||||
class CaptureWidget : public QWidget {
|
||||
class CaptureWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
explicit CaptureWidget(const uint id = 0,
|
||||
const QString &savePath = QString(),
|
||||
const QString& savePath = QString(),
|
||||
bool fullScreen = true,
|
||||
QWidget *parent = nullptr);
|
||||
QWidget* parent = nullptr);
|
||||
~CaptureWidget();
|
||||
|
||||
|
||||
void updateButtons();
|
||||
QPixmap pixmap();
|
||||
|
||||
@@ -66,7 +67,7 @@ public slots:
|
||||
signals:
|
||||
void captureTaken(uint id, QPixmap p);
|
||||
void captureFailed(uint id);
|
||||
void colorChanged(const QColor &c);
|
||||
void colorChanged(const QColor& c);
|
||||
void thicknessChanged(const int thickness);
|
||||
|
||||
private slots:
|
||||
@@ -91,22 +92,22 @@ private slots:
|
||||
void upMove();
|
||||
void downMove();
|
||||
|
||||
void setState(CaptureButton *b);
|
||||
void processTool(CaptureTool *t);
|
||||
void setState(CaptureButton* b);
|
||||
void processTool(CaptureTool* t);
|
||||
void handleButtonSignal(CaptureTool::Request r);
|
||||
void setDrawColor(const QColor &c);
|
||||
void setDrawThickness(const int &t);
|
||||
void setDrawColor(const QColor& c);
|
||||
void setDrawThickness(const int& t);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *);
|
||||
void mousePressEvent(QMouseEvent *);
|
||||
void mouseMoveEvent(QMouseEvent *);
|
||||
void mouseReleaseEvent(QMouseEvent *);
|
||||
void keyPressEvent(QKeyEvent *);
|
||||
void keyReleaseEvent(QKeyEvent *);
|
||||
void wheelEvent(QWheelEvent *);
|
||||
void resizeEvent(QResizeEvent *);
|
||||
void moveEvent(QMoveEvent *);
|
||||
void paintEvent(QPaintEvent*);
|
||||
void mousePressEvent(QMouseEvent*);
|
||||
void mouseMoveEvent(QMouseEvent*);
|
||||
void mouseReleaseEvent(QMouseEvent*);
|
||||
void keyPressEvent(QKeyEvent*);
|
||||
void keyReleaseEvent(QKeyEvent*);
|
||||
void wheelEvent(QWheelEvent*);
|
||||
void resizeEvent(QResizeEvent*);
|
||||
void moveEvent(QMoveEvent*);
|
||||
|
||||
// Context information
|
||||
CaptureContext m_context;
|
||||
@@ -129,18 +130,18 @@ protected:
|
||||
bool m_adjustmentButtonPressed;
|
||||
|
||||
private:
|
||||
void initContext(const QString &savePath, bool fullscreen);
|
||||
void initContext(const QString& savePath, bool fullscreen);
|
||||
void initPanel();
|
||||
void initSelection();
|
||||
void initShortcuts();
|
||||
void updateSizeIndicator();
|
||||
void updateCursor();
|
||||
void pushToolToStack();
|
||||
void makeChild(QWidget *w);
|
||||
void makeChild(QWidget* w);
|
||||
|
||||
private:
|
||||
QRect extendedSelection() const;
|
||||
QRect extendedRect(QRect *r) const;
|
||||
QRect extendedRect(QRect* r) const;
|
||||
|
||||
private:
|
||||
QUndoStack m_undoStack;
|
||||
@@ -150,13 +151,13 @@ private:
|
||||
QPointer<CaptureTool> m_activeTool;
|
||||
QPointer<QWidget> m_toolWidget;
|
||||
|
||||
ButtonHandler *m_buttonHandler;
|
||||
UtilityPanel *m_panel;
|
||||
ColorPicker *m_colorPicker;
|
||||
ButtonHandler* m_buttonHandler;
|
||||
UtilityPanel* m_panel;
|
||||
ColorPicker* m_colorPicker;
|
||||
ConfigHandler m_config;
|
||||
NotifierBox *m_notifierBox;
|
||||
HoverEventFilter *m_eventFilter;
|
||||
SelectionWidget *m_selection;
|
||||
NotifierBox* m_notifierBox;
|
||||
HoverEventFilter* m_eventFilter;
|
||||
SelectionWidget* m_selection;
|
||||
|
||||
QPoint m_dragStartPoint;
|
||||
SelectionWidget::SideType m_mouseOverHandle;
|
||||
|
||||
Reference in New Issue
Block a user