[gnote] Replace main window toolbar with box.



commit 0c083af653ed187b3bd7925d764be21bd4a1514b
Author: Aurimas Äernius <aurisc4 gmail com>
Date:   Sun Feb 17 19:53:12 2013 +0200

    Replace main window toolbar with box.

 src/recentchanges.cpp |   25 +++++++++++++------------
 src/recentchanges.hpp |    4 ++--
 2 files changed, 15 insertions(+), 14 deletions(-)
---
diff --git a/src/recentchanges.cpp b/src/recentchanges.cpp
index 933b0c7..a5ab46b 100644
--- a/src/recentchanges.cpp
+++ b/src/recentchanges.cpp
@@ -61,7 +61,7 @@ namespace gnote {
     m_search_notes_widget.signal_open_note_new_window
       .connect(sigc::mem_fun(*this, &NoteRecentChanges::on_open_note_new_window));
 
-    Gtk::Toolbar *toolbar = make_toolbar();
+    Gtk::Box *toolbar = make_toolbar();
     m_content_vbox.pack_start(*toolbar, false, false, 0);
     m_content_vbox.pack_start(m_embed_box, true, true, 0);
     m_embed_box.show();
@@ -85,23 +85,24 @@ namespace gnote {
     }
   }
 
-  Gtk::Toolbar *NoteRecentChanges::make_toolbar()
+  Gtk::Box *NoteRecentChanges::make_toolbar()
   {
-    Gtk::Toolbar *toolbar = manage(new Gtk::Toolbar);
-    m_all_notes_button = manage(new Gtk::ToolButton(
-      *manage(new Gtk::Image(Gtk::Stock::FIND, Gtk::IconSize(24))), _("All Notes")));
-    m_all_notes_button->set_is_important();
+    Gtk::Box *toolbar = manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL));
+    m_all_notes_button = manage(new Gtk::Button);
+    m_all_notes_button->set_image(*manage(new Gtk::Image(Gtk::Stock::FIND, Gtk::ICON_SIZE_BUTTON)));
+    m_all_notes_button->set_always_show_image(true);
+    m_all_notes_button->set_label(_("All Notes"));
     m_all_notes_button->signal_clicked().connect(sigc::mem_fun(*this, &NoteRecentChanges::present_search));
     m_all_notes_button->show_all();
-    toolbar->append(*m_all_notes_button);
+    toolbar->pack_start(*m_all_notes_button, false, false);
 
-    Gtk::ToolButton *button = manage(new Gtk::ToolButton(
-      *manage(new Gtk::Image(IconManager::obj().get_icon(IconManager::NOTE_NEW, 24))),
-      _("New")));
-    button->set_is_important();
+    Gtk::Button *button = manage(new Gtk::Button);
+    button->set_image(*manage(new Gtk::Image(IconManager::obj().get_icon(IconManager::NOTE_NEW, 24))));
+    button->set_always_show_image(true);
+    button->set_label(_("New"));
     button->signal_clicked().connect(sigc::mem_fun(m_search_notes_widget, &SearchNotesWidget::new_note));
     button->show_all();
-    toolbar->append(*button);
+    toolbar->pack_start(*button, false, false);
 
     toolbar->show();
     return toolbar;
diff --git a/src/recentchanges.hpp b/src/recentchanges.hpp
index 40a2275..82d62d5 100644
--- a/src/recentchanges.hpp
+++ b/src/recentchanges.hpp
@@ -67,14 +67,14 @@ private:
   bool on_key_pressed(GdkEventKey *);
   bool is_foreground(utils::EmbeddableWidget &);
   utils::EmbeddableWidget *currently_embedded();
-  Gtk::Toolbar *make_toolbar();
+  Gtk::Box *make_toolbar();
   void on_embedded_name_changed(const std::string & name);
 
   NoteManager        &m_note_manager;
   SearchNotesWidget   m_search_notes_widget;
   Gtk::VBox           m_content_vbox;
   Gtk::VBox           m_embed_box;
-  Gtk::ToolButton    *m_all_notes_button;
+  Gtk::Button        *m_all_notes_button;
   std::list<utils::EmbeddableWidget*> m_embedded_widgets;
   bool                m_mapped;
   sigc::connection    m_current_embedded_name_slot;


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