Handles to Minimize Windows

102 views
Skip to first unread message

Chris George

unread,
May 6, 2016, 7:49:39 PM5/6/16
to leo-editor
I have a question. How hard would it be to add handles to click to minimize the log window and the tree?

Attached is an image with two yellow circles showing where a < (to maximize the editor) and a v (to minimize the log window) could be placed. I often work with just the two panes; tree and editor, but also find myself using a fully maximized editor window quite often as well.

Chris
Snap20a.png

Edward K. Ream

unread,
May 7, 2016, 6:10:18 AM5/7/16
to leo-editor
On Fri, May 6, 2016 at 6:49 PM, Chris George <techn...@gmail.com> wrote:
I have a question. How hard would it be to add handles to click to minimize the log window and the tree?

​I am not aware of any Qt features that would make this easy.

However, it may be possible to switch quickly between layouts.  Terry, any suggestions?

Edward

Terry Brown

unread,
May 7, 2016, 9:46:58 AM5/7/16
to leo-e...@googlegroups.com
Depends if you want a key binding or a mouse action. If a key binding
would do, I think there are existing commands that would work, if not
wouldn't be hard to make them.

If you want something mouse driven, we'd have to check to see if Qt
fires an event for a click on the splitters, essentially a zero
distance drag, but it may not.

So you are looking for something mouse based Chris?

Cheers -Terry

Terry Brown

unread,
May 7, 2016, 9:56:35 AM5/7/16
to leo-e...@googlegroups.com
Checking I see splitter handles are full fledged QWidgets, so we can
definitely catch mouse events on them.

So the logic would be something like "if there's a single left click
without movement on a splitter between the tree and the body,
(un)maximize the body. Likewise between tree and log.

Cheers -Terry

Chris George

unread,
May 7, 2016, 8:50:15 PM5/7/16
to leo-editor
The intent was for a single click.

There are many examples of other applications that handle it this way, but none of them appear to be QT based. Kate uses tabs.

A command on a hotkey would probably work well.

Chris 

Terry Brown

unread,
May 10, 2016, 2:11:32 PM5/10/16
to leo-e...@googlegroups.com
On Sat, 7 May 2016 17:50:15 -0700 (PDT)
Chris George <techn...@gmail.com> wrote:

> The intent was for a single click.

Pushed a reasonable chunk of code for this. Added a "splitterClicked"
signal to NestedSplitter, and used this in free_layout.py to zoom the
body/tree if you middle-click on a splitter handle adjacent to the
body/tree.

Difficult to add an indicator for this, the free_layout code checks the
handle to see if it's body/tree adjacent when it's clicked. You'd have
to make a separate pass through the handles to tag the adjacent ones
for styling / decorating, but then pane arrangement could make them no
longer adjacent, and therefor misleading.

So currently there's no visual queue for it. Also it's on by default.
Middle clicking a handle and having some panes disappear might be
confusing for newbies. Also the handle has to be solely adjacent to
the body/tree, not overlapping those and other panes.
OTOH it seems very natural in use.

Let me know what you think.

Cheers -Terry

> There are many examples of other applications that handle it this
> way, but none of them appear to be QT based. Kate uses tabs.
>
> A command on a hotkey would probably work well.
>
> Chris
>
> On Saturday, May 7, 2016 at 6:56:35 AM UTC-7, Terry Brown wrote:
> >
> > On Sat, 7 May 2016 08:46:54 -0500
> > Terry Brown <terry_...@yahoo.com <javascript:>> wrote:
> >
> > > On Sat, 7 May 2016 05:10:17 -0500
> > > "Edward K. Ream" <edre...@gmail.com <javascript:>> wrote:
> > >
> > > > On Fri, May 6, 2016 at 6:49 PM, Chris George
> > > > <techn...@gmail.com
> > <javascript:>>

Terry Brown

unread,
May 10, 2016, 2:12:43 PM5/10/16
to leo-e...@googlegroups.com
On Tue, 10 May 2016 13:11:29 -0500
"'Terry Brown' via leo-editor" <leo-e...@googlegroups.com> wrote:

> for styling / decorating, but then pane arrangement could make them no
> longer adjacent, and therefor misleading.

pane re-arrangement I meant

Chris George

unread,
May 10, 2016, 2:43:40 PM5/10/16
to leo-editor
That is brilliant. It is very intuitive, quick, and the simplest thng that could possibly work. :-)

Thanks, I will use it in every situation I can think of and let you know if I find anything unusual along the way.

Chris

Chris George

unread,
May 18, 2016, 9:13:18 PM5/18/16
to leo-editor
Hi Terry,

It works great, but only with the first .leo file opened. For example, I have a default file that opens every time I start Leo with my organizing info in it. A middle click on either splitter handle.

But if I then open a settings file or a different .leo file, it doesn't work. If I close the first file, it still won't work in any of the open files.

Chris

Terry Brown

unread,
May 18, 2016, 10:43:01 PM5/18/16
to leo-e...@googlegroups.com
On Wed, 18 May 2016 18:13:18 -0700 (PDT)
Chris George <techn...@gmail.com> wrote:

> Hi Terry,
>
> It works great, but only with the first .leo file opened. For
> example, I have a default file that opens every time I start Leo with
> my organizing info in it. A middle click on either splitter handle.
>
> But if I then open a settings file or a different .leo file, it
> doesn't work. If I close the first file, it still won't work in any
> of the open files.

"Interesting." I've made a note to take a look, might not be for a
while.

Cheers -Terry

> Chris
>
> On Tuesday, May 10, 2016 at 11:12:43 AM UTC-7, Terry Brown wrote:
> >
> > On Tue, 10 May 2016 13:11:29 -0500
> > "'Terry Brown' via leo-editor" <leo-e...@googlegroups.com

Chris George

unread,
May 18, 2016, 11:29:07 PM5/18/16
to leo-editor
Just to be clearer, it always works in the first opened file and never works in any other.

Chris

lewis

unread,
May 19, 2016, 8:17:58 AM5/19/16
to leo-editor
I'm also finding middle-click command behaviour to be inconsistent.
There seems to be some effect regarding the tab 'number', where middle-click only works on even numbered tabs. Try opening new tabs like this:
open 3rd tab - does not work
open 4th tab - works
open 5th tab - does not work
open 6th tab - works
open 7th tab - does not work
open 8th tab - works

And further :/ the middle-click works correctly in a tab that was 4th and is now 3rd. 

I can also get the effect to flip to 'odd' tabs.

Regards
Lewis

Terry Brown

unread,
May 19, 2016, 9:41:27 AM5/19/16
to leo-e...@googlegroups.com
On Thu, 19 May 2016 05:17:58 -0700 (PDT)
lewis <lewi...@operamail.com> wrote:

> I'm also finding middle-click command behaviour to be inconsistent.
> There seems to be some effect regarding the tab 'number', where
> middle-click only works on even numbered tabs. Try opening new tabs
> like this:
> open 3rd tab - does not work
> open 4th tab - works
> open 5th tab - does not work
> open 6th tab - works
> open 7th tab - does not work
> open 8th tab - works

By tabs you mean panes, right? We're talking about the new feature
whereby middle clicking on the pane dividers or splitter handles to
give them their Qt name mini/maximises the body or tree pane *if* the
handle in question is solely adjacent to the body or tree, it doesn't
work if the handle's along the edge of multiple panes.

I will take a look as soon as I can, but have a bunch of travel stuff
going on currently.

Cheers -Terry

Chris George

unread,
May 19, 2016, 10:12:34 AM5/19/16
to leo-editor
Tabs are .leo files. The second file opened doesn't work, the third file opened does.

Chris

Terry Brown

unread,
May 19, 2016, 10:29:31 AM5/19/16
to leo-e...@googlegroups.com
On Thu, 19 May 2016 07:12:34 -0700 (PDT)
Chris George <techn...@gmail.com> wrote:

> Tabs are .leo files. The second file opened doesn't work, the third
> file opened does.

Ah, ok, stranger and stranger - I think it's something to do with the
way free_layout is initialized, although there may also be a design
flaw in the way the middle click event works, a list of listeners at
class level when they should be at "instance" level, complicated by an
"instance" of NestedSplitter really being a collection of instances,
but there's already a concept a 'root' instance, which will be where th
the list of listeners goes.

Cheers -Terry

Terry Brown

unread,
Jun 8, 2016, 4:36:12 PM6/8/16
to leo-e...@googlegroups.com
Hi - just pushed an attempt to resolve this, seems to work, would
appreciate confirmation from anyone who was seeing the issue.

Cheers -Terry

Chris George

unread,
Jun 8, 2016, 4:47:57 PM6/8/16
to leo-e...@googlegroups.com
This now works for me in each and every open file, all of the time.

Chris

--
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+...@googlegroups.com.
To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

lewis

unread,
Jun 8, 2016, 6:24:48 PM6/8/16
to leo-editor
Terry,

It's working for me in all open files. Great work.

Thanks
Lewis

Edward K. Ream

unread,
Jun 9, 2016, 10:02:18 AM6/9/16
to leo-editor
On Wed, Jun 8, 2016 at 3:36 PM, 'Terry Brown' via leo-editor <leo-e...@googlegroups.com> wrote:
Hi - just pushed an attempt to resolve this, seems to work, would
appreciate confirmation from anyone who was seeing the issue.

Many thanks, Terry, for this good work.

Edward

Kent Tenney

unread,
Jun 9, 2016, 1:16:19 PM6/9/16
to leo-editor
Really nice!, now Leo offers the simple, clean, kind of
interface the cool kids like!

:-\

WOW, even works after add-editor! 1/2 screen per node!
Thanks!!!


I was able to break it after multiple editors in multiple tabbed Leo files,
one of them ended up unable to retrieve the tree and log panes.
A diff showed

-<globals body_outline_ratio="0.38" body_secondary_ratio="0.50">
+<globals body_outline_ratio="0.00" body_secondary_ratio="0.50">

changing body_outline_ratio to any value other than "0.00" ("0.01")
fixed it.
Reply all
Reply to author
Forward
0 new messages