From 3626e82057e2cb581afbd5495a87c00db7d7c9b8 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Fri, 17 Dec 2021 18:34:51 +0100 Subject: GitHub #326: browser scrolling should be much improved Code now convinces browser to rebuild when the tree changes by UI. When widgets are move, the current widget should always be visible. It's the responsibility of the UI callback to update the browser. --- fluid/widget_browser.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'fluid/widget_browser.h') diff --git a/fluid/widget_browser.h b/fluid/widget_browser.h index dfcd4db35..f0e68f364 100644 --- a/fluid/widget_browser.h +++ b/fluid/widget_browser.h @@ -41,6 +41,8 @@ class Widget_Browser : public Fl_Browser_ } Fl_Type* pushedtitle; + int saved_h_scroll_; + int saved_v_scroll_; // required routines for Fl_Browser_ subclass: void *item_first() const ; @@ -57,7 +59,10 @@ public: Widget_Browser(int,int,int,int,const char * =NULL); int handle(int); void callback(); - void deleting(Fl_Type *inType) { Fl_Browser_::deleting((void*)inType); } + void save_scroll_position(); + void restore_scroll_position(); + void rebuild(); + void display(Fl_Type *); }; #endif // _FLUID_WIDGET_BROWSER_H -- cgit v1.2.3