Changeset View
Changeset View
Standalone View
Standalone View
src/Gui/KSWidget.cpp
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Line(s) | 42 | { | |||
---|---|---|---|---|---|
82 | mDelayLayout->addWidget(mDelayMsec); | 82 | mDelayLayout->addWidget(mDelayMsec); | ||
83 | mDelayLayout->addWidget(mCaptureOnClick); | 83 | mDelayLayout->addWidget(mCaptureOnClick); | ||
84 | 84 | | |||
85 | mCaptureModeForm = new QFormLayout; | 85 | mCaptureModeForm = new QFormLayout; | ||
86 | mCaptureModeForm->addRow(i18n("Area:"), mCaptureArea); | 86 | mCaptureModeForm->addRow(i18n("Area:"), mCaptureArea); | ||
87 | mCaptureModeForm->addRow(i18n("Delay:"), mDelayLayout); | 87 | mCaptureModeForm->addRow(i18n("Delay:"), mDelayLayout); | ||
88 | mCaptureModeForm->setContentsMargins(24, 0, 0, 0); | 88 | mCaptureModeForm->setContentsMargins(24, 0, 0, 0); | ||
89 | 89 | | |||
90 | // the content options (mouse pointer, window decorations) | 90 | // options (mouse pointer, window decorations, quit after saving or copying) | ||
91 | 91 | | |||
92 | mContentOptionsLabel = new QLabel(this); | 92 | mContentOptionsLabel = new QLabel(this); | ||
93 | mContentOptionsLabel->setText(i18n("<b>Content Options</b>")); | 93 | mContentOptionsLabel->setText(i18n("<b>Options</b>")); | ||
94 | 94 | | |||
95 | mMousePointer = new QCheckBox(i18n("Include mouse pointer"), this); | 95 | mMousePointer = new QCheckBox(i18n("Include mouse pointer"), this); | ||
96 | mMousePointer->setToolTip(i18n("Show the mouse cursor in the screenshot image")); | 96 | mMousePointer->setToolTip(i18n("Show the mouse cursor in the screenshot image")); | ||
97 | connect(mMousePointer, &QCheckBox::clicked, configManager, &SpectacleConfig::setIncludePointerChecked); | 97 | connect(mMousePointer, &QCheckBox::clicked, configManager, &SpectacleConfig::setIncludePointerChecked); | ||
98 | 98 | | |||
99 | mWindowDecorations = new QCheckBox(i18n("Include window titlebar and borders"), this); | 99 | mWindowDecorations = new QCheckBox(i18n("Include window titlebar and borders"), this); | ||
100 | mWindowDecorations->setToolTip(i18n("Show the window title bar, the minimize/maximize/close buttons, and the window border")); | 100 | mWindowDecorations->setToolTip(i18n("Show the window title bar, the minimize/maximize/close buttons, and the window border")); | ||
101 | mWindowDecorations->setEnabled(false); | 101 | mWindowDecorations->setEnabled(false); | ||
102 | connect(mWindowDecorations, &QCheckBox::clicked, configManager, &SpectacleConfig::setIncludeDecorationsChecked); | 102 | connect(mWindowDecorations, &QCheckBox::clicked, configManager, &SpectacleConfig::setIncludeDecorationsChecked); | ||
103 | 103 | | |||
104 | mCaptureTransientOnly = new QCheckBox(i18n("Capture the current pop-up only"), this); | 104 | mCaptureTransientOnly = new QCheckBox(i18n("Capture the current pop-up only"), this); | ||
105 | mCaptureTransientOnly->setToolTip(i18n("Capture only the current pop-up window (like a menu, tooltip etc).\n" | 105 | mCaptureTransientOnly->setToolTip(i18n("Capture only the current pop-up window (like a menu, tooltip etc).\n" | ||
106 | "If disabled, the pop-up is captured along with the parent window")); | 106 | "If disabled, the pop-up is captured along with the parent window")); | ||
107 | mCaptureTransientOnly->setEnabled(false); | 107 | mCaptureTransientOnly->setEnabled(false); | ||
108 | connect(mCaptureTransientOnly, &QCheckBox::clicked, configManager, &SpectacleConfig::setCaptureTransientWindowOnlyChecked); | 108 | connect(mCaptureTransientOnly, &QCheckBox::clicked, configManager, &SpectacleConfig::setCaptureTransientWindowOnlyChecked); | ||
109 | 109 | | |||
110 | mQuitAfterSaveOrCopy = new QCheckBox(i18n("Quit after Save or Copy"), this); | ||||
111 | mQuitAfterSaveOrCopy->setToolTip(i18n("Quit Spectacle after saving or copying the image")); | ||||
rkflx: Quit → Close? (would help those not knowing what quitting is)
spectacle → Spectacle | |||||
112 | connect(mQuitAfterSaveOrCopy, &QCheckBox::clicked, configManager, &SpectacleConfig::setQuitAfterSaveOrCopyChecked); | ||||
113 | | ||||
110 | mContentOptionsForm = new QVBoxLayout; | 114 | mContentOptionsForm = new QVBoxLayout; | ||
111 | mContentOptionsForm->addWidget(mMousePointer); | 115 | mContentOptionsForm->addWidget(mMousePointer); | ||
112 | mContentOptionsForm->addWidget(mWindowDecorations); | 116 | mContentOptionsForm->addWidget(mWindowDecorations); | ||
113 | mContentOptionsForm->addWidget(mCaptureTransientOnly); | 117 | mContentOptionsForm->addWidget(mCaptureTransientOnly); | ||
114 | mContentOptionsForm->setSpacing(16); | 118 | mContentOptionsForm->addWidget(mQuitAfterSaveOrCopy); | ||
Makes sense probably, but could you change the spacing so Options is closer to the group it is related to instead of being closer to the group above? rkflx: Makes sense probably, but could you change the spacing so {nav Options} is closer to the group… | |||||
115 | mContentOptionsForm->setContentsMargins(24, 0, 0, 0); | 119 | mContentOptionsForm->setContentsMargins(24, 0, 0, 0); | ||
116 | 120 | | |||
117 | // the take a new screenshot button | 121 | // the take a new screenshot button | ||
118 | 122 | | |||
119 | mTakeScreenshotButton = new QPushButton(i18n("Take a New Screenshot"), this); | 123 | mTakeScreenshotButton = new QPushButton(i18n("Take a New Screenshot"), this); | ||
120 | mTakeScreenshotButton->setIcon(QIcon::fromTheme(QStringLiteral("spectacle"))); | 124 | mTakeScreenshotButton->setIcon(QIcon::fromTheme(QStringLiteral("spectacle"))); | ||
121 | mTakeScreenshotButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | 125 | mTakeScreenshotButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | ||
122 | mTakeScreenshotButton->setFocus(); | 126 | mTakeScreenshotButton->setFocus(); | ||
123 | connect(mTakeScreenshotButton, &QPushButton::clicked, this, &KSWidget::newScreenshotClicked); | 127 | connect(mTakeScreenshotButton, &QPushButton::clicked, this, &KSWidget::newScreenshotClicked); | ||
124 | 128 | | |||
125 | QShortcut *shortcut = new QShortcut(QKeySequence(QKeySequence::New), mTakeScreenshotButton); | 129 | QShortcut *shortcut = new QShortcut(QKeySequence(QKeySequence::New), mTakeScreenshotButton); | ||
126 | auto clickFunc = [&]() { | 130 | auto clickFunc = [&]() { | ||
127 | mTakeScreenshotButton->animateClick(100); | 131 | mTakeScreenshotButton->animateClick(100); | ||
128 | QTimer::singleShot(100, mTakeScreenshotButton, &QPushButton::click); | 132 | QTimer::singleShot(100, mTakeScreenshotButton, &QPushButton::click); | ||
129 | }; | 133 | }; | ||
130 | connect(shortcut, &QShortcut::activated, clickFunc); | 134 | connect(shortcut, &QShortcut::activated, clickFunc); | ||
131 | 135 | | |||
132 | // finally, finish up the layouts | 136 | // finally, finish up the layouts | ||
133 | 137 | | |||
134 | mRightLayout = new QVBoxLayout; | 138 | mRightLayout = new QVBoxLayout; | ||
135 | mRightLayout->addStretch(1); | 139 | mRightLayout->addStretch(1); | ||
136 | mRightLayout->addWidget(mCaptureModeLabel); | 140 | mRightLayout->addWidget(mCaptureModeLabel); | ||
137 | mRightLayout->addSpacing(10); | | |||
138 | mRightLayout->addLayout(mCaptureModeForm); | 141 | mRightLayout->addLayout(mCaptureModeForm); | ||
139 | mRightLayout->addStretch(1); | 142 | mRightLayout->addStretch(1); | ||
140 | mRightLayout->addWidget(mContentOptionsLabel); | 143 | mRightLayout->addWidget(mContentOptionsLabel); | ||
141 | mRightLayout->addSpacing(10); | | |||
142 | mRightLayout->addLayout(mContentOptionsForm); | 144 | mRightLayout->addLayout(mContentOptionsForm); | ||
143 | mRightLayout->addStretch(10); | 145 | mRightLayout->addStretch(10); | ||
144 | mRightLayout->addWidget(mTakeScreenshotButton, 1, Qt::AlignHCenter); | 146 | mRightLayout->addWidget(mTakeScreenshotButton, 1, Qt::AlignHCenter); | ||
145 | mRightLayout->setContentsMargins(20, 0, 0, 10); | 147 | mRightLayout->setContentsMargins(20, 0, 0, 10); | ||
146 | 148 | | |||
147 | mMainLayout = new QGridLayout(this); | 149 | mMainLayout = new QGridLayout(this); | ||
148 | mMainLayout->addWidget(mImageWidget, 0, 0, 1, 1); | 150 | mMainLayout->addWidget(mImageWidget, 0, 0, 1, 1); | ||
149 | mMainLayout->addLayout(mRightLayout, 0, 1, 1, 1); | 151 | mMainLayout->addLayout(mRightLayout, 0, 1, 1, 1); | ||
150 | mMainLayout->setColumnMinimumWidth(0, 400); | 152 | mMainLayout->setColumnMinimumWidth(0, 400); | ||
151 | mMainLayout->setColumnMinimumWidth(1, 400); | 153 | mMainLayout->setColumnMinimumWidth(1, 400); | ||
152 | 154 | | |||
153 | // and read in the saved checkbox states and capture mode indices | 155 | // and read in the saved checkbox states and capture mode indices | ||
154 | 156 | | |||
155 | mMousePointer->setChecked (configManager->includePointerChecked()); | 157 | mMousePointer->setChecked (configManager->includePointerChecked()); | ||
156 | mWindowDecorations->setChecked (configManager->includeDecorationsChecked()); | 158 | mWindowDecorations->setChecked (configManager->includeDecorationsChecked()); | ||
157 | mCaptureOnClick->setChecked (configManager->onClickChecked()); | 159 | mCaptureOnClick->setChecked (configManager->onClickChecked()); | ||
158 | mCaptureTransientOnly->setChecked (configManager->captureTransientWindowOnlyChecked()); | 160 | mCaptureTransientOnly->setChecked (configManager->captureTransientWindowOnlyChecked()); | ||
161 | mQuitAfterSaveOrCopy->setChecked (configManager->quitAfterSaveOrCopyChecked()); | ||||
159 | mCaptureArea->setCurrentIndex (configManager->captureMode()); | 162 | mCaptureArea->setCurrentIndex (configManager->captureMode()); | ||
160 | mDelayMsec->setValue (configManager->captureDelay()); | 163 | mDelayMsec->setValue (configManager->captureDelay()); | ||
161 | 164 | | |||
162 | // done | 165 | // done | ||
163 | } | 166 | } | ||
164 | 167 | | |||
165 | // public slots | 168 | // public slots | ||
166 | 169 | | |||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |
Quit → Close? (would help those not knowing what quitting is)
spectacle → Spectacle