diff options
author | Brad Linden <brad@lindenlab.com> | 2024-03-01 10:12:00 -0800 |
---|---|---|
committer | Brad Linden <brad@lindenlab.com> | 2024-03-01 10:12:00 -0800 |
commit | 258c039584dd293ba7218dc522882bc0bac25e63 (patch) | |
tree | a695d32a5fff74828d281f04186039e08287566a /indra/llui/llscrollingpanellist.h | |
parent | 23d44cb6653ee4ca46ec0e33f19b393b58f5332f (diff) | |
parent | 701d1a33bb8227aa55a71f48caeb30a453e77ee0 (diff) |
Merge remote-tracking branch 'origin/main' into release/gltf-maint2
Diffstat (limited to 'indra/llui/llscrollingpanellist.h')
-rw-r--r-- | indra/llui/llscrollingpanellist.h | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/indra/llui/llscrollingpanellist.h b/indra/llui/llscrollingpanellist.h index e8df176ec3..d625039427 100644 --- a/indra/llui/llscrollingpanellist.h +++ b/indra/llui/llscrollingpanellist.h @@ -45,18 +45,24 @@ public: /* - * A set of panels that are displayed in a vertical sequence inside a scroll container. + * A set of panels that are displayed in a sequence inside a scroll container. */ class LLScrollingPanelList : public LLUICtrl { public: struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> - {}; - LLScrollingPanelList(const Params& p) - : LLUICtrl(p) - {} + { + Optional<bool> is_horizontal; + Optional<S32> padding; + Optional<S32> spacing; + + Params(); + }; + + LLScrollingPanelList(const Params& p); - static const S32 GAP_BETWEEN_PANELS = 6; + static const S32 DEFAULT_SPACING = 6; + static const S32 DEFAULT_PADDING = 2; typedef std::deque<LLScrollingPanel*> panel_list_t; @@ -65,11 +71,18 @@ public: virtual void draw(); void clearPanels(); - S32 addPanel( LLScrollingPanel* panel ); - void removePanel( LLScrollingPanel* panel ); - void removePanel( U32 panel_index ); + S32 addPanel(LLScrollingPanel* panel, bool back = false); + void removePanel(LLScrollingPanel* panel); + void removePanel(U32 panel_index); void updatePanels(BOOL allow_modify); - const panel_list_t& getPanelList() { return mPanelList; } + void rearrange(); + + const panel_list_t& getPanelList() const { return mPanelList; } + bool getIsHorizontal() const { return mIsHorizontal; } + void setPadding(S32 padding) { mPadding = padding; rearrange(); } + void setSpacing(S32 spacing) { mSpacing = spacing; rearrange(); } + S32 getPadding() const { return mPadding; } + S32 getSpacing() const { return mSpacing; } private: void updatePanelVisiblilty(); @@ -77,7 +90,11 @@ private: /** * Notify parent about size change, makes sense when used inside accordion */ - void notifySizeChanged(S32 height); + void notifySizeChanged(); + + bool mIsHorizontal; + S32 mPadding; + S32 mSpacing; panel_list_t mPanelList; }; |