i've been working on button extending class when left-clicked on displays stay-open popup menu (contextmenu object) on configurable side/corner of button. constructor takes enumerated value north_left indicates side of button gets shown , edges on both button , popup aligned. in other words 2 should show in l shape combo, not t shape.
so when want east_bottom bottom edges of both button , popup should align, figured work:
popupmenu.show(this, side.right, 0, this.getheight() - popupmenu.getheight()); but popup appears higher should. that's because popupmenu.getheight() call returning larger value expected. suspect because including large shadow border in dimensions. i've noticed semi-visible border extends on button bit , prevents mouse clicks registering on edge of button near menu. have multiple reasons want border of 0 width.
i assume there way via css. i've tried setting -fx-background-insets , -fx-padding 0 neither seems make difference. other suggestions?
the solution add -fx-effect: null; css contextmenu. removes dropshadow effect modena.css default contextmenus. once did able correctly place menu wherever needed go.
credit working answer goes josé pereda - worked out in comments above.
Comments
Post a Comment