Dark and Light FreeCAD stylesheets (v1.8a)

Info about new implemented features, classes, modules or APIs. Might get technical!
User avatar
easyw-fc
Posts: 604
Joined: Thu Jul 09, 2015 9:34 am

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

Postby easyw-fc » Thu Feb 25, 2016 5:26 pm

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
Posts: 2418
Joined: Wed Oct 05, 2011 7:36 am

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

Postby ickby » Thu Feb 25, 2016 5:44 pm

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

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

Postby pablogil » Thu Feb 25, 2016 7:49 pm

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
Posts: 604
Joined: Thu Jul 09, 2015 9:34 am

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

Postby easyw-fc » Thu Feb 25, 2016 8:07 pm

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: 155
Joined: Fri Jan 09, 2015 9:25 pm

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

Postby bill » Fri Feb 26, 2016 9:13 pm

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?
Attachments
examp.png
examp.png (199.06 KiB) Viewed 491 times
pablogil
Posts: 504
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

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

Postby pablogil » Fri Feb 26, 2016 11:45 pm

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: 155
Joined: Fri Jan 09, 2015 9:25 pm

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

Postby bill » Sat Feb 27, 2016 3:02 am

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

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

Postby pablogil » Sat Feb 27, 2016 9:13 am

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

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

Postby pablogil » Fri Mar 04, 2016 4:29 pm

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
Posts: 604
Joined: Thu Jul 09, 2015 9:34 am

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

Postby easyw-fc » Sun Sep 18, 2016 8:55 pm

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 163 times

but using a stylesheet theme the boxes became transparent
colored boxes-themed1.png
colored boxes-themed1.png (8.47 KiB) Viewed 163 times

Is there a way to have a box colored inside also when using theme stylesheet?
Thank you
Maurice