-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Codename One Style-Sheet Needs Constant Libraries Refreshing #2974
Comments
I can't reproduce this. Can you post a test project that I can try out? Are you sure you're changing the theme.css file, and not the theme.css.merged file? |
What kinds of style changes are you making? The message "File has not changed since last compile." indicates that the CSS compiler thinks that no style changes have been made. This is not a simple file timestamp check, it is actually comparing the style rules in the css file to the compiled .res file. It is possible that it is missing a change. Please provide a specific test case, including which stylesheet changes you made, so that I can try to reproduce. |
I have generated a new (bare bone) project and activated the CSS support in the CN1 settings. After simulating the the project, no CSS folder gets generated. Going back to css settings, there is warning message in the dialog box: css is enabled in the project properties, but it may not be working correctly, because some the project's configuration files appear to be out of date. I press the button: "Activate css Now", and then "Open CSS File for Editing". After running the application, the css folder appears. In the application's generated main class, I change the code to the following:
Inside the generated css folder, I open the file "theme.css", and add the following code:
In the running the application, the color of the label's background does not change. When changing the css attribute and save the files (Crtl+S), I get the following console output:
When I finally refresh the CN1 libraries , the css changes bocome visible. |
Thanks. I see the issue. It is eclipse-specific. I'll have a fix shortly. |
…sent. This fixes issues with CSS not being loaded properly in eclipse. #2974
The reason it refreshing libs worked is because it forces the "jar" target to run, which reloads the theme.res. I have made a change so that the simulator will prefer to load the theme.res file from the src directory if it is present, which will fix this issue. The fix will be available in the next update on Friday. |
Many thanks for looking into this ... |
I have a new Android application, that uses CSS styling.
The style sheet is added through the CN1-settings. This has always worked in the past.
Today, whenever I make changes to the style of a component in the style-sheet, they don't reflect, unless I refresh the CN1-Libraries.
I am using Eclipse on Ubuntu Budgie 19.10.
For the console output, after changing the CSS file and saving it, the print output is as follows:
-cn1-compile-css:
[java] Retina Scale: 1.0
[java] Updating merge file /home/xxxxxx/eclipse-workspace/Test_A1/css/theme.css.merged
[java] Input: /home/xxxxxx/eclipse-workspace/Test_A1/css/theme.css
[java] Output: /home/xxxxxx/eclipse-workspace/Test_A1/src/theme.res
[java] Acquiring lock on CSS checksums file /home/xxxxx/eclipse-workspace/Test_A1/.cn1_css_checksums...
[java] Lock obtained
[java] Releasing lock
[java] CSS file successfully compiled. /home/xxxxxx/eclipse-workspace/Test_A1/src/theme.res
jar:
[echo] Compile is forcing compliance to the supported API's/features for maximum device compatibility. This allows smaller
[echo] code size and wider device support
[copy] Copying 1 file to /home/xxxxxx/eclipse-workspace/Test_A1/build/tmp
Trying to override old definition of task javac
[javac] Compiling 2 source files to /home/xxxxxx/eclipse-workspace/Test_A1/build/tmp
[jar] Building jar: /home/xxxxxx/eclipse-workspace/Test_A1/dist/Test_A1.jar
BUILD SUCCESSFUL
Total time: 1 second
This is the console output when I run the simulator:
Found theme.css file. Watching for changes...
Retina Scale: 1.0
CSS> Retina Scale: 1.0
CSS> Updating merge file /home/xxxxxx/eclipse-workspace/Test_A1/css/theme.css.merged
CSS> Input: /home/xxxxxxx/eclipse-workspace/Test_A1/css/theme.css
CSS> Output: /home/xxxxxxx/eclipse-workspace/Test_A1/src/theme.res
CSS> Acquiring lock on CSS checksums file /home/xxxxxx/eclipse-workspace/Test_A1/.cn1_css_checksums...
CSS> Lock obtained
CSS> File has not changed since last compile.
CSS> Releasing lock
CSS> CSS file successfully compiled. /home/xxxxxx/eclipse-workspace/Test_A1/src/theme.res
CSS> null
What called my attention is that the output says : CSS> File has not changed since last compile. even though it has.
The text was updated successfully, but these errors were encountered: