Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Preview tabs #3860

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Preview tabs #3860

wants to merge 1 commit into from

Conversation

netonjm
Copy link
Contributor

@netonjm netonjm commented Feb 15, 2018

Adds feature in our TabStrip to include a new container with a new type of Tabs, the Preview Tabs.
They are aligned to the right of the screen. In the moment there are one in our content a decorative purple line appears at the bottom of them.

image

This PR wants merge the current feature disabled in master. These tabs can only be enabled overriding IsPreview property in a ViewContent class and with this simple Patch:
https://gist.github.com/netonjm/2d0bc8ac73ff88097dac060ec7c5388f

The objective is check we don't have any regression with the normal behaviour of the tabs, because there are some important things changed related to indexing (now we have two containers).

Testing the feature:

  • Try use shorcuts number to change the tabs
  • Try navigate the history next/previous
  • Try test accessibility keys
  • Try drop tabs into new windows, split documents etc...
  • Try resize window and discover odd behaviours in sizes
  • ....

@netonjm netonjm requested a review from sevoku February 19, 2018 08:01
@netonjm netonjm requested a review from iainx March 15, 2018 16:43
mkrueger
mkrueger previously approved these changes Mar 15, 2018
@@ -146,6 +146,7 @@ public virtual Task LoadNew (System.IO.Stream content, string mimeType)

#endregion

public virtual bool IsPreviewTab => false;
Copy link
Contributor

@mkrueger mkrueger Mar 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or better WorkspaceWindow.

Copy link
Contributor

@mkrueger mkrueger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving I think lluis already requesting some changes.

@slluis
Copy link
Member

slluis commented May 10, 2018

The value for IsPreview should not be taken from ViewContent. It is a display property of the tab, so it should be assigned directly to the tab by Document. IsPreview should be a read/write property of DockNotebookTab.

@slluis
Copy link
Member

slluis commented May 10, 2018

It looks good to go, once the last couple of issues are fixed.

@netonjm
Copy link
Contributor Author

netonjm commented May 10, 2018

Rebased on top of master

@slluis
Copy link
Member

slluis commented May 30, 2018

I don't understand the last commit. How I can convert a normal tab to Preview and vice-versa?

@rodrmoya
Copy link
Contributor

@netonjm this needs rebase from master

@jsuarezruiz
Copy link
Contributor

@netonjm This branch needs rebase (there are several conflicts!).

Fixes VSTS 521448 - Add support for preview tabs

Changes tab function to use object instead index

Changes in methods to use different tab collection and added ChangeTabToPreview

Calculated tabs now works use the current Tabs in TabContainer

Defines the correct rectangle for each tab container to draw
This fixes glich in animation closing tabs

Generated 2 containers in DockNotebook with normal and preview tabs

Fixed removed necessary method to update tabWidth and redraw

Recoverred GetRenderOffSet

Recovers removed update tabWidth by mistake

Reverts changes in UpdatedTabWidth

GetRenderOffSet recovers calculates now the offset

AllTabs now returns yield items

Fixes animation when tab is clossing

minor name changes and remove unused code

Fixes wrong call to change tabwidth when hover detection

Fixes tab calculation on closing PreviewTab

Fixes image cut on preview tab when is not seleced

Fixes select last preview tab when there are no normal tabs available

Fixes NRE dropping preview tab into a new window

TabCount must include PreviewTabs in the count

Removes wrong equality in NotebookTab
What happens if we move a tab over other window?
In this case I thing it's better leave the normal behaviour in comparations

Fixes issue obtaining the ActiveWorkbenchWindow
This provokes lot of issues related tab menus

Changed to use object equality

Makes content property which defines if is preview tab

Minor fixes

Checks if there are tabs in history before select last active

Removes duplicated code
This checks are included in SelectLastActiveTab method

Fixes Accessibility tab selection with multiple collections of tabs

Fixes shorcuts key numbers to switch between preview tabs also

Changes the responsibility of set preview tab to DockNotebook

Don't select any tab if there are no items in collections

Changes TabsReorderedHandler to use DockNoteBookTab instead indexes

OnActivate we need take currentFocusedTab not the currentTab

Change AllTabs to Tabs

Some checks to catch currentFocusTab is null

Reuses current indexOf in InternalViewContentCollection

Fixes the calculation on the size of tab when resizing tabstrip
We can't calculate the current preview tab width if we don't know first what's the real size
of a tab.
Also now we calculate over the total number of tabs and not only the normal types.
Includes a fix in RenderOffset when the selected tab is a Preview to use the last offset
drawing normal tabs

Minor fixes (styling and spaces)

Only changes tab to preview if is not a preview tab

Changed to use Contains instead Exists method extension

Changes IsPreviewTab property to SdiWorkspaceWindow level not ViewContent

Removed ContentChanged handling to set PreviewTab handling
now is OpenDocument who manages this handling

Fixes change IsPreview property when tab is preview
@mhutch
Copy link
Contributor

mhutch commented Jul 30, 2019

We need a "keep open" button (and icon, and keyboard shortcut), and any preview tab that becomes dirty should be automatically converted into a normal tab.

We should also verify that the preview tab is not reopened after closing and reopening the solution.

There should also only ever be one preview tab. Adding a new preview tab should replace the existing one.

What's the overflow behavior (i.e. when the tab well has too many tabs)?

Base automatically changed from master to main March 9, 2021 14:17
@akoeplinger akoeplinger changed the base branch from main to master March 15, 2021 17:02
Base automatically changed from master to main March 15, 2021 17:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants