Changeset View
Changeset View
Standalone View
Standalone View
src/Gui/KSWidget.h
Show All 15 Lines | |||||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
17 | * Boston, MA 02110-1301, USA. | 17 | * Boston, MA 02110-1301, USA. | ||
18 | * | 18 | * | ||
19 | * SPDX-License-Identifier: LGPL-2.0-or-later | 19 | * SPDX-License-Identifier: LGPL-2.0-or-later | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #pragma once | 22 | #pragma once | ||
23 | 23 | | |||
24 | #include <KLocalizedString> | ||||
25 | #include <QGlobalStatic> | ||||
broulik: Unused | |||||
24 | #include <QWidget> | 26 | #include <QWidget> | ||
25 | #include <QPixmap> | 27 | #include <QPixmap> | ||
26 | 28 | | |||
27 | #include "SpectacleCommon.h" | 29 | #include "SpectacleCommon.h" | ||
28 | #include "Platforms/Platform.h" | 30 | #include "Platforms/Platform.h" | ||
29 | 31 | | |||
32 | class QAction; | ||||
Coding style. But this can probably just be forward declared here class QAction; broulik: Coding style. But this can probably just be forward declared here `class QAction;` | |||||
30 | class QGridLayout; | 33 | class QGridLayout; | ||
31 | class QHBoxLayout; | 34 | class QHBoxLayout; | ||
32 | class QVBoxLayout; | 35 | class QVBoxLayout; | ||
33 | class QFormLayout; | 36 | class QFormLayout; | ||
34 | class QComboBox; | 37 | class QComboBox; | ||
35 | class QCheckBox; | 38 | class QCheckBox; | ||
36 | class QLabel; | 39 | class QLabel; | ||
37 | class QPushButton; | 40 | class QToolButton; | ||
38 | 41 | | |||
39 | class KSImageWidget; | 42 | class KSImageWidget; | ||
40 | class SmartSpinBox; | 43 | class SmartSpinBox; | ||
41 | 44 | | |||
42 | class KSWidget : public QWidget | 45 | class KSWidget : public QWidget | ||
43 | { | 46 | { | ||
44 | Q_OBJECT | 47 | Q_OBJECT | ||
45 | 48 | | |||
46 | public: | 49 | public: | ||
47 | 50 | | |||
48 | explicit KSWidget(const Platform::GrabModes &theGrabModes, QWidget *parent = nullptr); | 51 | explicit KSWidget(const Platform::GrabModes &theGrabModes, QWidget *parent = nullptr); | ||
49 | virtual ~KSWidget() = default; | 52 | virtual ~KSWidget() = default; | ||
50 | 53 | | |||
51 | int imagePaddingWidth() const; | 54 | int imagePaddingWidth() const; | ||
52 | 55 | | |||
53 | Q_SIGNALS: | 56 | Q_SIGNALS: | ||
54 | 57 | | |||
55 | void dragInitiated(); | 58 | void dragInitiated(); | ||
56 | void newScreenshotRequest(Spectacle::CaptureMode theCaptureMode, int theCaptureDelat, bool theIncludePointer, bool theIncludeDecorations); | 59 | void newScreenshotRequest(Spectacle::CaptureMode theCaptureMode, int theCaptureDelat, bool theIncludePointer, bool theIncludeDecorations); | ||
60 | void screenshotCanceled(); | ||||
57 | 61 | | |||
58 | public Q_SLOTS: | 62 | public Q_SLOTS: | ||
59 | 63 | | |||
60 | void setScreenshotPixmap(const QPixmap &thePixmap); | 64 | void setScreenshotPixmap(const QPixmap &thePixmap); | ||
61 | void lockOnClickDisabled(); | 65 | void lockOnClickDisabled(); | ||
62 | void lockOnClickEnabled(); | 66 | void lockOnClickEnabled(); | ||
67 | void setButtonTakeNewScreenshot(); | ||||
63 | 68 | | |||
64 | private Q_SLOTS: | 69 | private Q_SLOTS: | ||
65 | 70 | | |||
66 | void newScreenshotClicked(); | 71 | void newScreenshotClicked(); | ||
67 | void onClickStateChanged(int theState); | 72 | void onClickStateChanged(int theState); | ||
68 | void captureModeChanged(int theIndex); | 73 | void captureModeChanged(int theIndex); | ||
69 | 74 | | |||
70 | private: | 75 | private: | ||
71 | 76 | | |||
72 | QGridLayout *mMainLayout { nullptr }; | 77 | QGridLayout *mMainLayout { nullptr }; | ||
73 | QHBoxLayout *mDelayLayout { nullptr }; | 78 | QHBoxLayout *mDelayLayout { nullptr }; | ||
74 | QVBoxLayout *mRightLayout { nullptr }; | 79 | QVBoxLayout *mRightLayout { nullptr }; | ||
75 | QFormLayout *mCaptureModeForm { nullptr }; | 80 | QFormLayout *mCaptureModeForm { nullptr }; | ||
76 | QVBoxLayout *mContentOptionsForm { nullptr }; | 81 | QVBoxLayout *mContentOptionsForm { nullptr }; | ||
77 | KSImageWidget *mImageWidget { nullptr }; | 82 | KSImageWidget *mImageWidget { nullptr }; | ||
78 | QPushButton *mTakeScreenshotButton { nullptr }; | 83 | QToolButton *mTakeScreenshotButton; | ||
While the coding style is ... interesting, I would keep it and the new variables consistent with the rest for now broulik: While the coding style is ... interesting, I would keep it and the new variables consistent… | |||||
I thought given enough time maybe every variable will be touched and the style changed davidre: I thought given enough time maybe every variable will be touched and the style changed | |||||
79 | QComboBox *mCaptureArea { nullptr }; | 84 | QComboBox *mCaptureArea { nullptr }; | ||
80 | SmartSpinBox *mDelayMsec { nullptr }; | 85 | SmartSpinBox *mDelayMsec { nullptr }; | ||
81 | QCheckBox *mCaptureOnClick { nullptr }; | 86 | QCheckBox *mCaptureOnClick { nullptr }; | ||
82 | QCheckBox *mMousePointer { nullptr }; | 87 | QCheckBox *mMousePointer { nullptr }; | ||
83 | QCheckBox *mWindowDecorations { nullptr }; | 88 | QCheckBox *mWindowDecorations { nullptr }; | ||
84 | QCheckBox *mCaptureTransientOnly { nullptr }; | 89 | QCheckBox *mCaptureTransientOnly { nullptr }; | ||
85 | QCheckBox *mQuitAfterSaveOrCopy { nullptr }; | 90 | QCheckBox *mQuitAfterSaveOrCopy { nullptr }; | ||
86 | QLabel *mCaptureModeLabel { nullptr }; | 91 | QLabel *mCaptureModeLabel { nullptr }; | ||
87 | QLabel *mContentOptionsLabel { nullptr }; | 92 | QLabel *mContentOptionsLabel { nullptr }; | ||
88 | bool mTransientWithParentAvailable { false }; | 93 | bool mTransientWithParentAvailable { false }; | ||
94 | QAction *mTakeNewScreenshotAction; | ||||
95 | QAction *mCancelAction; | ||||
89 | }; | 96 | }; |
Unused