[gnote] Use a status bar in the "Search All Notes" and add a resize grip at the same time



commit aebb20ae40b4a4d176884dcc726ddadf365be3be
Author: Hubert Figuiere <hub figuiere net>
Date:   Thu Jul 16 22:06:50 2009 -0400

    Use a status bar in the "Search All Notes" and add a resize grip at the same time
    (Tomboy bug #500513) (tb-backport)

 src/recentchanges.cpp |   18 +++++++++---------
 src/recentchanges.hpp |    3 ++-
 2 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/src/recentchanges.cpp b/src/recentchanges.cpp
index de072a9..95f7a5e 100644
--- a/src/recentchanges.cpp
+++ b/src/recentchanges.cpp
@@ -153,8 +153,8 @@ namespace gnote {
     m_tree = manage(m_tree);
     m_tree->show ();
 
-    m_note_count.property_xalign() = 0;
-    m_note_count.show ();
+    m_status_bar.set_has_resize_grip(true);
+    m_status_bar.show();
 
     // Update on changes to notes
     m.signal_note_deleted.connect(sigc::mem_fun(*this, &NoteRecentChanges::on_notes_changed));
@@ -187,15 +187,11 @@ namespace gnote {
     hpaned->add2 (m_matches_window);
     hpaned->show ();
 
-    Gtk::HBox *status_box = manage(new Gtk::HBox (false, 8));
-    status_box->pack_start (m_note_count, true, true, 0);
-    status_box->show ();
-
     Gtk::VBox *vbox = manage(new Gtk::VBox (false, 8));
     vbox->set_border_width(6);
     vbox->pack_start (*hbox, false, false, 0);
     vbox->pack_start (*hpaned, true, true, 0);
-    vbox->pack_start (*status_box, false, false, 0);
+    vbox->pack_start (m_status_bar, false, false, 0);
     vbox->show ();
 
     // Use another VBox to place the MenuBar
@@ -578,7 +574,9 @@ namespace gnote {
     try {
       const char * fmt;
       fmt = ngettext("Total: %1% note", "Total: %1% notes", total);
-      m_note_count.set_text(str(boost::format (fmt) % total));
+      std::string status = str(boost::format (fmt) % total);
+      m_status_bar.pop(0);
+      m_status_bar.push(status, 0);
     } 
     catch(const std::exception & e)
     {
@@ -592,7 +590,9 @@ namespace gnote {
     try {
       const char * fmt;
       fmt = ngettext("Matches: %1% note", "Matches: %1% notes", matches);
-      m_note_count.set_text(str(boost::format (fmt) % matches));
+      std::string status = str(boost::format (fmt) % matches);
+      m_status_bar.pop(0);
+      m_status_bar.push(status, 0);
     }
     catch(const std::exception & e)
     {
diff --git a/src/recentchanges.hpp b/src/recentchanges.hpp
index 3d1fcdc..320888e 100644
--- a/src/recentchanges.hpp
+++ b/src/recentchanges.hpp
@@ -36,6 +36,7 @@
 #include <gtkmm/menubar.h>
 #include <gtkmm/scrolledwindow.h>
 #include <gtkmm/selectiondata.h>
+#include <gtkmm/statusbar.h>
 #include <gtkmm/treemodelfilter.h>
 #include <gtkmm/treemodelsort.h>
 #include <gtkmm/treepath.h>
@@ -164,7 +165,7 @@ private:
   Gtk::ComboBoxEntry  m_find_combo;
   Gtk::Button         m_clear_search_button;
   Gtk::CheckButton    m_case_sensitive;
-  Gtk::Label          m_note_count;
+  Gtk::Statusbar      m_status_bar;
   Gtk::ScrolledWindow m_matches_window;
   Gtk::VBox           m_content_vbox;
   Gtk::TreeViewColumn *m_matches_column;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]