-
Notifications
You must be signed in to change notification settings - Fork 1k
Preview tabs #3860
base: main
Are you sure you want to change the base?
Preview tabs #3860
Conversation
main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
Outdated
Show resolved
Hide resolved
main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
Outdated
Show resolved
Hide resolved
main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
Outdated
Show resolved
Hide resolved
main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebookContainer.cs
Outdated
Show resolved
Hide resolved
main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs
Outdated
Show resolved
Hide resolved
main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
Outdated
Show resolved
Hide resolved
main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
Show resolved
Hide resolved
main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
Outdated
Show resolved
Hide resolved
main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
Outdated
Show resolved
Hide resolved
main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
Outdated
Show resolved
Hide resolved
main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs
Outdated
Show resolved
Hide resolved
main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs
Outdated
Show resolved
Hide resolved
main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs
Outdated
Show resolved
Hide resolved
main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs
Outdated
Show resolved
Hide resolved
main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs
Outdated
Show resolved
Hide resolved
main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
Outdated
Show resolved
Hide resolved
main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebookTab.cs
Outdated
Show resolved
Hide resolved
main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs
Outdated
Show resolved
Hide resolved
main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs
Outdated
Show resolved
Hide resolved
@@ -146,6 +146,7 @@ public virtual Task LoadNew (System.IO.Stream content, string mimeType) | |||
|
|||
#endregion | |||
|
|||
public virtual bool IsPreviewTab => false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or better WorkspaceWindow.
There was a problem hiding this 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.
main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
Outdated
Show resolved
Hide resolved
main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs
Outdated
Show resolved
Hide resolved
main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
Outdated
Show resolved
Hide resolved
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. |
It looks good to go, once the last couple of issues are fixed. |
Rebased on top of master |
I don't understand the last commit. How I can convert a normal tab to Preview and vice-versa? |
@netonjm this needs rebase from master |
@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
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)? |
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.
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: