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!
pablogil
Posts: 820
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

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

Postby pablogil » Fri Jun 19, 2015 5:25 pm

@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
Site Admin
Posts: 15739
Joined: Thu Feb 19, 2009 10:32 am

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

Postby wmayer » Fri Jun 19, 2015 8:20 pm

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
Site Admin
Posts: 15739
Joined: Thu Feb 19, 2009 10:32 am

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

Postby wmayer » Fri Jun 19, 2015 9:00 pm

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
Site Admin
Posts: 15739
Joined: Thu Feb 19, 2009 10:32 am

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

Postby wmayer » Fri Jun 19, 2015 9:36 pm

git commit 72abf54

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

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

Postby pablogil » Sat Jun 20, 2015 6:27 am

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)

Postby Renato Rebelo » Sun Jun 21, 2015 3:42 am

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 1345 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
pablogil
Posts: 820
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

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

Postby pablogil » Sun Jun 21, 2015 9:31 am

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
pablogil
Posts: 820
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

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

Postby pablogil » Sun Jun 21, 2015 7:18 pm

@ 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)

Postby Renato Rebelo » Sun Jun 21, 2015 9:29 pm

These are my settings
2015_06_21 22_25_56.png
2015_06_21 22_25_56.png (68.15 KiB) Viewed 1301 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
Site Admin
Posts: 11845
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

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

Postby yorik » Mon Jun 22, 2015 12:23 am

Excellent work pablogil, congrats!