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 /FL | |
| parent | 00808500926af83a531fc1fdc0b2df9716743e8b (diff) | |
Adds `linespacing()` to `Fl_Browser_` and all derived widgets
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Fl_Browser_.H | 12 | ||||
| -rw-r--r-- | FL/Fl_File_Browser.H | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/FL/Fl_Browser_.H b/FL/Fl_Browser_.H index d83f94ee0..37ae59c5e 100644 --- a/FL/Fl_Browser_.H +++ b/FL/Fl_Browser_.H @@ -96,6 +96,7 @@ class FL_EXPORT Fl_Browser_ : public Fl_Group { void *redraw1,*redraw2; // minimal update pointers void* max_width_item; // which item has max_width_ int scrollbar_size_; // size of scrollbar trough + int linespacing_; void update_top(); @@ -400,6 +401,17 @@ public: */ void scrollbar_left() { scrollbar.align(FL_ALIGN_LEFT); } void sort(int flags=0); + + /** + Add some space between browser lines. + \param[in] pixels number of additional pixels between lines. + */ + void linespacing(int pixels) { linespacing_ = pixels; } + + /** Return the height of additional spacing between browser lines. + \return spacing height in pixel units. + */ + int linespacing() const { return linespacing_; } }; #endif diff --git a/FL/Fl_File_Browser.H b/FL/Fl_File_Browser.H index 101add4de..620315c17 100644 --- a/FL/Fl_File_Browser.H +++ b/FL/Fl_File_Browser.H @@ -46,7 +46,7 @@ class FL_EXPORT Fl_File_Browser : public Fl_Browser { int item_height(void *) const FL_OVERRIDE; int item_width(void *) const FL_OVERRIDE; void item_draw(void *, int, int, int, int) const FL_OVERRIDE; - int incr_height() const FL_OVERRIDE { return (item_height(0)); } + int incr_height() const FL_OVERRIDE { return (item_height(0) + linespacing()); } public: enum { FILES, DIRECTORIES }; |
