active pane styling switch to stylesheets

48 views
Skip to first unread message

Terry Brown

unread,
May 15, 2014, 1:38:32 PM5/15/14
to leo-e...@googlegroups.com
I've just pushed a switch from the old active pane border highlighting
code to a stylesheet based approach which makes it possible to do
different appearance things beyond border colors.

The default behavior is intended to be the same, it looks the same to
me, the active pane has a thin red border. But now that's caused by
the following stylesheet code:

/* focused pane border highlight */
QTextEdit#log-widget, LeoQTreeWidget#treeWidget, QTextEdit#richTextEdit {
border-style: @focused-border-style;
border-width: @focused-border-width;
border-color: @focused-border-unfocus-color;
}
QTextEdit:focus#log-widget, LeoQTreeWidget:focus#treeWidget, QTextEdit:focus#richTextEdit {
border-style: @focused-border-style;
border-width: @focused-border-width;
border-color: @focused-border-focus-color;
}

Background color etc. could be styled as well, probably most easily
in @data qt-gui-user-style-sheet

Edward - I know your dealing with other things at the moment, but
please let me know if this scheme doesn't work for your settings /
environment etc. so I can fix it, always hard to know how these changes
impact local settings. Same for everyone else of course - let me know
if this doesn't allow you to do what you were doing before.

Cheers -Terry

Edward K. Ream

unread,
May 15, 2014, 2:29:54 PM5/15/14
to leo-editor
On Thu, May 15, 2014 at 12:38 PM, 'Terry Brown' via leo-editor

> Edward - I know your dealing with other things at the moment, but
> please let me know if this scheme doesn't work for your settings /
> environment etc. so I can fix it, always hard to know how these changes
> impact local settings. Same for everyone else of course - let me know
> if this doesn't allow you to do what you were doing before.

I don't see any change except that during startup the tree pane has a
thin red border. This changes to my default thicker blue border after
startup is complete. Not a big deal, obviously, but it's a little
inconsistent.

Edward

Terry Brown

unread,
May 15, 2014, 3:59:09 PM5/15/14
to leo-e...@googlegroups.com
Thanks for the feedback. *If* you want to fiddle with it, you could
delete / set to False any `@bool use_focus_border` you have in your
local settings, and copy

.../leo/config/leoSettings.leo#@settings-->Qt Gui
(appearance)-->active frame border styles

to you local settings and edit the values there to your blue / thicker
border. I suspect that you have `@bool use_focus_border` set True in
local settings so you're still using the old code, which it would be
good to eliminate, but which I didn't remove because I'm trying to be
as non-disruptive as possible.

I guess a console / log output warning about the old code running might
be a good transitional strategy.

Cheers -Terry

Edward K. Ream

unread,
May 15, 2014, 4:11:40 PM5/15/14
to leo-editor
On Thu, May 15, 2014 at 2:59 PM, 'Terry Brown' via leo-editor
<leo-e...@googlegroups.com> wrote:

> Thanks for the feedback. *If* you want to fiddle with it, you could ...[snip]

Funny, getting excited about campaign reform has freed up *more*
energy for other things. I'll play with your suggestions and report
the results.

Edward

Edward K. Ream

unread,
May 15, 2014, 5:19:02 PM5/15/14
to leo-editor
On Thu, May 15, 2014 at 2:59 PM, 'Terry Brown' via leo-editor
<leo-e...@googlegroups.com> wrote:

> you could
> delete / set to False any `@bool use_focus_border` you have in your
> local settings, and copy
>
> .../leo/config/leoSettings.leo#@settings-->Qt Gui
> (appearance)-->active frame border styles
>
> to you local settings and edit the values there to your blue / thicker
> border.

That works for me.

Edward

duf...@gmail.com

unread,
May 16, 2014, 5:10:14 AM5/16/14
to leo-e...@googlegroups.com
Thanks indeed, Terry, for picking up and fulfilling my request so soon!

Could you please provide some basic step-by-step instructions on how to apply these changes?

Thanks again

Terry Brown

unread,
May 16, 2014, 9:52:15 AM5/16/14
to leo-e...@googlegroups.com
So to get the new code you just need to be running the latest version
from:

http://leoeditor.com/download.html

option 2. (when Edward next updates the documentation the information
will all be on that page, currently it's still popping out to the old
page, http://www.greygreen.org/leo/http://www.greygreen.org/leo/
but that page has the current info., so that's ok.

Then

Settings -> Open Personal Settings



Under the @settings node, create a node `@data qt-gui-user-style-sheet`

In that, put something like:

/* focused pane border highlight */
QTextEdit#log-widget, LeoQTreeWidget#treeWidget, QTextEdit#richTextEdit {
background: blue;
}
QTextEdit:focus#log-widget, LeoQTreeWidget:focus#treeWidget, QTextEdit:focus#richTextEdit {
background: red;
}

Also, to be sure the old red-border code's not running, create a node
under @settings, `@bool use_focus_border = False`

I think you mentioned changing the background color, as shown above,
but if you want to change the border, you can

Settings -> Open Global Settings

find the node there, `active frame border styles` and copy it and its
children under your @settings node in your personal settings, and edit
the values in the children as needed, they're:

@string focused-border-style = solid
@string focused-border-width = 1px
@string focused-border-focus-color = red
@string focused-border-unfocus-color = white

Two notes:

- long term this should just be a matter of going to the menu item
`Settings -> Appearance -> Active pane` or something, but we're not
there yet.

- if you want the full flexibility of and appearance tweaks Qt allows,
you're always going to have to deal with some complexity, knowing
the style-sheet syntax, essentially.

http://qt-project.org/doc/qt-4.8/stylesheet-reference.html

Cheers -Terry

dufriz

unread,
May 16, 2014, 10:31:58 AM5/16/14
to leo-e...@googlegroups.com
Thanks again, Terry! You are as useful as usual!!



--
You received this message because you are subscribed to a topic in the Google Groups "leo-editor" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/leo-editor/VQ6czgbMRkg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to leo-editor+...@googlegroups.com.
To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Edward K. Ream

unread,
May 19, 2014, 9:11:40 AM5/19/14
to leo-editor
On Fri, May 16, 2014 at 8:52 AM, 'Terry Brown' via leo-editor
<leo-e...@googlegroups.com> wrote:

> option 2. (when Edward next updates the documentation the information
> will all be on that page, currently it's still popping out to the old
> page, http://www.greygreen.org/leo/http://www.greygreen.org/leo/
> but that page has the current info., so that's ok.

I'm lost. What documentation am I supposed to be updating?

http://www.greygreen.org/leo/http://www.greygreen.org/leo/ just points
to http://codemostly.blogspot.com/ and I don't see anything related to
this topic there.

Edward

Terry Brown

unread,
May 19, 2014, 10:25:58 AM5/19/14
to leo-e...@googlegroups.com
On Mon, 19 May 2014 08:11:40 -0500
"Edward K. Ream" <edre...@gmail.com> wrote:

> On Fri, May 16, 2014 at 8:52 AM, 'Terry Brown' via leo-editor
> <leo-e...@googlegroups.com> wrote:
>
> > option 2. (when Edward next updates the documentation the
> > information will all be on that page, currently it's still popping
> > out to the old page,
> > http://www.greygreen.org/leo/http://www.greygreen.org/leo/ but that
> > page has the current info., so that's ok.
>
> I'm lost. What documentation am I supposed to be updating?

None, I updated the relevant docs. in .../leo/docs, they just won't
show up on the website until you next "push" the sphinx output there.
Nothing urgent so I figured I'd just let it happen next time you did
something else with the docs.

Cheers -Terry

Edward K. Ream

unread,
May 19, 2014, 11:20:54 AM5/19/14
to leo-editor
On Mon, May 19, 2014 at 9:25 AM, 'Terry Brown' via leo-editor
<leo-e...@googlegroups.com> wrote:
> On Mon, 19 May 2014 08:11:40 -0500
> "Edward K. Ream" <edre...@gmail.com> wrote:

>> I'm lost. What documentation am I supposed to be updating?
>
> None, I updated the relevant docs. in .../leo/docs, they just won't
> show up on the website until you next "push" the sphinx output there.
> Nothing urgent so I figured I'd just let it happen next time you did
> something else with the docs.

Just rebuilt LeoDocs.leo#Leo's Documentation-->Users Guide and upped them.

Is that what is needed?

Edward

Terry Brown

unread,
May 19, 2014, 1:01:49 PM5/19/14
to leo-e...@googlegroups.com
On Mon, 19 May 2014 10:20:54 -0500
"Edward K. Ream" <edre...@gmail.com> wrote:

> Just rebuilt LeoDocs.leo#Leo's Documentation-->Users Guide and upped
> them.

Ok, maybe something I don't know about the doc. build system, but I
expected

.../leo/doc/LeoDocs.leo#Leo's Documentation-->Installing & running
Leo-->@rst html/download.html

to show up at

leoeditor.com/download.html

Am I missing something?

Cheers -Terry

Edward K. Ream

unread,
May 19, 2014, 2:44:47 PM5/19/14
to leo-editor
Don't know. download.html seems to match @rst html/download.html in
my copy of LeoDocs.leo.

Edward
Reply all
Reply to author
Forward
0 new messages