Re: PyQt 5.8 changes stylesheet interpretation
Hi, I have found out, that problem is with selectors using ~= (tilda) for example: QLineEdit#lineEdit[style_class ~= 'minibuffer_warning'] { background-color: @minibuffer_warning_color; } When you try replace all occurences of "~=" with "=" in stylesheet, everything seems work right even in PyQ 5.8. Milan Melena Dne středa 15. března 2017 3:39:22 UTC+1 Terry Brown napsal(a): > Just confirmed in a Windows 7 VM switching back and forth between PyQt > 5.7.1 and 5.8 (Python 3 for both) that stylesheets that work fine in > 5.7.1 (my personal one, and EKR Windows Dark) have issues in PyQt 5.8. > > My backgrounds are ok, but font sizes are wrong. EKR Dark had light > backgrounds and some fonts aren't sized right, but some are. > > I can not google up any reports of this issue, but it might be only > PyQt, not Qt, or just too early to be being reported yet? > > So it might be possible to write stylesheets that work in 5.8 and lower > versions, seeing addressed the right way fonts and backgrounds can be > changed, but what a pain. > > Haven't looked into it beyond this observation yet. > > Cheers -Terry > -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: PyQt 5.8 changes stylesheet interpretation
On Wed, 15 Mar 2017 01:18:35 -0700 (PDT) Milan Melena wrote: > Hi, > > I have found out, that problem is with selectors using ~= (tilda) > > for example: > > QLineEdit#lineEdit[style_class ~= 'minibuffer_warning'] { > background-color: @minibuffer_warning_color; > } Ah, ok, thanks for the detective work. Leo uses that construct to emulate HTML-CSS's `class` attribute, which Qt-CSS doesn't have. Or at least didn't have, maybe it has something like that now. Will have to see if Qt-CSS supports ~= in some other way now. ~= means "contains". Cheers -Terry > When you try replace all occurences of "~=" with "=" in stylesheet, > everything seems work right even in PyQ 5.8. > > Milan Melena > > Dne středa 15. března 2017 3:39:22 UTC+1 Terry Brown napsal(a): > > > Just confirmed in a Windows 7 VM switching back and forth between > > PyQt 5.7.1 and 5.8 (Python 3 for both) that stylesheets that work > > fine in 5.7.1 (my personal one, and EKR Windows Dark) have issues > > in PyQt 5.8. > > > > My backgrounds are ok, but font sizes are wrong. EKR Dark had > > light backgrounds and some fonts aren't sized right, but some are. > > > > I can not google up any reports of this issue, but it might be only > > PyQt, not Qt, or just too early to be being reported yet? > > > > So it might be possible to write stylesheets that work in 5.8 and > > lower versions, seeing addressed the right way fonts and > > backgrounds can be changed, but what a pain. > > > > Haven't looked into it beyond this observation yet. > > > > Cheers -Terry > > > -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: PyQt 5.8 changes stylesheet interpretation
p.s. search http://doc.qt.io/qt-5.8/stylesheet-syntax.html for ~, it seems like it should still work. Cheers -Terry On Wed, 15 Mar 2017 07:02:17 -0500 Terry Brown wrote: > On Wed, 15 Mar 2017 01:18:35 -0700 (PDT) > Milan Melena wrote: > > > Hi, > > > > I have found out, that problem is with selectors using ~= (tilda) > > > > for example: > > > > QLineEdit#lineEdit[style_class ~= 'minibuffer_warning'] { > > background-color: @minibuffer_warning_color; > > } > > Ah, ok, thanks for the detective work. Leo uses that construct to > emulate HTML-CSS's `class` attribute, which Qt-CSS doesn't have. Or > at least didn't have, maybe it has something like that now. Will > have to see if Qt-CSS supports ~= in some other way now. ~= means > "contains". > > Cheers -Terry > > > When you try replace all occurences of "~=" with "=" in stylesheet, > > everything seems work right even in PyQ 5.8. > > > > Milan Melena > > > > Dne středa 15. března 2017 3:39:22 UTC+1 Terry Brown napsal(a): > > > > > Just confirmed in a Windows 7 VM switching back and forth between > > > PyQt 5.7.1 and 5.8 (Python 3 for both) that stylesheets that work > > > fine in 5.7.1 (my personal one, and EKR Windows Dark) have issues > > > in PyQt 5.8. > > > > > > My backgrounds are ok, but font sizes are wrong. EKR Dark had > > > light backgrounds and some fonts aren't sized right, but some > > > are. > > > > > > I can not google up any reports of this issue, but it might be > > > only PyQt, not Qt, or just too early to be being reported yet? > > > > > > So it might be possible to write stylesheets that work in 5.8 and > > > lower versions, seeing addressed the right way fonts and > > > backgrounds can be changed, but what a pain. > > > > > > Haven't looked into it beyond this observation yet. > > > > > > Cheers -Terry > > > > > -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: PyQt 5.8 changes stylesheet interpretation
Many thanks, Milan, you are spot on: eliminating the tildes does indeed fix the problem. Alac On Wednesday, March 15, 2017 at 5:18:35 PM UTC+9, Milan Melena wrote: > > Hi, > > I have found out, that problem is with selectors using ~= (tilda) > > for example: > > QLineEdit#lineEdit[style_class ~= 'minibuffer_warning'] { > background-color: @minibuffer_warning_color; > } > > When you try replace all occurences of "~=" with "=" in stylesheet, > everything seems work right even in PyQ 5.8. > > Milan Melena > > Dne středa 15. března 2017 3:39:22 UTC+1 Terry Brown napsal(a): > >> Just confirmed in a Windows 7 VM switching back and forth between PyQt >> 5.7.1 and 5.8 (Python 3 for both) that stylesheets that work fine in >> 5.7.1 (my personal one, and EKR Windows Dark) have issues in PyQt 5.8. >> >> My backgrounds are ok, but font sizes are wrong. EKR Dark had light >> backgrounds and some fonts aren't sized right, but some are. >> >> I can not google up any reports of this issue, but it might be only >> PyQt, not Qt, or just too early to be being reported yet? >> >> So it might be possible to write stylesheets that work in 5.8 and lower >> versions, seeing addressed the right way fonts and backgrounds can be >> changed, but what a pain. >> >> Haven't looked into it beyond this observation yet. >> >> Cheers -Terry >> > -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: PyQt 5.8 changes stylesheet interpretation
Terry, I have reported this issue on github twice, #435 and #436. The issue also affects pristine, vanilla Leo with no theme enabled. Alac On Wednesday, March 15, 2017 at 11:39:22 AM UTC+9, Terry Brown wrote: > > Just confirmed in a Windows 7 VM switching back and forth between PyQt > 5.7.1 and 5.8 (Python 3 for both) that stylesheets that work fine in > 5.7.1 (my personal one, and EKR Windows Dark) have issues in PyQt 5.8. > > My backgrounds are ok, but font sizes are wrong. EKR Dark had light > backgrounds and some fonts aren't sized right, but some are. > > I can not google up any reports of this issue, but it might be only > PyQt, not Qt, or just too early to be being reported yet? > > So it might be possible to write stylesheets that work in 5.8 and lower > versions, seeing addressed the right way fonts and backgrounds can be > changed, but what a pain. > > Haven't looked into it beyond this observation yet. > > Cheers -Terry > -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: PyQt 5.8 changes stylesheet interpretation
Yes, it is a litle mystery for me too. Dne středa 15. března 2017 13:21:53 UTC+1 Terry Brown napsal(a): > > p.s. search > http://doc.qt.io/qt-5.8/stylesheet-syntax.html > for ~, it seems like it should still work. > > Cheers -Terry > > On Wed, 15 Mar 2017 07:02:17 -0500 > Terry Brown > wrote: > > > On Wed, 15 Mar 2017 01:18:35 -0700 (PDT) > > Milan Melena > wrote: > > > > > Hi, > > > > > > I have found out, that problem is with selectors using ~= (tilda) > > > > > > for example: > > > > > > QLineEdit#lineEdit[style_class ~= 'minibuffer_warning'] { > > > background-color: @minibuffer_warning_color; > > > } > > > > Ah, ok, thanks for the detective work. Leo uses that construct to > > emulate HTML-CSS's `class` attribute, which Qt-CSS doesn't have. Or > > at least didn't have, maybe it has something like that now. Will > > have to see if Qt-CSS supports ~= in some other way now. ~= means > > "contains". > > > > Cheers -Terry > > > > > When you try replace all occurences of "~=" with "=" in stylesheet, > > > everything seems work right even in PyQ 5.8. > > > > > > Milan Melena > > > > > > Dne středa 15. března 2017 3:39:22 UTC+1 Terry Brown napsal(a): > > > > > > > Just confirmed in a Windows 7 VM switching back and forth between > > > > PyQt 5.7.1 and 5.8 (Python 3 for both) that stylesheets that work > > > > fine in 5.7.1 (my personal one, and EKR Windows Dark) have issues > > > > in PyQt 5.8. > > > > > > > > My backgrounds are ok, but font sizes are wrong. EKR Dark had > > > > light backgrounds and some fonts aren't sized right, but some > > > > are. > > > > > > > > I can not google up any reports of this issue, but it might be > > > > only PyQt, not Qt, or just too early to be being reported yet? > > > > > > > > So it might be possible to write stylesheets that work in 5.8 and > > > > lower versions, seeing addressed the right way fonts and > > > > backgrounds can be changed, but what a pain. > > > > > > > > Haven't looked into it beyond this observation yet. > > > > > > > > Cheers -Terry > > > > > > > > -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: PyQt 5.8 changes stylesheet interpretation
On Wed, Mar 15, 2017 at 4:56 AM, alacnorr wrote: > Many thanks, Milan, > you are spot on: eliminating the tildes does indeed fix the problem. > Alright. I shall eliminate tildes everywhere in style sheets. Thanks to all for the sleuthing. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: PyQt 5.8 changes stylesheet interpretation
On Wed, Mar 15, 2017 at 10:02 AM, Edward K. Ream wrote: > > Alright. I shall eliminate tildes everywhere in style sheets. > Done at rev 3488fbe. Please report any problems pronto. I would like to release Leo 5.5b1 tomorrow. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: PyQt 5.8 changes stylesheet interpretation
On March 15, 2017 10:02:42 AM CDT, "Edward K. Ream" wrote: >On Wed, Mar 15, 2017 at 4:56 AM, alacnorr >wrote: > >> Many thanks, Milan, >> you are spot on: eliminating the tildes does indeed fix the problem. >> > >Alright. I shall eliminate tildes everywhere in style sheets. Thanks >to >all for the sleuthing. Note that that will break styles where the style_class property is more than one identifier. E.g. "minibuffer error" as opposed to "minibuffer". Some of these things won't be easy to see in a quick spot check. Some of these things change dynamically at run time. Border highlighting might be an example. Cheers -Terry >Edward -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: PyQt 5.8 changes stylesheet interpretation
P.s. depending on how significant the loss of the tilde function turns out to be, best workaround might be to replace tildes at runtime while we wait for what seems to be a Qt bug to be fixed. It may be something more subtle, like a change in style sheet specificity rules involving tildes. More investigation needed. On March 15, 2017 10:14:53 AM CDT, "Edward K. Ream" wrote: >On Wed, Mar 15, 2017 at 10:02 AM, Edward K. Ream >wrote: > >> >> Alright. I shall eliminate tildes everywhere in style sheets. >> > >Done at rev 3488fbe. Please report any problems pronto. I would like >to >release Leo 5.5b1 tomorrow. > >Edward > >-- >You received this message because you are subscribed to the Google >Groups "leo-editor" group. >To unsubscribe from this group and stop receiving emails from it, send >an email to leo-editor+unsubscr...@googlegroups.com. >To post to this group, send email to leo-editor@googlegroups.com. >Visit this group at https://groups.google.com/group/leo-editor. >For more options, visit https://groups.google.com/d/optout. -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: PyQt 5.8 changes stylesheet interpretation
Note that that will break styles where the style_class property is more than one identifier. E.g. "minibuffer error" as opposed to "minibuffer". Some of these things won't be easy to see in a quick spot check. Some of these things change dynamically at run time. Border highlighting might be an example. (Sent this from email but don't see it despite seeing my p.s.) -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: PyQt 5.8 changes stylesheet interpretation
On Wed, Mar 15, 2017 at 4:19 PM, Terry Brown wrote: > Note that that will break styles where the style_class property is more > than one identifier. E.g. "minibuffer error" as opposed to "minibuffer". > Some of these things won't be easy to see in a quick spot check. Some of > these things change dynamically at run time. Border highlighting might be > an example. > Terry, what do you suggest we do? I can move the tilde-less stylesheet to a branch, or leave things as they are. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: PyQt 5.8 changes stylesheet interpretation
On Wed, 15 Mar 2017 18:00:57 -0500 "Edward K. Ream" wrote: > On Wed, Mar 15, 2017 at 4:19 PM, Terry Brown > wrote: > > > Note that that will break styles where the style_class property is > > more than one identifier. E.g. "minibuffer error" as opposed to > > "minibuffer". Some of these things won't be easy to see in a quick > > spot check. Some of these things change dynamically at run time. > > Border highlighting might be an example. > > Terry, what do you suggest we do? I can move the tilde-less > stylesheet to a branch, or leave things as they are. If taking the tildes out hasn't broken border highlighting (I don't usually use it anyway) then I guess leave it for now. Might have been easier taking them out at runtime, in terms of being a one liner we could revert if the issue gets fixed. I posted this to the PyQt list: Hi - I think there's a problem with ~= in stylesheets in PyQt 5.8. The attached program illustrates the issue (also here, same code: https://gist.github.com/tbnorth/76191db825cc49dcca296ffb8d777047) It seems 5.8 stops parsing the stylesheet as soon as it sees ~=, whereas < 5.8 acts as expected (described in docstring of code). Any thoughts much appreciated, Thanks, Terry but I guess it could be a Qt issue rather than a PyQt issue. Cheers -Terry -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: PyQt 5.8 changes stylesheet interpretation
On Wed, Mar 15, 2017 at 8:36 PM, Terry Brown wrote: If taking the tildes out hasn't broken border highlighting (I don't > usually use it anyway) then I guess leave it for now. It looks like removing tildes has broken background highlighting in the status area. With my unchanged myLeoSettings.leo, the stylesheets *with* tildes code shows failed searches in red, and successful searches in blue. The stylesheets *without* tildes show the default background colors always. This is an essential feature for me. For awhile I thought the find commands were broken. find.showStatus sets these background colors by calling frame.putStatusLine, which calls QtStatusLineClass.put. qsl.put does: c.styleSheetManager.mng.remove_sclass(w, ['info', 'fail']) c.styleSheetManager.mng.add_sclass(w, status) c.styleSheetManager.mng.update_view(w) # force appearance update I'll see what I can deduce. If I can't fix this quickly I'll restore the tildes so I can release 5.5b1 asap. We can discuss this further before 5.5 final. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: PyQt 5.8 changes stylesheet interpretation
On Thu, Mar 16, 2017 at 4:44 AM, Edward K. Ream wrote: It looks like removing tildes has broken background highlighting in the status area. Rev 383484 restores leoSettings.leo from an earlier rev so that it has tildes again. With only this change, the essential background highlighting in the status area works again. I suspect that there is a bug in the stylesheet manager class relating to tildes. The bug might be subtle. I didn't write this code, and I don't want to touch it so soon before b1. Terry, if you can fix the problem quickly, we can remove tildes from leoSettings.leo before b1. It's up to you. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: PyQt 5.8 changes stylesheet interpretation
On Thu, 16 Mar 2017 05:13:24 -0500 "Edward K. Ream" wrote: > On Thu, Mar 16, 2017 at 4:44 AM, Edward K. Ream > wrote: > > It looks like removing tildes has broken background highlighting in > the status area. > > Rev 383484 restores leoSettings.leo from an earlier rev so that it > has tildes again. With only this change, the essential background > highlighting in the status area works again. > > I suspect that there is a bug in the stylesheet manager class > relating to tildes. The bug might be subtle. I think the blame lies entirely with Qt. http://doc.qt.io/qt-5.8/stylesheet-syntax.html clearly describes the use ~= just as we've been using it, without problems, prior to 5.8. For technical users, I'd say the best solution is pip3 install "PyQt5<5.8" until it's fixed. The problem from Leo's perspective is that 5.8 is now the default install (at least on Windows) and that's a hurdle for less technical users. The PyQt list responded to my minimal example code, https://gist.github.com/tbnorth/76191db825cc49dcca296ffb8d777047 reasonably pointing out that it's a Qt problem, not a PyQt problem. I'll try and get feedback from the Qt people. The question is does Leo need to code around the problem in the interim? Certain irony in this coming up just as the themes were given a work over. Assuming that Qt will fix ~= reasonably quickly and it would be nice to retain the expressiveness it provides, we could just add temporary code tagged with "# QT_TILDE" that (a) removes tildes in the stylesheet generated by expand_css_constants, and (b) explicitly styles elements in cases where c.styleSheetManager.mng.* methods are used - this wouldn't play nice with themes, but hopefully it would be short lived. I'll start with the Qt people. Cheers -Terry > I didn't write this code, and I don't want to touch it so soon before > b1. Terry, if you can fix the problem quickly, we can remove tildes > from leoSettings.leo before b1. It's up to you. > > Edward > -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: PyQt 5.8 changes stylesheet interpretation
On Thu, 16 Mar 2017 07:49:03 -0500 "'Terry Brown' via leo-editor" wrote: > I'll start with the Qt people. https://bugreports.qt.io/browse/QTBUG-59533 -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: PyQt 5.8 changes stylesheet interpretation
On Thu, Mar 16, 2017 at 8:03 AM, 'Terry Brown' via leo-editor < leo-editor@googlegroups.com> wrote: > On Thu, 16 Mar 2017 07:49:03 -0500 > "'Terry Brown' via leo-editor" wrote: > > > I'll start with the Qt people. > > https://bugreports.qt.io/browse/QTBUG-59533 Thanks for looking into this. I think the safest thing to do is leave the tildes in place, without changing any code. The last thing I want to do is play with speculative code just before releasing b1. Those of us with working stylesheets can keep them without fear of breakage. Newbies *might* get bitten, but we can deal with that as needed. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.