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 simplified ribbon #924

Merged
merged 45 commits into from
Aug 29, 2021

Conversation

nishy2000
Copy link
Contributor

@nishy2000 nishy2000 commented Apr 29, 2021

I am proceeding with implementation based on PR #707 for issue #695.
This implement resolves #695 (a part of full feature)

Note: In the showcase program, the Simplified Ribbon can be found under Tests --> Windows --> "Open Simplified Ribbon-Window"

First of all, I am currently implementing the following items.

  • Add CanUseSimplified property in the ribbon control. This property is to control adding GUI for switching between classic and simplified ribbons.
  • Add IsSimplified property to the Ribbon control
  • Add a read-only IsSimplified property for switching styles to controls that support simplified mode
  • Add a MediumIcon property to controls that support simplified mode
  • Add ControlTemplate for simplified mode to controls that support simplified mode
  • Add a SimplifiedSizeDefinition property to controls that support simplified mode as the SizeDefinition property for Simplified mode.
  • Add a SimplifiedStateDefinition property to RibbonGroupBox control as the StateDefinition property for Simplified mode. The default value of StateDefinition is "Large,Middle,Small,Collapased", but the default value of SimplifiedStateDefinition is "Large,Middle,Collapased".

Overflow button is not supported in this PR. I will create another PR to support the overflow button.

The basic idea on Simplified mode is that the child controls of the RibbonGroupBox show the elements as follows:

  • If RibbonControl.Size is Large, show MediumIcon (24x24) and Header
  • If RibbonControl.Size is Middle, show MediumIcon (24x24)
  • if RibbonControl.Size is Small, show Icon (16x16)

Splitwirez and others added 26 commits March 3, 2019 16:57
- Add a read-only IsSimplified property to child controls of the ribbon control
- Propagate the IsSimplified value of the ribbon control to the child controls
- Add control template for simplified mode to child controls of the RibbonGroupBox control
- add SimplifiedSizeDefinition property for simplified mode to child controls of the RibbonGroupBox control
- change the retrieving method of RibbonGroupBox's child controls from Items to ItemContainerGenerator
- refactor some controls (RibbonProperties/Ribbon/RibbonTabItem/DropDwonButton/SplitButton)
- fix the visual size of the ribbon controls might be incorrect when switching between ribbon tabs
Display the items in the pop-up panel vertically when RibbonGroupBox is in the collapsed state
- reflect IsSimplified property to chiled controls in RibbontoolBar control
- reflect IsSimplified property to chiled controls in RibbonGroupBox control
- The default value of StateDefinition is "Large,Middle,Small,Collapsed", but the default value of SimplifiedStateDefinition is "Large,Middle,Collapsed"
@nishy2000 nishy2000 marked this pull request as ready for review May 11, 2021 13:58
@batzen
Copy link
Member

batzen commented May 15, 2021

@nishy2000 I added a new IconPresenter control.
Maybe that makes your work easier. ;-)

@batzen batzen mentioned this pull request Jun 30, 2021
@batzen
Copy link
Member

batzen commented Jul 7, 2021

@nishy2000 Are you still working on this or should i start reviewing your changes?

@nishy2000
Copy link
Contributor Author

@batzen
I thought I was done with the implementation.
However, today I realized that there is an omission in the implementation: I didn't add the GUI for switching between the classic ribbon and the simplified ribbon. I think the switching GUI is a must-have feature. Can you please wait a bit?

@batzen
Copy link
Member

batzen commented Jul 11, 2021

@nishy2000 Of course. Didn't want to pressure you. Take your time and just ping me if you are ready.

@Splitwirez
Copy link
Contributor

Splitwirez commented Jul 11, 2021

@batzen
I thought I was done with the implementation.
However, today I realized that there is an omission in the implementation: I didn't add the GUI for switching between the classic ribbon and the simplified ribbon. I think the switching GUI is a must-have feature. Can you please wait a bit?

@nishy2000 It might be, but...I'd recommend thinking twice before assuming that both GUIs are adequately-suited to every use-case.

@nishy2000
Copy link
Contributor Author

@nishy2000 It might be, but...I'd recommend thinking twice before assuming that both GUIs are adequately-suited to every use-case.

@Splitwirez
That's right. I'm thinking of the following.
Add a new property to the ribbon control to enable the new switching UI(context menu and switching button). If the new property of the ribbon control is not set in XAML, the behavior will be the same as before.

@nishy2000
Copy link
Contributor Author

@batzen
I have finished. Please start review.

@batzen
Copy link
Member

batzen commented Jul 12, 2021

@nishy2000 Will try to have a look during the weekend.

@batzen
Copy link
Member

batzen commented Jul 19, 2021

@nishy2000 I started my review during the weekend but didn't have time to finish it. Will try to get it done during the week. Sorry for the delay.

@batzen
Copy link
Member

batzen commented Aug 6, 2021

Sorry again for the delay.
Most of the changes look good to me.

There are a couple of things i don't really like.
One part is the "iconImageBorder" you introduced in some controls.
I don't think we need that and if people want a border when not providing an icon they could provide the border as an icon.

The other part are the separate templates.
In don't really get why we need separate templates for every control.
The ComboBox templates, for example, don't really differ in content and just add more maintenance cost (and risk for bugs).
I guess the reason for you to create a separate template, in case of the ComboBox, was to get the mouse over border showing, but that's not what happens in the simplified ribbon in Word Online (which is the only Word version that i could find that has a simplified ribbon).

Which were the reasons to create separate templates for all the other controls?
Most things should be solvable through attached properties.

And thanks for all your great work and your patience.
I currently struggle to find motivation to work on OSS, that's the reason for the long delays.

… differences in ComboBox template definitions.
@nishy2000
Copy link
Contributor Author

@batzen
Thanks for your review.

About iconImageBorder:
I will look into your suggestion about IconBorder (border as icon).

About separate templates:
If we talk only about ComboBox, I added Border not for mouseover handling, but for Padding handling.
To make it easier to compare the differences in the ComboBox templates, I added the commit 58f65f9 that matches the order of the properties. Please check it.

Overall I separated the templates for a several reasons.

  • Compatibility with existing behaviors
  • Avoidance of merge conflicts
  • Increasing complexity of triggers

The first is to avoid affecting the existing behavior (classic ribbon). I wanted to avoid adding functionality to the Simple Ribbon that would affect the Classic Ribbon's functionality.

The second is to avoid conflicts. During the implementation of the Simple Ribbon, bug fixes and feature improvements to Fluent.Ribbon continued. If a single template is used to deal with the problem, it is difficult to understand the differences when merging, and conflicts are more likely to occur.

Third, the complexity of triggers is increasing. If we use a single template, IsSimplified will be added to the trigger condition, making it a multi-condition instead of a single condition. I thought this might be a complication.

However, if you think the above reason is not a big deal, I can integrate the template.

In fact, for example, I was concerned about the existence of duplicate code in the ComboBox template, since the definition of the Popup control is exactly the same. Therefore, I thought of a countermeasure. However, I couldn't even change the Popup definition to a style definition because it is referenced in Template.Triggers.
Do you have any good ideas on this point?

@batzen
Copy link
Member

batzen commented Aug 17, 2021

I have to admit that the triggers are really a mess already and sometimes way too complex.
But maintaining triggers is still easier than maintaining complete different templates.
I didn't compare all the templates, but in case of the ComboBox i don't think we need a separate template.

What do you think about this suggestion:
I will merge your changes, so you don't have to constantly merge changes from develop and resolve conflicts.
That way people also get the chance to test the simplified ribbon.
I will try to check all templates and remove separated ones where we don't need them because the differences are so small.
Some things might be solvable by introducing new attached properties. Maybe it's really easier to have separated templates in some places, i am still not sure about that.

And i should introduce something like XAML-Styler to have all XAML formatted in the same way. That way comparing everything should get a lot easier. That should be the first thing for me to do after your PR is merged.

@nishy2000 Just tell me when i can merge. And sorry again for the long delay.

@nishy2000
Copy link
Contributor Author

@batzen
I have finished all. Please merge PR. I'm looking forward to it.

@batzen
Copy link
Member

batzen commented Aug 28, 2021

I will resolve the conflicts tomorrow and merge.

@batzen batzen merged commit 78e9c8b into fluentribbon:develop Aug 29, 2021
batzen added a commit that referenced this pull request Sep 28, 2021
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.

[Feature] Simplified Ribbon
3 participants