Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/Fluent TabControl #4133

Merged
merged 8 commits into from
Jun 18, 2020
Merged

Feature/Fluent TabControl #4133

merged 8 commits into from
Jun 18, 2020

Conversation

maxkatz6
Copy link
Member

What does the pull request do?

image
image
image
image

@maxkatz6
Copy link
Member Author

Since this style is based on UWP's Pivot, it brings some specific style details:

  1. Bigger header's font
  2. Content margin (you can see it here, pink padding on left and right: https://asp-net-example.blogspot.com/2016/11/uwp-simple-pivot-example.html)

Probably Margin should be removed, because it could be uncomfortable for developers to migrate to new style. @danwalmsley

Also:

  1. It seems TabControl can use TabStrip internally. And TabItem could inherit TabStripItem. Right now it duplicates 100% of style.
  2. I will remove unused resources, rename rest of "Pivot*" to "TabControl*" and add new Avalonia specific later.

@maxkatz6 maxkatz6 marked this pull request as ready for review June 17, 2020 21:18
@danwalmsley danwalmsley changed the title [WIP] Feature/Fluent TabControl Feature/Fluent TabControl Jun 17, 2020
Copy link
Member

@danwalmsley danwalmsley left a comment

Choose a reason for hiding this comment

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

Tested and LawesomeTM

@danwalmsley danwalmsley merged commit 7a4a95c into AvaloniaUI:master Jun 18, 2020
@maxkatz6 maxkatz6 deleted the feature/fluent-tabcontrol branch June 18, 2020 00:59
@robloo
Copy link
Contributor

robloo commented Jun 18, 2020

I'm a little confused by this control. As noted, it appears more like UWP's Pivot (and it using those style resources). Is this going to cause confusion down the road when a full TabView control is needed? There are a lot of features in a TabView not covered here.

Should this control be renamed?

@maxkatz6
Copy link
Member Author

@robloo
TabControl in Avalonia and WPF is not same as TabView in WinUI.
TabView is way more complex control, and while it should be possible to improve existed TabControl (by rewriting it from the scratch), I believe there should be some light-weight tabbed control. And just imho, it isn't same control, even though with similar name.

This control was named as "TabControl" in WPF, and is familiar for developers.
In same time Pivot looks and works in similar way, but is limited with Top view and has better touch experience.
This style from PR is based on Pivot, but also it is the common style of tabbed controls in Fluent design (see also NavigationView left and top modes).

But I agree. WinUI doesn't have such a problem - it have never had control named "TabControl" (there is Pivot and MasterDetailsView instead), so TabView is not conflicted with anything. Avalonia could have complex browser-like TabView in future.
So it is good point to decide now, if we should rename TabControl.

FYI @danwalmsley

@maxkatz6
Copy link
Member Author

In WinUI there are NavigationView and TabView, but Pivot still could be used as light-weight control and is easier to restyle. Also it supports swipe navigation (NavView and TabView don't).
I am not still sure, if Avalonia needs to rename TabControl to Pivot. In this case it should also migrate other features.

Right now there is TabControl with Fluent-like selected indicator. Not Pivot, not TabView.

@Gillibald
Copy link
Contributor

Implementing all TabView features on top of TabControl shouldn't be that hard. I don't think we should rename all controls to match WinUI's naming.

@robloo
Copy link
Contributor

robloo commented Jun 18, 2020

I guess my concern is there is a big conceptual difference between a Pivot and TabView in WinUI. There is a use case for both situations.

Pivot : Lightweight view that simply cycles through different views represented by a header
TabView : A full-featured tabbed interface. It's possible to close tabs, move tabs, tear tabs off into a new window, etc. This, like NavigationView, is one of the ways an app can layout the main user interface.

I think it's important to decide if TabControl will be one or the other. I certainly don't think it should be both -- I don't care so much about the name. However, if TabControl really will be more of a 'Pivot' style or classic WPF TabControl, then there is going to be a lot of confusion when/if TabView gets added.

@robloo
Copy link
Contributor

robloo commented Jun 18, 2020

Separately, with the left/right styles above. What happens with right-to-left vs left-to-right languages? The indicator should actually switch sides.

@Gillibald
Copy link
Contributor

Y it should but we currently don't have FlowDirection support

@danwalmsley
Copy link
Member

We could rename it, but only at the point that someone implements a real TabControl as people are already using this.

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.

4 participants