Commit 7c4f4bb6 authored by Peter Simonsson's avatar Peter Simonsson
Browse files

* Fix connect

* Add hack to limit the size of the section list

svn path=/trunk/koffice/; revision=546641
parent a9b73774
......@@ -29,6 +29,7 @@
#include <QPainter>
#include <QPen>
#include <QPixmap>
#include <QSize>
#include <klocale.h>
#include <kfiledialog.h>
......@@ -187,6 +188,8 @@ void KoOpenPane::initRecentDocs()
if(d->m_instance->config()->hasGroup("RecentFiles")) {
d->m_sectionList->setSelected(item, true);
}
updateSectionListMaxHeight();
}
void KoOpenPane::initTemplates(const QString& templateType)
......@@ -206,7 +209,7 @@ void KoOpenPane::initTemplates(const QString& templateType)
KoTemplatesPane* pane = new KoTemplatesPane(this, d->m_instance, group->name(),
group, templateTree.defaultTemplate());
connect(pane, SIGNAL(openFile(const KUrl&)), this, SIGNAL(openTemplate(const KUrl&)));
connect(pane, SIGNAL(openUrl(const KUrl&)), this, SIGNAL(openTemplate(const KUrl&)));
connect(pane, SIGNAL(alwaysUseChanged(KoTemplatesPane*, const QString&)),
this, SIGNAL(alwaysUseChanged(KoTemplatesPane*, const QString&)));
connect(this, SIGNAL(alwaysUseChanged(KoTemplatesPane*, const QString&)),
......@@ -241,6 +244,8 @@ void KoOpenPane::initTemplates(const QString& templateType)
} else if(!d->m_sectionList->selectedItem() && firstItem) {
d->m_sectionList->setSelected(firstItem, true);
}
updateSectionListMaxHeight();
}
void KoOpenPane::setCustomDocumentWidget(QWidget *widget) {
......@@ -257,6 +262,8 @@ void KoOpenPane::setCustomDocumentWidget(QWidget *widget) {
KoSectionListItem* selectedItem = static_cast<KoSectionListItem*>(item);
d->m_widgetStack->widget(selectedItem->widgetIndex())->setFocus();
}
updateSectionListMaxHeight();
}
Q3ListViewItem* KoOpenPane::addPane(const QString& title, const QString& icon, QWidget* widget, int sortWeight)
......@@ -315,4 +322,19 @@ void KoOpenPane::itemClicked(Q3ListViewItem* item)
}
}
void KoOpenPane::updateSectionListMaxHeight()
{
Q3ListViewItemIterator it(d->m_sectionList);
int totalHeight = 0;
while(it.current()) {
totalHeight += it.current()->height();
++it;
}
totalHeight += 4;
QSize sizeHint = d->m_sectionList->sizeHint();
d->m_sectionList->setFixedHeight(totalHeight);
}
#include "KoOpenPane.moc"
......@@ -86,6 +86,8 @@ class KoOpenPane : public QWidget
*/
void initTemplates(const QString& templateType);
void updateSectionListMaxHeight();
private:
KoOpenPanePrivate* d;
};
......
......@@ -227,7 +227,7 @@ void KoRecentDocumentsPane::updatePreview(const KFileItem* fileItem, const QPixm
break;
}
it++;
++it;
}
}
......
......@@ -58,4 +58,4 @@ class KoRecentDocumentsPane : public KoDetailsPane
KoRecentDocumentsPanePrivate* d;
};
#endif
\ No newline at end of file
#endif
......@@ -24,7 +24,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<widget class="QWidget" name="" >
<widget class="QWidget" name="layoutWidget" >
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
......@@ -66,11 +66,11 @@
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>0</width>
<width>20</width>
<height>0</height>
</size>
</property>
......@@ -84,7 +84,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>195</width>
<width>69</width>
<height>464</height>
</rect>
</property>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment