mirror of
https://review.haiku-os.org/haiku
synced 2025-01-31 18:56:49 +01:00
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:
parent
a3fb982730
commit
7c7357f07c
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user