Commit 97116ac0 authored by Andreas Hartmetz's avatar Andreas Hartmetz

Session chooser: Ensure no unnecessary horizontal scroll bar.

There really is no need to resize any but the first columns.
The manual layout did not take into account the width of the
vertical scroll bar. This here is much easier than fixing that.
parent ef0cd0dc
......@@ -52,10 +52,10 @@ KateSessionChooser::KateSessionChooser(QWidget *parent, const QString &lastSessi
header << QString();
m_sessions->setHeaderLabels(header);
m_sessions->header()->setStretchLastSection(false);
m_sessions->header()->resizeSection(0, (m_sessions->size().width() - 32) * 2 / 3);
m_sessions->header()->resizeSection(1, (m_sessions->size().width() - 32) / 3);
m_sessions->header()->setSectionResizeMode(0, QHeaderView::Stretch);
m_sessions->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
m_sessions->header()->setSectionResizeMode(2, QHeaderView::Fixed);
m_sessions->header()->resizeSection(2, 32);
m_sessions->header()->setSectionResizeMode(QHeaderView::Fixed);
m_sessions->setRootIsDecorated(false);
m_sessions->setItemsExpandable(false);
m_sessions->setAllColumnsShowFocus(true);
......@@ -117,17 +117,9 @@ KateSessionChooser::KateSessionChooser(QWidget *parent, const QString &lastSessi
connect(newButton, SIGNAL(clicked()), this, SLOT(slotNew()));
setResult(resultNone);
//m_sessions->resizeColumnToContents(0);
selectionChanged(NULL, NULL);
}
void KateSessionChooser::resizeEvent(QResizeEvent *)
{
m_sessions->header()->resizeSection(0, (m_sessions->size().width() - 32) * 2 / 3);
m_sessions->header()->resizeSection(1, (m_sessions->size().width() - 32) / 3);
m_sessions->header()->resizeSection(2, 32);
}
KateSessionChooser::~KateSessionChooser()
{}
......
......@@ -61,9 +61,6 @@ protected Q_SLOTS:
*/
void selectionChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
protected:
void resizeEvent(QResizeEvent *);
private:
QTreeWidget *m_sessions;
QCheckBox *m_useLast;
......
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