[gnote] Fix margins in popovers
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Fix margins in popovers
- Date: Sun, 5 Mar 2017 15:56:50 +0000 (UTC)
commit 8b2b2f4fbc4f6f42458d4809fee0c0974c502bb8
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sun Mar 5 17:53:40 2017 +0200
Fix margins in popovers
src/recentchanges.cpp | 5 +----
src/utils.cpp | 11 ++++++++++-
src/utils.hpp | 1 +
3 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/src/recentchanges.cpp b/src/recentchanges.cpp
index 512b828..88cf62e 100644
--- a/src/recentchanges.cpp
+++ b/src/recentchanges.cpp
@@ -764,10 +764,7 @@ namespace gnote {
std::map<Glib::ustring, Gtk::Widget*> submenus;
Gtk::PopoverMenu *menu = manage(new Gtk::PopoverMenu);
Gtk::Box *menu_box = manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL));
- menu_box->property_margin_bottom() = 5;
- menu_box->property_margin_top() = 5;
- menu_box->property_margin_left() = 5;
- menu_box->property_margin_right() = 5;
+ utils::set_common_popover_widget_props(*menu_box);
FOREACH(Gtk::Widget *item, items) {
if(item) {
utils::PopoverSubmenu *submenu = dynamic_cast<utils::PopoverSubmenu*>(item);
diff --git a/src/utils.cpp b/src/utils.cpp
index e47f3b6..e341ef6 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -120,7 +120,7 @@ namespace gnote {
: Gtk::Box(Gtk::ORIENTATION_VERTICAL)
, PopoverSubmenu(submenu)
{
- set_common_popover_widget_props(*this);
+ utils::set_common_popover_widget_props(*this);
}
};
@@ -330,6 +330,15 @@ namespace gnote {
widget.property_hexpand() = true;
}
+ void set_common_popover_widget_props(Gtk::Box & widget)
+ {
+ widget.property_margin_top() = 9;
+ widget.property_margin_bottom() = 9;
+ widget.property_margin_left() = 12;
+ widget.property_margin_right() = 12;
+ set_common_popover_widget_props(static_cast<Gtk::Widget&>(widget));
+ }
+
void add_item_to_ordered_map(std::map<int, Gtk::Widget*> & dest, int order, Gtk::Widget *item)
{
diff --git a/src/utils.hpp b/src/utils.hpp
index 290384e..a4afa4f 100644
--- a/src/utils.hpp
+++ b/src/utils.hpp
@@ -67,6 +67,7 @@ namespace gnote {
Gtk::Widget * create_popover_submenu_button(const Glib::ustring & submenu, const Glib::ustring & label);
Gtk::Box * create_popover_submenu(const Glib::ustring & name);
void set_common_popover_widget_props(Gtk::Widget & widget);
+ void set_common_popover_widget_props(Gtk::Box & widget);
void add_item_to_ordered_map(std::map<int, Gtk::Widget*> & dest, int order, Gtk::Widget *item);
void merge_ordered_maps(std::map<int, Gtk::Widget*> & dest, const std::map<int, Gtk::Widget*> & adds);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]