| 22 | #define SNAP_DELTA 15 |
| 23 | |
| 24 | class HandleDrag : public QWidget |
| 25 | { |
| 26 | Q_OBJECT |
| 27 | |
| 28 | public: |
| 29 | explicit HandleDrag(QWidget *parent = Q_NULLPTR) |
| 30 | : QWidget(parent) |
| 31 | { |
| 32 | setCursor(Qt::SizeAllCursor); |
| 33 | setFixedWidth(style()->pixelMetric(QStyle::PM_ToolBarHandleExtent)); |
| 34 | } |
| 35 | |
| 36 | void paintEvent(QPaintEvent *) override |
| 37 | { |
| 38 | QStyleOption opt; |
| 39 | opt.initFrom(this); |
| 40 | opt.state |= QStyle::State_Horizontal; |
| 41 | QStylePainter p(this); |
| 42 | p.drawPrimitive(QStyle::PE_IndicatorToolBarHandle, opt); |
| 43 | } |
| 44 | }; |
| 45 | |
| 46 | PresentationSearchBar::PresentationSearchBar(Okular::Document *document, QWidget *anchor, QWidget *parent) |