diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-11-25 18:20:02 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2023-11-25 18:20:08 +0100 |
| commit | 34ed30fe1a710f6294e23003aa385bd6da6cb326 (patch) | |
| tree | 4fb8628a64a3c2943b23a9f7646206cb38bba69a /src/Fl_Browser.cxx | |
| parent | 00808500926af83a531fc1fdc0b2df9716743e8b (diff) | |
Adds `linespacing()` to `Fl_Browser_` and all derived widgets
Diffstat (limited to 'src/Fl_Browser.cxx')
| -rw-r--r-- | src/Fl_Browser.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Fl_Browser.cxx b/src/Fl_Browser.cxx index e78ccee30..09f9c2d1c 100644 --- a/src/Fl_Browser.cxx +++ b/src/Fl_Browser.cxx @@ -208,7 +208,7 @@ FL_BLINE* Fl_Browser::_remove(int line) { cacheline = line-1; cache = ttt->prev; lines--; - full_height_ -= item_height(ttt); + full_height_ -= item_height(ttt) + linespacing(); if (ttt->prev) ttt->prev->next = ttt->next; else first = ttt->next; if (ttt->next) ttt->next->prev = ttt->prev; @@ -264,7 +264,7 @@ void Fl_Browser::insert(int line, FL_BLINE* item) { cacheline = line; cache = item; lines++; - full_height_ += item_height(item); + full_height_ += item_height(item) + linespacing(); redraw_line(item); } @@ -489,7 +489,7 @@ int Fl_Browser::full_height() const { incr_height(), full_height() */ int Fl_Browser::incr_height() const { - return textsize()+2; + return textsize() + 2 + linespacing(); } /** @@ -620,9 +620,9 @@ void Fl_Browser::lineposition(int line, Fl_Line_Position pos) { FL_BLINE* l; for (l=first; l && line>1; l = l->next) { - line--; p += item_height(l); + line--; p += item_height(l) + linespacing(); } - if (l && (pos == BOTTOM)) p += item_height (l); + if (l && (pos == BOTTOM)) p += item_height(l) + linespacing(); int final = p, X, Y, W, H; bbox(X, Y, W, H); @@ -670,7 +670,7 @@ void Fl_Browser::textsize(Fl_Fontsize newSize) { full_height_ = 0; if (lines == 0) return; for (FL_BLINE* itm=(FL_BLINE *)item_first(); itm; itm=(FL_BLINE *)item_next(itm)) { - full_height_ += item_height(itm); + full_height_ += item_height(itm) + linespacing(); } } @@ -769,7 +769,7 @@ void Fl_Browser::show(int line) { FL_BLINE* t = find_line(line); if (t->flags & NOTDISPLAYED) { t->flags &= ~NOTDISPLAYED; - full_height_ += item_height(t); + full_height_ += item_height(t) + linespacing(); if (Fl_Browser_::displayed(t)) redraw(); } } @@ -786,7 +786,7 @@ void Fl_Browser::show(int line) { void Fl_Browser::hide(int line) { FL_BLINE* t = find_line(line); if (!(t->flags & NOTDISPLAYED)) { - full_height_ -= item_height(t); + full_height_ -= item_height(t) + linespacing(); t->flags |= NOTDISPLAYED; if (Fl_Browser_::displayed(t)) redraw(); } |
