Changeset View
Changeset View
Standalone View
Standalone View
src/Gui/KSWidget.cpp
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Line(s) | 42 | { | |||
---|---|---|---|---|---|
121 | // the take a new screenshot button | 121 | // the take a new screenshot button | ||
122 | 122 | | |||
123 | mTakeScreenshotButton = new QPushButton(i18n("Take a New Screenshot"), this); | 123 | mTakeScreenshotButton = new QPushButton(i18n("Take a New Screenshot"), this); | ||
124 | mTakeScreenshotButton->setIcon(QIcon::fromTheme(QStringLiteral("spectacle"))); | 124 | mTakeScreenshotButton->setIcon(QIcon::fromTheme(QStringLiteral("spectacle"))); | ||
125 | mTakeScreenshotButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | 125 | mTakeScreenshotButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | ||
126 | mTakeScreenshotButton->setFocus(); | 126 | mTakeScreenshotButton->setFocus(); | ||
127 | connect(mTakeScreenshotButton, &QPushButton::clicked, this, &KSWidget::newScreenshotClicked); | 127 | connect(mTakeScreenshotButton, &QPushButton::clicked, this, &KSWidget::newScreenshotClicked); | ||
128 | 128 | | |||
129 | QShortcut *shortcut = new QShortcut(QKeySequence(QKeySequence::New), mTakeScreenshotButton); | | |||
130 | auto clickFunc = [&]() { | 129 | auto clickFunc = [&]() { | ||
131 | mTakeScreenshotButton->animateClick(100); | 130 | mTakeScreenshotButton->animateClick(100); | ||
132 | QTimer::singleShot(100, mTakeScreenshotButton, &QPushButton::click); | 131 | QTimer::singleShot(100, mTakeScreenshotButton, &QPushButton::click); | ||
133 | }; | 132 | }; | ||
134 | connect(shortcut, &QShortcut::activated, clickFunc); | 133 | | ||
134 | QShortcut *enterKey = new QShortcut(QKeySequence(QKeySequence::New), mTakeScreenshotButton); | ||||
135 | connect(enterKey, &QShortcut::activated, clickFunc); | ||||
136 | QShortcut *ctrlT = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_T), mTakeScreenshotButton); | ||||
137 | connect(ctrlT, &QShortcut::activated, clickFunc); | ||||
135 | 138 | | |||
136 | // finally, finish up the layouts | 139 | // finally, finish up the layouts | ||
137 | 140 | | |||
138 | mRightLayout = new QVBoxLayout; | 141 | mRightLayout = new QVBoxLayout; | ||
139 | mRightLayout->addStretch(1); | 142 | mRightLayout->addStretch(1); | ||
140 | mRightLayout->addWidget(mCaptureModeLabel); | 143 | mRightLayout->addWidget(mCaptureModeLabel); | ||
141 | mRightLayout->addLayout(mCaptureModeForm); | 144 | mRightLayout->addLayout(mCaptureModeForm); | ||
142 | mRightLayout->addStretch(1); | 145 | mRightLayout->addStretch(1); | ||
▲ Show 20 Lines • Show All 95 Lines • Show Last 20 Lines |