Changeset View
Changeset View
Standalone View
Standalone View
plugins/dockers/historydocker/KisUndoView.cpp
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | |||||
68 | #include <QIcon> | 68 | #include <QIcon> | ||
69 | #include <QLabel> | 69 | #include <QLabel> | ||
70 | #include <QSpinBox> | 70 | #include <QSpinBox> | ||
71 | #include <QDoubleSpinBox> | 71 | #include <QDoubleSpinBox> | ||
72 | #include <QWidgetAction> | 72 | #include <QWidgetAction> | ||
73 | #include <QGridLayout> | 73 | #include <QGridLayout> | ||
74 | #include <kis_config.h> | 74 | #include <kis_config.h> | ||
75 | 75 | | |||
76 | 76 | #include "kis_double_parse_spin_box.h" | |||
77 | #include "kis_int_parse_spin_box.h" | ||||
77 | 78 | | |||
78 | /*! | 79 | /*! | ||
79 | \class KisUndoView | 80 | \class KisUndoView | ||
80 | \brief The KisUndoView class displays the contents of a KUndo2QStack. | 81 | \brief The KisUndoView class displays the contents of a KUndo2QStack. | ||
81 | \since 4.2 | 82 | \since 4.2 | ||
82 | 83 | | |||
83 | \ingroup advanced | 84 | \ingroup advanced | ||
84 | 85 | | |||
▲ Show 20 Lines • Show All 217 Lines • ▼ Show 20 Line(s) | |||||
302 | void KisUndoView::mousePressEvent(QMouseEvent *event) | 303 | void KisUndoView::mousePressEvent(QMouseEvent *event) | ||
303 | { | 304 | { | ||
304 | if (event->button() == Qt::RightButton) | 305 | if (event->button() == Qt::RightButton) | ||
305 | { | 306 | { | ||
306 | QMenu menu(this); | 307 | QMenu menu(this); | ||
307 | QAction* action1 = menu.addAction(KisIconUtils::loadIcon("link"),stack()->useCumulativeUndoRedo()?i18n("Disable Cumulative Undo"):i18n("Enable Cumulative Undo")); | 308 | QAction* action1 = menu.addAction(KisIconUtils::loadIcon("link"),stack()->useCumulativeUndoRedo()?i18n("Disable Cumulative Undo"):i18n("Enable Cumulative Undo")); | ||
308 | connect(action1, SIGNAL(triggered()), this, SLOT(toggleCumulativeUndoRedo())); | 309 | connect(action1, SIGNAL(triggered()), this, SLOT(toggleCumulativeUndoRedo())); | ||
309 | QLabel *l = new QLabel(i18n("Start merging time")); | 310 | QLabel *l = new QLabel(i18n("Start merging time")); | ||
310 | QDoubleSpinBox *s = new QDoubleSpinBox(); | 311 | QDoubleSpinBox *s = new KisDoubleParseSpinBox(); | ||
311 | s->setToolTip(i18nc("@info:tooltip", "The amount of time after a merged stroke before merging again")); | 312 | s->setToolTip(i18nc("@info:tooltip", "The amount of time after a merged stroke before merging again")); | ||
312 | s->setRange(3,10); | 313 | s->setRange(3,10); | ||
313 | s->setValue(stack()->timeT1()); | 314 | s->setValue(stack()->timeT1()); | ||
314 | QGridLayout *g = new QGridLayout(); | 315 | QGridLayout *g = new QGridLayout(); | ||
315 | g->addWidget(l); | 316 | g->addWidget(l); | ||
316 | g->addWidget(s); | 317 | g->addWidget(s); | ||
317 | QWidget *w = new QWidget(); | 318 | QWidget *w = new QWidget(); | ||
318 | w->setLayout(g); | 319 | w->setLayout(g); | ||
319 | w->setVisible(stack()->useCumulativeUndoRedo()); | 320 | w->setVisible(stack()->useCumulativeUndoRedo()); | ||
320 | QWidgetAction* action2 = new QWidgetAction(s); | 321 | QWidgetAction* action2 = new QWidgetAction(s); | ||
321 | action2->setDefaultWidget(w); | 322 | action2->setDefaultWidget(w); | ||
322 | connect(s,SIGNAL(valueChanged(double)),SLOT(setStackT1(double))); | 323 | connect(s,SIGNAL(valueChanged(double)),SLOT(setStackT1(double))); | ||
323 | 324 | | |||
324 | QLabel *l1 = new QLabel(i18n("Group time")); | 325 | QLabel *l1 = new QLabel(i18n("Group time")); | ||
325 | QDoubleSpinBox *s1 = new QDoubleSpinBox(); | 326 | QDoubleSpinBox *s1 = new KisDoubleParseSpinBox(); | ||
326 | s1->setToolTip(i18nc("@info:tooltip", "The amount of time every stroke should be apart from its previous stroke to be classified in one group")); | 327 | s1->setToolTip(i18nc("@info:tooltip", "The amount of time every stroke should be apart from its previous stroke to be classified in one group")); | ||
327 | s1->setRange(0.3,s->value()); | 328 | s1->setRange(0.3,s->value()); | ||
328 | s1->setValue(stack()->timeT2()); | 329 | s1->setValue(stack()->timeT2()); | ||
329 | QGridLayout *g1 = new QGridLayout(); | 330 | QGridLayout *g1 = new QGridLayout(); | ||
330 | g1->addWidget(l1); | 331 | g1->addWidget(l1); | ||
331 | g1->addWidget(s1); | 332 | g1->addWidget(s1); | ||
332 | QWidget *w1 = new QWidget(); | 333 | QWidget *w1 = new QWidget(); | ||
333 | w1->setLayout(g1); | 334 | w1->setLayout(g1); | ||
334 | w1->setVisible(stack()->useCumulativeUndoRedo()); | 335 | w1->setVisible(stack()->useCumulativeUndoRedo()); | ||
335 | QWidgetAction* action3 = new QWidgetAction(s1); | 336 | QWidgetAction* action3 = new QWidgetAction(s1); | ||
336 | action3->setDefaultWidget(w1); | 337 | action3->setDefaultWidget(w1); | ||
337 | connect(s1,SIGNAL(valueChanged(double)),SLOT(setStackT2(double))); | 338 | connect(s1,SIGNAL(valueChanged(double)),SLOT(setStackT2(double))); | ||
338 | 339 | | |||
339 | QLabel *l2 = new QLabel(i18n("Split Strokes")); | 340 | QLabel *l2 = new QLabel(i18n("Split Strokes")); | ||
340 | QSpinBox *s2 = new QSpinBox(); | 341 | QSpinBox *s2 = new KisIntParseSpinBox(); | ||
341 | s2->setToolTip(i18nc("@info:tooltip", "The number of last strokes which Krita should store separately")); | 342 | s2->setToolTip(i18nc("@info:tooltip", "The number of last strokes which Krita should store separately")); | ||
342 | s2->setRange(1,stack()->undoLimit()); | 343 | s2->setRange(1,stack()->undoLimit()); | ||
343 | s2->setValue(stack()->strokesN()); | 344 | s2->setValue(stack()->strokesN()); | ||
344 | QGridLayout *g2 = new QGridLayout(); | 345 | QGridLayout *g2 = new QGridLayout(); | ||
345 | g1->addWidget(l2); | 346 | g1->addWidget(l2); | ||
346 | g1->addWidget(s2); | 347 | g1->addWidget(s2); | ||
347 | QWidget *w2 = new QWidget(); | 348 | QWidget *w2 = new QWidget(); | ||
348 | w2->setLayout(g2); | 349 | w2->setLayout(g2); | ||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |