X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flist.h;h=ef4311e0702c73b818a19ab3abaadb07e1427abb;hb=7e328215742ee672b1a93e5f5f358828c53ce921;hp=25001d18f7948dcab5af79e8671feddf538a61ae;hpb=6e58cefe8fd7aa736e528803ba483b9c8514bda1;p=libs%2Fgltk.git diff --git a/source/list.h b/source/list.h index 25001d1..ef4311e 100644 --- a/source/list.h +++ b/source/list.h @@ -131,6 +131,14 @@ private: } }; + struct Row + { + unsigned first; + unsigned height; + + Row(unsigned f): first(f), height(0) { } + }; + public: sigc::signal signal_item_selected; sigc::signal signal_selection_cleared; @@ -142,9 +150,10 @@ private: ItemFactory *item_factory; int sel_index; int focus_index; - unsigned first; + unsigned first_row; unsigned max_scroll; - unsigned view_size; + unsigned view_rows; + const Part *items_part; bool ignore_slider_change; bool dragging; int drag_start_x; @@ -152,6 +161,7 @@ private: VSlider slider; std::vector items; + std::vector rows; public: List(); @@ -205,11 +215,15 @@ public: virtual void focus_in(); virtual bool navigate(Navigation); private: + virtual void on_style_change(); + void move_focus(Navigation, bool); void set_focus_index(int); void item_autosize_changed(Item *); - unsigned last_to_first(unsigned) const; + void reposition_items(bool); + unsigned last_to_first_row(unsigned) const; + unsigned item_index_to_row(unsigned) const; void check_view_range(); void scroll_to_focus(); void slider_value_changed(double);