Skip to content

Commit

Permalink
RibbonTools: TextPosition Bottom in GalleryControls wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
harborsiem committed Sep 30, 2021
1 parent c281470 commit 15f9cee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).

#### Changed (RibbonTools)

- Bugfix: GalleryControls in AppMenuGroup and in other Groups
- Bugfixes: GalleryControls in AppMenuGroup and in other Groups
- Default TextPosition in GalleryControls
### Ribbon V2.11.0, RibbonTools V1.3.5

#### Changed (Ribbon)
Expand Down
12 changes: 6 additions & 6 deletions RibbonTools/Misc/XMarkupClasses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2976,7 +2976,7 @@ protected TRibbonGallery(TRibbonDocument owner, TRibbonCommandRefObject parent)
_hasLargeItems = true;
_itemHeight = -1;
_itemWidth = -1;
_textPosition = RibbonTextPosition.Bottom;
_textPosition = RibbonTextPosition.Right;
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
Expand All @@ -2997,16 +2997,16 @@ protected TRibbonGallery(TRibbonDocument owner, XElement E, TRibbonCommandRefObj
_itemWidth = AttributeAsInt32OrDefault(E, AN_ITEM_WIDTH, -1);

s = E.Attribute(AN_TEXT_POSITION)?.Value;
if ((string.IsNullOrEmpty(s)) || (s == ES_BOTTOM))
_textPosition = RibbonTextPosition.Bottom;
if ((string.IsNullOrEmpty(s)) || (s == ES_RIGHT))
_textPosition = RibbonTextPosition.Right;
else if (s == ES_HIDE)
_textPosition = RibbonTextPosition.Hide;
else if (s == ES_LEFT)
_textPosition = RibbonTextPosition.Left;
else if (s == ES_OVERLAP)
_textPosition = RibbonTextPosition.Overlap;
else if (s == ES_RIGHT)
_textPosition = RibbonTextPosition.Right;
else if (s == ES_BOTTOM)
_textPosition = RibbonTextPosition.Bottom;
else if (s == ES_TOP)
_textPosition = RibbonTextPosition.Top;
else
Expand Down Expand Up @@ -3047,7 +3047,7 @@ protected virtual void SaveAttributes(XmlWriter writer)
if (_itemWidth != -1)
writer.WriteAttributeString(AN_ITEM_WIDTH, XmlConvert.ToString(_itemWidth));

if (_textPosition != RibbonTextPosition.Bottom)
if (_textPosition != RibbonTextPosition.Right)
writer.WriteAttributeString(AN_TEXT_POSITION, TEXT_POSITIONS[(int)_textPosition]);
}

Expand Down

0 comments on commit 15f9cee

Please sign in to comment.