From ce2ec24b67d997baf0a66f71e3589388652416a6 Mon Sep 17 00:00:00 2001 From: Allan Rae Date: Thu, 3 Jan 2002 03:14:40 +0000 Subject: [PATCH] Modified form of John Levon's icon title patch git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3277 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 11 +++++++++++ src/LyXView.C | 6 ++++-- src/LyXView.h | 2 +- src/XFormsView.C | 3 ++- src/XFormsView.h | 4 ++-- src/lyxfind.C | 4 ++-- 6 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 8d9e80b4d8..9e2311594f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2002-01-03 Allan Rae + + * LyXView.C (updateWindowTitle): Setup a short icon title of either + "LyX" or the filename of the current buffer if it has one. This is a + modified form of John Levon's patch. + + * XFormsView.C (setWindowTitle): also set icon title. + + * LyXView.h: (setWindowTitle): signature changed. + * XFormsView.h (setWindowTitle): ditto. + 2002-01-02 Juergen Vigna * tabular.C (AppendColumn): hopefully fixed this memory access problem. diff --git a/src/LyXView.C b/src/LyXView.C index 97ab981e68..5362a6e48e 100644 --- a/src/LyXView.C +++ b/src/LyXView.C @@ -222,6 +222,7 @@ void LyXView::updateWindowTitle() { static string last_title = "LyX"; string title = "LyX"; + string icon_title = "LyX"; if (view()->available()) { string const cur_title = buffer()->fileName(); @@ -231,13 +232,14 @@ void LyXView::updateWindowTitle() 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; } - last_title = title; } diff --git a/src/LyXView.h b/src/LyXView.h index 2a570d958d..0027484b90 100644 --- a/src/LyXView.h +++ b/src/LyXView.h @@ -123,7 +123,7 @@ private: /// Dialogs * dialogs_; /// - virtual void setWindowTitle(string const &) = 0; + virtual void setWindowTitle(string const &, string const &) = 0; /** The last textclass layout list in the layout choice selector This should probably be moved to the toolbar, but for now it's here. (Asger) */ diff --git a/src/XFormsView.C b/src/XFormsView.C index bbb2d7c820..e331f5dc7d 100644 --- a/src/XFormsView.C +++ b/src/XFormsView.C @@ -212,9 +212,10 @@ void XFormsView::init() } -void XFormsView::setWindowTitle(string const & title) +void XFormsView::setWindowTitle(string const & title, string const & icon_title) { fl_set_form_title(form_, title.c_str()); + fl_winicontitle(form_->window, icon_title.c_str()); } diff --git a/src/XFormsView.h b/src/XFormsView.h index 885c86671f..e3b052be77 100644 --- a/src/XFormsView.h +++ b/src/XFormsView.h @@ -49,8 +49,8 @@ public: window manager. */ static int atCloseMainFormCB(FL_FORM *, void *); private: - /// - virtual void setWindowTitle(string const &); + /// pass the title, and the iconified title + virtual void setWindowTitle(string const &, string const &); /// makes the main form. void create_form_form_main(int width, int height); /// A pointer to the form. diff --git a/src/lyxfind.C b/src/lyxfind.C index 13e8eeeff2..5a44645f90 100644 --- a/src/lyxfind.C +++ b/src/lyxfind.C @@ -255,7 +255,7 @@ SearchResult SearchForward(BufferView * bv, LyXText * text, string const & str, } else { // make sure we end up at the end of the text, // not the start point of the last search - text->setCursor(bv, prev_par, prev_par->size()); + text->setCursor(bv, prev_par, prev_par->size()); return SR_NOT_FOUND; } } @@ -303,7 +303,7 @@ SearchResult SearchBackward(BufferView * bv, LyXText * text, return SR_FOUND; } else { // go to the last part of the unsuccessful search - text->setCursor(bv, prev_par, 0); + text->setCursor(bv, prev_par, 0); return SR_NOT_FOUND; } } -- 2.39.5