Changeset View
Changeset View
Standalone View
Standalone View
src/IncrementalSearchBar.cpp
Show First 20 Lines • Show All 233 Lines • ▼ Show 20 Line(s) | 231 | if ((keyEvent->key() == Qt::Key_Return) | |||
---|---|---|---|---|---|
234 | return true; | 234 | return true; | ||
235 | } | 235 | } | ||
236 | 236 | | |||
237 | return QWidget::eventFilter(watched, event); | 237 | return QWidget::eventFilter(watched, event); | ||
238 | } | 238 | } | ||
239 | 239 | | |||
240 | void IncrementalSearchBar::correctPosition(const QSize &parentSize) | 240 | void IncrementalSearchBar::correctPosition(const QSize &parentSize) | ||
241 | { | 241 | { | ||
242 | const auto width = geometry().width(); | 242 | const auto x = parentSize.width() - width(); | ||
243 | const auto height = geometry().height(); | 243 | const auto y = parentSize.height(); | ||
244 | const auto x = parentSize.width() - width; | 244 | setGeometry(x, 0 + y, width(), height()); | ||
245 | setGeometry(x, 0, width, height); | | |||
246 | } | 245 | } | ||
247 | 246 | | |||
248 | void IncrementalSearchBar::keyPressEvent(QKeyEvent *event) | 247 | void IncrementalSearchBar::keyPressEvent(QKeyEvent *event) | ||
249 | { | 248 | { | ||
250 | static auto movementKeysToPassAlong = QSet<int>{ | 249 | static auto movementKeysToPassAlong = QSet<int>{ | ||
251 | Qt::Key_PageUp, Qt::Key_PageDown, Qt::Key_Up, Qt::Key_Down | 250 | Qt::Key_PageUp, Qt::Key_PageDown, Qt::Key_Up, Qt::Key_Down | ||
252 | }; | 251 | }; | ||
253 | 252 | | |||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |