summaryrefslogtreecommitdiff
path: root/Aktywator/MainForm.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Aktywator/MainForm.cs')
-rw-r--r--Aktywator/MainForm.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/Aktywator/MainForm.cs b/Aktywator/MainForm.cs
index 8e02320..68f9408 100644
--- a/Aktywator/MainForm.cs
+++ b/Aktywator/MainForm.cs
@@ -68,6 +68,8 @@ namespace Aktywator
bws.convert();
labelFilename.Text = filename;
+ this.shortenFilenameLabel();
+
this.fillSectionSelector(bws.getSections());
cbNamesSection.Items.Clear();
foreach (object i in cbSettingsSection.Items)
@@ -95,6 +97,19 @@ namespace Aktywator
this.WindowState = FormWindowState.Normal;
}
+ private void shortenFilenameLabel()
+ {
+ String originalLabel = (String)labelFilename.Text.Clone();
+ int firstBackslash = originalLabel.IndexOf('\\') + 1;
+ int lettersToCut = 5;
+ while (Graphics.FromHwnd(IntPtr.Zero).MeasureString(labelFilename.Text, labelFilename.Font).Width > 400)
+ {
+ lettersToCut++;
+ labelFilename.Text = originalLabel.Substring(0, firstBackslash) + "[...]"
+ + originalLabel.Substring(firstBackslash + lettersToCut);
+ }
+ }
+
private Tournament detectTeamyTournament()
{
try