AboutSystem: make static constants out of some member variables.

This avoids using them while uninitialized (as could happen when
using the archive constructor.

Fixes #17955.

Change-Id: If75354216b9731b3273d79aec787cd0140a6175e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5723
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
This commit is contained in:
Oscar Lesta 2022-10-07 18:07:12 -03:00 committed by Jérôme Duval
parent a3fb982730
commit 7c7357f07c

View File

@ -258,8 +258,6 @@ private:
private:
BString fText;
int32 fLabelCount;
int32 fSubtextCount;
rgb_color fDesktopTextColor;
BStringView* fMemSizeView;
@ -274,6 +272,9 @@ private:
float fCachedMinHeight;
bool fIsReplicant : 1;
static const uint8 kLabelCount = 5;
static const uint8 kSubtextCount = 7;
};
@ -696,8 +697,6 @@ SysInfoView::SysInfoView()
.SetInsets(inset)
.End();
fLabelCount = 5;
fSubtextCount = 7;
_CreateDragger();
}
@ -1110,9 +1109,9 @@ SysInfoView::_BaseHeight()
font_height boldFH;
be_bold_font->GetHeight(&boldFH);
return ceilf(((boldFH.ascent + boldFH.descent) * fLabelCount
+ (plainFH.ascent + plainFH.descent) * (fSubtextCount + 1) // extra for fUptimeView
+ be_control_look->DefaultLabelSpacing() * fLabelCount));
return ceilf(((boldFH.ascent + boldFH.descent) * kLabelCount
+ (plainFH.ascent + plainFH.descent) * (kSubtextCount + 1) // extra for fUptimeView
+ be_control_look->DefaultLabelSpacing() * kLabelCount));
}