Skip to content

Conversation

yaira2
Copy link
Member

@yaira2 yaira2 commented Nov 16, 2020

image
Part of #260.

@yaira2 yaira2 requested a review from gave92 November 16, 2020 22:47
@d2dyno1
Copy link
Member

d2dyno1 commented Nov 16, 2020

Looks good 👍

gave92
gave92 previously approved these changes Nov 16, 2020
Copy link
Member

@gave92 gave92 left a comment

Choose a reason for hiding this comment

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

This adds a new tab at the end of the tab row right?
Would be nice if it added the new tab right next to the clicked tab

@yaira2
Copy link
Member Author

yaira2 commented Nov 16, 2020

This adds a new tab at the end of the tab row right?
Would be nice if it added the new tab right next to the clicked tab

That would be a nice enhancement, do you have any ideas how we can find out which tab was right clicked on?

@gave92
Copy link
Member

gave92 commented Nov 17, 2020

@yaichenbaum The following should do the job

private async void NewTabMenuItem_Click(object sender, RoutedEventArgs e)
{
    var tabItem = ((FrameworkElement)sender).DataContext as TabItem;
    var index = MainPage.AppInstances.IndexOf(tabItem);
    await MainPage.AddNewTabByPathAsync(typeof(ModernShellPage), "NewTab".GetLocalized(), index + 1);
}

!EDIT!
This will easily trigger an (existing) bug that makes the app crash, to reproduce:

  1. right click on the first tab and select "add new tab"
  2. right click on the first tab and select "add new tab" (again)
  3. navigate to a folder
  4. crash with NullReferenceException in SetSelectedTabInfoAsync

Added the option to move a tab to new a window
@yaira2 yaira2 changed the title Added the option to open a new tab to the HorizontalMultitaskingControl right click context menu. Added a right click context menu to the HorizontalMultitaskingControl Nov 17, 2020
@yaira2 yaira2 requested a review from gave92 November 17, 2020 16:12
@gave92
Copy link
Member

gave92 commented Nov 17, 2020

New options work fine but I can still repro the bug described above with the "new tab" menu item

ezgif com-gif-maker

@yaira2
Copy link
Member Author

yaira2 commented Nov 17, 2020

This will easily trigger an (existing) bug that makes the app crash, to reproduce:

@gave92 I removed the part that inserts the tab next to the one that was right clicked. This should solve the issue while we continue to look for a better solution.

@yaira2 yaira2 changed the title Added a right click context menu to the HorizontalMultitaskingControl Added a right click context menu to the horizontal tab control Nov 17, 2020
@yaira2 yaira2 merged commit 559af78 into master Nov 17, 2020
@yaira2 yaira2 deleted the TabContextMenu branch November 27, 2020 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants