diff src/historywidget.cpp @ 558:d932ce55c364 find

Remove the single find widget from top, add one to each tab at the bottom instead. (Turns out you don't usually want to search for the same text in both types of widget.) Also provide sensible no-results text.
author Chris Cannam
date Mon, 27 Feb 2012 17:08:26 +0000
parents a1d210c767ab
children 533519ebc0cb
line wrap: on
line diff
--- a/src/historywidget.cpp	Thu Feb 23 15:28:29 2012 +0000
+++ b/src/historywidget.cpp	Mon Feb 27 17:08:26 2012 +0000
@@ -23,6 +23,7 @@
 #include "grapher.h"
 #include "debug.h"
 #include "uncommitteditem.h"
+#include "findwidget.h"
 
 #include <iostream>
 
@@ -55,11 +56,21 @@
     settings.beginGroup("Presentation");
     bool showClosed = (settings.value("showclosedbranches", false).toBool());
 
+    QWidget *opts = new QWidget;
+    QGridLayout *optLayout = new QGridLayout(opts);
+    optLayout->setMargin(0);
+    layout->addWidget(opts, ++row, 0, 1, 2);
+
+    m_findWidget = new FindWidget(this);
+    optLayout->addWidget(m_findWidget, 0, 0, Qt::AlignLeft);
+    connect(m_findWidget, SIGNAL(findTextChanged(QString)),
+            this, SLOT(setSearchText(QString)));
+
     m_showClosedBranches = new QCheckBox(tr("Show closed branches"), this);
     m_showClosedBranches->setChecked(showClosed);
     connect(m_showClosedBranches, SIGNAL(toggled(bool)), 
             this, SLOT(showClosedChanged(bool)));
-    layout->addWidget(m_showClosedBranches, ++row, 0, Qt::AlignLeft);
+    optLayout->addWidget(m_showClosedBranches, 0, 1, Qt::AlignRight);
     m_showClosedBranches->hide();
 
     setLayout(layout);