code
code copied to clipboard
[GTK4 Prep] Update DocumentView to use Hdy.TabView
DocumentView widget has been rewritten to use the Hdy.TabView widget.
The majority of the work is done. There are a few more things that left to do but I haven't figured out how to do these yet (Any help would be very appreciated!):
- [x] Add "Open in a New Window" menu option to tab view in DocumentView.
- [x] Support opening drag and drop operations with tabs
- [x] Drag tab out of window to open tab in new window
- [x] Drag tab into window to move tab from one window to another
Part of #1157
I've addressed the additional feedback you had.
@jeremypw pinging because it has been a while
Requesting review from @danirabbit regarding what accels to use consistently for tab menu between Code, Files, Terminal and Web (if they need to be consistent).
Looks like Chrome and Edge are also using "Ctrl Shift K". Safari uses Super Shift K. So it makes sense for us to be in line with what appears to be a de facto standard here. We should probably add this shortcut to Files too
OK, I'll leave it as is here and modify Files and Terminal to match.
Just found another regression - dropping a file from Files onto the tabbar (empty space) no longer opens it in a new tab. @colinkiama Would you like to submit a new PR fixing that? If not I'll try to fix it some time.
I won't be working on this until next week. Feel free to fix this in the meantime.
@colinkiama I could not get dropping onto the empty tabbar space to work in my Terminal branch https://github.com/elementary/terminal/pull/760 - there was no obvious way to access a widget for that area. I could only implement dropping onto the add button and tab labels. In Code, dropping onto the add button already works. I can implement dropping onto tab labels easily enough.
Before converting to Hdy.TabView, Code did not support dropping onto the tab labels, I guess because it is not clear what should happen? Should the contents of the dropped file replace the contents of the document (destructive), should it be appended to the document, should the document be closed and a new one created from the dropped file, replacing the old document or should a new tab be created?
Gedit only implements drop on the add button anyway so maybe we can just leave this (unless someone can find a way implementing drop on empty space