CodeEditor: SyncWidth fix #975

git-svn-id: svn://ultimatepp.org/upp/trunk@8149 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-02-08 11:49:27 +00:00
parent aa00459569
commit 95bce323b6
2 changed files with 8 additions and 9 deletions

View file

@ -98,7 +98,7 @@ public:
void Scroll() { Refresh(); }
void SyncWidth();
void SyncSize();
void Renumber(int linecount);
void ClearBreakpoints();
@ -416,7 +416,7 @@ public:
void CheckEdited(bool e = true) { check_edited = e; }
bool GetCheckEdited() { return check_edited; }
void EditorBarLayout() { bar.SyncWidth(); }
void EditorBarLayout() { bar.SyncSize(); }
LineInfo GetLineInfo() const { return bar.GetLineInfo(); }
void SetLineInfo(const LineInfo& lf);

View file

@ -476,7 +476,7 @@ void EditorBar::HidePtr()
Refresh();
}
void EditorBar::SyncWidth()
void EditorBar::SyncSize()
{
int n = editor ? editor->GetLineCount() : 0;
int i = 0;
@ -485,22 +485,21 @@ void EditorBar::SyncWidth()
n /= 10;
}
int w = (line_numbers && editor ? editor->GetFont()['0'] * i : 0) + 12 + 4 + annotations;
if(w != GetWidth()) {
if(w != GetWidth())
Width(w);
Refresh();
}
Refresh();
}
void EditorBar::LineNumbers(bool b)
{
line_numbers = b;
SyncWidth();
SyncSize();
}
void EditorBar::Annotations(int width)
{
annotations = width;
SyncWidth();
SyncSize();
}
EditorBar::EditorBar()
@ -513,7 +512,7 @@ EditorBar::EditorBar()
annotations = 0;
ignored_next_edit = false;
next_age = 0;
SyncWidth();
SyncSize();
}
EditorBar::~EditorBar()