Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmytro Ovcharov <dmytro.ovcharov@globallogic.com>2017-12-18 16:18:08 +0300
committerDmytro Ovcharov <dmytro.ovcharov@globallogic.com>2017-12-18 16:18:08 +0300
commit2ac0ca80cff1f6c9fb3b4c71d342cbc720f223c8 (patch)
treee07dcd2123bb475081a5538e2e0266f1831402b3 /main/src/addins/MonoDevelop.UnitTesting
parentebcba0f1341f228cdd305b19a46710b45e4a3c1e (diff)
Implemented ellipsize of a long text in the unit tests context menu
Diffstat (limited to 'main/src/addins/MonoDevelop.UnitTesting')
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/AbstractUnitTestEditorExtension.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/AbstractUnitTestEditorExtension.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/AbstractUnitTestEditorExtension.cs
index ee58887fcd..cfda1ddba1 100644
--- a/main/src/addins/MonoDevelop.UnitTesting/Services/AbstractUnitTestEditorExtension.cs
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/AbstractUnitTestEditorExtension.cs
@@ -253,6 +253,15 @@ namespace MonoDevelop.UnitTesting
menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier + id, project, true).Select;
submenu.Add (menuItem);
+ const int maxLabelLength = 80;
+ if (label.Length > maxLabelLength) {
+ const string gap = "...";
+ int remainsLength = (maxLabelLength - gap.Length) / 2;
+ string start = label.Substring (0, remainsLength);
+ string end = label.Substring (label.Length - remainsLength, remainsLength);
+ label = $"{start}{gap}{end}";
+ }
+
var subMenuItem = new ContextMenuItem (label);
// if (!string.IsNullOrEmpty (tooltip))
// subMenuItem.TooltipText = tooltip;