Skip to content

Commit 0aca55c

Browse files
committed
textrenderer to measure the size for the following labels
* labelStatus * labelLines * labelSize * labelCurrentLine those labels will now correctly display the current status in the bottom status strip
1 parent ff1e629 commit 0aca55c

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/LogExpert/Controls/LogTabWindow/LogTabWindowPrivate.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,9 +706,13 @@ private void StatusLineEventWorker(StatusLineEventArgs e)
706706
{
707707
//_logger.logDebug("StatusLineEvent: text = " + e.StatusText);
708708
labelStatus.Text = e.StatusText;
709-
labelLines.Text = $@"{string.Empty} {e.LineCount} lines";
709+
labelStatus.Size = TextRenderer.MeasureText(labelStatus.Text, labelStatus.Font);
710+
labelLines.Text = $" {e.LineCount} lines";
711+
labelLines.Size = TextRenderer.MeasureText(labelLines.Text, labelLines.Font);
710712
labelSize.Text = Util.GetFileSizeAsText(e.FileSize);
711-
labelCurrentLine.Text = $@"Line: {e.CurrentLineNum}";
713+
labelSize.Size = TextRenderer.MeasureText(labelSize.Text, labelSize.Font);
714+
labelCurrentLine.Text = $"Line: {e.CurrentLineNum}";
715+
labelCurrentLine.Size = TextRenderer.MeasureText(labelCurrentLine.Text, labelCurrentLine.Font);
712716
statusStrip.Refresh();
713717
}
714718

src/LogExpert/Controls/LogWindow/LogWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public partial class LogWindow : DockContent, ILogPaintContext, ILogView
3131

3232
private const int SPREAD_MAX = 99;
3333
private const int PROGRESS_BAR_MODULO = 1000;
34-
private const int FILTER_ADVANCED_SPLITTER_DISTANCE = 100;
34+
private const int FILTER_ADVANCED_SPLITTER_DISTANCE = 150;
3535
private static readonly ILogger _logger = LogManager.GetCurrentClassLogger();
3636

3737
private readonly Image _advancedButtonImage;

src/LogExpert/Controls/LogWindow/LogWindowEventHandlers.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,7 @@ private void OnDataGridContextMenuStripOpening(object sender, CancelEventArgs e)
788788

789789
// Remove all "old" plugin entries
790790
int index = dataGridContextMenuStrip.Items.IndexOf(pluginSeparator);
791+
791792
if (index > 0)
792793
{
793794
for (int i = index + 1; i < dataGridContextMenuStrip.Items.Count;)
@@ -811,10 +812,10 @@ private void OnDataGridContextMenuStripOpening(object sender, CancelEventArgs e)
811812
string menuText = entry.GetMenuText(lines, CurrentColumnizer, callback);
812813
if (menuText != null)
813814
{
814-
bool disabled = menuText.StartsWith("_");
815+
bool disabled = menuText.StartsWith('_');
815816
if (disabled)
816817
{
817-
menuText = menuText.Substring(1);
818+
menuText = menuText[1..];
818819
}
819820

820821
ToolStripItem item = dataGridContextMenuStrip.Items.Add(menuText, null, ev);

0 commit comments

Comments
 (0)