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
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: Dark and Light FreeCAD stylesheets (v1.8a)

Post by easyw-fc »

ickby wrote:Ok than not with font sizes, i overlooked that, but Buttons and Widgets sizes are also defined by Styles which define Border sizes and spaces. If you want Cross Platform and cross style compatibility you need to use then too.
Ok I will see for Buttons, and Widgets, but I fixed their size already... I will check better...
Anyway my Macro is proved already through Cross Platform on Win, OSX, Linux and I had feedback from users that they display it fine without prob... at the moment I have prob only with stylesheets
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Dark and Light FreeCAD stylesheets (v1.8a)

Post by ickby »

Why are you so reluctant to use layouts, any reason for that? Even Fixing fonts seems strange, what with the difference between normal and high dpi displays? Most likely buttons will be nearly unreadable on 3200 pixels. Of course this is all your choice, but imho you are throwing away one of the major benefits of qt.
User avatar
pablogil
Posts: 881
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Dark and Light FreeCAD stylesheets (v1.8a)

Post by pablogil »

ickby is right, you should learn how to design with QT layouts.
I also suggest you not to include any style value in the code side as they are, as an standard, applied later by the stylesheets (or default OS style which is internally a style). It only can result on strange or unexpected behaviors.
If you really want your widget/macro to look different for any reason I suggest you two steps:
  • on the parent layout element (probably a QWidget), name it with an unique name or ID, that way you will be able to refer it on any stylesheet (for instance: QWidget#my_macro_name)
  • create an specific stylesheet for your macro: something like make it read a my_macro_name.qss file
I hope it helps you.
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: Dark and Light FreeCAD stylesheets (v1.8a)

Post by easyw-fc »

pablogil wrote:I hope it helps you.
thanks for suggestions...
I made my macro by hands, without using QTEditor, and it is a bit out of my scope to rewrite it just to fulfill stylesheets...
Anyway, thank you for your time, now I know what to modify in case I would get some spare time ...
Maurice
User avatar
bill
Posts: 376
Joined: Fri Jan 09, 2015 9:25 pm

Re: Dark and Light FreeCAD stylesheets (v1.8a)

Post by bill »

Got back and downloaded v1.8a, graphics are corrected with new version, but MOUSE_OVER (up and down arrows) converts CURSOR to "Data Input" over these arrows; not allowing selection/action. The arrows can only be selected by the very TOP or BOTTOM EDGE of the arrow image.

[img]
examp.png
examp.png (199.06 KiB) Viewed 3933 times
[/img]

Note: even though the zip folder says v1.8a, the file inside says v1.8; ??? Is that OK?
User avatar
pablogil
Posts: 881
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Dark and Light FreeCAD stylesheets (v1.8a)

Post by pablogil »

bill wrote:Got back and downloaded v1.8a, graphics are corrected with new version, but MOUSE_OVER (up and down arrows) converts CURSOR to "Data Input" over these arrows; not allowing selection/action. The arrows can only be selected by the very TOP or BOTTOM EDGE of the arrow image.

[img]
examp.png
[/img]

Note: even though the zip folder says v1.8a, the file inside says v1.8; ??? Is that OK?
Umm, strange behavior... Could you share with me your OS, FreeCAD version and stuff?
I would like to reproduce it and investigate.

Yes, you are using the correct version, 1.8a was a quick fix for 1.8 and I just forgot to change the version inside the file...

As an advance, I will release 2.0 version next week with a fully redone code and with much better integration, stay tuned ;)
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
User avatar
bill
Posts: 376
Joined: Fri Jan 09, 2015 9:25 pm

Re: Dark and Light FreeCAD stylesheets (v1.8a)

Post by bill »

pablogil,
your code works everywhere else I have tested but not in the placement interface. I don't believe it is your code; since it works for the "ROTATION ANGLE" in the lower part of the dialog. I suspect it is a symptom of the dialog event handling.

If I am the only one having this problem, don't worry about it.

Thanks, bill


OS: Windows
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.16.5602 (Git)
Build type: Release
Branch: master
Hash: 037ec5be789d52b2f82cc18a4b8e37b6cdc25e6b
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
User avatar
pablogil
Posts: 881
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Dark and Light FreeCAD stylesheets (v1.8a)

Post by pablogil »

I have just tested it and you are right, it's a problem related to my style but pretty easy to fix (I think so), so I'll let you know later this weekend if I could solve it or not. :)
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
User avatar
pablogil
Posts: 881
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Dark and Light FreeCAD stylesheets (v1.8a)

Post by pablogil »

In case you haven't noticed, I have updated the styles to 2.0 with lots of improvements.
It's such a big change that I preferred to create a new thread, you can follow it at:
Dark and Light FreeCAD stylesheets (v2.x)

Thank you
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: Dark and Light FreeCAD stylesheets (v1.8a)

Post by easyw-fc »

pablogil wrote:you should learn how to design with QT layouts.
I also suggest you not to include any style value in the code side as they are, as an standard, applied later by the stylesheets (or default OS style which is internally a style). It only can result on strange or unexpected behaviors.
If you really want your widget/macro to look different for any reason I suggest you two steps:
  • on the parent layout element (probably a QWidget), name it with an unique name or ID, that way you will be able to refer it on any stylesheet (for instance: QWidget#my_macro_name)
  • create an specific stylesheet for your macro: something like make it read a my_macro_name.qss file
I hope it helps you.
Hi @pablogil
I'm porting my macro and I'm trying to use QT layout
I have a part of the macro using this code:

Code: Select all

   pal = QtGui.QPalette()
   bgc = QtGui.QColor(shape_col[0]*255,shape_col[1]*255, shape_col[2]*255)
   pal.setColor(QtGui.QPalette.Base, bgc)
   ui.plainTextEdit.viewport().setPalette(pal)
when used in standard FC basic configuration (no style applied) the code works fine
colored boxes.png
colored boxes.png (7.13 KiB) Viewed 3605 times
but using a stylesheet theme the boxes became transparent
colored boxes-themed1.png
colored boxes-themed1.png (8.47 KiB) Viewed 3605 times
Is there a way to have a box colored inside also when using theme stylesheet?
Thank you
Maurice
Post Reply