mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
GuiSearch: Properly delegate focus
This commit is contained in:
parent
a7c1a39b5b
commit
109e98d945
@ -110,7 +110,7 @@ void GuiSearchWidget::keyPressEvent(QKeyEvent * ev)
|
||||
return;
|
||||
}
|
||||
if (ev->key() == Qt::Key_Escape) {
|
||||
dispatch(FuncRequest(LFUN_DIALOG_TOGGLE, "findreplace"));
|
||||
dispatch(FuncRequest(LFUN_DIALOG_HIDE, "findreplace"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -295,7 +295,7 @@ GuiSearch::GuiSearch(GuiView & parent, Qt::DockWidgetArea area, Qt::WindowFlags
|
||||
{
|
||||
setWidget(widget_);
|
||||
widget_->setBufferView(bufferview());
|
||||
setFocusProxy(widget_->findCO);
|
||||
setFocusProxy(widget_);
|
||||
|
||||
connect(widget_, SIGNAL(needTitleBarUpdate()), this, SLOT(updateTitle()));
|
||||
connect(widget_, SIGNAL(needSizeUpdate()), this, SLOT(updateSize()));
|
||||
|
@ -95,9 +95,11 @@ public:
|
||||
void updateView() override;
|
||||
void saveSession(QSettings & settings) const override;
|
||||
void restoreSession() override;
|
||||
bool wantInitialFocus() const override { return true; }
|
||||
///@}
|
||||
|
||||
protected:
|
||||
bool wantInitialFocus() const override { return true; }
|
||||
|
||||
public Q_SLOTS:
|
||||
///
|
||||
void onBufferViewChanged() override;
|
||||
|
@ -4893,7 +4893,8 @@ void GuiView::doShowDialog(QString const & qname, QString const & qdata,
|
||||
// activateWindow is needed for floating dockviews
|
||||
dialog->asQWidget()->raise();
|
||||
dialog->asQWidget()->activateWindow();
|
||||
dialog->asQWidget()->setFocus();
|
||||
if (dialog->wantInitialFocus())
|
||||
dialog->asQWidget()->setFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user