X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLyXView.C;h=3b049a538c0a549dafbb1f439de028f76e67f647;hb=a393cfc37c978985f534f9f00bdbbcfed07b3731;hp=03550c4a1f5c92b48a8b5383f2902d294153a574;hpb=b9d61343fc76a681b0264d65703ef2119647df56;p=lyx.git diff --git a/src/LyXView.C b/src/LyXView.C index 03550c4a1f..3b049a538c 100644 --- a/src/LyXView.C +++ b/src/LyXView.C @@ -15,20 +15,13 @@ #pragma implementation #endif -#include -#include - #include "LyXView.h" #include "minibuffer.h" #include "debug.h" #include "intl.h" #include "lyxrc.h" -#include "support/filetools.h" // OnlyFilename() #include "lyxtext.h" #include "buffer.h" -#include "frontends/Dialogs.h" -#include "frontends/Toolbar.h" -#include "frontends/Menubar.h" #include "MenuBackend.h" #include "lyx_gui_misc.h" // [update,Close,Redraw]AllBufferRelatedDialogs #include "bufferview_funcs.h" // CurrentState() @@ -36,12 +29,22 @@ #include "lyxfunc.h" #include "BufferView.h" +#include "frontends/Dialogs.h" +#include "frontends/Toolbar.h" +#include "frontends/Menubar.h" + +#include "support/filetools.h" // OnlyFilename() + +#include +#include + using std::endl; +using lyx::layout_type; extern void AutoSave(BufferView *); extern void QuitLyX(); -LyXTextClass::size_type current_layout = 0; +layout_type current_layout = 0; LyXView::LyXView() @@ -99,7 +102,7 @@ Toolbar * LyXView::getToolbar() const } -void LyXView::setLayout(LyXTextClass::size_type layout) +void LyXView::setLayout(layout_type layout) { toolbar->setLayout(layout); } @@ -108,7 +111,6 @@ void LyXView::setLayout(LyXTextClass::size_type layout) void LyXView::updateToolbar() { toolbar->update(); - menubar->update(); } @@ -155,6 +157,7 @@ void LyXView::updateMenubar() menubar->set("main_nobuffer"); else menubar->set("main"); + menubar->update(); } @@ -201,15 +204,13 @@ void LyXView::updateLayoutChoice() toolbar->updateLayoutList(true); last_textclass = int(buffer()->params.textclass); current_layout = 0; - } else + } else { toolbar->updateLayoutList(false); - + } + layout_type layout = bufferview->getLyXText()->cursor.par()->getLayout(); - LyXTextClass::size_type layout = - bufferview->text->cursor.par()->getLayout(); - - if (layout != current_layout){ + if (layout != current_layout) { toolbar->setLayout(layout); current_layout = layout; } @@ -221,26 +222,28 @@ void LyXView::updateWindowTitle() { static string last_title = "LyX"; string title = "LyX"; + string icon_title = "LyX"; if (view()->available()) { string const cur_title = buffer()->fileName(); - if (!cur_title.empty()){ + if (!cur_title.empty()) { title += ": " + MakeDisplayPath(cur_title, 30); if (!buffer()->isLyxClean()) title += _(" (Changed)"); if (buffer()->isReadonly()) title += _(" (read only)"); + /* Show only the filename if it's available. */ + icon_title = OnlyFilename(cur_title); } } if (title != last_title) { - setWindowTitle(title); + setWindowTitle(title, icon_title); + last_title = title; } } void LyXView::showState() { - message(CurrentState(view())); - getToolbar()->update(); - menubar->update(); + message(currentState(view())); }