]> git.lyx.org Git - features.git/commitdiff
Modified form of John Levon's icon title patch
authorAllan Rae <rae@lyx.org>
Thu, 3 Jan 2002 03:14:40 +0000 (03:14 +0000)
committerAllan Rae <rae@lyx.org>
Thu, 3 Jan 2002 03:14:40 +0000 (03:14 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3277 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/LyXView.C
src/LyXView.h
src/XFormsView.C
src/XFormsView.h
src/lyxfind.C

index 8d9e80b4d831abdb286548b48cd57ddc26e31b60..9e2311594fe4c51d5a554abfdc827a549d641c99 100644 (file)
@@ -1,3 +1,14 @@
+2002-01-03  Allan Rae  <rae@lyx.org>
+
+       * 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  <jug@sad.it>
 
        * tabular.C (AppendColumn): hopefully fixed this memory access problem.
index 97ab981e68bd215e78dda7eddb8353f351587a80..5362a6e48e13711ff3dbcc8aade6a59103ae6e54 100644 (file)
@@ -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;
 }
 
 
index 2a570d958d393803892d4c23dcc47327b927aac4..0027484b901bdaaa9393027fb52853f4914296db 100644 (file)
@@ -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) */
index bbb2d7c820e275cfdcfaec9adc7cb4b0c5fef569..e331f5dc7d770902684bbdc2acf1cb4db22a2754 100644 (file)
@@ -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());
 }
 
 
index 885c86671f76d1e622d75470a30c696a6c29c27d..e3b052be77f9f58436d0308efdf87e9d621c528e 100644 (file)
@@ -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.      
index 13e8eeeff2caf971e8760b28c15e97dc0ed46ec9..5a44645f906b52790f4bff8dee5c5c9799dc30f9 100644 (file)
@@ -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;
        }
 }