B4J Question Rounded MenuBar menuitems (CSS)

ThRuST

Well-Known Member
Licensed User
Longtime User
What's the CSS command to make Menubar menuitems container edges rounded? I've been looking everywhere without finding the solution. It might looks nicer with rounded submenu items instead of rectangle shape. Thanks
 

jmon

Well-Known Member
Licensed User
Longtime User
I think the only way to do it is with an external css file, see the example attached

B4X:
.menu-item .label {
    -fx-text-fill: grey;
    -fx-background-radius:15;
}

.menu-item:focused {
     -fx-background-color: red;
}

.menu-item:focused .label {
    -fx-text-fill: blue;
}

.context-menu {
    -fx-skin: "com.sun.javafx.scene.control.skin.ContextMenuSkin";
    -fx-background-color: black;
    -fx-background-insets: 0, 1, 2;
    -fx-background-radius: 0 6 6 6, 0 5 5 5, 0 4 4 4;
    -fx-padding: 0.333333em 0.083333em 0.666667em 0.083333em; /* 4 1 8 1 */
}
 

Attachments

  • menuBarCss.zip
    1.3 KB · Views: 294
Upvote 0
Top