[gnote] Switch to Gtk::Box for Popover menus and remove margins between items
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Switch to Gtk::Box for Popover menus and remove margins between items
- Date: Sun, 11 Dec 2016 17:34:30 +0000 (UTC)
commit fb96e23ac59ef3f007242ad5a0e214c7a5cc32f2
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sun Dec 11 19:24:36 2016 +0200
Switch to Gtk::Box for Popover menus and remove margins between items
src/utils.cpp | 27 ++++++++-------------------
src/utils.hpp | 3 +--
2 files changed, 9 insertions(+), 21 deletions(-)
---
diff --git a/src/utils.cpp b/src/utils.cpp
index 468b09f..4e07676 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -1,7 +1,7 @@
/*
* gnote
*
- * Copyright (C) 2010-2015 Aurimas Cernius
+ * Copyright (C) 2010-2016 Aurimas Cernius
* Copyright (C) 2010 Debarshi Ray
* Copyright (C) 2009 Hubert Figuiere
*
@@ -115,13 +115,14 @@ namespace gnote {
}
- class PopoverSubmenuGrid
- : public Gtk::Grid
+ class PopoverSubmenuBox
+ : public Gtk::Box
, public PopoverSubmenu
{
public:
- PopoverSubmenuGrid(const Glib::ustring & submenu)
- : PopoverSubmenu(submenu)
+ PopoverSubmenuBox(const Glib::ustring & submenu)
+ : Gtk::Box(Gtk::ORIENTATION_VERTICAL)
+ , PopoverSubmenu(submenu)
{
set_common_popover_widget_props(*this);
}
@@ -309,29 +310,17 @@ namespace gnote {
}
- Gtk::Grid * create_popover_submenu(const Glib::ustring & name)
+ Gtk::Box * create_popover_submenu(const Glib::ustring & name)
{
- return new PopoverSubmenuGrid(name);
+ return new PopoverSubmenuBox(name);
}
void set_common_popover_widget_props(Gtk::Widget & widget)
{
- widget.property_margin_top() = 5;
- widget.property_margin_bottom() = 5;
widget.property_hexpand() = true;
}
- Gtk::Grid *create_popover_inner_grid(int *top)
- {
- Gtk::Grid *grid = new Gtk::Grid;
- set_common_popover_widget_props(*grid);
- if(top) {
- *top = 0;
- }
- return grid;
- }
-
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 19650f8..d479144 100644
--- a/src/utils.hpp
+++ b/src/utils.hpp
@@ -65,9 +65,8 @@ namespace gnote {
Gtk::Widget * create_popover_button(const Glib::ustring & action, const Glib::ustring & label);
Gtk::Widget * create_popover_submenu_button(const Glib::ustring & submenu, const Glib::ustring & label);
- Gtk::Grid * create_popover_submenu(const Glib::ustring & name);
+ Gtk::Box * create_popover_submenu(const Glib::ustring & name);
void set_common_popover_widget_props(Gtk::Widget & widget);
- Gtk::Grid *create_popover_inner_grid(int *top = NULL);
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]