# HG changeset patch # User fpozo # Date 1350468925 -7200 # Node ID f635e227775c40874416a0f45338eb157204207c # Parent 7f1adcdc6cdc609a5ee6f502e485b741b95cd09c History widget stays on top when closing a branch. diff -r 7f1adcdc6cdc -r f635e227775c src/historywidget.cpp --- a/src/historywidget.cpp Wed Sep 26 21:29:48 2012 +0100 +++ b/src/historywidget.cpp Wed Oct 17 12:15:25 2012 +0200 @@ -71,7 +71,7 @@ connect(m_showClosedBranches, SIGNAL(toggled(bool)), this, SLOT(showClosedChanged(bool))); optLayout->addWidget(m_showClosedBranches, 0, 1, Qt::AlignRight); - m_showClosedBranches->hide(); + // m_showClosedBranches->hide(); setLayout(layout); } @@ -243,11 +243,24 @@ toFocus = g.getUncommittedItem(); if (!toFocus) { if (!m_currentIds.empty()) { - toFocus = g.getItemFor(m_currentIds[0]); + for (int i = 0; i < m_currentIds.size(); ++i) { + toFocus = g.getItemFor(m_currentIds[i]); + if (toFocus != 0) { + break; + } + } } else { toFocus = g.getItemFor(m_changesets[0]); } } + if (!toFocus) { + for (int i = 0; i < m_changesets.size(); ++i) { + toFocus = g.getItemFor(m_changesets[i]); + if (toFocus != 0) { + break; + } + } + } } m_panned->setScene(scene);