]> git.lyx.org Git - lyx.git/commitdiff
Use localized item when calculating the panel stack's tree widget width.
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 5 Feb 2017 17:02:34 +0000 (18:02 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 5 Feb 2017 17:02:34 +0000 (18:02 +0100)
The current version was wrong for non-English dialogs, and even for
the English one, due to the translator commands that were not removed
for calculation (as in "Formats[[output]]").

Candidate for stable.

src/frontends/qt4/PanelStack.cpp

index 70ab4e0776395b98f7c4b1c416e249a7e1cc7b71..3036b1e4d35385687847813eb710dfb9cbd62e23 100644 (file)
@@ -120,7 +120,7 @@ void PanelStack::addCategory(QString const & name, QString const & parent)
        QFontMetrics fm(list_->font());
                
        // calculate the real size the current item needs in the listview
-       int itemsize = fm.width(name) + 10 + list_->indentation() * depth;
+       int itemsize = fm.width(qt_(name)) + 10 + list_->indentation() * depth;
        // adjust the listview width to the max. itemsize
        if (itemsize > list_->minimumWidth())
                list_->setMinimumWidth(itemsize);