Dark and Light FreeCAD stylesheets (v1.8a)

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
pablogil
Posts: 882
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Dark and Light FreeCAD stylesheets (v1.1)

Post by pablogil »

@microelly2
That's great! thank for including them in your loader =)

@wmayer
I don't understand how you suggets it's possible to solve it... is it something the user should do, the stylesheet designer or FreeCAD coder?
I guess the best and more reliable approach would be to be something inside FreeCAD, but don't know if it's possible due to the Qt API you referred...
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Dark and Light FreeCAD stylesheets (v1.1)

Post by wmayer »

I don't understand how you suggets it's possible to solve it... is it something the user should do, the stylesheet designer or FreeCAD coder?
I guess the best and more reliable approach would be to be something inside FreeCAD, but don't know if it's possible due to the Qt API you referred...
By setting the cwd to the qss directory just shows that Qt loads image files relative to this cwd -- nothing more.
But setting the cwd to this directory is NOT a solution because at runtime this again can change to any other directory and then newly created widgets again will fail to load the image files.

A quick and dirty solution could be to use a certain string as prefix and then replace this string with the actual directory name.
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Dark and Light FreeCAD stylesheets (v1.1)

Post by wmayer »

Using QDir::setSearchPaths is a proper solution for this issue. Inside FreeCAD this search path can be set to the qss directories and inside the .qss file you have to use the qss prefix.

Example:

Code: Select all

QMdiArea[showImage="true"] {
    background-image: url(qss:images/background_freecad.png);
    background-position: center;
    background-repeat: no-repeat;
}
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Dark and Light FreeCAD stylesheets (v1.1)

Post by wmayer »

git commit 72abf54

Now you have to replace all occurrences of "[PATH_TO_IMAGES]" with "qss:images" inside the .qss files.
User avatar
pablogil
Posts: 882
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Dark and Light FreeCAD stylesheets (v1.1)

Post by pablogil »

wmayer wrote:git commit 72abf54

Now you have to replace all occurrences of "[PATH_TO_IMAGES]" with "qss:images" inside the .qss files.
Great solution!
I'll try it out this weekend but I really like it. That way it will work on all OS and the user won't need to edit any file, just install the stylesheets (place the files in the correspondent folder).
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
Renato Rebelo
Posts: 255
Joined: Mon May 19, 2014 1:14 pm
Location: Vouzela - Portugal

Re: Dark and Light FreeCAD stylesheets (v1.1)

Post by Renato Rebelo »

hello,
great job, congratulations.
I've been testing, but I have a problem, the snap buttons are narrow and wide, this is normal or is it some bug
thank you,
Renato
2015_06_21.png
2015_06_21.png (23.3 KiB) Viewed 2881 times
OS: Ubuntu 15.04
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.5086 (Git)
Build type: None
Branch: master
Hash: 4f5534a87a7e2d224022ff98729a341bf57e7f9e
Python version: 2.7.9
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
my native language is not English, please excuse me any incorrectness, I apologize for any inconvenience caused, thank you
User avatar
pablogil
Posts: 882
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Dark and Light FreeCAD stylesheets (v1.1)

Post by pablogil »

Renato Rebelo wrote:hello,
great job, congratulations.
I've been testing, but I have a problem, the snap buttons are narrow and wide, this is normal or is it some bug
thank you,
Renato
2015_06_21.png
OS: Ubuntu 15.04
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.5086 (Git)
Build type: None
Branch: master
Hash: 4f5534a87a7e2d224022ff98729a341bf57e7f9e
Python version: 2.7.9
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Hello,
Yes, it's a bug. I'll try to reproduce it and let you know, it seems easy to fix.
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
User avatar
pablogil
Posts: 882
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Dark and Light FreeCAD stylesheets (v1.1)

Post by pablogil »

@ Renato
Have you changed "size of toolbar icons" in the Preferences/General? I see they are not perfectly sized so I can improve them but I don't get the exact size a proportions you get in the screenshot you provided me...
Any other custom configuration you have in Ubuntu?
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
Renato Rebelo
Posts: 255
Joined: Mon May 19, 2014 1:14 pm
Location: Vouzela - Portugal

Re: Dark and Light FreeCAD stylesheets (v1.1)

Post by Renato Rebelo »

These are my settings
2015_06_21 22_25_56.png
2015_06_21 22_25_56.png (68.15 KiB) Viewed 2837 times
thank you,
Renato
my native language is not English, please excuse me any incorrectness, I apologize for any inconvenience caused, thank you
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Dark and Light FreeCAD stylesheets (v1.1)

Post by yorik »

Excellent work pablogil, congrats!
Post Reply