[Issue] Multiline Textfield with Dark Themes

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
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: [Issue] Multiline Textfield with Dark Themes

Post by wandererfan »

MisterMaker wrote: Wed Aug 03, 2022 10:45 am That is a great fix!
I'll make a PR then.
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: [Issue] Multiline Textfield with Dark Themes

Post by wandererfan »

@MisterMaker , @balrobs

Are we ok that this doesn't respect the stylesheet's settings? I don't know a way to get the selection colour from the stylesheet instead of the palette.
Attachments
propertyList_nostylesheet.png
propertyList_nostylesheet.png (214.82 KiB) Viewed 1472 times
propertyList_lightgreen.png
propertyList_lightgreen.png (206.96 KiB) Viewed 1472 times
propertyList_darkorange.png
propertyList_darkorange.png (195.48 KiB) Viewed 1472 times
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

Re: [Issue] Multiline Textfield with Dark Themes

Post by balrobs »

wandererfan wrote: Wed Aug 03, 2022 3:57 pm
Are we ok that this doesn't respect the stylesheet's settings? I don't know a way to get the selection colour from the stylesheet instead of the palette.
From my point of view it‘s already a big improvement so I would vote for it … but let‘s hear also @MisterMaker‘s opinion.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: [Issue] Multiline Textfield with Dark Themes

Post by adrianinsaval »

Can't you just skip specifically assigning a color? I believe with that you are overriding the stylesheet that would have otherwise been auto applied.
User avatar
obelisk79
Veteran
Posts: 1061
Joined: Thu Sep 24, 2020 9:01 pm

Re: [Issue] Multiline Textfield with Dark Themes

Post by obelisk79 »

adrianinsaval wrote: Wed Aug 03, 2022 7:01 pm Can't you just skip specifically assigning a color? I believe with that you are overriding the stylesheet that would have otherwise been auto applied.
I agree, I think by not assigning it directly in the code it will default to the style settings for that type of widget as defined in the stylesheet.
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: [Issue] Multiline Textfield with Dark Themes

Post by wandererfan »

obelisk79 wrote: Wed Aug 03, 2022 7:41 pm
adrianinsaval wrote: Wed Aug 03, 2022 7:01 pm Can't you just skip specifically assigning a color? I believe with that you are overriding the stylesheet that would have otherwise been auto applied.
I agree, I think by not assigning it directly in the code it will default to the style settings for that type of widget as defined in the stylesheet.
I tried that. If I just remove the setting of the colours, then the selection isn't highlighted at all, even if there is no stylesheet in effect. The colours aren't set on a widget, but on a QTextCharFormat.
Attachments
noAttributesSet_darkorange.png
noAttributesSet_darkorange.png (195.23 KiB) Viewed 1366 times
User avatar
obelisk79
Veteran
Posts: 1061
Joined: Thu Sep 24, 2020 9:01 pm

Re: [Issue] Multiline Textfield with Dark Themes

Post by obelisk79 »

I'm not trying to sound difficult here, but is the line highlighting even necessary? It seems the rest of the window follows the stylesheet without it, and if there's a blinking cursor to indicate where you're typing, it seems kind of superfluous to have the highlight. This would alleviate any future complaints regarding styling with negligible potential downsides as far as I can tell.
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

Re: [Issue] Multiline Textfield with Dark Themes

Post by balrobs »

I think that giving up the highlighting feature would cause troubles to many users.
Imagine the case a user selects all words in a single line. The visual feedback would be a blinking coursor at the end of the line. So pressing DEL he could expect to delete only the last letter of that line.
Hope my thinking makes sense.
Cheers
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: [Issue] Multiline Textfield with Dark Themes

Post by wandererfan »

obelisk79 wrote: Wed Aug 03, 2022 9:03 pm but is the line highlighting even necessary?
Easy enough to take the original yellow line out, but you'd lose the indication that each line is a separate item in the PropertyStringList.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: [Issue] Multiline Textfield with Dark Themes

Post by adrianinsaval »

In that case why are we using a QTextEdit widget and not an editable QListWidget?
Post Reply