hiding statusbar on Leo startup

37 views
Skip to first unread message

jamo...@gmail.com

unread,
Nov 2, 2023, 1:13:20 PM11/2/23
to leo-editor
Hi all,

Getting back into using Leo a bit after a few years away,
I was wondering what the best way is to have Leo start without showing the statusbar, minibuffer, and iconbar. In the past I wasn't able to find a way to do this, and so I set up a command node with a keyboard shortcut that I could manually run once when I started leo, which worked fine.
The contents were
c.k.simulateCommand("gui-statusbar-toggle")
c.k.simulateCommand("gui-minibuffer-toggle")
c.k.simulateCommand("gui-iconbar-toggle")
 
This didn't work in modern Leo, when I run the command it doesn't work. I tried c.executeMinibufferCommand instead and now  see the error 'no command function for 'gui-statusbar-toggle' in the log, so there must be something else I'm missing.
Thanks in advance for any tips!

-Ben

Edward K. Ream

unread,
Nov 2, 2023, 1:18:04 PM11/2/23
to leo-e...@googlegroups.com
On Thu, Nov 2, 2023 at 12:13 PM jamo...@gmail.com <jamo...@gmail.com> wrote:

Getting back into using Leo a bit after a few years away,
I was wondering what the best way is to have Leo start without showing the statusbar, minibuffer, and iconbar.

If you never want to see these areas you could create a theme that hides them via css.

Otherwise, commands to toggle the visibility of various areas would have limited value.

Edward

Edward K. Ream

unread,
Nov 2, 2023, 2:00:46 PM11/2/23
to leo-editor
Ben wrote:

> I was wondering what the best way is to have Leo start without showing the statusbar, minibuffer, and iconbar.

Looking at the dw.construct method I see that it's (mostly) easy to toggle various of the screen in Leo's Qt gui. Here is tested code:

dw = c.frame.top  # The DynamicWindow class

Icon bar

w = dw.iconBar  # A PyQt6.QtWidgets.QToolBar object
w.hide()  # Hides the icon bar. w.show() shows the icon bar.

Status bar

w = dw.statusBar  #  A PyQt6.QtWidgets.QStatusBar object
w.hide()  # Hides the status bar. w.show() shows the status bar.

Minibuffer

Hiding the minibuffer takes a bit more work. The dw.createMiniBuffer method creates a QFrame whose name is minibufferFrame.

Heh. At the end of dw.createMiniBuffer are two commented-out lines:

# self.leo_minibuffer_frame = frame
# self.leo_minibuffer_layout = layout

I have no idea why I restricted the visibility of these widgets! The following works after defining the leo_minibuffer_frame ivar:

w = dw.leo_minibuffer_frame  # A PyQt6.QtWidgets.QFrame
w.show()  # Hides the minibuffer. w.show() shows the minibuffer

Summary

Interesting question.  A new PR will define the leo_minibuffer_frame ivar and various show/hide/toggle commands.

Edward

Edward K. Ream

unread,
Nov 2, 2023, 2:36:23 PM11/2/23
to leo-editor
On Thursday, November 2, 2023 at 1:00:46 PM UTC-5 Edward K. Ream wrote:

> A new PR will define the leo_minibuffer_frame ivar and various show/hide/toggle commands.

Done.  See PR #3630. All comments welcome.

Edward

jamo...@gmail.com

unread,
Nov 3, 2023, 8:40:49 PM11/3/23
to leo-editor
Thank you!
Updated the command and it's working well. Will grab the PR changes tomorrow.
Now I can press a keyboard shortcut to toggle between a "clean view" mode and a mode that restores the other interface parts, which is just what I want.

-Ben

Edward K. Ream

unread,
Nov 4, 2023, 5:12:44 AM11/4/23
to leo-e...@googlegroups.com
On Fri, Nov 3, 2023 at 7:40 PM jamo...@gmail.com <jamo...@gmail.com> wrote:

> A new PR will define the leo_minibuffer_frame ivar and various show/hide/toggle commands.

Done.  See PR #3630. All comments welcome.

Thank you!
Updated the command and it's working well. Will grab the PR changes tomorrow.
Now I can press a keyboard shortcut to toggle between a "clean view" mode and a mode that restores the other interface parts, which is just what I want.

You're welcome.

Edward
Reply all
Reply to author
Forward
0 new messages