diff options
author | Julien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr> | 2019-10-31 10:27:16 +0100 |
---|---|---|
committer | Julien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr> | 2019-10-31 10:29:43 +0100 |
commit | fb9203998b0481194a5424d5811c5c79e0f7e0fe (patch) | |
tree | b28be62bcb87e91dbedad6853b588f2e878e86d7 /libs/gtkmm2ext | |
parent | 7d48b20652ebfba355ab6228dce285f92a805e97 (diff) |
Align vertical centers of widget and active menuitem
Diffstat (limited to 'libs/gtkmm2ext')
-rw-r--r-- | libs/gtkmm2ext/utils.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/gtkmm2ext/utils.cc b/libs/gtkmm2ext/utils.cc index 6f2a177372..6d9e47e80e 100644 --- a/libs/gtkmm2ext/utils.cc +++ b/libs/gtkmm2ext/utils.cc @@ -416,13 +416,13 @@ _position_menu_anchored (int& x, int& y, bool& push_in, if (i != items.end() && y - offset >= monitor.get_y() && y - offset + menu_req.height <= monitor.get_y() + monitor.get_height()) { - y -= offset; /* a) */ + y += allocation.get_height() / 2 - i->size_request().height / 2 - offset; /* a) */ } else if (y + allocation.get_height() + menu_req.height <= monitor.get_y() + monitor.get_height()) { y += allocation.get_height(); /* b) */ } else if ((y - menu_req.height) >= monitor.get_y()) { y -= menu_req.height; /* c) */ } else if (i != items.end()) { - y -= offset; /* d) */ + y += allocation.get_height() / 2 - i->size_request().height / 2 - offset; /* d) */ } else if (monitor.get_height() - allocation.get_height() >= 2*(y - monitor.get_y())) { y += allocation.get_height(); /* e), more space below */ } else { |