mirror of
https://github.com/Crypto-Notepad/Crypto-Notepad.git
synced 2026-03-11 08:55:25 +00:00
StatusPanel now does not work when disabled in settings
This commit is contained in:
parent
6d0518dc0c
commit
305410e5f8
1 changed files with 16 additions and 9 deletions
|
|
@ -430,21 +430,28 @@ private async void StatusPanelMessage(string type)
|
|||
|
||||
private void StatusPanelTextInfo()
|
||||
{
|
||||
int currentColumn = 1 + richTextBox.SelectionStart - richTextBox.GetFirstCharIndexOfCurrentLine();
|
||||
RichTextBox rtb = new RichTextBox();
|
||||
rtb.WordWrap = false;
|
||||
rtb.Text = richTextBox.Text;
|
||||
int currentLine = 1 + rtb.GetLineFromCharIndex(richTextBox.SelectionStart);
|
||||
int linesCount = richTextBox.Lines.Count();
|
||||
if (linesCount == 0)
|
||||
int currentColumn = 0;
|
||||
int currentLine = 0;
|
||||
int linesCount = 0;
|
||||
if (statusPanel.Visible)
|
||||
{
|
||||
linesCount = 1;
|
||||
currentColumn = 1 + richTextBox.SelectionStart - richTextBox.GetFirstCharIndexOfCurrentLine();
|
||||
RichTextBox rtb = new RichTextBox
|
||||
{
|
||||
WordWrap = false,
|
||||
Text = richTextBox.Text
|
||||
};
|
||||
currentLine = 1 + rtb.GetLineFromCharIndex(richTextBox.SelectionStart);
|
||||
linesCount = richTextBox.Lines.Count();
|
||||
if (linesCount == 0)
|
||||
{
|
||||
linesCount = 1;
|
||||
}
|
||||
}
|
||||
statusPanelLengthLabel.Text = "Length: " + richTextBox.TextLength;
|
||||
statusPaneLinesLabel.Text = "Lines: " + linesCount;
|
||||
statusPaneLnLabel.Text = "Ln: " + currentLine;
|
||||
statusPaneColLabel.Text = "Col: " + currentColumn;
|
||||
|
||||
}
|
||||
|
||||
private void LockFile()
|
||||
|
|
|
|||
Loading…
Reference in a new issue