Buttons of equal length

Ribbon for WPF Forum

Posted 12 years ago by Kasper
Avatar

Hi guys,

When I have three ribbon buttons in medium size mode, stacked on top of each other within the same StackPanel, it would be really great if there was some sort of property that allowed me to force the buttons to have the same length, of course based on the longest of them. The reason for this is that when the first button has a shorter text than one of the others, I see my self moving my mouse to where I would expect the button to go to based on the button(s) below it and then not being able to click it, because it's not long enough. 

I might be able to solve this by setting a common width on all the buttons, but I fear that this might make the buttons look weird if the user has another font size than me? Also, if I decide to change the text on one of the buttons, I will have to find that perfect width for all of them again. 

Perhaps this breaks some sort of design rule for the Ribbon interface, or perhaps I'm the only one who is fooled each time I want to click a button of a lower length that the others in its group. Let me know what you think :)

Edit: Another approach might be to do an ActualWidth binding to the button I expect to have the biggest width, but then I would still have to make changes if I decide to change the text of the buttons. It could be a viable workaround if you don't wish to add this feature though :)

[Modified 12 years ago]

Comments (5)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Kasper,

Do you have images for those buttons?  If you always try to have your mouse hit the image instead of the text, you shouldn't really run into issues pressing the buttons.

I haven't seen that sort of layout in a ribbon before where it makes the buttons larger to fill the space when stacked vertically.  It might be ok with the ribbon spec, as I believe the ribbon spec just requires that text is left aligned.

The downside to this idea is that if you have some popup or split buttons that enter this scenario, their arrows will be way off on the right and potentially disassociated visually with the related image/text.  So in that regard, it might not be the best idea to do this and may be why Office doesn't do it.


Actipro Software Support

Posted 12 years ago by Kasper
Avatar

Hi,

>Do you have images for those buttons? If you always try to have your mouse hit the image instead of the text, you shouldn't really run into issues pressing the buttons.

Yes I do have images, but when the mouse is far to the right of the button, I think it's natural to aim for the right side of the button - at least that's how it seems to be, which led me to believe that some of my customers would be doing the same thing :)

>The downside to this idea is that if you have some popup or split buttons that enter this scenario, their arrows will be way off on the right and potentially disassociated visually with the related image/text. So in that regard, it might not be the best idea to do this and may be why Office doesn't do it.

In many cases, where the text length doesn't differ that much, I would actually prefer that the arrows were visually on top of each other! It would make them easier to hit and I think that it would look better if they were aligned. Of course, for buttons with very different lengths, it wouldn't look good at all, as you point out, but the then again, my suggestion was not for default behavior but for an option - it should definitely not be default behavior :)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Ok, if we add this sort of option on StackPanel, what should it be called?


Actipro Software Support

Posted 12 years ago by Kasper
Avatar

I really hate naming things, and I'm sure that you can come up with something better, but my thoughts go along the line of "JustifyButtons" / "JustifyControls" (boolean) or "ControlStretchMode" (enum, like None, StretchToEqualLength) or perhaps "ControlAlignment" (enum, like Left, Justify) or something like that :). Hope it can give you some sort of inspiration for a better name :P

Answer - Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Ok, I think we'll try to add a HorizontalContentAlignment property for 2012.1.


Actipro Software Support

The latest build of this product (v24.1.2) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.