mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 19:25:39 +00:00
parent
528eee0a25
commit
ce8b4e3a21
@ -564,6 +564,33 @@ GuiSearch::GuiSearch(GuiView & parent, Qt::DockWidgetArea area, Qt::WindowFlags
|
|||||||
connect(widget_, SIGNAL(needSizeUpdate()), this, SLOT(updateSize()));
|
connect(widget_, SIGNAL(needSizeUpdate()), this, SLOT(updateSize()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GuiSearch::mousePressEvent(QMouseEvent *event)
|
||||||
|
{
|
||||||
|
if (isFloating() && event->button() == Qt::LeftButton) {
|
||||||
|
dragPosition = event->globalPos() - frameGeometry().topLeft();
|
||||||
|
event->accept();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GuiSearch::mouseMoveEvent(QMouseEvent *event)
|
||||||
|
{
|
||||||
|
if (isFloating() && event->buttons() & Qt::LeftButton) {
|
||||||
|
move(event->globalPos() - dragPosition);
|
||||||
|
event->accept();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GuiSearch::mouseDoubleClickEvent(QMouseEvent *event)
|
||||||
|
{
|
||||||
|
if (event->button() == Qt::LeftButton) {
|
||||||
|
setFloating(!isFloating());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void GuiSearch::onBufferViewChanged()
|
void GuiSearch::onBufferViewChanged()
|
||||||
{
|
{
|
||||||
widget_->setEnabled(static_cast<bool>(bufferview()));
|
widget_->setEnabled(static_cast<bool>(bufferview()));
|
||||||
|
@ -127,6 +127,9 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool wantInitialFocus() const override { return true; }
|
bool wantInitialFocus() const override { return true; }
|
||||||
|
void mouseMoveEvent(QMouseEvent * event) override;
|
||||||
|
void mousePressEvent(QMouseEvent * event) override;
|
||||||
|
void mouseDoubleClickEvent(QMouseEvent *event) override;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
///
|
///
|
||||||
@ -141,6 +144,8 @@ private Q_SLOTS:
|
|||||||
private:
|
private:
|
||||||
/// The encapsulated widget.
|
/// The encapsulated widget.
|
||||||
GuiSearchWidget * widget_;
|
GuiSearchWidget * widget_;
|
||||||
|
///
|
||||||
|
QPoint dragPosition;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace frontend
|
} // namespace frontend
|
||||||
|
Loading…
Reference in New Issue
Block a user