Use CSS & theme.res together in same project!

37 views
Skip to first unread message

Fuad Nassar

unread,
Dec 20, 2019, 2:37:10 PM12/20/19
to CodenameOne Discussions
IDE: NetBeans
Desktop OS: Windows 10
Simulator 

Enable CSS file from cn1 settings lead to failed loading theme.res file
 
can i use both two files in same project ? 
..
if yes, why i got failed in loading theme file ?

Shai Almog

unread,
Dec 21, 2019, 12:10:42 AM12/21/19
to CodenameOne Discussions
CSS generates a new theme.css file every time you build the project. You can have another res file but it can't be named theme.res. You can add its styles via theme layering as explained here: https://www.codenameone.com/manual/advanced-theming.html

Fuad Nassar

unread,
Dec 21, 2019, 2:58:46 AM12/21/19
to CodenameOne Discussions
Okay that's work
Is there an easy way to change color of shadow from black[default color] to yellow?

Shai Almog

unread,
Dec 21, 2019, 9:04:37 PM12/21/19
to CodenameOne Discussions
This very much depends on the type of shadow you created. How did you create the shadow?

Fuad Nassar

unread,
Dec 22, 2019, 5:14:27 AM12/22/19
to CodenameOne Discussions
from theme.res file 
i created a simple style and used it by UIID 

Shai Almog

unread,
Dec 22, 2019, 9:16:01 PM12/22/19
to CodenameOne Discussions
On a border? A round or round rect border?

Fuad Nassar

unread,
Dec 23, 2019, 9:14:20 AM12/23/19
to CodenameOne Discussions
round rect border -_-
Message has been deleted

Shai Almog

unread,
Dec 23, 2019, 9:44:15 PM12/23/19
to CodenameOne Discussions
There is no feature to control the shadow color in RoundRectBorder. I've added a shadow color property to the RoundRectBorder class which should be there for the weekly update.
But doing this in the UI is more challenging so if you want that you'd need to customize it from code.

Fuad Nassar

unread,
Dec 24, 2019, 8:25:55 AM12/24/19
to CodenameOne Discussions
Thank you soo much. I will keep following cn1 blogs for the next week.

Shai Almog

unread,
Dec 24, 2019, 9:22:20 PM12/24/19
to CodenameOne Discussions
I won't post about it as it's a pretty minor thing. RoundRectShadow will just have a shadowColor(int) method after the next Friday update.
Reply all
Reply to author
Forward
0 new messages