[gnote/gnome-3-8] Revert "Let move window my dragging toolbar"



commit 79d949a4ddd1a10de95397160d6f6aa91fa78f2f
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Wed May 8 21:57:24 2013 +0300

    Revert "Let move window my dragging toolbar"
    
    This reverts commit af3fa017486cb8c64584bbf003b72b0cf7a33d5d.
    This does not work properly on GNOME 3.8, toolbar is not rendered, when
    search entry is visible.

 src/recentchanges.cpp |   25 ++++++++-----------------
 src/recentchanges.hpp |    2 +-
 2 files changed, 9 insertions(+), 18 deletions(-)
---
diff --git a/src/recentchanges.cpp b/src/recentchanges.cpp
index b1afabd..203b1f3 100644
--- a/src/recentchanges.cpp
+++ b/src/recentchanges.cpp
@@ -69,7 +69,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();
@@ -112,21 +112,17 @@ namespace gnote {
     }
   }
 
-  Gtk::Toolbar *NoteRecentChanges::make_toolbar()
+  Gtk::Box *NoteRecentChanges::make_toolbar()
   {
-    Gtk::Toolbar *toolbar = manage(new Gtk::Toolbar);
-    // let move window by dragging toolbar with mouse
-    toolbar->get_style_context()->add_class(GTK_STYLE_CLASS_MENUBAR);
-    Gtk::ToolItem *tool_item = manage(new Gtk::ToolItem);
-    Gtk::Box *box = manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL));
-    box->set_border_width(5);
+    Gtk::Box *toolbar = manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL));
+    toolbar->set_border_width(5);
     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();
-    box->pack_start(*m_all_notes_button, false, false);
+    toolbar->pack_start(*m_all_notes_button, false, false);
 
     Gtk::Button *button = manage(new Gtk::Button);
     button->set_image(*manage(new Gtk::Image(IconManager::obj().get_icon(IconManager::NOTE_NEW, 24))));
@@ -134,7 +130,7 @@ namespace gnote {
     button->set_label(_("New"));
     button->signal_clicked().connect(sigc::mem_fun(m_search_notes_widget, &SearchNotesWidget::new_note));
     button->show_all();
-    box->pack_start(*button, false, false);
+    toolbar->pack_start(*button, false, false);
 
     m_search_entry.set_activates_default(false);
     m_search_entry.set_size_request(300);
@@ -145,7 +141,7 @@ namespace gnote {
     Gtk::Alignment *alignment = manage(new Gtk::Alignment(Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER, 0));
     alignment->add(m_search_entry);
     alignment->show_all();
-    box->pack_start(*alignment, true, true);
+    toolbar->pack_start(*alignment, true, true);
 
     button = manage(new Gtk::Button);
     button->set_image(*manage(new Gtk::Image(IconManager::obj().get_icon("emblem-system-symbolic", 24))));
@@ -153,13 +149,8 @@ namespace gnote {
     button->signal_clicked().connect(
       boost::bind(sigc::mem_fun(*this, &NoteRecentChanges::on_show_window_menu), button));
     button->show_all();
-    box->pack_end(*button, false, false);
+    toolbar->pack_end(*button, false, false);
 
-    box->show();
-    tool_item->add(*box);
-    tool_item->set_expand(true);
-    tool_item->show();
-    toolbar->add(*tool_item);
     toolbar->show();
     return toolbar;
   }
diff --git a/src/recentchanges.hpp b/src/recentchanges.hpp
index 7953eda..eec2964 100644
--- a/src/recentchanges.hpp
+++ b/src/recentchanges.hpp
@@ -67,7 +67,7 @@ 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);
   void on_entry_changed();
   void on_entry_activated();


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