[BUG_FIXED] Make Finder's fg/bg colors aligned with global default fg/bg colors.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1261 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2014-07-19 23:12:54 +00:00
parent a8ebab987f
commit bf9f679cb8
4 changed files with 21 additions and 18 deletions

View File

@ -1415,47 +1415,47 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
(NppParameters::getInstance())->setCurrentDefaultBgColor(style._bgColor); (NppParameters::getInstance())->setCurrentDefaultBgColor(style._bgColor);
// Set default fg/bg colors on internal docking dialog // Set default fg/bg colors on internal docking dialog
if (_pFuncList && _pFuncList->isCreated() && _pFuncList->isVisible()) if (_pFuncList)
{ {
_pFuncList->setBackgroundColor(style._bgColor); _pFuncList->setBackgroundColor(style._bgColor);
_pFuncList->setForegroundColor(style._fgColor); _pFuncList->setForegroundColor(style._fgColor);
} }
if (_pAnsiCharPanel && _pAnsiCharPanel->isCreated() && _pAnsiCharPanel->isVisible()) if (_pAnsiCharPanel)
{ {
_pAnsiCharPanel->setBackgroundColor(style._bgColor); _pAnsiCharPanel->setBackgroundColor(style._bgColor);
_pAnsiCharPanel->setForegroundColor(style._fgColor); _pAnsiCharPanel->setForegroundColor(style._fgColor);
} }
if (_pFileSwitcherPanel && _pFileSwitcherPanel->isCreated() && _pFileSwitcherPanel->isVisible()) if (_pFileSwitcherPanel)
{ {
_pFileSwitcherPanel->setBackgroundColor(style._bgColor); _pFileSwitcherPanel->setBackgroundColor(style._bgColor);
_pFileSwitcherPanel->setForegroundColor(style._fgColor); _pFileSwitcherPanel->setForegroundColor(style._fgColor);
} }
if (_pClipboardHistoryPanel && _pClipboardHistoryPanel->isCreated() && _pClipboardHistoryPanel->isVisible()) if (_pClipboardHistoryPanel)
{ {
_pClipboardHistoryPanel->setBackgroundColor(style._bgColor); _pClipboardHistoryPanel->setBackgroundColor(style._bgColor);
_pClipboardHistoryPanel->setForegroundColor(style._fgColor); _pClipboardHistoryPanel->setForegroundColor(style._fgColor);
_pClipboardHistoryPanel->redraw(true); _pClipboardHistoryPanel->redraw(true);
} }
if (_pProjectPanel_1 && _pProjectPanel_1->isCreated() && _pProjectPanel_1->isVisible()) if (_pProjectPanel_1)
{ {
_pProjectPanel_1->setBackgroundColor(style._bgColor); _pProjectPanel_1->setBackgroundColor(style._bgColor);
_pProjectPanel_1->setForegroundColor(style._fgColor); _pProjectPanel_1->setForegroundColor(style._fgColor);
} }
if (_pProjectPanel_2 && _pProjectPanel_2->isCreated() && _pProjectPanel_2->isVisible()) if (_pProjectPanel_2)
{ {
_pProjectPanel_2->setBackgroundColor(style._bgColor); _pProjectPanel_2->setBackgroundColor(style._bgColor);
_pProjectPanel_2->setForegroundColor(style._fgColor); _pProjectPanel_2->setForegroundColor(style._fgColor);
} }
if (_pProjectPanel_3 && _pProjectPanel_3->isCreated() && _pProjectPanel_3->isVisible()) if (_pProjectPanel_3)
{ {
_pProjectPanel_3->setBackgroundColor(style._bgColor); _pProjectPanel_3->setBackgroundColor(style._bgColor);
_pProjectPanel_3->setForegroundColor(style._fgColor); _pProjectPanel_3->setForegroundColor(style._fgColor);
} }
if (_pDocMap && _pDocMap->isCreated() && _pDocMap->isVisible()) if (_pDocMap)
{ {
_pDocMap->setSyntaxHiliting(); _pDocMap->setSyntaxHiliting();
} }

View File

@ -2528,8 +2528,19 @@ void Finder::setFinderStyle()
_scintView.execute(SCI_SETCARETLINEBACK, style._bgColor); _scintView.execute(SCI_SETCARETLINEBACK, style._bgColor);
} }
} }
_scintView.setSearchResultLexer(); _scintView.setSearchResultLexer();
// Override foreground & background colour by default foreground & background coulour
StyleArray & stylers = _scintView._pParameter->getMiscStylerArray();
int iStyleDefault = stylers.getStylerIndexByID(STYLE_DEFAULT);
if (iStyleDefault != -1)
{
Style & styleDefault = stylers.getStyler(iStyleDefault);
_scintView.setStyle(styleDefault);
_scintView.execute(SCI_STYLESETFORE, SCE_SEARCHRESULT_DEFAULT, styleDefault._fgColor);
_scintView.execute(SCI_STYLESETBACK, SCE_SEARCHRESULT_DEFAULT, styleDefault._bgColor);
}
_scintView.execute(SCI_COLOURISE, 0, -1); _scintView.execute(SCI_COLOURISE, 0, -1);
} }

View File

@ -2095,7 +2095,6 @@ void ScintillaEditView::performGlobalStyles()
activeFoldFgColor = style._fgColor; activeFoldFgColor = style._fgColor;
} }
ScintillaViewParams & svp = (ScintillaViewParams &)_pParameter->getSVP(); ScintillaViewParams & svp = (ScintillaViewParams &)_pParameter->getSVP();
for (int j = 0 ; j < NB_FOLDER_STATE ; ++j) for (int j = 0 ; j < NB_FOLDER_STATE ; ++j)
defineMarker(_markersArray[FOLDER_TYPE][j], _markersArray[svp._folderStyle][j], foldfgColor, foldbgColor, activeFoldFgColor); defineMarker(_markersArray[FOLDER_TYPE][j], _markersArray[svp._folderStyle][j], foldfgColor, foldbgColor, activeFoldFgColor);
@ -2750,13 +2749,6 @@ void ScintillaEditView::hideLines() {
_currentBuffer->setHideLineChanged(true, startLine-1); _currentBuffer->setHideLineChanged(true, startLine-1);
} }
void ScintillaEditView::setHiLiteResultWords(const TCHAR *keywords)
{
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
const char * word2search = wmc->wchar2char(keywords, CP_ACP);
setKeywords(L_SEARCHRESULT, word2search, 0);
}
bool ScintillaEditView::markerMarginClick(int lineNumber) { bool ScintillaEditView::markerMarginClick(int lineNumber) {
int state = execute(SCI_MARKERGET, lineNumber); int state = execute(SCI_MARKERGET, lineNumber);

View File

@ -618,7 +618,7 @@ public:
previousSelRange = currentSelRange; previousSelRange = currentSelRange;
return false; return false;
}; };
void setHiLiteResultWords(const TCHAR *keywords);
void defineDocType(LangType typeDoc); //setup stylers for active document void defineDocType(LangType typeDoc); //setup stylers for active document
void mouseWheel(WPARAM wParam, LPARAM lParam) { void mouseWheel(WPARAM wParam, LPARAM lParam) {
scintillaNew_Proc(_hSelf, WM_MOUSEWHEEL, wParam, lParam); scintillaNew_Proc(_hSelf, WM_MOUSEWHEEL, wParam, lParam);