-
Notifications
You must be signed in to change notification settings - Fork 260
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
Make tabs detachable + minor bugfix #494
Conversation
LOL, yep. There's a reason https://lazka.github.io/pgi-docs/ is one of my most-used bookmarks :) Thanks, I'm curious to see how this is going. I'll likely pull it down and play with it tomorrow morning. |
One bug found:
I ran terminator without Strange stuff. Only happens when you detach a tab from a notebook that contains 3 or more tabs. It doesn't seem to have any effect, other than the error message. Probably I am missing a function call or something. |
Yep, Edit - there is still this:
To reproduce:
|
This looks good so far, though I agree definitely not ready for prime time yet. |
Updates That strange log error is not caused by the detached tabs. I could reproduce it by simply having 3 tabs and then closing the Terminator window (using the GUI "X"). I've written a dbg message for the new function and done some testing. I think the PR could be ready. |
So, I was playing with this last night, and this error, I believe is caused by (of all things) terminator/terminatorlib/notebook.py Line 295 in b20d11e
Which means that clicking anywhere on the label of the tab (basically anywhere in the tab), it can consider that calling closetab. I'd really like to make it so that you have to click on the X button to close the tab. |
Wait, if you click the notebook label, the tab closes? I do have to click the X in the tab label to close it. Btw I think I found something related. for terminal in self.get_visible_terminals():
terminal.close() If I remove them, I see one more error message ( Writing this after 10 minutes. for terminal in self.get_terminals():
terminal.close() I'm including this commit in the PR. |
Is this ready to go? |
Yep, I think it is. |
Cool, I'll pull it down again and give it a quick once-over before merging it. |
This looks great. Thanks again! |
Fixes #302
Note - This pull request is to show the progress. I have done very little testing, so I don't recommend pulling it right now.
About
As said in the issue comments,
set_tab_detachable
does the job. The code found on StackOverflow gave me a guideline, but much of that stuff is already implemented somewhere in Terminator. So I had to create only one function,create_window_detach
.About
self.hoover
: without calling that function, if a tab is detached and a notebook only has 2 tabs, the resulting notebook only has 1 tab, causing some troubles.Most of the work was about reading the documentation.
I'll finish testing soon, and maybe fix that Drag-and-drop problem that we were talking about in the comments, since it's related.