Changeset View
Changeset View
Standalone View
Standalone View
dialogs/imagelib/transforms/kpTransformResizeScaleDialog.cpp
Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Line(s) | 93 | { | |||
---|---|---|---|---|---|
94 | setWindowTitle (i18nc ("@title:window", "Resize / Scale")); | 94 | setWindowTitle (i18nc ("@title:window", "Resize / Scale")); | ||
95 | QDialogButtonBox *buttons = new QDialogButtonBox (QDialogButtonBox::Ok | | 95 | QDialogButtonBox *buttons = new QDialogButtonBox (QDialogButtonBox::Ok | | ||
96 | QDialogButtonBox::Cancel, this); | 96 | QDialogButtonBox::Cancel, this); | ||
97 | connect (buttons, &QDialogButtonBox::accepted, this, &kpTransformResizeScaleDialog::accept); | 97 | connect (buttons, &QDialogButtonBox::accepted, this, &kpTransformResizeScaleDialog::accept); | ||
98 | connect (buttons, &QDialogButtonBox::rejected, this, &kpTransformResizeScaleDialog::reject); | 98 | connect (buttons, &QDialogButtonBox::rejected, this, &kpTransformResizeScaleDialog::reject); | ||
99 | 99 | | |||
100 | QWidget *baseWidget = new QWidget (this); | 100 | QWidget *baseWidget = new QWidget (this); | ||
101 | 101 | | |||
102 | QVBoxLayout *dialogLayout = new QVBoxLayout (this); | 102 | auto *dialogLayout = new QVBoxLayout (this); | ||
103 | dialogLayout->addWidget (baseWidget); | 103 | dialogLayout->addWidget (baseWidget); | ||
104 | dialogLayout->addWidget (buttons); | 104 | dialogLayout->addWidget (buttons); | ||
105 | 105 | | |||
106 | QWidget *actOnBox = createActOnBox(baseWidget); | 106 | QWidget *actOnBox = createActOnBox(baseWidget); | ||
107 | QGroupBox *operationGroupBox = createOperationGroupBox(baseWidget); | 107 | QGroupBox *operationGroupBox = createOperationGroupBox(baseWidget); | ||
108 | QGroupBox *dimensionsGroupBox = createDimensionsGroupBox(baseWidget); | 108 | QGroupBox *dimensionsGroupBox = createDimensionsGroupBox(baseWidget); | ||
109 | 109 | | |||
110 | QVBoxLayout *baseLayout = new QVBoxLayout (baseWidget); | 110 | auto *baseLayout = new QVBoxLayout (baseWidget); | ||
111 | baseLayout->setContentsMargins(0, 0, 0, 0); | 111 | baseLayout->setContentsMargins(0, 0, 0, 0); | ||
112 | baseLayout->addWidget(actOnBox); | 112 | baseLayout->addWidget(actOnBox); | ||
113 | baseLayout->addWidget(operationGroupBox); | 113 | baseLayout->addWidget(operationGroupBox); | ||
114 | baseLayout->addWidget(dimensionsGroupBox); | 114 | baseLayout->addWidget(dimensionsGroupBox); | ||
115 | 115 | | |||
116 | KConfigGroup cfg(KSharedConfig::openConfig(), kpSettingsGroupGeneral); | 116 | KConfigGroup cfg(KSharedConfig::openConfig(), kpSettingsGroupGeneral); | ||
117 | setKeepAspectRatio(cfg.readEntry(kpSettingResizeScaleLastKeepAspect, false)); | 117 | setKeepAspectRatio(cfg.readEntry(kpSettingResizeScaleLastKeepAspect, false)); | ||
118 | m_lastType = static_cast<kpTransformResizeScaleCommand::Type> | 118 | m_lastType = static_cast<kpTransformResizeScaleCommand::Type> | ||
Show All 36 Lines | |||||
155 | //--------------------------------------------------------------------- | 155 | //--------------------------------------------------------------------- | ||
156 | // private | 156 | // private | ||
157 | 157 | | |||
158 | QWidget *kpTransformResizeScaleDialog::createActOnBox(QWidget *baseWidget) | 158 | QWidget *kpTransformResizeScaleDialog::createActOnBox(QWidget *baseWidget) | ||
159 | { | 159 | { | ||
160 | QWidget *actOnBox = new QWidget (baseWidget); | 160 | QWidget *actOnBox = new QWidget (baseWidget); | ||
161 | 161 | | |||
162 | 162 | | |||
163 | QLabel *actOnLabel = new QLabel (i18n ("Ac&t on:"), actOnBox); | 163 | auto *actOnLabel = new QLabel (i18n ("Ac&t on:"), actOnBox); | ||
164 | m_actOnCombo = new QComboBox (actOnBox); | 164 | m_actOnCombo = new QComboBox (actOnBox); | ||
165 | 165 | | |||
166 | 166 | | |||
167 | actOnLabel->setBuddy (m_actOnCombo); | 167 | actOnLabel->setBuddy (m_actOnCombo); | ||
168 | 168 | | |||
169 | m_actOnCombo->insertItem (Image, i18n ("Entire Image")); | 169 | m_actOnCombo->insertItem (Image, i18n ("Entire Image")); | ||
170 | if (selection ()) | 170 | if (selection ()) | ||
171 | { | 171 | { | ||
172 | QString selName = i18n ("Selection"); | 172 | QString selName = i18n ("Selection"); | ||
173 | 173 | | |||
174 | if (textSelection ()) | 174 | if (textSelection ()) { | ||
175 | selName = i18n ("Text Box"); | 175 | selName = i18n ("Text Box"); | ||
176 | } | ||||
176 | 177 | | |||
177 | m_actOnCombo->insertItem (Selection, selName); | 178 | m_actOnCombo->insertItem (Selection, selName); | ||
178 | m_actOnCombo->setCurrentIndex (Selection); | 179 | m_actOnCombo->setCurrentIndex (Selection); | ||
179 | } | 180 | } | ||
180 | else | 181 | else | ||
181 | { | 182 | { | ||
182 | actOnLabel->setEnabled (false); | 183 | actOnLabel->setEnabled (false); | ||
183 | m_actOnCombo->setEnabled (false); | 184 | m_actOnCombo->setEnabled (false); | ||
184 | } | 185 | } | ||
185 | 186 | | |||
186 | 187 | auto *lay = new QHBoxLayout (actOnBox); | |||
187 | QHBoxLayout *lay = new QHBoxLayout (actOnBox); | | |||
188 | lay->setContentsMargins(0, 0, 0, 0); | 188 | lay->setContentsMargins(0, 0, 0, 0); | ||
189 | lay->addWidget (actOnLabel); | 189 | lay->addWidget (actOnLabel); | ||
190 | lay->addWidget (m_actOnCombo, 1); | 190 | lay->addWidget (m_actOnCombo, 1); | ||
191 | 191 | | |||
192 | | ||||
193 | connect (m_actOnCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), | 192 | connect (m_actOnCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), | ||
194 | this, &kpTransformResizeScaleDialog::slotActOnChanged); | 193 | this, &kpTransformResizeScaleDialog::slotActOnChanged); | ||
195 | 194 | | |||
196 | return actOnBox; | 195 | return actOnBox; | ||
197 | } | 196 | } | ||
198 | 197 | | |||
199 | //--------------------------------------------------------------------- | 198 | //--------------------------------------------------------------------- | ||
200 | 199 | | |||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 245 | toolButtonSetLook (m_scaleButton, | |||
247 | QLatin1String ("scale"), | 246 | QLatin1String ("scale"), | ||
248 | i18n ("&Scale")); | 247 | i18n ("&Scale")); | ||
249 | 248 | | |||
250 | m_smoothScaleButton = new QToolButton (operationGroupBox); | 249 | m_smoothScaleButton = new QToolButton (operationGroupBox); | ||
251 | toolButtonSetLook (m_smoothScaleButton, | 250 | toolButtonSetLook (m_smoothScaleButton, | ||
252 | QLatin1String ("smooth_scale"), | 251 | QLatin1String ("smooth_scale"), | ||
253 | i18n ("S&mooth Scale")); | 252 | i18n ("S&mooth Scale")); | ||
254 | 253 | | |||
255 | QButtonGroup *resizeScaleButtonGroup = new QButtonGroup (baseWidget); | 254 | auto *resizeScaleButtonGroup = new QButtonGroup (baseWidget); | ||
256 | resizeScaleButtonGroup->addButton (m_resizeButton); | 255 | resizeScaleButtonGroup->addButton (m_resizeButton); | ||
257 | resizeScaleButtonGroup->addButton (m_scaleButton); | 256 | resizeScaleButtonGroup->addButton (m_scaleButton); | ||
258 | resizeScaleButtonGroup->addButton (m_smoothScaleButton); | 257 | resizeScaleButtonGroup->addButton (m_smoothScaleButton); | ||
259 | 258 | | |||
260 | 259 | | |||
261 | QGridLayout *operationLayout = new QGridLayout (operationGroupBox ); | 260 | auto *operationLayout = new QGridLayout (operationGroupBox ); | ||
262 | operationLayout->addWidget (m_resizeButton, 0, 0, Qt::AlignCenter); | 261 | operationLayout->addWidget (m_resizeButton, 0, 0, Qt::AlignCenter); | ||
263 | operationLayout->addWidget (m_scaleButton, 0, 1, Qt::AlignCenter); | 262 | operationLayout->addWidget (m_scaleButton, 0, 1, Qt::AlignCenter); | ||
264 | operationLayout->addWidget (m_smoothScaleButton, 0, 2, Qt::AlignCenter); | 263 | operationLayout->addWidget (m_smoothScaleButton, 0, 2, Qt::AlignCenter); | ||
265 | 264 | | |||
266 | connect (m_resizeButton, &QToolButton::toggled, | 265 | connect (m_resizeButton, &QToolButton::toggled, | ||
267 | this, &kpTransformResizeScaleDialog::slotTypeChanged); | 266 | this, &kpTransformResizeScaleDialog::slotTypeChanged); | ||
268 | connect (m_scaleButton, &QToolButton::toggled, | 267 | connect (m_scaleButton, &QToolButton::toggled, | ||
269 | this, &kpTransformResizeScaleDialog::slotTypeChanged); | 268 | this, &kpTransformResizeScaleDialog::slotTypeChanged); | ||
270 | connect (m_smoothScaleButton, &QToolButton::toggled, | 269 | connect (m_smoothScaleButton, &QToolButton::toggled, | ||
271 | this, &kpTransformResizeScaleDialog::slotTypeChanged); | 270 | this, &kpTransformResizeScaleDialog::slotTypeChanged); | ||
272 | 271 | | |||
273 | return operationGroupBox; | 272 | return operationGroupBox; | ||
274 | } | 273 | } | ||
275 | 274 | | |||
276 | //--------------------------------------------------------------------- | 275 | //--------------------------------------------------------------------- | ||
277 | // private | 276 | // private | ||
278 | 277 | | |||
279 | QGroupBox *kpTransformResizeScaleDialog::createDimensionsGroupBox(QWidget *baseWidget) | 278 | QGroupBox *kpTransformResizeScaleDialog::createDimensionsGroupBox(QWidget *baseWidget) | ||
280 | { | 279 | { | ||
281 | QGroupBox *dimensionsGroupBox = new QGroupBox (i18n ("Dimensions"), baseWidget); | 280 | QGroupBox *dimensionsGroupBox = new QGroupBox (i18n ("Dimensions"), baseWidget); | ||
282 | 281 | | |||
283 | QLabel *widthLabel = new QLabel (i18n ("Width:"), dimensionsGroupBox); | 282 | auto *widthLabel = new QLabel (i18n ("Width:"), dimensionsGroupBox); | ||
284 | widthLabel->setAlignment (widthLabel->alignment () | Qt::AlignHCenter); | 283 | widthLabel->setAlignment (widthLabel->alignment () | Qt::AlignHCenter); | ||
285 | QLabel *heightLabel = new QLabel (i18n ("Height:"), dimensionsGroupBox); | 284 | auto *heightLabel = new QLabel (i18n ("Height:"), dimensionsGroupBox); | ||
286 | heightLabel->setAlignment (heightLabel->alignment () | Qt::AlignHCenter); | 285 | heightLabel->setAlignment (heightLabel->alignment () | Qt::AlignHCenter); | ||
287 | 286 | | |||
288 | QLabel *originalLabel = new QLabel (i18n ("Original:"), dimensionsGroupBox); | 287 | auto *originalLabel = new QLabel (i18n ("Original:"), dimensionsGroupBox); | ||
289 | m_originalWidthInput = new QSpinBox; | 288 | m_originalWidthInput = new QSpinBox; | ||
290 | m_originalWidthInput->setRange(1, INT_MAX); | 289 | m_originalWidthInput->setRange(1, INT_MAX); | ||
291 | m_originalWidthInput->setValue(document()->width(static_cast<bool> (selection()))); | 290 | m_originalWidthInput->setValue(document()->width(static_cast<bool> (selection()))); | ||
292 | QLabel *xLabel0 = new QLabel (i18n ("x"), dimensionsGroupBox); | 291 | auto *xLabel0 = new QLabel (i18n ("x"), dimensionsGroupBox); | ||
293 | m_originalHeightInput = new QSpinBox; | 292 | m_originalHeightInput = new QSpinBox; | ||
294 | m_originalHeightInput->setRange(1, INT_MAX); | 293 | m_originalHeightInput->setRange(1, INT_MAX); | ||
295 | m_originalHeightInput->setValue(document()->height(static_cast<bool> (selection()))); | 294 | m_originalHeightInput->setValue(document()->height(static_cast<bool> (selection()))); | ||
296 | 295 | | |||
297 | QLabel *newLabel = new QLabel (i18n ("&New:"), dimensionsGroupBox); | 296 | auto *newLabel = new QLabel (i18n ("&New:"), dimensionsGroupBox); | ||
298 | m_newWidthInput = new QSpinBox; | 297 | m_newWidthInput = new QSpinBox; | ||
299 | m_newWidthInput->setRange(1, INT_MAX); | 298 | m_newWidthInput->setRange(1, INT_MAX); | ||
300 | QLabel *xLabel1 = new QLabel (i18n ("x"), dimensionsGroupBox); | 299 | auto *xLabel1 = new QLabel (i18n ("x"), dimensionsGroupBox); | ||
301 | m_newHeightInput = new QSpinBox; | 300 | m_newHeightInput = new QSpinBox; | ||
302 | m_newHeightInput->setRange(1, INT_MAX); | 301 | m_newHeightInput->setRange(1, INT_MAX); | ||
303 | 302 | | |||
304 | QLabel *percentLabel = new QLabel (i18n ("&Percent:"), dimensionsGroupBox); | 303 | auto *percentLabel = new QLabel (i18n ("&Percent:"), dimensionsGroupBox); | ||
305 | m_percentWidthInput = new QDoubleSpinBox; | 304 | m_percentWidthInput = new QDoubleSpinBox; | ||
306 | m_percentWidthInput->setRange(0.01, 1000000); | 305 | m_percentWidthInput->setRange(0.01, 1000000); | ||
307 | m_percentWidthInput->setValue(100); | 306 | m_percentWidthInput->setValue(100); | ||
308 | m_percentWidthInput->setSingleStep(1); | 307 | m_percentWidthInput->setSingleStep(1); | ||
309 | m_percentWidthInput->setDecimals(2); | 308 | m_percentWidthInput->setDecimals(2); | ||
310 | m_percentWidthInput->setSuffix(i18n("%")); | 309 | m_percentWidthInput->setSuffix(i18n("%")); | ||
311 | 310 | | |||
312 | QLabel *xLabel2 = new QLabel (i18n ("x"), dimensionsGroupBox); | 311 | auto *xLabel2 = new QLabel (i18n ("x"), dimensionsGroupBox); | ||
313 | 312 | | |||
314 | m_percentHeightInput = new QDoubleSpinBox; | 313 | m_percentHeightInput = new QDoubleSpinBox; | ||
315 | m_percentHeightInput->setRange(0.01, 1000000); | 314 | m_percentHeightInput->setRange(0.01, 1000000); | ||
316 | m_percentHeightInput->setValue(100); | 315 | m_percentHeightInput->setValue(100); | ||
317 | m_percentHeightInput->setSingleStep(1); | 316 | m_percentHeightInput->setSingleStep(1); | ||
318 | m_percentHeightInput->setDecimals(2); | 317 | m_percentHeightInput->setDecimals(2); | ||
319 | m_percentHeightInput->setSuffix(i18n("%")); | 318 | m_percentHeightInput->setSuffix(i18n("%")); | ||
320 | 319 | | |||
321 | m_keepAspectRatioCheckBox = new QCheckBox (i18n ("Keep &aspect ratio"), | 320 | m_keepAspectRatioCheckBox = new QCheckBox (i18n ("Keep &aspect ratio"), | ||
322 | dimensionsGroupBox); | 321 | dimensionsGroupBox); | ||
323 | 322 | | |||
324 | 323 | | |||
325 | m_originalWidthInput->setEnabled (false); | 324 | m_originalWidthInput->setEnabled (false); | ||
326 | m_originalHeightInput->setEnabled (false); | 325 | m_originalHeightInput->setEnabled (false); | ||
327 | originalLabel->setBuddy (m_originalWidthInput); | 326 | originalLabel->setBuddy (m_originalWidthInput); | ||
328 | newLabel->setBuddy (m_newWidthInput); | 327 | newLabel->setBuddy (m_newWidthInput); | ||
329 | m_percentWidthInput->setValue (100); | 328 | m_percentWidthInput->setValue (100); | ||
330 | m_percentHeightInput->setValue (100); | 329 | m_percentHeightInput->setValue (100); | ||
331 | percentLabel->setBuddy (m_percentWidthInput); | 330 | percentLabel->setBuddy (m_percentWidthInput); | ||
332 | 331 | | |||
333 | 332 | | |||
334 | QGridLayout *dimensionsLayout = new QGridLayout (dimensionsGroupBox); | 333 | auto *dimensionsLayout = new QGridLayout (dimensionsGroupBox); | ||
335 | dimensionsLayout->setColumnStretch (1/*column*/, 1); | 334 | dimensionsLayout->setColumnStretch (1/*column*/, 1); | ||
336 | dimensionsLayout->setColumnStretch (3/*column*/, 1); | 335 | dimensionsLayout->setColumnStretch (3/*column*/, 1); | ||
337 | 336 | | |||
338 | 337 | | |||
339 | dimensionsLayout->addWidget (widthLabel, 0, 1); | 338 | dimensionsLayout->addWidget (widthLabel, 0, 1); | ||
340 | dimensionsLayout->addWidget (heightLabel, 0, 3); | 339 | dimensionsLayout->addWidget (heightLabel, 0, 3); | ||
341 | 340 | | |||
342 | dimensionsLayout->addWidget (originalLabel, 1, 0); | 341 | dimensionsLayout->addWidget (originalLabel, 1, 0); | ||
▲ Show 20 Lines • Show All 118 Lines • ▼ Show 20 Line(s) | 452 | { | |||
461 | if (actOnSelection ()) | 460 | if (actOnSelection ()) | ||
462 | { | 461 | { | ||
463 | if (textSelection ()) | 462 | if (textSelection ()) | ||
464 | { | 463 | { | ||
465 | m_resizeButton->setChecked (true); | 464 | m_resizeButton->setChecked (true); | ||
466 | } | 465 | } | ||
467 | else | 466 | else | ||
468 | { | 467 | { | ||
469 | if (m_lastType == kpTransformResizeScaleCommand::Scale) | 468 | if (m_lastType == kpTransformResizeScaleCommand::Scale) { | ||
470 | m_scaleButton->setChecked (true); | 469 | m_scaleButton->setChecked (true); | ||
471 | else | 470 | } | ||
471 | else { | ||||
472 | m_smoothScaleButton->setChecked (true); | 472 | m_smoothScaleButton->setChecked (true); | ||
473 | } | 473 | } | ||
474 | } | 474 | } | ||
475 | } | ||||
475 | else | 476 | else | ||
476 | { | 477 | { | ||
477 | if (m_lastType == kpTransformResizeScaleCommand::Resize) | 478 | if (m_lastType == kpTransformResizeScaleCommand::Resize) { | ||
478 | m_resizeButton->setChecked (true); | 479 | m_resizeButton->setChecked (true); | ||
479 | else if (m_lastType == kpTransformResizeScaleCommand::Scale) | 480 | } | ||
481 | else if (m_lastType == kpTransformResizeScaleCommand::Scale) { | ||||
480 | m_scaleButton->setChecked (true); | 482 | m_scaleButton->setChecked (true); | ||
481 | else | 483 | } | ||
484 | else { | ||||
482 | m_smoothScaleButton->setChecked (true); | 485 | m_smoothScaleButton->setChecked (true); | ||
483 | } | 486 | } | ||
487 | } | ||||
484 | 488 | | |||
485 | 489 | | |||
486 | m_originalWidthInput->setValue (originalWidth ()); | 490 | m_originalWidthInput->setValue (originalWidth ()); | ||
487 | m_originalHeightInput->setValue (originalHeight ()); | 491 | m_originalHeightInput->setValue (originalHeight ()); | ||
488 | 492 | | |||
489 | 493 | | |||
490 | m_newWidthInput->blockSignals (true); | 494 | m_newWidthInput->blockSignals (true); | ||
491 | m_newHeightInput->blockSignals (true); | 495 | m_newHeightInput->blockSignals (true); | ||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | |||||
548 | } | 552 | } | ||
549 | 553 | | |||
550 | //--------------------------------------------------------------------- | 554 | //--------------------------------------------------------------------- | ||
551 | // public slot | 555 | // public slot | ||
552 | 556 | | |||
553 | void kpTransformResizeScaleDialog::slotPercentWidthChanged (double percentWidth) | 557 | void kpTransformResizeScaleDialog::slotPercentWidthChanged (double percentWidth) | ||
554 | { | 558 | { | ||
555 | qCDebug(kpLogDialogs) << "kpTransformResizeScaleDialog::slotPercentWidthChanged(" | 559 | qCDebug(kpLogDialogs) << "kpTransformResizeScaleDialog::slotPercentWidthChanged(" | ||
556 | << percentWidth << ")" << endl; | 560 | << percentWidth << ")"; | ||
557 | 561 | | |||
558 | SET_VALUE_WITHOUT_SIGNAL_EMISSION (m_newWidthInput, | 562 | SET_VALUE_WITHOUT_SIGNAL_EMISSION (m_newWidthInput, | ||
559 | qRound (percentWidth * originalWidth () / 100.0)); | 563 | qRound (percentWidth * originalWidth () / 100.0)); | ||
560 | 564 | | |||
561 | widthFitHeightToAspectRatio (); | 565 | widthFitHeightToAspectRatio (); | ||
562 | 566 | | |||
563 | //enableButtonOk (!isNoOp ()); | 567 | //enableButtonOk (!isNoOp ()); | ||
564 | } | 568 | } | ||
565 | 569 | | |||
566 | //--------------------------------------------------------------------- | 570 | //--------------------------------------------------------------------- | ||
567 | // public slot | 571 | // public slot | ||
568 | 572 | | |||
569 | void kpTransformResizeScaleDialog::slotPercentHeightChanged (double percentHeight) | 573 | void kpTransformResizeScaleDialog::slotPercentHeightChanged (double percentHeight) | ||
570 | { | 574 | { | ||
571 | qCDebug(kpLogDialogs) << "kpTransformResizeScaleDialog::slotPercentHeightChanged(" | 575 | qCDebug(kpLogDialogs) << "kpTransformResizeScaleDialog::slotPercentHeightChanged(" | ||
572 | << percentHeight << ")" << endl; | 576 | << percentHeight << ")"; | ||
573 | 577 | | |||
574 | SET_VALUE_WITHOUT_SIGNAL_EMISSION (m_newHeightInput, | 578 | SET_VALUE_WITHOUT_SIGNAL_EMISSION (m_newHeightInput, | ||
575 | qRound (percentHeight * originalHeight () / 100.0)); | 579 | qRound (percentHeight * originalHeight () / 100.0)); | ||
576 | 580 | | |||
577 | heightFitWidthToAspectRatio (); | 581 | heightFitWidthToAspectRatio (); | ||
578 | 582 | | |||
579 | //enableButtonOk (!isNoOp ()); | 583 | //enableButtonOk (!isNoOp ()); | ||
580 | } | 584 | } | ||
581 | 585 | | |||
582 | //--------------------------------------------------------------------- | 586 | //--------------------------------------------------------------------- | ||
583 | // public slot | 587 | // public slot | ||
584 | 588 | | |||
585 | void kpTransformResizeScaleDialog::setKeepAspectRatio (bool on) | 589 | void kpTransformResizeScaleDialog::setKeepAspectRatio (bool on) | ||
586 | { | 590 | { | ||
587 | qCDebug(kpLogDialogs) << "kpTransformResizeScaleDialog::setKeepAspectRatio(" | 591 | qCDebug(kpLogDialogs) << "kpTransformResizeScaleDialog::setKeepAspectRatio(" | ||
588 | << on << ")" << endl; | 592 | << on << ")"; | ||
589 | if (on != m_keepAspectRatioCheckBox->isChecked ()) | 593 | if (on != m_keepAspectRatioCheckBox->isChecked ()) { | ||
590 | m_keepAspectRatioCheckBox->setChecked (on); | 594 | m_keepAspectRatioCheckBox->setChecked (on); | ||
595 | } | ||||
591 | 596 | | |||
592 | if (on) | 597 | if (on) { | ||
593 | widthFitHeightToAspectRatio (); | 598 | widthFitHeightToAspectRatio (); | ||
594 | } | 599 | } | ||
600 | } | ||||
595 | 601 | | |||
596 | //--------------------------------------------------------------------- | 602 | //--------------------------------------------------------------------- | ||
597 | 603 | | |||
598 | #undef IGNORE_KEEP_ASPECT_RATIO | 604 | #undef IGNORE_KEEP_ASPECT_RATIO | ||
599 | #undef SET_VALUE_WITHOUT_SIGNAL_EMISSION | 605 | #undef SET_VALUE_WITHOUT_SIGNAL_EMISSION | ||
600 | 606 | | |||
601 | 607 | | |||
602 | //--------------------------------------------------------------------- | 608 | //--------------------------------------------------------------------- | ||
Show All 36 Lines | 644 | { | |||
639 | return (m_actOnCombo->currentIndex () == Selection); | 645 | return (m_actOnCombo->currentIndex () == Selection); | ||
640 | } | 646 | } | ||
641 | 647 | | |||
642 | //--------------------------------------------------------------------- | 648 | //--------------------------------------------------------------------- | ||
643 | // public | 649 | // public | ||
644 | 650 | | |||
645 | kpTransformResizeScaleCommand::Type kpTransformResizeScaleDialog::type () const | 651 | kpTransformResizeScaleCommand::Type kpTransformResizeScaleDialog::type () const | ||
646 | { | 652 | { | ||
647 | if (m_resizeButton->isChecked ()) | 653 | if (m_resizeButton->isChecked ()) { | ||
648 | return kpTransformResizeScaleCommand::Resize; | 654 | return kpTransformResizeScaleCommand::Resize; | ||
649 | else if (m_scaleButton->isChecked ()) | 655 | } | ||
656 | | ||||
657 | if (m_scaleButton->isChecked ()) { | ||||
650 | return kpTransformResizeScaleCommand::Scale; | 658 | return kpTransformResizeScaleCommand::Scale; | ||
651 | else | 659 | } | ||
660 | | ||||
652 | return kpTransformResizeScaleCommand::SmoothScale; | 661 | return kpTransformResizeScaleCommand::SmoothScale; | ||
653 | } | 662 | } | ||
654 | 663 | | |||
655 | //--------------------------------------------------------------------- | 664 | //--------------------------------------------------------------------- | ||
656 | // public | 665 | // public | ||
657 | 666 | | |||
658 | bool kpTransformResizeScaleDialog::isNoOp () const | 667 | bool kpTransformResizeScaleDialog::isNoOp () const | ||
659 | { | 668 | { | ||
▲ Show 20 Lines • Show All 156 Lines • Show Last 20 Lines |