[gnote] Replace Gtk::Alignment with Gtk::Grid
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Replace Gtk::Alignment with Gtk::Grid
- Date: Fri, 14 May 2021 19:43:58 +0000 (UTC)
commit 4fd3710b8701ea665682d65209ca6ab078a5915e
Author: Aurimas Černius <aurisc4 gmail com>
Date: Fri May 14 22:43:48 2021 +0300
Replace Gtk::Alignment with Gtk::Grid
src/recentchanges.cpp | 23 +++++++++++------------
src/recentchanges.hpp | 5 ++---
2 files changed, 13 insertions(+), 15 deletions(-)
---
diff --git a/src/recentchanges.cpp b/src/recentchanges.cpp
index 9c9bcb5c..37fc8b63 100644
--- a/src/recentchanges.cpp
+++ b/src/recentchanges.cpp
@@ -174,7 +174,8 @@ namespace gnote {
left_box->show();
m_embedded_toolbar.set_margin_left(6);
- m_embedded_toolbar.set(Gtk::ALIGN_START, Gtk::ALIGN_CENTER, 0, 0);
+ m_embedded_toolbar.set_halign(Gtk::ALIGN_START);
+ m_embedded_toolbar.set_valign(Gtk::ALIGN_CENTER);
m_embedded_toolbar.show();
Gtk::Grid *right_box = manage(new Gtk::Grid);
@@ -251,16 +252,11 @@ namespace gnote {
.connect(sigc::mem_fun(*this, &NoteRecentChanges::on_entry_activated));
m_search_entry->show();
- Gtk::Grid *grid = manage(new Gtk::Grid);
- grid->set_margin_left(5);
- grid->set_margin_right(5);
- grid->set_hexpand(false);
- grid->attach(*m_search_entry, 0, 0, 1, 1);
- grid->show();
-
- m_search_box = manage(new Gtk::Alignment(0.5, 0.5, 0.0, 1.0));
- m_search_box->add(*grid);
- m_search_box->set_hexpand(true);
+ m_search_box = manage(new Gtk::Grid);
+ m_search_box->set_hexpand(false);
+ m_search_box->attach(*m_search_entry, 0, 0, 1, 1);
+ m_search_box->set_halign(Gtk::ALIGN_CENTER);
+ m_search_box->show();
auto content = dynamic_cast<Gtk::Grid*>(m_embed_box.get_parent());
if(content) {
@@ -661,7 +657,10 @@ namespace gnote {
catch(std::bad_cast&) {
}
- m_embedded_toolbar.remove();
+ auto children = m_embedded_toolbar.get_children();
+ for(auto child : children) {
+ m_embedded_toolbar.remove(*child);
+ }
}
bool NoteRecentChanges::contains(EmbeddableWidget & widget)
diff --git a/src/recentchanges.hpp b/src/recentchanges.hpp
index 103f7f06..2b1d3a0e 100644
--- a/src/recentchanges.hpp
+++ b/src/recentchanges.hpp
@@ -24,7 +24,6 @@
#ifndef __NOTE_RECENT_CHANGES_HPP_
#define __NOTE_RECENT_CHANGES_HPP_
-#include <gtkmm/alignment.h>
#include <gtkmm/applicationwindow.h>
#include <gtkmm/grid.h>
#include <gtkmm/popovermenu.h>
@@ -105,7 +104,7 @@ private:
Preferences &m_preferences;
Gtk::Widget *m_header_bar;
SearchNotesWidget *m_search_notes_widget;
- Gtk::Alignment *m_search_box;
+ Gtk::Grid *m_search_box;
Gtk::Grid *m_find_next_prev_box;
union
{
@@ -113,7 +112,7 @@ private:
Glib::ustring *m_search_text;
};
Gtk::ToggleButton m_search_button;
- Gtk::Alignment m_embedded_toolbar;
+ Gtk::Grid m_embedded_toolbar;
Gtk::Grid m_embed_box;
Gtk::Button *m_all_notes_button;
Gtk::Button *m_new_note_button;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]