diff --git a/Common/UI/ViewGroup.cpp b/Common/UI/ViewGroup.cpp index b137697d94..cb9666e951 100644 --- a/Common/UI/ViewGroup.cpp +++ b/Common/UI/ViewGroup.cpp @@ -1287,7 +1287,7 @@ void AnchorLayout::Layout() { } GridLayout::GridLayout(GridLayoutSettings settings, LayoutParams *layoutParams) - : ViewGroup(layoutParams), settings_(settings), numColumns_(1) { + : ViewGroup(layoutParams), settings_(settings) { if (settings.orientation != ORIENT_HORIZONTAL) ERROR_LOG(SYSTEM, "GridLayout: Vertical layouts not yet supported"); } @@ -1468,7 +1468,7 @@ void TabHolder::PersistData(PersistStatus status, std::string anonId, PersistMap } ChoiceStrip::ChoiceStrip(Orientation orientation, LayoutParams *layoutParams) - : LinearLayout(orientation, layoutParams), selected_(0), topTabs_(false) { + : LinearLayout(orientation, layoutParams) { SetSpacing(0.0f); } diff --git a/Common/UI/ViewGroup.h b/Common/UI/ViewGroup.h index c5ee4032dd..b789935592 100644 --- a/Common/UI/ViewGroup.h +++ b/Common/UI/ViewGroup.h @@ -113,9 +113,7 @@ const float NONE = -FLT_MAX; class AnchorLayoutParams : public LayoutParams { public: AnchorLayoutParams(Size w, Size h, float l, float t, float r, float b, bool c = false) - : LayoutParams(w, h, LP_ANCHOR), left(l), top(t), right(r), bottom(b), center(c) { - - } + : LayoutParams(w, h, LP_ANCHOR), left(l), top(t), right(r), bottom(b), center(c) {} // There's a small hack here to make this behave more intuitively - AnchorLayout ordinarily ignores FILL_PARENT. AnchorLayoutParams(Size w, Size h, bool c = false) : LayoutParams(w, h, LP_ANCHOR), left(0), top(0), right(w == FILL_PARENT ? 0 : NONE), bottom(h == FILL_PARENT ? 0 : NONE), center(c) { @@ -135,7 +133,7 @@ public: class AnchorLayout : public ViewGroup { public: - AnchorLayout(LayoutParams *layoutParams = 0) : ViewGroup(layoutParams), overflow_(true) {} + AnchorLayout(LayoutParams *layoutParams = 0) : ViewGroup(layoutParams) {} void Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec vert) override; void Layout() override; void Overflow(bool allow) { @@ -145,7 +143,7 @@ public: private: void MeasureViews(const UIContext &dc, MeasureSpec horiz, MeasureSpec vert); - bool overflow_; + bool overflow_ = true; }; class LinearLayoutParams : public LayoutParams { @@ -157,7 +155,7 @@ public: LinearLayoutParams(float wgt, const Margins &mgn) : LayoutParams(LP_LINEAR), weight(wgt), gravity(G_TOPLEFT), margins(mgn), hasMargins_(true) {} LinearLayoutParams(Size w, Size h, float wgt = 0.0f, Gravity grav = G_TOPLEFT) - : LayoutParams(w, h, LP_LINEAR), weight(wgt), gravity(grav), hasMargins_(false) {} + : LayoutParams(w, h, LP_LINEAR), weight(wgt), gravity(grav), margins(0), hasMargins_(false) {} LinearLayoutParams(Size w, Size h, float wgt, Gravity grav, const Margins &mgn) : LayoutParams(w, h, LP_LINEAR), weight(wgt), gravity(grav), margins(mgn), hasMargins_(true) {} LinearLayoutParams(Size w, Size h, const Margins &mgn) @@ -184,7 +182,7 @@ private: class LinearLayout : public ViewGroup { public: LinearLayout(Orientation orientation, LayoutParams *layoutParams = 0) - : ViewGroup(layoutParams), orientation_(orientation), defaultMargins_(0), spacing_(10) {} + : ViewGroup(layoutParams), orientation_(orientation), defaultMargins_(0) {} void Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec vert) override; void Layout() override; @@ -197,7 +195,7 @@ protected: Orientation orientation_; private: Margins defaultMargins_; - float spacing_; + float spacing_ = 10.0f; }; class LinearLayoutList : public LinearLayout { @@ -249,7 +247,7 @@ public: private: GridLayoutSettings settings_; - int numColumns_; + int numColumns_ = 1; }; class GridLayoutList : public GridLayout { @@ -317,11 +315,6 @@ private: static float lastScrollPosY; }; -class ViewPager : public ScrollView { -public: -}; - - class ChoiceStrip : public LinearLayout { public: ChoiceStrip(Orientation orientation, LayoutParams *layoutParams = 0); @@ -348,8 +341,8 @@ private: StickyChoice *Choice(int index); EventReturn OnChoiceClick(EventParams &e); - int selected_; - bool topTabs_; // Can be controlled with L/R. + int selected_ = 0; // Can be controlled with L/R. + bool topTabs_ = false; };