[NEW_FEATURE] Make orange indicator on the top of tab lighter when the view loss the focus.
Fix the multi-line tab height display problem while adding/removing the document. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@117 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
4b4e1f9967
commit
d88fa6236d
|
@ -4524,9 +4524,9 @@ int Notepad_plus::switchEditViewTo(int gid)
|
|||
|
||||
//checkDocState();
|
||||
setTitleWith(_pEditView->getCurrentTitle());
|
||||
//setLangStatus(_pEditView->getCurrentDocType());
|
||||
//updateStatusBar();
|
||||
//dynamicCheckMenuAndTB();
|
||||
|
||||
::InvalidateRect(_mainDocTab.getHSelf(), NULL, TRUE);
|
||||
::InvalidateRect(_subDocTab.getHSelf(), NULL, TRUE);
|
||||
::SendMessage(_hSelf, NPPM_INTERNAL_DOCSWITCHIN, 0, 0);
|
||||
return oldView;
|
||||
}
|
||||
|
@ -7250,6 +7250,13 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
|||
{
|
||||
return _mainDocTab.getHideTabBarStatus();
|
||||
}
|
||||
|
||||
case NPPM_INTERNAL_ISFOCUSEDTAB :
|
||||
{
|
||||
ScintillaEditView *cv = getCurrentEditView();
|
||||
HWND pMainTB = (_mainDocTab.getView() == cv)?_mainDocTab.getHSelf():_subDocTab.getHSelf();
|
||||
return (HWND)lParam == pMainTB;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
|
|
|
@ -41,7 +41,6 @@ char * DocTabView::newDocInit()
|
|||
|
||||
// create a new (the first) sub tab then hightlight it
|
||||
TabBar::insertAtEnd(newTitle);
|
||||
|
||||
return newTitle;
|
||||
}
|
||||
|
||||
|
@ -64,10 +63,13 @@ const char * DocTabView::newDoc(const char *fn)
|
|||
if (fn[i] == '\0')
|
||||
break;
|
||||
}
|
||||
//fnConformToTab[j] = '\0';
|
||||
|
||||
TabBar::insertAtEnd(fnConformToTab);
|
||||
TabBar::activateAt(_nbItem - 1);
|
||||
|
||||
if (_isMultiLine)
|
||||
{
|
||||
::SendMessage(_hParent, WM_SIZE, 0, 0);
|
||||
}
|
||||
return (const char *)completName;
|
||||
}
|
||||
|
||||
|
@ -80,6 +82,11 @@ const char * DocTabView::newDoc(Buffer & buf)
|
|||
// for the title of sub tab
|
||||
TabBar::insertAtEnd(PathFindFileName(completName));
|
||||
TabBar::activateAt(_nbItem - 1);
|
||||
|
||||
if (_isMultiLine)
|
||||
{
|
||||
::SendMessage(_hParent, WM_SIZE, 0, 0);
|
||||
}
|
||||
return completName;
|
||||
}
|
||||
|
||||
|
@ -121,6 +128,12 @@ const char * DocTabView::closeCurrentDoc()
|
|||
|
||||
TabBar::activateAt(i2activate);
|
||||
}
|
||||
|
||||
if (_isMultiLine)
|
||||
{
|
||||
::SendMessage(_hParent, WM_SIZE, 0, 0);
|
||||
}
|
||||
|
||||
return _pView->getCurrentTitle();
|
||||
}
|
||||
|
||||
|
|
|
@ -87,6 +87,10 @@ public :
|
|||
_pView->reSizeTo(rc);
|
||||
}
|
||||
};
|
||||
|
||||
const ScintillaEditView * getView() const {
|
||||
return _pView;
|
||||
};
|
||||
|
||||
private :
|
||||
static unsigned short _nbNewTitle;
|
||||
|
|
|
@ -515,7 +515,11 @@ void TabBarPlus::drawItem(DRAWITEMSTRUCT *pDrawItemStruct)
|
|||
rect.top += 2;
|
||||
}
|
||||
|
||||
hBrush = ::CreateSolidBrush(RGB(250, 170, 60));
|
||||
if (::SendMessage(_hParent, NPPM_INTERNAL_ISFOCUSEDTAB, 0, (LPARAM)_hSelf))
|
||||
hBrush = ::CreateSolidBrush(RGB(250, 170, 60)); // #FAAA3C
|
||||
else
|
||||
hBrush = ::CreateSolidBrush(RGB(250, 210, 150)); // #FAD296
|
||||
|
||||
::FillRect(hDC, &barRect, hBrush);
|
||||
::DeleteObject((HGDIOBJ)hBrush);
|
||||
}
|
||||
|
|
|
@ -283,6 +283,7 @@
|
|||
#define NPPM_INTERNAL_DOCSWITCHOFF (NOTEPADPLUS_USER_INTERNAL + 10)
|
||||
#define NPPM_INTERNAL_DOCSWITCHIN (NOTEPADPLUS_USER_INTERNAL + 11)
|
||||
#define NPPM_INTERNAL_ISTABBARREDUCED (NOTEPADPLUS_USER_INTERNAL + 12)
|
||||
#define NPPM_INTERNAL_ISFOCUSEDTAB (NOTEPADPLUS_USER_INTERNAL + 13)
|
||||
// See Notepad_plus_msgs.h
|
||||
//#define NOTEPADPLUS_USER (WM_USER + 1000)
|
||||
#define SCINTILLA_USER (WM_USER + 2000)
|
||||
|
|
Loading…
Reference in New Issue