mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-03 03:38:33 +08:00
Подробнее описана глава "Тема в десктоп-приложениях"
This commit is contained in:
parent
0124a79668
commit
537cdf2f90
File diff suppressed because it is too large
Load Diff
BIN
doc/content/manual/ru/img/gui_themes_desktop_structure.png
Normal file
BIN
doc/content/manual/ru/img/gui_themes_desktop_structure.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.3 KiB |
BIN
doc/content/manual/ru/img/gui_themes_example4.png
Normal file
BIN
doc/content/manual/ru/img/gui_themes_example4.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
BIN
doc/content/manual/ru/img/gui_themes_example5.png
Normal file
BIN
doc/content/manual/ru/img/gui_themes_example5.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
doc/content/manual/ru/img/gui_themes_example6.png
Normal file
BIN
doc/content/manual/ru/img/gui_themes_example6.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 532 B |
File diff suppressed because it is too large
Load Diff
@ -1,2 +1,2 @@
|
||||
cuba.desktop.resourceLocations = com/haulmont/cuba/desktop/res \
|
||||
com/haulmont/ext/desktop/res
|
||||
com/sample/sales/desktop/res
|
@ -0,0 +1,14 @@
|
||||
public class UnderlinedLabelDecorator implements ComponentDecorator {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void decorate(Object component, Set<String> state) {
|
||||
DesktopLabel item = (DesktopLabel) component;
|
||||
JLabel jlabel = item.getComponent();
|
||||
|
||||
Font originalFont = jlabel.getFont();
|
||||
Map attributes = originalFont.getAttributes();
|
||||
attributes.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
|
||||
jlabel.setFont(originalFont.deriveFont(attributes));
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<theme xmlns="http://schemas.haulmont.com/cuba/4.0/desktop-theme.xsd">
|
||||
<style name="label-underlined" component="com.haulmont.cuba.desktop.gui.components.DesktopLabel">
|
||||
<custom class="com.sample.sales.desktop.gui.decorators.UnderlinedLabelDecorator"/>
|
||||
</style>
|
||||
</theme>
|
@ -0,0 +1 @@
|
||||
<label id="label1" stylename="label-underlined" value="Label"/>
|
Loading…
Reference in New Issue
Block a user