summaryrefslogtreecommitdiff
path: root/Aktywator
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-11-18 18:02:05 +0100
committeremkael <emkael@tlen.pl>2017-11-18 18:02:05 +0100
commitc11772fd05c82af11645bff5059ce70545e86e0c (patch)
treeaa33ae7a87d7a8eb028c2ec42d6e618fc989331a /Aktywator
parent0f90cab947e23f36fdd6f15c877c99a76fe16165 (diff)
Shortening filename if it wouldn't fit the toolstrip label.
Fixes #23.
Diffstat (limited to 'Aktywator')
-rw-r--r--Aktywator/MainForm.cs15
-rw-r--r--Aktywator/MainForm.resx101
2 files changed, 65 insertions, 51 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
diff --git a/Aktywator/MainForm.resx b/Aktywator/MainForm.resx
index 7bcd39e..4b7b92d 100644
--- a/Aktywator/MainForm.resx
+++ b/Aktywator/MainForm.resx
@@ -334,57 +334,56 @@
<data name="bTruncate.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSU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jUT/ZAzXkRpVUXVZrzgCKhfdsRXfZ2tpRTJdRI8HCIqfb
+ xw5tnnyclXBHlpHqYyLPdC2jCSRPQVN8MG5Ge6E2XDoYB9X+Asi8bJBlZnaSpEPv5UeZ41KHr9q9nKDw
+ FCPIwEDzXvTxqaDMc3PWzN6u5XPRlhoDxQthaJjqg2/CnVAVaIsafyuUejogzIC9guky6ljp6rpc4HIf
+ trs6YpdAcIq5/HjUeXo6t6QmQrUyGW3pz+Pb2RFoiPVFXQQFMpXOtYEiXHK1BY81+EZhzFgustrW4yrF
+ BQe7e2wKD+by8ByTSPy6FyRAlZsGZWYcmudEQj7dH/WRLqihB5e6IBt84WILMxYrgukyJpiamppX+YoH
+ WsV2VBzqJjCXhyfI1NT/ftZcqPMy0J49Cy3zp6BxRiBuRrmhjkqJWkqnZ50cHtGpNZ7pMmZkOTqu7/dw
+ xTJT04PMpeGZaGLi+CAjEer1mejImYvWlFgoEkJwizJRQwQFcrAT9vD5ZSQdtuIcDY64O5cf53Jrma+P
+ R+20ibUDuenoWpnCxEE4mmJ8cCvKBdcoO4TpG/7vvzbHEHMdHY84Y2PNqfz4GW+ymVl8R3wUevPSBl+h
+ K+dPRktCMMpC3VEgsKwmiXRI+avx5K8fl3I4hU1TQtC5MI7Og2hURfnhKJ/fZ6GtHc9Inn0S9A23nrC2
+ 7jpNOXmLJfeGuZbWXLpMJcpvCF0Wy43ysKZk0LjNmJy8v/Pbh8X6N3byy1ecBZtwAAAAAElFTkSuQmCC
</value>
</data>
<metadata name="toolStrip3.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">