mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-02 16:22:40 -06:00
CodeEditor: SyncWidth fix #975
git-svn-id: svn://ultimatepp.org/upp/trunk@8149 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
aa00459569
commit
95bce323b6
2 changed files with 8 additions and 9 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue