diff --git a/src/Notepad3.c b/src/Notepad3.c index da8a779e8..b7120db89 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -1488,7 +1488,6 @@ void CreateBars(HWND hwnd,HINSTANCE hInstance) BOOL bExternalBitmap = FALSE; DWORD dwToolbarStyle = WS_TOOLBAR; - DWORD dwStatusbarStyle = WS_CHILD | WS_CLIPSIBLINGS; DWORD dwReBarStyle = WS_REBAR; BOOL bIsPrivAppThemed = PrivateIsAppThemed(); @@ -1617,6 +1616,8 @@ void CreateBars(HWND hwnd,HINSTANCE hInstance) SendMessage(hwndToolbar,TB_GETITEMRECT,0,(LPARAM)&rc); //SendMessage(hwndToolbar,TB_SETINDENT,2,0); + DWORD dwStatusbarStyle = WS_CHILD | WS_CLIPSIBLINGS; + if (bShowStatusbar) dwStatusbarStyle |= WS_VISIBLE; @@ -1852,11 +1853,11 @@ void MsgSize(HWND hwnd,WPARAM wParam,LPARAM lParam) EndDeferWindowPos(hdwp); // Statusbar width - aWidth[0] = max(120,min(cx/3,StatusCalcPaneWidth(g_hwndStatus,L" Ln 9'999'999 : 9'999'999 Col 9'999'999 : 999 Sel 9'999'999 SelLn 9'999'999 Occ 9'999'999 "))); - aWidth[1] = aWidth[0] + StatusCalcPaneWidth(g_hwndStatus,L" 9'999'999 Bytes [UTF-8] "); - aWidth[2] = aWidth[1] + StatusCalcPaneWidth(g_hwndStatus,L" Unicode (UTF-8) Signature "); - aWidth[3] = aWidth[2] + StatusCalcPaneWidth(g_hwndStatus,L" CR+LF "); - aWidth[4] = aWidth[3] + StatusCalcPaneWidth(g_hwndStatus,L" OVR "); + aWidth[0] = max(150,min(cx*2/5,StatusCalcPaneWidth(g_hwndStatus,L" Ln 9'999'999 : 9'999'999 Col 9'999'999 : 999 Sel 9'999'999 SelLn 9'999'999 Occ 9'999'999 "))); + aWidth[1] = aWidth[0] + StatusCalcPaneWidth(g_hwndStatus,L" 9'999'999 Bytes [utf-8] "); + aWidth[2] = aWidth[1] + StatusCalcPaneWidth(g_hwndStatus,L" Unicode (UTF-8) Signature "); + aWidth[3] = aWidth[2] + StatusCalcPaneWidth(g_hwndStatus,L" CR+LF "); + aWidth[4] = aWidth[3] + StatusCalcPaneWidth(g_hwndStatus,L" OVR "); aWidth[5] = -1; SendMessage(g_hwndStatus,SB_SETPARTS,COUNTOF(aWidth),(LPARAM)aWidth); @@ -7212,7 +7213,8 @@ void UpdateStatusbar() static WCHAR tchDocPos[256] = { L'\0' }; static WCHAR tchBytes[64] = { L'\0' }; - static WCHAR tchDocSize[256] = { L'\0' }; + static WCHAR tchDocSize[64] = { L'\0' }; + static WCHAR tchEncoding[64] = { L'\0' }; static WCHAR tchEOLMode[32] = { L'\0' }; static WCHAR tchOvrMode[32] = { L'\0' }; @@ -7256,15 +7258,15 @@ void UpdateStatusbar() { if ((iMarkOccurrencesMaxCount < 0) || (iMarkOccurrencesCount < iMarkOccurrencesMaxCount)) { - StringCchPrintf(tchOcc, COUNTOF(tchOcc), L"%i", iMarkOccurrencesCount); + StringCchPrintf(tchOcc, COUNTOF(tchOcc), L"%i ", iMarkOccurrencesCount); FormatNumberStr(tchOcc); } else { - StringCchPrintf(tchOcc, COUNTOF(tchOcc), L">= %i", iMarkOccurrencesMaxCount); + StringCchPrintf(tchOcc, COUNTOF(tchOcc), L">= %i ", iMarkOccurrencesMaxCount); } } else { - StringCchCopy(tchOcc, COUNTOF(tchOcc), L"--"); + StringCchCopy(tchOcc, COUNTOF(tchOcc), L"-- "); } // Print number of selected lines in statusbar @@ -7288,30 +7290,31 @@ void UpdateStatusbar() FormatString(tchDocSize, COUNTOF(tchDocSize), IDS_DOCSIZE, tchBytes); Encoding_GetLabel(Encoding_Current(CPI_GET)); + StringCchPrintf(tchEncoding, COUNTOF(tchEncoding), L" %s ", mEncoding[Encoding_Current(CPI_GET)].wchLabel); if (iEOLMode == SC_EOL_CR) { - StringCchCopy(tchEOLMode, COUNTOF(tchEOLMode), L" CR"); + StringCchCopy(tchEOLMode, COUNTOF(tchEOLMode), L" CR "); } else if (iEOLMode == SC_EOL_LF) { - StringCchCopy(tchEOLMode, COUNTOF(tchEOLMode), L" LF"); + StringCchCopy(tchEOLMode, COUNTOF(tchEOLMode), L" LF "); } else { - StringCchCopy(tchEOLMode, COUNTOF(tchEOLMode), L" CR+LF"); + StringCchCopy(tchEOLMode, COUNTOF(tchEOLMode), L" CR+LF "); } if (SendMessage(g_hwndEdit, SCI_GETOVERTYPE, 0, 0)) { - StringCchCopy(tchOvrMode, COUNTOF(tchOvrMode), L" OVR"); + StringCchCopy(tchOvrMode, COUNTOF(tchOvrMode), L" OVR "); } else { - StringCchCopy(tchOvrMode, COUNTOF(tchOvrMode), L" INS"); + StringCchCopy(tchOvrMode, COUNTOF(tchOvrMode), L" INS "); } Style_GetCurrentLexerName(tchLexerName, COUNTOF(tchLexerName)); StatusSetText(g_hwndStatus, STATUS_DOCPOS, tchDocPos); StatusSetText(g_hwndStatus, STATUS_DOCSIZE, tchDocSize); - StatusSetText(g_hwndStatus, STATUS_CODEPAGE, mEncoding[Encoding_Current(CPI_GET)].wchLabel); + StatusSetText(g_hwndStatus, STATUS_CODEPAGE, tchEncoding); StatusSetText(g_hwndStatus, STATUS_EOLMODE, tchEOLMode); StatusSetText(g_hwndStatus, STATUS_OVRMODE, tchOvrMode); StatusSetText(g_hwndStatus, STATUS_LEXER, tchLexerName); diff --git a/src/Notepad3.rc b/src/Notepad3.rc index 2188849f9..b1b1c7368 100644 --- a/src/Notepad3.rc +++ b/src/Notepad3.rc @@ -1418,7 +1418,7 @@ BEGIN IDS_READONLY "(Read Only)" IDS_DOCPOS " Ln %s / %s Col %s Sel %s SelLn %s Occ %s " IDS_DOCPOS2 " Ln %s / %s Col %s / %s Sel %s SelLn %s Occ %s " - IDS_DOCSIZE " %s [UTF-8]" + IDS_DOCSIZE " %s [utf-8]" IDS_LOADFILE "Loading ""%s""..." IDS_SAVEFILE "Saving ""%s""..." IDS_PRINTFILE "Printing page %i..." diff --git a/src/Styles.c b/src/Styles.c index 11a465e77..bc9a63e16 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -5295,10 +5295,18 @@ void Style_SetFontQuality(HWND hwnd,LPCWSTR lpszStyle) { // // Style_GetCurrentLexerName() // -void Style_GetCurrentLexerName(LPWSTR lpszName,int cchName) +void Style_GetCurrentLexerName(LPWSTR lpszName, int cchName) { - if (!GetString(g_pLexCurrent->rid,lpszName,cchName)) - StringCchCopyN(lpszName,cchName,g_pLexCurrent->pszName,cchName); + if (IsLexerStandard(g_pLexCurrent)) { + StringCchPrintfW(lpszName, cchName, L" %s", GetCurrentStdLexer()->pszName); + } + else { + WCHAR wch[128] = { L'\0' }; + if (!GetString(g_pLexCurrent->rid, wch, COUNTOF(wch))) { + StringCchCopyW(wch, COUNTOF(wch), g_pLexCurrent->pszName); + } + StringCchPrintfW(lpszName, cchName, L" %s%s", wch, (Style_GetUse2ndDefault() ? L" [2nd]" : L"")); + } }