mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
Let M-x give focus to minibuffer when it is already open
This commit is contained in:
parent
bbb53c5363
commit
65b0e84b54
@ -324,9 +324,8 @@ void GuiToolbar::add(ToolbarItem const & item)
|
|||||||
void GuiToolbar::update(int context)
|
void GuiToolbar::update(int context)
|
||||||
{
|
{
|
||||||
if (visibility_ & Toolbars::AUTO) {
|
if (visibility_ & Toolbars::AUTO) {
|
||||||
bool const was_visible = isVisible();
|
|
||||||
setVisible(visibility_ & context & Toolbars::ALLOWAUTO);
|
setVisible(visibility_ & context & Toolbars::ALLOWAUTO);
|
||||||
if (isVisible() && !was_visible && commandBuffer())
|
if (isVisible() && commandBuffer() && (context & Toolbars::MINIBUFFER_FOCUS))
|
||||||
commandBuffer()->setFocus();
|
commandBuffer()->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -513,7 +513,7 @@ QSet<Buffer const *> GuiView::GuiViewPrivate::busyBuffers;
|
|||||||
|
|
||||||
GuiView::GuiView(int id)
|
GuiView::GuiView(int id)
|
||||||
: d(*new GuiViewPrivate(this)), id_(id), closing_(false), busy_(0),
|
: d(*new GuiViewPrivate(this)), id_(id), closing_(false), busy_(0),
|
||||||
command_execute_(false)
|
command_execute_(false), minibuffer_focus_(false)
|
||||||
{
|
{
|
||||||
// GuiToolbars *must* be initialised before the menu bar.
|
// GuiToolbars *must* be initialised before the menu bar.
|
||||||
normalSizedIcons(); // at least on Mac the default is 32 otherwise, which is huge
|
normalSizedIcons(); // at least on Mac the default is 32 otherwise, which is huge
|
||||||
@ -1564,6 +1564,10 @@ void GuiView::updateToolbars()
|
|||||||
context |= Toolbars::IPA;
|
context |= Toolbars::IPA;
|
||||||
if (command_execute_)
|
if (command_execute_)
|
||||||
context |= Toolbars::MINIBUFFER;
|
context |= Toolbars::MINIBUFFER;
|
||||||
|
if (minibuffer_focus_) {
|
||||||
|
context |= Toolbars::MINIBUFFER_FOCUS;
|
||||||
|
minibuffer_focus_ = false;
|
||||||
|
}
|
||||||
|
|
||||||
for (ToolbarMap::iterator it = d.toolbars_.begin(); it != end; ++it)
|
for (ToolbarMap::iterator it = d.toolbars_.begin(); it != end; ++it)
|
||||||
it->second->update(context);
|
it->second->update(context);
|
||||||
@ -3661,6 +3665,7 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
|||||||
|
|
||||||
case LFUN_COMMAND_EXECUTE: {
|
case LFUN_COMMAND_EXECUTE: {
|
||||||
command_execute_ = true;
|
command_execute_ = true;
|
||||||
|
minibuffer_focus_ = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LFUN_DROP_LAYOUTS_CHOICE:
|
case LFUN_DROP_LAYOUTS_CHOICE:
|
||||||
|
@ -452,6 +452,8 @@ private:
|
|||||||
|
|
||||||
/// Request to open the command toolbar if it is "auto"
|
/// Request to open the command toolbar if it is "auto"
|
||||||
bool command_execute_;
|
bool command_execute_;
|
||||||
|
/// Request to give focus to minibuffer
|
||||||
|
bool minibuffer_focus_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -108,9 +108,10 @@ public:
|
|||||||
TABLE = 256, //< show when in table
|
TABLE = 256, //< show when in table
|
||||||
REVIEW = 512, //< show when change tracking is enabled
|
REVIEW = 512, //< show when change tracking is enabled
|
||||||
MATHMACROTEMPLATE = 1024, //< show in math macro template
|
MATHMACROTEMPLATE = 1024, //< show in math macro template
|
||||||
SAMEROW = 2048, //place to the current row, no new line
|
SAMEROW = 2048, //< place to the current row, no new line
|
||||||
IPA = 4096, //< show when in IPA inset
|
IPA = 4096, //< show when in IPA inset
|
||||||
MINIBUFFER = 8192, //< show when command-execute has been invoked
|
MINIBUFFER = 8192, //< show when command-execute has been invoked
|
||||||
|
MINIBUFFER_FOCUS = 16384, //< set focus to minibuffer
|
||||||
ALLOWAUTO = MATH | TABLE | REVIEW | MATHMACROTEMPLATE | IPA | MINIBUFFER
|
ALLOWAUTO = MATH | TABLE | REVIEW | MATHMACROTEMPLATE | IPA | MINIBUFFER
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user