Skip to content

setting dialog's prefSize not effected under Linux KDE #18

Description

@zerobikappa

Operating System: Arch Linux
KDE Plasma Version: 5.27.2
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 6.2.1-arch1-1 (64-bit)
JavaFX Version:17.0.2

如下图所示:
Screenshot_20230302_045750

设定窗口的显示高度有问题,

dialogPane.prefWidth = 600.0
dialogPane.prefHeight = 480.0

这里设定了窗口宽度600像素,高度480像素。可是只有宽度是有生效的,而高度只有100+像素,并且窗口无法手动调整大小。
查了一下这好像是javafx的Dialog类在linux平台下(其中比较多反馈是在KDE桌面下)的bug。

我没学过java,所以也不知道是哪里出问题。我查到Dialog类下有setResizable()函数可以把窗口设置成允许调整窗口大小,所以把这作为治标不治本的暂时方案了。

    init {
        title = I18N["settings.title"]
        setResizable(true)
        dialogPane.prefWidth = 600.0
        dialogPane.prefHeight = 480.0
        ...
        ...

Screenshot_20230302_055656

不知道有没有更好的方法?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions