Target Spreadsheet Aliased Cell Color through .qss? (FreeCAD 0.20.1)

A forum for research and development of the user interface of FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Target Spreadsheet Aliased Cell Color through .qss?

Post by onekk »

Axeia wrote: Tue Oct 04, 2022 2:50 pm ...
If changes are made to the FreeCAD code I'd be in support of simply adding a class named "alias" or "aliased" so themes can simply target it as

Code: Select all

QTableView::item.aliased{
    background-color: teal;
}
It's a lot easier to read than the the whole "qproperty-AliasedCellBackgroundColor" syntax. It also makes it easier for people (like me) that have a CSS rather than a Qt Style Sheets background to understand what's going on.
Things are somewhat complex, as the whole "color change" and "color customization" is improving recently, as a lot of work is done in "color customization" and "many little places" where things are not so smoth are found and fixed.

From what I know about Qt changing QTableView::item setting will spread across FC even in places where maybe you will not know that is used, so probably some more verbose name has to be used, to refer maybe to a specific use of the QTableView widget, like the Spreadsheet alias you intend to change.

Probably trying to find some "meaningful names" that maybe use some abbreviations like AliasSSBckCol as a rough example will be a more "clever setting", as it could be retrieved and applied to a specific use of QTableView control.

But as UI is not my most known part of FC I leave to more skilled people to make such type of decision.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
MisterMaker
Posts: 739
Joined: Mon Sep 21, 2020 7:41 am

Re: Target Spreadsheet Aliased Cell Color through .qss? (FreeCAD 0.20.1)

Post by MisterMaker »

Code: Select all

            <FCText Name="ImportExportQuoteCharacter">"</FCText>
            <FCText Name="ImportExportEscapeCharacter">\</FCText>
            <FCUInt Name="aliasBgColor" Value="2105376255"/>
            <FCUInt Name="AliasedCellBackgroundColor" Value="2105376255"/>
Found the settings but they really screw up my markup, I wonder if this can impact the rest of the settings?
Image
User avatar
chennes
Veteran
Posts: 3881
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Target Spreadsheet Aliased Cell Color through .qss? (FreeCAD 0.20.1)

Post by chennes »

No, that's perfectly well-formed XML, it's just your XML formatter doesn't understand it correctly.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Target Spreadsheet Aliased Cell Color through .qss? (FreeCAD 0.20.1)

Post by chrisb »

chennes wrote: Tue Oct 04, 2022 3:57 pm No, that's perfectly well-formed XML, it's just your XML formatter doesn't understand it correctly.
No there is an additional double quote in the seventh line between closing and opening bracket: >"<
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
MisterMaker
Posts: 739
Joined: Mon Sep 21, 2020 7:41 am

Re: Target Spreadsheet Aliased Cell Color through .qss? (FreeCAD 0.20.1)

Post by MisterMaker »

I tried to remove the offending characters but had no affect.
Created an issue on Github about this:
https://github.com/FreeCAD/FreeCAD/issues/7582
User avatar
chennes
Veteran
Posts: 3881
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Target Spreadsheet Aliased Cell Color through .qss? (FreeCAD 0.20.1)

Post by chennes »

chrisb wrote: Wed Oct 05, 2022 7:59 pm No there is an additional double quote in the seventh line between closing and opening bracket: >"<
That's legal XML. It's a literal double quote character in that position.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
MisterMaker
Posts: 739
Joined: Mon Sep 21, 2020 7:41 am

Re: Target Spreadsheet Aliased Cell Color through .qss? (FreeCAD 0.20.1)

Post by MisterMaker »

Could it because the colors aren't in the settings menu? I could remember something that this should be the case for it to be read?
User avatar
chennes
Veteran
Posts: 3881
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Target Spreadsheet Aliased Cell Color through .qss? (FreeCAD 0.20.1)

Post by chennes »

Ahhh.... it's actually because the code for reading that color value is non-standard: it is expecting an ASCII string (it defaults to "#feff9e"), rather than an unsigned integer. So try using a hex code instead, and instead of FCUint for the type, use FCText. IMO we should change this, but of course doing so will break everyone's stylesheets.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
MisterMaker
Posts: 739
Joined: Mon Sep 21, 2020 7:41 am

Re: Target Spreadsheet Aliased Cell Color through .qss? (FreeCAD 0.20.1)

Post by MisterMaker »

chennes wrote: Sun Oct 09, 2022 7:38 pm Ahhh.... it's actually because the code for reading that color value is non-standard: it is expecting an ASCII string (it defaults to "#feff9e"), rather than an unsigned integer. So try using a hex code instead, and instead of FCUint for the type, use FCText. IMO we should change this, but of course doing so will break everyone's stylesheets.
Noice, now we know what the issue is we can fix it! I kinda like the hex way more than the integer....
This:

Code: Select all

            <FCText Name="AliasedCellBackgroundColor">#850097</FCText>
Changed it too purple!
Image
Ok my extremProDark theme now changes the color to purple, this color works with white and black text.
There is no way other than applying my light them to get it back. :?
This really needs to move to the qss file.
Also if we want a quick fix then we should change the yellow default color to a color from this site.
Last edited by MisterMaker on Sun Oct 09, 2022 8:24 pm, edited 1 time in total.
Post Reply