Making tool tips on top tabs better
This commit is contained in:
parent
8e6b17d838
commit
889fcb756b
4 changed files with 22 additions and 4 deletions
|
|
@ -180,7 +180,12 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
markdownWidegt.Markdown = toolTipText;
|
||||
markdownWidegt.Width = 350;
|
||||
var maxLineWidth = markdownWidegt.Descendants<ParagraphX>().Max(i => i.MaxLineWidth);
|
||||
var maxLineWidth = 0.0;
|
||||
if (markdownWidegt.Descendants<ParagraphX>().Any())
|
||||
{
|
||||
maxLineWidth = markdownWidegt.Descendants<ParagraphX>().Max(i => i.MaxLineWidth);
|
||||
}
|
||||
|
||||
markdownWidegt.Width = maxLineWidth + 15;
|
||||
|
||||
return markdownWidegt;
|
||||
|
|
|
|||
|
|
@ -821,7 +821,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
var textWidget = partTab.Descendants<TextWidget>().First();
|
||||
var tabPill = partTab.Descendants<SimpleTab.TabPill>().First();
|
||||
partTab.ToolTipText = textWidget.Text;
|
||||
tabPill.HAnchor = HAnchor.Stretch;
|
||||
var closeBox = partTab.Descendants<ImageWidget>().FirstOrDefault();
|
||||
if (closeBox != null)
|
||||
|
|
@ -852,7 +851,20 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
}
|
||||
|
||||
partTab.MaximumSize = new Vector2(width, partTab.MaximumSize.Y);
|
||||
partTab.Width = partTab.Width - 1;
|
||||
partTab.Width -= 1;
|
||||
|
||||
// wait for this size change to take effect and update the tool tip
|
||||
partTab.BoundsChanged += (s, e) =>
|
||||
{
|
||||
if (partTab.Width < partTab.MaximumSize.X)
|
||||
{
|
||||
partTab.ToolTipText = textWidget.Text;
|
||||
}
|
||||
else
|
||||
{
|
||||
partTab.ToolTipText = "";
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
partTab.HAnchor = HAnchor.Stretch;
|
||||
|
|
|
|||
|
|
@ -525,6 +525,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
public class ToolTab : SimpleTab
|
||||
{
|
||||
public Color InactiveTabColor { get; set; }
|
||||
|
||||
public Color ActiveTabColor { get; set; }
|
||||
|
||||
public override Color BorderColor
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit eae4b60fa1bb1f507010102cd540e30c69b0f24d
|
||||
Subproject commit 3623ff4084d7c3b09e7b5bd0e5f0b2c5c7e408d9
|
||||
Loading…
Add table
Add a link
Reference in a new issue