From: Vincent van Ravesteijn Date: Tue, 4 Jan 2011 09:41:27 +0000 (+0000) Subject: Better fix for part 3 of bug #7182: LyX truncates file names to about 25 chars. X-Git-Tag: 2.0.0~1185 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=8ba5c7f886838fd572f9464be9e5b412808dde4a;p=features.git Better fix for part 3 of bug #7182: LyX truncates file names to about 25 chars. 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 --- diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index 4488c701a8..1d627bcf9f 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -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()); } }