mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 11:16:55 +00:00
Fix focus on WorkArea after mini-buffer command.
* LyXView: - setFocus(): new pure virtual method. * QCommandBuffer: - simplify Ctor - call GuiView::setFocus() instead of centralWidget()->setFocus() * GuiView: - implement setFocus(): - focusNextPrevChild(): use setFocus(). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16386 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
0d6a07b9c3
commit
42426e1423
@ -70,6 +70,8 @@ public:
|
||||
|
||||
virtual void close() = 0;
|
||||
|
||||
virtual void setFocus() = 0;
|
||||
|
||||
std::vector<int> const & workAreaIds() const { return work_area_ids_; }
|
||||
|
||||
void setWorkArea(frontend::WorkArea * work_area);
|
||||
|
@ -195,6 +195,12 @@ void GuiView::close()
|
||||
}
|
||||
|
||||
|
||||
void GuiView::setFocus()
|
||||
{
|
||||
static_cast<GuiWorkArea *>(work_area_)->setFocus();
|
||||
}
|
||||
|
||||
|
||||
QMenu* GuiView::createPopupMenu()
|
||||
{
|
||||
return d.toolBarPopup(this);
|
||||
@ -648,7 +654,7 @@ bool GuiView::event(QEvent * e)
|
||||
|
||||
bool GuiView::focusNextPrevChild(bool /*next*/)
|
||||
{
|
||||
static_cast<GuiWorkArea *>(work_area_)->setFocus();
|
||||
setFocus();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -56,6 +56,7 @@ public:
|
||||
|
||||
virtual void init();
|
||||
virtual void close();
|
||||
virtual void setFocus();
|
||||
virtual void setGeometry(
|
||||
unsigned int width,
|
||||
unsigned int height,
|
||||
|
@ -74,9 +74,8 @@ protected:
|
||||
} // end of anon
|
||||
|
||||
|
||||
QCommandBuffer::QCommandBuffer(GuiView * view, ControlCommandBuffer & control,
|
||||
QWidget * parent)
|
||||
: QWidget(parent), view_(view), controller_(control)
|
||||
QCommandBuffer::QCommandBuffer(GuiView * view, ControlCommandBuffer & control)
|
||||
: QWidget(view), view_(view), controller_(control)
|
||||
{
|
||||
QPixmap qpup(toqstr(libFileSearch("images", "up", "xpm").absFilename()));
|
||||
QPixmap qpdown(toqstr(libFileSearch("images", "down", "xpm").absFilename()));
|
||||
@ -127,7 +126,7 @@ void QCommandBuffer::cancel()
|
||||
void QCommandBuffer::dispatch()
|
||||
{
|
||||
controller_.dispatch(fromqstr(edit_->text()));
|
||||
view_->centralWidget()->setFocus();
|
||||
view_->setFocus();
|
||||
edit_->setText(QString());
|
||||
edit_->clearFocus();
|
||||
}
|
||||
|
@ -26,8 +26,7 @@ class ControlCommandBuffer;
|
||||
class QCommandBuffer : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
QCommandBuffer(GuiView * view, ControlCommandBuffer & control,
|
||||
QWidget * parent=NULL);
|
||||
QCommandBuffer(GuiView * view, ControlCommandBuffer & control);
|
||||
|
||||
/// focus the edit widget
|
||||
void focus_command();
|
||||
|
Loading…
Reference in New Issue
Block a user