mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-28 22:03:40 -06:00
TabBar: Fixed some corner dnd and stacking issues
git-svn-id: svn://ultimatepp.org/upp/trunk@3035 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
2a3df454dd
commit
4e79386a28
2 changed files with 13 additions and 4 deletions
|
|
@ -1132,7 +1132,7 @@ void TabBar::Paint(Draw &w)
|
|||
|
||||
Image TabBar::GetDragSample()
|
||||
{
|
||||
int h = highlight;
|
||||
int h = drag_highlight;
|
||||
if(stacking)
|
||||
h = FindStackHead(tabs[h].stack);
|
||||
return GetDragSample(h);
|
||||
|
|
@ -1448,6 +1448,7 @@ int TabBar::GetPrev(int n, bool drag) const
|
|||
void TabBar::Clear()
|
||||
{
|
||||
highlight = -1;
|
||||
drag_highlight = -1;
|
||||
active = -1;
|
||||
target = -1;
|
||||
cross = -1;
|
||||
|
|
@ -1870,16 +1871,19 @@ void TabBar::SetIcon(int n, Image icon)
|
|||
|
||||
void TabBar::LeftDown(Point p, dword keyflags)
|
||||
{
|
||||
SetCapture();
|
||||
|
||||
if(keyflags & K_SHIFT)
|
||||
{
|
||||
highlight = -1;
|
||||
Refresh();
|
||||
SetCapture();
|
||||
Fix(p);
|
||||
oldp = p;
|
||||
return;
|
||||
}
|
||||
|
||||
drag_highlight = highlight;
|
||||
|
||||
isctrl = keyflags & K_CTRL;
|
||||
if(isctrl)
|
||||
return;
|
||||
|
|
@ -2024,7 +2028,7 @@ void TabBar::SetHighlight(int n)
|
|||
|
||||
void TabBar::MouseMove(Point p, dword keyflags)
|
||||
{
|
||||
if(HasCapture())
|
||||
if(HasCapture() && (keyflags & K_SHIFT))
|
||||
{
|
||||
Fix(p);
|
||||
sc.AddPos(p.x - oldp.x, true);
|
||||
|
|
@ -2033,6 +2037,9 @@ void TabBar::MouseMove(Point p, dword keyflags)
|
|||
return;
|
||||
}
|
||||
|
||||
if(HasCapture())
|
||||
return;
|
||||
|
||||
if(ProcessMouse(active, p))
|
||||
return;
|
||||
|
||||
|
|
@ -2066,7 +2073,7 @@ void TabBar::DragAndDrop(Point p, PasteClip& d)
|
|||
{
|
||||
Fix(p);
|
||||
int c = GetTargetTab(p);
|
||||
int tab = isctrl ? highlight : active;
|
||||
int tab = isctrl ? drag_highlight : active;
|
||||
|
||||
if (&GetInternal<TabBar>(d) != this || tabsort || c < 0 || !allowreorder) return;
|
||||
|
||||
|
|
@ -2141,6 +2148,7 @@ void TabBar::LeftDrag(Point p, dword keyflags)
|
|||
if(highlight < 0)
|
||||
return;
|
||||
|
||||
Sync();
|
||||
isdrag = true;
|
||||
dragtab = GetDragSample();
|
||||
DoDragAndDrop(InternalClip(*this, "tabs"));
|
||||
|
|
|
|||
|
|
@ -233,6 +233,7 @@ protected:
|
|||
|
||||
private:
|
||||
int highlight;
|
||||
int drag_highlight;
|
||||
int target;
|
||||
int cross;
|
||||
bool crosses;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue