Edwin Leuven wrote:
Asger Ottar Alstrup wrote:
- The preferences dialog has the wrong size initially

updated patch attached.

works for me, so will commit soon unless someone doesn't like it...
Index: panelstack.C
===================================================================
--- panelstack.C        (revision 15525)
+++ panelstack.C        (working copy)
@@ -15,10 +15,10 @@
 #include "qt_helpers.h"
 
 #include <QStackedWidget>
-#include <QFontMetrics>
 #include <QTreeWidget>
 #include <QHBoxLayout>
 #include <QLayout>
+#include <QHeaderView>
 
 #include <boost/assert.hpp>
 
@@ -90,7 +90,7 @@
 
        panel_map_[n] = item;
 
-       list_->setFixedWidth(list_->sizeHint().width());
+       list_->setMinimumWidth(list_->header()->sectionSize(0) + 
list_->indentation());
 /*
        item->setFlags(false);
        item->setOpen(true);
@@ -142,10 +142,11 @@
        stack_->setCurrentWidget(cit->second);
 }
 
-#include "panelstack_moc.cpp"
 
+QSize PanelStack::sizeHint() const
+{
+       return QSize(list_->width() + stack_->width(),
+               list_->height() + stack_->height());
+}
 
-namespace lyx {
-
-
-} // namespace lyx
+#include "panelstack_moc.cpp"
Index: panelstack.h
===================================================================
--- panelstack.h        (revision 15525)
+++ panelstack.h        (working copy)
@@ -43,6 +43,7 @@
        /// set current panel by logical name
        void setCurrentPanel(lyx::docstring const &);
 
+       virtual QSize sizeHint() const;
 public Q_SLOTS:
        /// set current panel from an item
        void switchPanel(QTreeWidgetItem * i, QTreeWidgetItem* previous=0);

Reply via email to