]> git.lyx.org Git - features.git/commitdiff
Better fix for part 3 of bug #7182: LyX truncates file names to about 25 chars.
authorVincent van Ravesteijn <vfr@lyx.org>
Tue, 4 Jan 2011 09:41:27 +0000 (09:41 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Tue, 4 Jan 2011 09:41:27 +0000 (09:41 +0000)
Now, when hovering the tabs, the full paths are shown as a tooltip.

see r37084.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37101 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiWorkArea.cpp

index 4488c701a8661276f5767b7a9043f289004fb6be..1d627bcf9fec1ea0558ddb19d5b1645ff4c6be8d 100644 (file)
@@ -1578,8 +1578,7 @@ GuiWorkArea * TabWorkArea::addWorkArea(Buffer & buffer, GuiView & view)
        // when hiding it again below).
        if (!(currentWorkArea() && currentWorkArea()->isFullScreen()))
                showBar(count() > 0);
-       int const index = addTab(wa, wa->windowTitle());
-       setTabToolTip(index, wa->windowTitle());
+       addTab(wa, wa->windowTitle());
        QObject::connect(wa, SIGNAL(titleChanged(GuiWorkArea *)),
                this, SLOT(updateTabTexts()));
        if (currentWorkArea() && currentWorkArea()->isFullScreen())
@@ -1868,12 +1867,13 @@ void TabWorkArea::updateTabTexts()
 
        // set new tab titles
        for (It it = paths.begin(); it != paths.end(); ++it) {
-               GuiWorkArea * i_wa = workArea(it->tab());
-               Buffer & buf = i_wa->bufferView().buffer();
+               int const tab_index = it->tab();
+               Buffer const & buf = workArea(tab_index)->bufferView().buffer();
+               QString tab_text = it->displayString();
                if (!buf.fileName().empty() && !buf.isClean())
-                       setTabText(it->tab(), it->displayString() + "*");
-               else
-                       setTabText(it->tab(), it->displayString());
+                       tab_text += "*";
+               setTabText(tab_index, tab_text);
+               setTabToolTip(tab_index, it->abs());
        }
 }