From 822f22835097643a8afacf38296402752e259b29 Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 23 Nov 2014 16:49:15 +0000 Subject: [PATCH] ide: Fixed issue with font change and line numbers #929 git-svn-id: svn://ultimatepp.org/upp/trunk@7922 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CodeEditor/CodeEditor.cpp | 1 + uppsrc/CodeEditor/CodeEditor.h | 12 ++++++++---- uppsrc/ide/Setup.cpp | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/uppsrc/CodeEditor/CodeEditor.cpp b/uppsrc/CodeEditor/CodeEditor.cpp index 476623464..a7957fab7 100644 --- a/uppsrc/CodeEditor/CodeEditor.cpp +++ b/uppsrc/CodeEditor/CodeEditor.cpp @@ -53,6 +53,7 @@ void CodeEditor::Highlight(const String& h) SetColor(LineEdit::PAPER_READONLY, hl_style[HighlightSetup::PAPER_READONLY].color); SetColor(LineEdit::PAPER_SELECTED, hl_style[HighlightSetup::PAPER_SELECTED].color); Refresh(); + EditorBarLayout(); } void CodeEditor::DirtyFrom(int line) { diff --git a/uppsrc/CodeEditor/CodeEditor.h b/uppsrc/CodeEditor/CodeEditor.h index 9f33ae757..5d53cca5b 100644 --- a/uppsrc/CodeEditor/CodeEditor.h +++ b/uppsrc/CodeEditor/CodeEditor.h @@ -85,7 +85,6 @@ private: String& PointBreak(int& y); void sPaintImage(Draw& w, int y, int fy, const Image& img); - void SyncWidth(); public: Callback1 WhenBreakpoint; @@ -99,6 +98,8 @@ public: void Scroll() { Refresh(); } + void SyncWidth(); + void Renumber(int linecount); void ClearBreakpoints(); void ValidateBreakpoints(); @@ -188,9 +189,6 @@ public: virtual void Serialize(Stream& s); virtual void MouseLeave(); - void CheckEdited(bool e = true) { check_edited = e; } - bool GetCheckEdited() { return check_edited; } - protected: virtual void HighlightLine(int line, Vector& h, int pos); virtual void PreInsert(int pos, const WString& s); @@ -412,6 +410,12 @@ public: Callback1 WhenBreakpoint; + + void CheckEdited(bool e = true) { check_edited = e; } + bool GetCheckEdited() { return check_edited; } + + void EditorBarLayout() { bar.SyncWidth(); } + LineInfo GetLineInfo() const { return bar.GetLineInfo(); } void SetLineInfo(const LineInfo& lf); LineInfoRem GetLineInfoRem() { return LineInfoRem(bar.GetLineInfoRem(), 0); } diff --git a/uppsrc/ide/Setup.cpp b/uppsrc/ide/Setup.cpp index 529ea4572..2b308cbbe 100644 --- a/uppsrc/ide/Setup.cpp +++ b/uppsrc/ide/Setup.cpp @@ -173,6 +173,7 @@ void Ide::EditorFontScroll(int d) while(editorfont.GetCy() == h && (d < 0 ? editorfont.GetCy() > 5 : editorfont.GetCy() < 40)) editorfont.Height(q += d); editor.SetFont(editorfont); + editor.EditorBarLayout(); } struct FormatDlg : TabDlg {