HaikuDepot: Morestable layout in title ar

* Try to obtain a more stable layout in the title
   area by forcing unlimited width and using weights.
This commit is contained in:
Stephan Aßmus
2013-11-10 10:46:25 +01:00
parent efc3172fba
commit 59062d32b7
+16 -8
View File
@@ -182,7 +182,7 @@ private:
}; };
// #pragma mark - AboutView // #pragma mark - rating stats
class RatingView : public BView { class RatingView : public BView {
@@ -400,19 +400,24 @@ public:
BLayoutBuilder::Group<>(this) BLayoutBuilder::Group<>(this)
.Add(fIconView) .Add(fIconView)
.AddGroup(B_VERTICAL, 1.0f) .AddGroup(B_VERTICAL, 1.0f, 2.2f)
.Add(fTitleView) .Add(fTitleView)
.Add(fPublisherView) .Add(fPublisherView)
.SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET))
.End() .End()
.AddGlue(0.1f) .AddGlue(0.1f)
.AddGroup(B_HORIZONTAL, B_USE_SMALL_SPACING) .AddGroup(B_HORIZONTAL, B_USE_SMALL_SPACING, 0.8f)
.Add(fRatingView) .Add(fRatingView)
.Add(fAvgRating) .Add(fAvgRating)
.Add(fVoteInfo) .Add(fVoteInfo)
.SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET))
.End() .End()
.AddGlue(0.2f) .AddGlue(0.2f)
.Add(fVersionInfo) .AddGroup(B_HORIZONTAL, B_USE_SMALL_SPACING, 2.0f)
.AddGlue(3.0f) .Add(fVersionInfo)
.AddGlue()
.SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET))
.End()
; ;
Clear(); Clear();
@@ -502,6 +507,7 @@ public:
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
SetLayout(fLayout); SetLayout(fLayout);
fLayout->AddItem(BSpaceLayoutItem::CreateGlue());
} }
virtual ~PackageActionView() virtual ~PackageActionView()
@@ -557,7 +563,7 @@ public:
else { else {
for (int32 i = 0; i < actions.CountItems(); i++) { for (int32 i = 0; i < actions.CountItems(); i++) {
if (actions.ItemAtFast(i)->Type() if (actions.ItemAtFast(i)->Type()
!= fPackageActions.ItemAtFast(i)->Type()) { != fPackageActions.ItemAtFast(i)->Type()) {
clearNeeded = true; clearNeeded = true;
break; break;
} }
@@ -1252,12 +1258,14 @@ PackageInfoView::PackageInfoView(BLocker* modelLock,
{ {
fTitleView = new TitleView(); fTitleView = new TitleView();
fPackageActionView = new PackageActionView(handler); fPackageActionView = new PackageActionView(handler);
fPackageActionView->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED,
B_SIZE_UNSET));
fPagesView = new PagesView(); fPagesView = new PagesView();
BLayoutBuilder::Group<>(this) BLayoutBuilder::Group<>(this)
.AddGroup(B_HORIZONTAL, 0.0f) .AddGroup(B_HORIZONTAL, 0.0f)
.Add(fTitleView) .Add(fTitleView, 6.0f)
.Add(fPackageActionView) .Add(fPackageActionView, 1.0f)
.SetInsets( .SetInsets(
B_USE_DEFAULT_SPACING, 0.0f, B_USE_DEFAULT_SPACING, 0.0f,
B_USE_DEFAULT_SPACING, 0.0f) B_USE_DEFAULT_SPACING, 0.0f)