Changeset View
Changeset View
Standalone View
Standalone View
src/Gui/KSWidget.cpp
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Line(s) | 103 | mCaptureTransientOnly->setToolTip(i18n("Capture only the current pop-up window (like a menu, tooltip etc).\n" | |||
---|---|---|---|---|---|
104 | "If disabled, the pop-up is captured along with the parent window")); | 104 | "If disabled, the pop-up is captured along with the parent window")); | ||
105 | mCaptureTransientOnly->setEnabled(false); | 105 | mCaptureTransientOnly->setEnabled(false); | ||
106 | connect(mCaptureTransientOnly, &QCheckBox::clicked, configManager, &SpectacleConfig::setCaptureTransientWindowOnlyChecked); | 106 | connect(mCaptureTransientOnly, &QCheckBox::clicked, configManager, &SpectacleConfig::setCaptureTransientWindowOnlyChecked); | ||
107 | 107 | | |||
108 | mQuitAfterSaveOrCopy = new QCheckBox(i18n("Quit after Save or Copy"), this); | 108 | mQuitAfterSaveOrCopy = new QCheckBox(i18n("Quit after Save or Copy"), this); | ||
109 | mQuitAfterSaveOrCopy->setToolTip(i18n("Quit Spectacle after saving or copying the image")); | 109 | mQuitAfterSaveOrCopy->setToolTip(i18n("Quit Spectacle after saving or copying the image")); | ||
110 | connect(mQuitAfterSaveOrCopy, &QCheckBox::clicked, configManager, &SpectacleConfig::setQuitAfterSaveOrCopyChecked); | 110 | connect(mQuitAfterSaveOrCopy, &QCheckBox::clicked, configManager, &SpectacleConfig::setQuitAfterSaveOrCopyChecked); | ||
111 | 111 | | |||
112 | mShowMagnifier = new QCheckBox(i18n("Show magnifier"), this); | ||||
113 | mShowMagnifier->setToolTip(i18n("Show magnifier")); | ||||
114 | mShowMagnifier->setEnabled(false); | ||||
115 | connect(mShowMagnifier, &QCheckBox::clicked, configManager, &SpectacleConfig::setShowMagnifierChecked); | ||||
116 | | ||||
112 | mContentOptionsForm = new QVBoxLayout; | 117 | mContentOptionsForm = new QVBoxLayout; | ||
113 | mContentOptionsForm->addWidget(mMousePointer); | 118 | mContentOptionsForm->addWidget(mMousePointer); | ||
114 | mContentOptionsForm->addWidget(mWindowDecorations); | 119 | mContentOptionsForm->addWidget(mWindowDecorations); | ||
115 | mContentOptionsForm->addWidget(mCaptureTransientOnly); | 120 | mContentOptionsForm->addWidget(mCaptureTransientOnly); | ||
116 | mContentOptionsForm->addWidget(mQuitAfterSaveOrCopy); | 121 | mContentOptionsForm->addWidget(mQuitAfterSaveOrCopy); | ||
122 | mContentOptionsForm->addWidget(mShowMagnifier); | ||||
117 | mContentOptionsForm->setContentsMargins(24, 0, 0, 0); | 123 | mContentOptionsForm->setContentsMargins(24, 0, 0, 0); | ||
118 | 124 | | |||
119 | // the take a new screenshot button | 125 | // the take a new screenshot button | ||
120 | 126 | | |||
121 | mTakeScreenshotButton = new QPushButton(i18n("Take a New Screenshot"), this); | 127 | mTakeScreenshotButton = new QPushButton(i18n("Take a New Screenshot"), this); | ||
122 | mTakeScreenshotButton->setIcon(QIcon::fromTheme(QStringLiteral("spectacle"))); | 128 | mTakeScreenshotButton->setIcon(QIcon::fromTheme(QStringLiteral("spectacle"))); | ||
123 | mTakeScreenshotButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | 129 | mTakeScreenshotButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | ||
124 | mTakeScreenshotButton->setFocus(); | 130 | mTakeScreenshotButton->setFocus(); | ||
Show All 25 Lines | |||||
150 | 156 | | |||
151 | // and read in the saved checkbox states and capture mode indices | 157 | // and read in the saved checkbox states and capture mode indices | ||
152 | 158 | | |||
153 | mMousePointer->setChecked (configManager->includePointerChecked()); | 159 | mMousePointer->setChecked (configManager->includePointerChecked()); | ||
154 | mWindowDecorations->setChecked (configManager->includeDecorationsChecked()); | 160 | mWindowDecorations->setChecked (configManager->includeDecorationsChecked()); | ||
155 | mCaptureOnClick->setChecked (configManager->onClickChecked()); | 161 | mCaptureOnClick->setChecked (configManager->onClickChecked()); | ||
156 | mCaptureTransientOnly->setChecked (configManager->captureTransientWindowOnlyChecked()); | 162 | mCaptureTransientOnly->setChecked (configManager->captureTransientWindowOnlyChecked()); | ||
157 | mQuitAfterSaveOrCopy->setChecked (configManager->quitAfterSaveOrCopyChecked()); | 163 | mQuitAfterSaveOrCopy->setChecked (configManager->quitAfterSaveOrCopyChecked()); | ||
164 | mShowMagnifier->setChecked (configManager->showMagnifierChecked()); | ||||
158 | mCaptureArea->setCurrentIndex (configManager->captureMode()); | 165 | mCaptureArea->setCurrentIndex (configManager->captureMode()); | ||
159 | mDelayMsec->setValue (configManager->captureDelay()); | 166 | mDelayMsec->setValue (configManager->captureDelay()); | ||
160 | 167 | | |||
161 | // done | 168 | // done | ||
162 | } | 169 | } | ||
163 | 170 | | |||
164 | int KSWidget::imagePaddingWidth() const | 171 | int KSWidget::imagePaddingWidth() const | ||
165 | { | 172 | { | ||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | |||||
216 | { | 223 | { | ||
217 | SpectacleConfig::instance()->setCaptureMode(index); | 224 | SpectacleConfig::instance()->setCaptureMode(index); | ||
218 | 225 | | |||
219 | ImageGrabber::GrabMode mode = static_cast<ImageGrabber::GrabMode>(mCaptureArea->itemData(index).toInt()); | 226 | ImageGrabber::GrabMode mode = static_cast<ImageGrabber::GrabMode>(mCaptureArea->itemData(index).toInt()); | ||
220 | switch (mode) { | 227 | switch (mode) { | ||
221 | case ImageGrabber::WindowUnderCursor: | 228 | case ImageGrabber::WindowUnderCursor: | ||
222 | mWindowDecorations->setEnabled(true); | 229 | mWindowDecorations->setEnabled(true); | ||
223 | mCaptureTransientOnly->setEnabled(true); | 230 | mCaptureTransientOnly->setEnabled(true); | ||
231 | mShowMagnifier->setEnabled(false); | ||||
224 | break; | 232 | break; | ||
225 | case ImageGrabber::ActiveWindow: | 233 | case ImageGrabber::ActiveWindow: | ||
226 | mWindowDecorations->setEnabled(true); | 234 | mWindowDecorations->setEnabled(true); | ||
227 | mCaptureTransientOnly->setEnabled(false); | 235 | mCaptureTransientOnly->setEnabled(false); | ||
236 | mShowMagnifier->setEnabled(false); | ||||
237 | break; | ||||
238 | case ImageGrabber::RectangularRegion: | ||||
239 | mWindowDecorations->setEnabled(false); | ||||
240 | mCaptureTransientOnly->setEnabled(false); | ||||
241 | mShowMagnifier->setEnabled(true); | ||||
228 | break; | 242 | break; | ||
229 | default: | 243 | default: | ||
230 | mWindowDecorations->setEnabled(false); | 244 | mWindowDecorations->setEnabled(false); | ||
231 | mCaptureTransientOnly->setEnabled(false); | 245 | mCaptureTransientOnly->setEnabled(false); | ||
246 | mShowMagnifier->setEnabled(false); | ||||
232 | } | 247 | } | ||
233 | } | 248 | } |