[BUG_FIXED] Update internal docking dialog colors while selecting themes.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1260 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2014-07-18 08:58:52 +00:00
parent f3407442db
commit a8ebab987f
6 changed files with 30 additions and 14 deletions

View File

@ -4631,7 +4631,7 @@ void Notepad_plus::notifyBufferActivated(BufferID bufid, int view)
if (_pDocMap && (!_pDocMap->isClosed()) && _pDocMap->isVisible()) if (_pDocMap && (!_pDocMap->isClosed()) && _pDocMap->isVisible())
{ {
_pDocMap->reloadMap(); _pDocMap->reloadMap();
_pDocMap->setSyntaxLiliting(); _pDocMap->setSyntaxHiliting();
} }
if (_pFuncList && (!_pFuncList->isClosed()) && _pFuncList->isVisible()) if (_pFuncList && (!_pFuncList->isClosed()) && _pFuncList->isVisible())

View File

@ -1398,9 +1398,11 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
{ {
//reset styler for change in Stylers.xml //reset styler for change in Stylers.xml
_mainEditView.defineDocType(_mainEditView.getCurrentBuffer()->getLangType()); _mainEditView.defineDocType(_mainEditView.getCurrentBuffer()->getLangType());
_subEditView.defineDocType(_subEditView.getCurrentBuffer()->getLangType());
_mainEditView.performGlobalStyles(); _mainEditView.performGlobalStyles();
_subEditView.defineDocType(_subEditView.getCurrentBuffer()->getLangType());
_subEditView.performGlobalStyles(); _subEditView.performGlobalStyles();
_findReplaceDlg.updateFinderScintilla(); _findReplaceDlg.updateFinderScintilla();
drawTabbarColoursFromStylerArray(); drawTabbarColoursFromStylerArray();
@ -1413,45 +1415,50 @@ 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) if (_pFuncList && _pFuncList->isCreated() && _pFuncList->isVisible())
{ {
_pFuncList->setBackgroundColor(style._bgColor); _pFuncList->setBackgroundColor(style._bgColor);
_pFuncList->setForegroundColor(style._fgColor); _pFuncList->setForegroundColor(style._fgColor);
} }
if (_pAnsiCharPanel) if (_pAnsiCharPanel && _pAnsiCharPanel->isCreated() && _pAnsiCharPanel->isVisible())
{ {
_pAnsiCharPanel->setBackgroundColor(style._bgColor); _pAnsiCharPanel->setBackgroundColor(style._bgColor);
_pAnsiCharPanel->setForegroundColor(style._fgColor); _pAnsiCharPanel->setForegroundColor(style._fgColor);
} }
if (_pFileSwitcherPanel) if (_pFileSwitcherPanel && _pFileSwitcherPanel->isCreated() && _pFileSwitcherPanel->isVisible())
{ {
_pFileSwitcherPanel->setBackgroundColor(style._bgColor); _pFileSwitcherPanel->setBackgroundColor(style._bgColor);
_pFileSwitcherPanel->setForegroundColor(style._fgColor); _pFileSwitcherPanel->setForegroundColor(style._fgColor);
} }
if (_pClipboardHistoryPanel) if (_pClipboardHistoryPanel && _pClipboardHistoryPanel->isCreated() && _pClipboardHistoryPanel->isVisible())
{ {
_pClipboardHistoryPanel->setBackgroundColor(style._bgColor); _pClipboardHistoryPanel->setBackgroundColor(style._bgColor);
_pClipboardHistoryPanel->setForegroundColor(style._fgColor); _pClipboardHistoryPanel->setForegroundColor(style._fgColor);
_pClipboardHistoryPanel->redraw(true);
} }
if (_pProjectPanel_1) if (_pProjectPanel_1 && _pProjectPanel_1->isCreated() && _pProjectPanel_1->isVisible())
{ {
_pProjectPanel_1->setBackgroundColor(style._bgColor); _pProjectPanel_1->setBackgroundColor(style._bgColor);
_pProjectPanel_1->setForegroundColor(style._fgColor); _pProjectPanel_1->setForegroundColor(style._fgColor);
} }
if (_pProjectPanel_2) if (_pProjectPanel_2 && _pProjectPanel_2->isCreated() && _pProjectPanel_2->isVisible())
{ {
_pProjectPanel_2->setBackgroundColor(style._bgColor); _pProjectPanel_2->setBackgroundColor(style._bgColor);
_pProjectPanel_2->setForegroundColor(style._fgColor); _pProjectPanel_2->setForegroundColor(style._fgColor);
} }
if (_pProjectPanel_3) if (_pProjectPanel_3 && _pProjectPanel_3->isCreated() && _pProjectPanel_3->isVisible())
{ {
_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())
{
_pDocMap->setSyntaxHiliting();
}
// Notify plugins of update to styles xml // Notify plugins of update to styles xml
SCNotification scnN; SCNotification scnN;

View File

@ -64,9 +64,11 @@ public:
virtual void setBackgroundColor(int bgColour) const { virtual void setBackgroundColor(int bgColour) const {
ListView_SetBkColor(_listView.getHSelf(), bgColour); ListView_SetBkColor(_listView.getHSelf(), bgColour);
ListView_SetTextBkColor(_listView.getHSelf(), bgColour); ListView_SetTextBkColor(_listView.getHSelf(), bgColour);
_listView.redraw(true);
}; };
virtual void setForegroundColor(int fgColour) const { virtual void setForegroundColor(int fgColour) const {
ListView_SetTextColor(_listView.getHSelf(), fgColour); ListView_SetTextColor(_listView.getHSelf(), fgColour);
_listView.redraw(true);
}; };
protected: protected:

View File

@ -35,7 +35,6 @@ void DocumentMap::reloadMap()
{ {
if (_pScintillaEditView && _ppEditView) if (_pScintillaEditView && _ppEditView)
{ {
Document currentDoc = (*_ppEditView)->execute(SCI_GETDOCPOINTER); Document currentDoc = (*_ppEditView)->execute(SCI_GETDOCPOINTER);
_pScintillaEditView->execute(SCI_SETDOCPOINTER, 0, (LPARAM)currentDoc); _pScintillaEditView->execute(SCI_SETDOCPOINTER, 0, (LPARAM)currentDoc);
@ -61,7 +60,7 @@ void DocumentMap::reloadMap()
} }
} }
void DocumentMap::setSyntaxLiliting() void DocumentMap::setSyntaxHiliting()
{ {
Buffer *buf = _pScintillaEditView->getCurrentBuffer(); Buffer *buf = _pScintillaEditView->getCurrentBuffer();
_pScintillaEditView->defineDocType(buf->getLangType()); _pScintillaEditView->defineDocType(buf->getLangType());
@ -253,6 +252,10 @@ void DocumentMap::scrollMap(bool direction, moveMode whichMode)
scrollMap(); scrollMap();
} }
void DocumentMap::redraw(bool) const
{
_pScintillaEditView->execute(SCI_COLOURISE, 0, -1);
}
BOOL CALLBACK DocumentMap::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) BOOL CALLBACK DocumentMap::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
{ {
@ -275,7 +278,7 @@ BOOL CALLBACK DocumentMap::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara
_vzDlg.doDialog(); _vzDlg.doDialog();
(NppParameters::getInstance())->SetTransparent(_vzDlg.getHSelf(), 50); // 0 <= transparancy < 256 (NppParameters::getInstance())->SetTransparent(_vzDlg.getHSelf(), 50); // 0 <= transparancy < 256
setSyntaxLiliting(); setSyntaxHiliting();
_pScintillaEditView->showMargin(0, false); _pScintillaEditView->showMargin(0, false);
_pScintillaEditView->showMargin(1, false); _pScintillaEditView->showMargin(1, false);
@ -319,7 +322,7 @@ BOOL CALLBACK DocumentMap::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara
{ {
_vzDlg.display(); _vzDlg.display();
reloadMap(); reloadMap();
setSyntaxLiliting(); setSyntaxHiliting();
return TRUE; return TRUE;
} }

View File

@ -112,6 +112,8 @@ public:
_vzDlg.display(); _vzDlg.display();
}; };
virtual void redraw(bool forceUpdate = false) const;
void setParent(HWND parent2set){ void setParent(HWND parent2set){
_hParent = parent2set; _hParent = parent2set;
}; };
@ -128,7 +130,7 @@ public:
void doMove(); void doMove();
void fold(int line, bool foldOrNot); void fold(int line, bool foldOrNot);
void foldAll(bool mode); void foldAll(bool mode);
void setSyntaxLiliting(); void setSyntaxHiliting();
protected: protected:
virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);

View File

@ -74,10 +74,12 @@ public:
void setBackgroundColor(COLORREF bgColour) { void setBackgroundColor(COLORREF bgColour) {
ListView_SetBkColor(_hSelf, bgColour); ListView_SetBkColor(_hSelf, bgColour);
ListView_SetTextBkColor(_hSelf, bgColour); ListView_SetTextBkColor(_hSelf, bgColour);
redraw(true);
}; };
void setForegroundColor(COLORREF fgColour) { void setForegroundColor(COLORREF fgColour) {
ListView_SetTextColor(_hSelf, fgColour); ListView_SetTextColor(_hSelf, fgColour);
redraw(true);
}; };
protected: protected: