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 <QWidget> | 24 | #include <QWidget> | ||
25 | #include <QPixmap> | 25 | #include <QPixmap> | ||
broulik: Unused | |||||
26 | 26 | | |||
27 | #include "SpectacleCommon.h" | 27 | #include "SpectacleCommon.h" | ||
28 | #include "Platforms/Platform.h" | 28 | #include "Platforms/Platform.h" | ||
29 | 29 | | |||
30 | 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; | 31 | class QGridLayout; | ||
31 | class QHBoxLayout; | 32 | class QHBoxLayout; | ||
32 | class QVBoxLayout; | 33 | class QVBoxLayout; | ||
33 | class QFormLayout; | 34 | class QFormLayout; | ||
34 | class QComboBox; | 35 | class QComboBox; | ||
35 | class QCheckBox; | 36 | class QCheckBox; | ||
36 | class QLabel; | 37 | class QLabel; | ||
37 | class QPushButton; | 38 | class QToolButton; | ||
38 | 39 | | |||
39 | class KSImageWidget; | 40 | class KSImageWidget; | ||
40 | class SmartSpinBox; | 41 | class SmartSpinBox; | ||
41 | 42 | | |||
42 | class KSWidget : public QWidget | 43 | class KSWidget : public QWidget | ||
43 | { | 44 | { | ||
44 | Q_OBJECT | 45 | Q_OBJECT | ||
45 | 46 | | |||
46 | public: | 47 | public: | ||
47 | 48 | | |||
48 | explicit KSWidget(const Platform::GrabModes &theGrabModes, QWidget *parent = nullptr); | 49 | explicit KSWidget(const Platform::GrabModes &theGrabModes, QWidget *parent = nullptr); | ||
49 | virtual ~KSWidget() = default; | 50 | virtual ~KSWidget() = default; | ||
50 | 51 | | |||
52 | enum class State { | ||||
53 | TakeNewScreenshot, | ||||
54 | Cancel | ||||
55 | }; | ||||
56 | | ||||
51 | int imagePaddingWidth() const; | 57 | int imagePaddingWidth() const; | ||
52 | 58 | | |||
53 | Q_SIGNALS: | 59 | Q_SIGNALS: | ||
54 | 60 | | |||
55 | void dragInitiated(); | 61 | void dragInitiated(); | ||
56 | void newScreenshotRequest(Spectacle::CaptureMode theCaptureMode, int theCaptureDelat, bool theIncludePointer, bool theIncludeDecorations); | 62 | void newScreenshotRequest(Spectacle::CaptureMode theCaptureMode, int theCaptureDelat, bool theIncludePointer, bool theIncludeDecorations); | ||
63 | void screenshotCanceled(); | ||||
57 | 64 | | |||
58 | public Q_SLOTS: | 65 | public Q_SLOTS: | ||
59 | 66 | | |||
60 | void setScreenshotPixmap(const QPixmap &thePixmap); | 67 | void setScreenshotPixmap(const QPixmap &thePixmap); | ||
61 | void lockOnClickDisabled(); | 68 | void lockOnClickDisabled(); | ||
62 | void lockOnClickEnabled(); | 69 | void lockOnClickEnabled(); | ||
70 | void setButtonState(State state); | ||||
63 | 71 | | |||
64 | private Q_SLOTS: | 72 | private Q_SLOTS: | ||
65 | 73 | | |||
66 | void newScreenshotClicked(); | 74 | void newScreenshotClicked(); | ||
67 | void onClickStateChanged(int theState); | 75 | void onClickStateChanged(int theState); | ||
68 | void captureModeChanged(int theIndex); | 76 | void captureModeChanged(int theIndex); | ||
69 | 77 | | |||
70 | private: | 78 | private: | ||
71 | 79 | | |||
72 | QGridLayout *mMainLayout { nullptr }; | 80 | QGridLayout *mMainLayout { nullptr }; | ||
73 | QHBoxLayout *mDelayLayout { nullptr }; | 81 | QHBoxLayout *mDelayLayout { nullptr }; | ||
74 | QVBoxLayout *mRightLayout { nullptr }; | 82 | QVBoxLayout *mRightLayout { nullptr }; | ||
75 | QFormLayout *mCaptureModeForm { nullptr }; | 83 | QFormLayout *mCaptureModeForm { nullptr }; | ||
76 | QVBoxLayout *mContentOptionsForm { nullptr }; | 84 | QVBoxLayout *mContentOptionsForm { nullptr }; | ||
77 | KSImageWidget *mImageWidget { nullptr }; | 85 | KSImageWidget *mImageWidget { nullptr }; | ||
78 | QPushButton *mTakeScreenshotButton { nullptr }; | 86 | 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 }; | 87 | QComboBox *mCaptureArea { nullptr }; | ||
80 | SmartSpinBox *mDelayMsec { nullptr }; | 88 | SmartSpinBox *mDelayMsec { nullptr }; | ||
81 | QCheckBox *mCaptureOnClick { nullptr }; | 89 | QCheckBox *mCaptureOnClick { nullptr }; | ||
82 | QCheckBox *mMousePointer { nullptr }; | 90 | QCheckBox *mMousePointer { nullptr }; | ||
83 | QCheckBox *mWindowDecorations { nullptr }; | 91 | QCheckBox *mWindowDecorations { nullptr }; | ||
84 | QCheckBox *mCaptureTransientOnly { nullptr }; | 92 | QCheckBox *mCaptureTransientOnly { nullptr }; | ||
85 | QCheckBox *mQuitAfterSaveOrCopy { nullptr }; | 93 | QCheckBox *mQuitAfterSaveOrCopy { nullptr }; | ||
86 | QLabel *mCaptureModeLabel { nullptr }; | 94 | QLabel *mCaptureModeLabel { nullptr }; | ||
87 | QLabel *mContentOptionsLabel { nullptr }; | 95 | QLabel *mContentOptionsLabel { nullptr }; | ||
88 | bool mTransientWithParentAvailable { false }; | 96 | bool mTransientWithParentAvailable { false }; | ||
97 | QAction *mTakeNewScreenshotAction; | ||||
98 | QAction *mCancelAction; | ||||
89 | }; | 99 | }; |
Unused