[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-openjfx-dev
Subject: Style a Popup in a Skin
From: Florian Brunner <fbrunnerlist () gmx ! ch>
Date: 2017-09-08 19:24:02
Message-ID: 1846222.lRJ5sKo1Rr () andor
[Download RAW message or body]
Hi,
Sorry to bother this list with this question, but I didn' receive any answer on \
Stackoverflow and I'm not sure if or how this is supported at all: \
https://stackoverflow.com/questions/45467626/custom-skin-style-popup \
https://stackoverflow.com/questions/14610639/custom-control-opaque-popup
In a Skin implementation of a custom control I want to style a Popup.
I guess I have to use the PopupControl[1], not Popup[2].
PopupControl popup = new PopupControl();
popup.getScene().setRoot(popupContentPane);
popup.setAutoHide(true);
popup.setAnchorLocation(PopupWindow.AnchorLocation.WINDOW_BOTTOM_LEFT);
popup.setStyle("-fx-background-color: red;");
popup.getStyleClass().add("my-popup");
popup.show(getSkinnable(), screenLocation.getX(), screenLocation.getY());
The skinnable overrides the userAgentStylesheet:
@Override
public String getUserAgentStylesheet() {
return Stylesheets.getDefaultStylesheet();
}
But neither the style, nor the styleClass nor any styleClass applied to any child \
node of popupContentPane has some effect. If I understand the documentation[3] \
correctly the popup should use the stylesheet of the ownerNode (here the skinnable). \
How can I style a popup in a skin? Or should I file an enhancement request?
Kind regards,Florian
--------
[1] http://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/PopupControl.html
[2] http://docs.oracle.com/javase/8/javafx/api/javafx/stage/Popup.html
[3] http://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/PopupControl.html#getStyleableParent--
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic