gpt4 book ai didi

css - JavaFX - 用于定义 StageStyle 的 css 文件位于何处或如何更改它?

转载 作者:行者123 更新时间:2023-11-28 08:50:04 25 4
gpt4 key购买 nike

问题:

I'm actually implementing some Frontend applications in JavaFX. Therewe're using several windows. In some cases the design of the windowshave to be adapted like we want. That means it needs a specific icon,colour of the title and given images which replace the standardbuttons for resizing, minimizing and closing the window. ConsequentlyI have to adjust the whole title of the window.

我有什么:

It is no problem to set a new icon, but the rest of the adaptions leadto problems. During my researches I found, that it is possible todefine the StageStyle within my programm with the help of:

primaryStage.initStyle(StageStyle.DECORATED);

可能的解决方案:

I know that a possible solution for my problem is, to set theStageStyle on Undecorated and to adding a node which contains thenecessary icons, button etc (like it was done here:https://gist.github.com/JaDogg/4d9999ba233f4a43b7c5). This can be theroot of my window.

我需要什么:

The problem with the possible solution is, that it is hard to definethe border in the same way like it is done withinStageStyle.DECORATED. But it is recommand that the border of thewindows with our own icons, buttons etc have to be similiar to theborders of the standard windows. That's why I have the idea to adjustthe element which was defined within the StageStyle. But the problemis, that I don't know the name of it. If I use .root within my cssfile just my root scene is taken. But I need the whole window.

Does anybody know how the element is defined? Or does anybody know the location of the css file where the StageStyles are defined?

If I got it, I also know the name of the element. In addition to thisas soon as I have the css declaration it is obvious how to configuremy own window to get the same border like in the standard window ofStageStyle.DECORATED.

Or perhaps does anybody know how to define the border so that it looks like the one of StageStyle.DECORATED?

最佳答案

Stage 可以用一些 options 设置样式:装饰,未装饰,透明,...,而 Scene 可以使用 CSS 完全设置样式。但是没有用于舞台装饰的 CSS。

装饰未装饰舞台的好来源是这个 post .

如您所见,它的层模型允许您使用 CSS 装饰边框。但这将取决于您要模仿的操作系统。

对于 native 实现(主要是控件),请查看 these主题:适用于 Mac 的 AquaFX、适用于 Windows 7 的 AeroFX 或 this一个用于 Windows 8。

关于css - JavaFX - 用于定义 StageStyle 的 css 文件位于何处或如何更改它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27404375/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com