[Suggest]CSS Styling

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

xXArthurXx
Not too shy to talk
Not too shy to talk
Posts: 21
Joined: Mon Jun 13, 2016 15:06

[Suggest]CSS Styling

Postby xXArthurXx » Mon Jul 25, 2016 13:16

Hey Guys,
I'm back again with crazy ideas ;D
Anyway, I investigated, how Styling is done in CEGUI, but I'm afraid.

It's fine for games etc. but not for modern desktop applications

Because I'm coming from JavaFX I'm used to style the whole application with CSS - Stylesheets, thats why I thought about to add CSS Styling to CEGUI. Of course, I won't force someone to do this for me, I'll do it but before I try something which is impossible to do so with CEGUI, I first want to ask you about the possibility of this idea.

Is it possible to add CSS Styling to CEGUI without breaking changes?

EDIT:

Small list why CSS Styling is useful:

    - Style of Application can be easily changed.

    - Each component object could have a own style (if it's similar to JavaFX styling).

    - Standard stylesheet could be loaded to create window components without any further loading.

DOUBLE EDIT:

I'm used to create graphic objects without any specifing paths etc.
A CSS standard stylesheet speed up things in the way, that I do not ever have to load the style for a component again.
Aswell css styling provides more flexibility to the whole style because background, borders, insets etc. could be dynamicly changed. For me it's much easier xD
Last edited by xXArthurXx on Mon Jul 25, 2016 13:52, edited 4 times in total.
May be the physic with you !

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: [Suggest]CSS Styling

Postby YaronCT » Mon Jul 25, 2016 13:30

@xXArthurXx: Can u plz detail a cegui user case where that might b useful?

xXArthurXx
Not too shy to talk
Not too shy to talk
Posts: 21
Joined: Mon Jun 13, 2016 15:06

Re: [Suggest]CSS Styling

Postby xXArthurXx » Mon Jul 25, 2016 13:37

I could give some links to JavaFX to show which pros CSS Styling has :P!
In my opinion CSS styling is very modern!

Sometimes the companies itself show well which advantages their products have :D,

Last edited by xXArthurXx on Mon Jul 25, 2016 13:44, edited 1 time in total.
May be the physic with you !

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: [Suggest]CSS Styling

Postby YaronCT » Mon Jul 25, 2016 13:43

@xXArthurXx: Thanx! I'll look at it.

xXArthurXx
Not too shy to talk
Not too shy to talk
Posts: 21
Joined: Mon Jun 13, 2016 15:06

Re: [Suggest]CSS Styling

Postby xXArthurXx » Mon Jul 25, 2016 13:44

YaronCT wrote:@xXArthurXx: Thanx! I'll look at it.


No problem, I hope It's fine :D

After thinking about this a while I came to the conclusion CEGUI should need some medium changes to accept CSS Styling.

@YaronCT: We need a CSS Parser D:!
(Found one :P http://www.netsurf-browser.org/projects/libcss/)
May be the physic with you !

xXArthurXx
Not too shy to talk
Not too shy to talk
Posts: 21
Joined: Mon Jun 13, 2016 15:06

Re: [Suggest]CSS Styling

Postby xXArthurXx » Mon Jul 25, 2016 15:24

Okay I make a conclusion how CSS styling and XML layout should work.

CSS is for styling, not for layout
The css files only specify how the background, inner border, outer border, text alignment, general alignment are. This also includes margin and insets.

XML is for Layout, not for styling
One general thing what I like is a clear gap between layout and styling. That's why I prefer to save all layout like things in the XML files. This is already done but such things like xml files for look and feel should be preferred for games, not for general office applications.

One default CSS file for CEGUI to provide Non-Resource-loading object generation
Providing of one default css file which describes the style of each window component in CEGUI. This should give ability to instantiate a object without using further resource loading with the resource provider.

Aswell this makes starting with CEGUI easier though this is my opinion. But anyway I do not have any clue how rendering with a css file works...

PS:
I want to use CEGUI for office applications because:
    1. I want to support a open source project
    2. I do not like that the best C++ GUI Libraries cost. I'm always asking myself, why isn't there a general library for C++?
    3.CEGUI uses XML Files for layout. That's the biggest advantage of CEGUI :D
May be the physic with you !

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: [Suggest]CSS Styling

Postby Ident » Mon Jul 25, 2016 18:54

This is not an entirely new idea btw, it has been around for the last two CEGUI GSoCs (2013, 2014) at least: http://wiki.worldforge.org/wiki/Summer_ ... rer_set.29

I think Martin brought it up.

The main benefit of CSS is that it is easy for people who already know CSS. That said, the CSS parser you mentioned is the least of issues. Adding an external dependcy to CEGUI is annoying though and we should prevent it if possible and have our own minimal parser.

Translating the CSS into data structures CEGUI understands and being able to display those is the big issue really. Also you must consider that the Look N Feel files are more than a description of looks. They also say what's there (and thus, how it feels/what works). CSS could be used as a subset in the LNF files imo , which would already help tremendously.


In my opinion though, we really rather should have a good skinning editor than anything else. The editor is the main issue if you ask me, and if it creates CSS or XML in the background doesnt matter. People shouldnt have to blindly skin things in a text editor. I started working on one in my last GSoC and I was busy with other topics since. I plan to get back to it later or support whoever wants to continue with it.
CrazyEddie: "I don't like GUIs"

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: [Suggest]CSS Styling

Postby YaronCT » Mon Jul 25, 2016 19:35

@Ident: r u back from your vacation??

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: [Suggest]CSS Styling

Postby Ident » Thu Jul 28, 2016 21:31

yes + 1 week of being back to my job -but no time yet for CEGUI, i am looking through all the topics i missed now - and btw this is barely the right place to discuss this :D
CrazyEddie: "I don't like GUIs"

xXArthurXx
Not too shy to talk
Not too shy to talk
Posts: 21
Joined: Mon Jun 13, 2016 15:06

Re: [Suggest]CSS Styling

Postby xXArthurXx » Wed Nov 23, 2016 09:17

It's not good if the internal structure of how CEGUI understands layout and style isn't clear and easy.
For the purpose of easy understanding libraries it would be better to apply changes to this.

Do most of the properties have to be applied with internal usage of the XML parser?

I think there is no way around applying some internal changes to CEGUI if we want to add CSS Support.
May be the physic with you !

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: [Suggest]CSS Styling

Postby Ident » Wed Nov 23, 2016 17:28

xXArthurXx wrote:It's not good if the internal structure of how CEGUI understands layout and style isn't clear and easy.
For the purpose of easy understanding libraries it would be better to apply changes to this.

Then point out what of the "internal structure" is not clear and easy and suggest how to improve it. While what you said might be generally true, it does not contain any constructive criticism regarding CEGUI.

xXArthurXx wrote:Do most of the properties have to be applied with internal usage of the XML parser?

Not sure what is meant by "applying a property"?

xXArthurXx wrote:I think there is no way around applying some internal changes to CEGUI if we want to add CSS Support.

There is indeed no way to add something to CEGUI without changing CEGUI.
CrazyEddie: "I don't like GUIs"

xXArthurXx
Not too shy to talk
Not too shy to talk
Posts: 21
Joined: Mon Jun 13, 2016 15:06

Re: [Suggest]CSS Styling

Postby xXArthurXx » Wed Nov 23, 2016 17:52

Thanks for being open for changes! I only build my sentence on what you told me. I will figure out how difficult it is to apply CSS Styling on CEGUI.
May be the physic with you !

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: [Suggest]CSS Styling

Postby YaronCT » Wed Nov 23, 2016 18:24

@xXArthurXx: Your enthusiasm to improve cegui is appreciated. However, I think u should start small and take it one step at a time. Set yourself 1 little goal, like fix a small cegui bug. When you've done that, we'll c how we continue from there.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: [Suggest]CSS Styling

Postby Ident » Wed Nov 23, 2016 19:41

xXArthurXx wrote:Thanks for being open for changes! I only build my sentence on what you told me. I will figure out how difficult it is to apply CSS Styling on CEGUI.

We will of course have to look how much we really need to change. It is always good to change as little as necessary but as much as is meaningful. In the perfect situation, we should only change private and internal functions when adding CSS as a feature. Adding things is always an option, but removing/changing means breaking stuff and making porting more difficult from older CEGUI versions.

In general, if you think of CSS, I would suggest you first look at the Falagard c++ classes and our Look N' Feel files and try to understand how they work. The system has very little to do with how html & css works as you will soon notice. CSS will however need to play in a similar domain as the Look N Feel stuff, optimally it should be possible to use it inside Look N Feel files. But maybe you have a better idea.
CrazyEddie: "I don't like GUIs"


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 4 guests