From: John Levon Date: Mon, 7 Apr 2003 16:57:38 +0000 (+0000) Subject: reset the status message on leaving an inset or clicking with the mous X-Git-Tag: 1.6.10~17041 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5d67f7c61758821dde284198aff0cb76bff60df0;p=features.git reset the status message on leaving an inset or clicking with the mous git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6727 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index 51a1d48818..cf0d3c6ad1 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -337,6 +337,9 @@ int BufferView::Pimpl::resizeCurrentBuffer() switchKeyMap(); owner_->busy(false); + // reset the "Formatting..." message + owner_->clearMessage(); + updateScrollbar(); return 0; @@ -937,6 +940,11 @@ bool BufferView::Pimpl::workAreaDispatch(FuncRequest const & ev_in) bv_->owner()->updateLayoutChoice(); bv_->fitCursor(); + // slight hack: this is only called currently when + // we clicked somewhere, so we force through the display + // of the new status here. + bv_->owner()->clearMessage(); + return res; } diff --git a/src/ChangeLog b/src/ChangeLog index 2490b75fbc..fbc26e38a7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2003-04-07 John Levon + + * BufferView_pimpl.C: clear message when doc finishes resizing, + and after a mouse event + + * lyxfunc.C: clear message after exiting inset + 2003-04-07 John Levon * bufferview_funcs.C: show math status not outside diff --git a/src/frontends/LyXView.h b/src/frontends/LyXView.h index e3318d2bb9..ea4c42d08d 100644 --- a/src/frontends/LyXView.h +++ b/src/frontends/LyXView.h @@ -124,6 +124,9 @@ public: /// display a message in the view virtual void message(string const &) = 0; + /// clear any temporary message and replace with current status + virtual void clearMessage() = 0; + /// updates the title of the window void updateWindowTitle(); diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index aedbd92228..30ac476542 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,8 @@ +2003-04-07 John Levon + + * QtView.h: + * QtView.C: implement clearMessage() + 2003-04-07 John Levon * QtView.h: diff --git a/src/frontends/qt2/QtView.C b/src/frontends/qt2/QtView.C index 63b60e32ee..6c432b6736 100644 --- a/src/frontends/qt2/QtView.C +++ b/src/frontends/qt2/QtView.C @@ -19,7 +19,6 @@ #include "MenuBackend.h" #include "ToolbarBackend.h" #include "lyxfunc.h" -#include "bufferview_funcs.h" #include "BufferView.h" #include "frontends/Toolbar.h" @@ -41,7 +40,6 @@ #include using std::endl; -using namespace bv_funcs; namespace { @@ -109,6 +107,12 @@ void QtView::message(string const & str) } +void QtView::clearMessage() +{ + update_view_state_qt(); +} + + void QtView::focus_command_widget() { commandbuffer_->focus_command(); @@ -117,7 +121,7 @@ void QtView::focus_command_widget() void QtView::update_view_state_qt() { - statusBar()->message(toqstr(currentState(view().get()))); + statusBar()->message(toqstr(getLyXFunc().view_status_message())); statusbar_timer_.stop(); } @@ -128,7 +132,7 @@ void QtView::update_view_state() if (statusbar_timer_.isActive()) return; - statusBar()->message(toqstr(currentState(view().get()))); + statusBar()->message(toqstr(getLyXFunc().view_status_message())); } diff --git a/src/frontends/qt2/QtView.h b/src/frontends/qt2/QtView.h index bc0f91b2df..f5484d00e6 100644 --- a/src/frontends/qt2/QtView.h +++ b/src/frontends/qt2/QtView.h @@ -42,6 +42,10 @@ public: /// display a status message virtual void message(string const & str); + + /// clear status message + virtual void clearMessage(); + public slots: /// menu item has been selected void activated(int id); diff --git a/src/frontends/xforms/XFormsView.C b/src/frontends/xforms/XFormsView.C index 7971cf91ff..4d37ffd175 100644 --- a/src/frontends/xforms/XFormsView.C +++ b/src/frontends/xforms/XFormsView.C @@ -189,6 +189,12 @@ void XFormsView::message(string const & str) } +void XFormsView::clearMessage() +{ + message(getLyXFunc().view_status_message()); +} + + void XFormsView::show_view_state() { message(getLyXFunc().view_status_message()); diff --git a/src/frontends/xforms/XFormsView.h b/src/frontends/xforms/XFormsView.h index e5b6c99d83..70ba5ada9c 100644 --- a/src/frontends/xforms/XFormsView.h +++ b/src/frontends/xforms/XFormsView.h @@ -53,6 +53,9 @@ public: /// display a status message virtual void message(string const & str); + /// clear back to normal status message + virtual void clearMessage(); + private: /** * setWindowTitle - set title of window diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 1784cda237..669b1ddba4 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2003-04-07 John Levon + + * insettabular.C: + * insettext.C: clear status message on inset exit + 2003-04-03 John Levon * insetcommand.C: return dispatched on DIALOG_UPDATE diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index 8f1939db07..d8964618a8 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -854,10 +854,17 @@ Inset::RESULT InsetTabular::localDispatch(FuncRequest const & cmd) return result; } else if (result == FINISHED_UP) { action = LFUN_UP; + // Make sure to reset status message after + // exiting, e.g. math inset + bv->owner()->clearMessage(); } else if (result == FINISHED_DOWN) { action = LFUN_DOWN; + bv->owner()->clearMessage(); } else if (result == FINISHED_RIGHT) { action = LFUN_RIGHT; + bv->owner()->clearMessage(); + } else if (result == FINISHED) { + bv->owner()->clearMessage(); } } diff --git a/src/insets/insettext.C b/src/insets/insettext.C index e85a5ca925..753161a6d5 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -1146,6 +1146,8 @@ Inset::RESULT InsetText::localDispatch(FuncRequest const & ev) } the_locking_inset = 0; updateLocal(bv, CURSOR, false); + // make sure status gets reset immediately + bv->owner()->clearMessage(); return result; } } diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 71c513dd6c..e9e3efe8af 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -818,6 +818,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose) goto exit_with_message; // If UNDISPATCHED, just soldier on else if (result == FINISHED) { + owner->clearMessage(); goto exit_with_message; // We do not need special RTL handling here: // FINISHED means that the cursor should be @@ -825,7 +826,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose) } else if (result == FINISHED_RIGHT) { TEXT()->cursorRight(view()); moveCursorUpdate(true, false); - owner->view_state_changed(); + owner->clearMessage(); goto exit_with_message; } else if (result == FINISHED_UP) { if (TEXT()->cursor.irow() != TEXT()->rows().begin()) { @@ -839,10 +840,10 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose) TEXT()->cursorUp(view()); #endif moveCursorUpdate(true, false); - owner->view_state_changed(); } else { view()->update(TEXT(), BufferView::SELECT); } + owner->clearMessage(); goto exit_with_message; } else if (result == FINISHED_DOWN) { if (boost::next(TEXT()->cursor.irow()) != TEXT()->rows().end()) { @@ -860,7 +861,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose) TEXT()->cursorRight(view()); } moveCursorUpdate(true, false); - owner->view_state_changed(); + owner->clearMessage(); goto exit_with_message; } #warning I am not sure this is still right, please have a look! (Jug 20020417)