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