diff --git a/uppsrc/TextDiffCtrl/TextCtrl.cpp b/uppsrc/TextDiffCtrl/TextCtrl.cpp index 0e2f306af..3726792d8 100644 --- a/uppsrc/TextDiffCtrl/TextCtrl.cpp +++ b/uppsrc/TextDiffCtrl/TextCtrl.cpp @@ -4,28 +4,7 @@ namespace Upp { inline Color HistoryBg() { return Color(255, 255, 0); } -/* -struct GapDisplay : public Display { - virtual void Paint(Draw& draw, const Rect& rc, const Value& v, Color ink, Color paper, dword style) const - { - draw.DrawRect(rc, paper); - Rect clip = rc.Deflated(3, 0); - draw.Clip(clip); - WString txt = IsString(v) ? v : StdConvert().Format(v); - Font fnt = StdFont(); - int tcy = GetTLTextHeight(txt, fnt); - DrawTLText(draw, rc.left + 5, rc.top + max((rc.Height() - tcy) / 2, 0), rc.Width(), txt, fnt, ink); - draw.End(); - } -}; -struct HistoryRowDisplay : public GapDisplay { - virtual void Paint(Draw& draw, const Rect& rc, const Value& v, Color ink, Color paper, dword style) const - { - GapDisplay::Paint(draw, rc, v, ink, style & CURSOR ? paper : HistoryBg(), style); - } -}; -*/ TextCompareCtrl::TextCompareCtrl() { letter = Size(1, 1); @@ -46,11 +25,10 @@ TextCompareCtrl::TextCompareCtrl() void TextCompareCtrl::LeftDown(Point pt, dword keyflags) { - if(pt.x < gutter_width || HasCapture()) - { + Size sz = GetSize(); + if(pt.x > sz.cx - gutter_width || HasCapture()) { if(!HasCapture()) SetCapture(); - Size sz = GetSize(); int line = (pt.y * lines.GetCount()) / sz.cy; int page_lines = sz.cy / letter.cy; scroll.SetY(line - page_lines / 2); diff --git a/uppsrc/TextDiffCtrl/TextDiffCtrl.h b/uppsrc/TextDiffCtrl/TextDiffCtrl.h index 413eb579a..485dfed74 100644 --- a/uppsrc/TextDiffCtrl/TextDiffCtrl.h +++ b/uppsrc/TextDiffCtrl/TextDiffCtrl.h @@ -111,6 +111,8 @@ class TextDiffCtrl : public Splitter { public: void Set(Stream& l, Stream& r); void Set(const String& l, const String& r); + void InsertFrameLeft(CtrlFrame& f) { left.InsertFrame(0, f); } + void InsertFrameRight(CtrlFrame& f) { right.InsertFrame(0, f); } void AddFrameLeft(CtrlFrame& f) { left.AddFrame(f); } void AddFrameRight(CtrlFrame& f) { right.AddFrame(f); } diff --git a/uppsrc/ide/Diff.cpp b/uppsrc/ide/Diff.cpp index 3da0c0eee..ced588f66 100644 --- a/uppsrc/ide/Diff.cpp +++ b/uppsrc/ide/Diff.cpp @@ -52,7 +52,7 @@ DiffDlg::DiffDlg() { Add(diff.SizePos()); Sizeable().Zoomable(); - diff.AddFrameLeft(p); + diff.InsertFrameLeft(p); int cy = EditField::GetStdHeight(); p.Height(cy); p.Add(l.VSizePos().HSizePos(0, 6 * cy)); @@ -95,7 +95,7 @@ FileDiff::FileDiff() { r.Height(EditField::GetStdHeight()); Icon(IdeImg::Diff()); - diff.AddFrameRight(r); + diff.InsertFrameRight(r); r <<= THISBACK(Open); } @@ -290,7 +290,7 @@ SvnDiff::SvnDiff() r.Height(EditField::GetStdHeight()); r.SetDropLines(32); Icon(IdeImg::SvnDiff()); - diff.AddFrameRight(r); + diff.InsertFrameRight(r); r <<= THISBACK(Load); }