Reputation: 2355
In my Codename One app the styling is defined in css. Namely the side menu which I styled based on this great video tutorial. So I have a style defined as follows :
SideMenuTagLine {
cn1-derive: "SideCommand";
text-align: right;
padding-left: 0mm;
padding-right: 0mm;
padding-top: 1mm;
padding-bottom: 0mm;
margin-right: 3mm;
font-family: "native:ItalicLight";
font-size: 3mm;
}
When I tested the tagline showed in Italic, but then I worked further on the css to add other styles and all of a sudden the tagline lost its Italic (simulator and real device).
To make it reappear I have to delete the myTheme.css.res file. But again when I make changes to a css style (not SideMenuTagLine nor SideCommand), the tagline Italic gets lost. Maybe other stylings are also lost but I did not notice.
Here is the previews that I get when the res file is first generated (starting from no existing myTheme.css.res file). One may notice that the KmLabelProgress
alignment changes between the unselected and the selected tabs although I did not change it. :
Then if I change anything in the css file (eg : color for a selector) I get the following generated res file. In this case the afore mentionned alignment changes do not occur :
Please note : this is the behaviour too in the latest (3.7.3) CN1 plugin version (as in the previous version).
What can I do to be sure the css styles that I defined in the css file are applied ?
Any help appreciated,
Edit October 9th 2017 : Here is the beginning of the stack trace that I get when I open the generated res file with the designer from the command line :
2017-10-09 10:37:09.388:INFO:oejs.Server:jetty-8.0.y.z-SNAPSHOT
2017-10-09 10:37:09.441:INFO:oejs.AbstractConnector:Started
[email protected]:9000 STARTING
oct. 09, 2017 10:37:09 AM org.jdesktop.application.LocalStorage getId
AVERTISSEMENT: unspecified resource Application.id using ResourceEditorApp
Exception in thread "AWT-EventQueue-0" java.lang.StackOverflowError
at java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager(KeyboardFocusManager.java:216)
at java.awt.KeyboardFocusManager.processCurrentLightweightRequests(KeyboardFocusManager.java:2621)
at java.awt.KeyboardFocusManager.retargetFocusEvent(KeyboardFocusManager.java:2946)
at java.awt.Component.dispatchEventImpl(Component.java:4752)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
Please note : the full stack trace is longer than the allowed length on SO.
Upvotes: 1
Views: 210
Reputation: 4716
As Shai indicated, this was a but in the CSS generation related to native fonts. I have fixed this bug and released a new CSS plugin (v.1.1.4). To update, simply download the latest cn1css-ant-task.jar into your project's lib directory.
https://github.com/shannah/cn1-css/releases/tag/1.1.4
Upvotes: 1