我们要添加两个 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 时,就会出现所需的样式。
何