code icon indicating copy to clipboard operation
code copied to clipboard

[GTK4 Prep] Update DocumentView to use Hdy.TabView

Open colinkiama opened this issue 1 year ago • 1 comments

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

colinkiama avatar Feb 29 '24 03:02 colinkiama

I've addressed the additional feedback you had.

colinkiama avatar Mar 29 '24 17:03 colinkiama

@jeremypw pinging because it has been a while

colinkiama avatar May 17 '24 13:05 colinkiama

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).

jeremypw avatar Jun 15 '24 15:06 jeremypw

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

danirabbit avatar Jun 15 '24 15:06 danirabbit

OK, I'll leave it as is here and modify Files and Terminal to match.

jeremypw avatar Jun 15 '24 17:06 jeremypw

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.

jeremypw avatar Jun 19 '24 19:06 jeremypw

I won't be working on this until next week. Feel free to fix this in the meantime.

colinkiama avatar Jun 19 '24 21:06 colinkiama

@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.

jeremypw avatar Jun 20 '24 16:06 jeremypw

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?

jeremypw avatar Jun 20 '24 16:06 jeremypw

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

jeremypw avatar Jun 20 '24 16:06 jeremypw