mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
fix qt dialog list resizing (bug 1033)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9802 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
882a1f2e7e
commit
9dd60d60b3
@ -1,3 +1,8 @@
|
||||
2005-04-11 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
|
||||
|
||||
* panelstack.C (addCategory): let the listview compute the
|
||||
correct width.
|
||||
|
||||
2005-04-08 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* QAbout.C (build_dialog): specify that the CREDITS data is
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "qt_helpers.h"
|
||||
|
||||
#include <qwidgetstack.h>
|
||||
#include <qfontmetrics.h>
|
||||
#include <qlayout.h>
|
||||
#include <qlistview.h>
|
||||
|
||||
@ -87,8 +88,13 @@ void PanelStack::addCategory(string const & n, string const & parent)
|
||||
item->setOpen(true);
|
||||
panel_map_[n] = item;
|
||||
|
||||
// Qt is just unbelievably moronic
|
||||
list_->setMinimumSize(QSize(150, list_->minimumHeight()));
|
||||
// calculate the real size the current item needs in the listview
|
||||
QFontMetrics fm(list_->font());
|
||||
int itemsize = item->width(fm, list_, 0) + 10
|
||||
+ list_->treeStepSize() * (item->depth() + 1) + list_->itemMargin();
|
||||
// adjust the listview width to the max. itemsize
|
||||
if (itemsize > list_->minimumWidth())
|
||||
list_->setMinimumWidth(itemsize);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user