Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added toggle sidebar feature #134

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

dan-ess
Copy link

@dan-ess dan-ess commented Feb 14, 2015

I wanted to add support to copy pudb console output to the clipboard. Unfortunately, python libraries such as tkinter or pyclipboard rely on external modules to provide clipboard support, which makes this feature difficult to provide reliably.

As I work around, I have added support to toggle the sidebar using ctrl ^. When the sidebar is not visible you can select multiple lines of text in the console without selecting text from the sidebar.

@inducer
Copy link
Owner

inducer commented Feb 14, 2015

Could you add that shortcut to the help screen?

@dan-ess
Copy link
Author

dan-ess commented Feb 14, 2015

Sure! Is that ok?

@inducer
Copy link
Owner

inducer commented Feb 14, 2015

Now that I've actually tried the patch, I'm actually not completely happy with it. The problem I see is that even in the disabled state, the sidebar can still accept focus, which is confusing. In addition, a small gray bar is still shown on the right.

@dan-ess
Copy link
Author

dan-ess commented Feb 15, 2015

Good points. I updated the PR to unfocus the sidebar and hide the column separator (dividechars = 0) when the side bar is turned off. What do you think?

@inducer
Copy link
Owner

inducer commented Feb 15, 2015

Not entirely happy--I can still get the focus onto the sidebar, at which point my key events appear to go nowhere... @asmeurer, what do you think?

@asmeurer
Copy link
Collaborator

I agree we should not allow the keyboard to get to the sidebar if it's hidden. Can you disable key bindings temporarily?

@dan-ess
Copy link
Author

dan-ess commented Feb 16, 2015

Hi guys, thanks for the feedback!

I know this is not what was suggested, but what about just making the sidebar visible first if someone tries to focus a sidebar element while the sidebar is not visible? Seems like reasonable UI behaviour.

@inducer
Copy link
Owner

inducer commented Feb 16, 2015

You don't get notified when the sidebar gets the focus (IIRC), so you'd have to poll (in the event loop or so). Not sure I'm a fan.

@dan-ess
Copy link
Author

dan-ess commented Feb 16, 2015

Sidebar focus is set by RHColumnFocuser when one of 'V', 'S', or 'B' is pressed. RHColumnFocuser receives notification of the key press event from SignalWrap.

I just added code inside RHColumnFocuser before it sets focus to the sidebar, to ensure the sidebar is visible first (no polling for focus on the sidebar required). Does this seem reasonable?

@inducer
Copy link
Owner

inducer commented Feb 16, 2015

No, because Urwid also messes with the Focus behind our backs. Pressing "Cursor Right" will also get the sidebar focused.

@dan-ess
Copy link
Author

dan-ess commented Feb 17, 2015

Aha! Thanks for the clarification, I figured I was missing something. I'll have a think about this.

Base automatically changed from master to main March 8, 2021 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants