Eclipse RCP 应用程序为 macOS 设置默认的 css 和主题

问题描述 投票:0回答:0

我们要添加两个 css 样式表,每个用于 macOS 和 windows。我已将以下属性添加到 plugin.xml 中的扩展点 org.eclipse.core.runtime.products。

<property
        name="cssTheme"
        value="com.my.id.css.theme">
</property>

还为主题添加了两个条目如下

<extension
         point="org.eclipse.e4.ui.css.swt.theme">
      <theme
            basestylesheeturi="css/style.css"
            id="com.my.id.css.theme"
            label="wincss"
            os="win32">
      </theme>
      <theme
            basestylesheeturi="css/macstyle.css"
            id="com.my.id.css.theme"
            label="maccss"
            os="macosx">
      </theme>
   </extension>

在 eclipse rcp 应用程序启动时,默认情况下未选择 maccss 主题。虽然在 windows 11 中,wincss 是默认选择的主题。

在 macos 中,当我们打开 Preferences > General > Appearance 并将主题手动更改为 maccss 时,就会出现所需的样式。

eclipse-rcp
© www.soinside.com 2019 - 2024. All rights reserved.