HaikuDepot: BTabView with About, Rating & comments and Changelog

Completely non-functional. Should be replaced by something visually
more unified. The selected package's title and icon should be always
visible above the three sections, and the sections should not be
tabs but something more subtle.
This commit is contained in:
Stephan Aßmus 2013-07-27 22:54:18 +02:00
parent ac7d911bae
commit 713ce3be95
2 changed files with 86 additions and 0 deletions

View File

@ -0,0 +1,61 @@
/*
* Copyright 2013, Stephan Aßmus <superstippi@gmx.de>.
* All rights reserved. Distributed under the terms of the MIT License.
*/
#include "PackageInfoView.h"
#include <algorithm>
#include <stdio.h>
#include <Button.h>
#include <Catalog.h>
#include <LayoutBuilder.h>
#include <Message.h>
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "PackageInfoView"
PackageInfoView::PackageInfoView()
:
BTabView("package info view", B_WIDTH_FROM_WIDEST)
{
fDescriptionView = new BView("about", 0);
AddTab(fDescriptionView);
fRatingAndCommentsView = new BView("rating and comments", 0);
AddTab(fRatingAndCommentsView);
fChangeLogView = new BView("changelog", 0);
AddTab(fChangeLogView);
TabAt(0)->SetLabel(B_TRANSLATE("About"));
TabAt(1)->SetLabel(B_TRANSLATE("Rating & comments"));
TabAt(2)->SetLabel(B_TRANSLATE("Changelog"));
Select(0);
}
PackageInfoView::~PackageInfoView()
{
}
void
PackageInfoView::AttachedToWindow()
{
}
void
PackageInfoView::MessageReceived(BMessage* message)
{
switch (message->what) {
default:
BTabView::MessageReceived(message);
break;
}
}

View File

@ -0,0 +1,25 @@
/*
* Copyright 2013, Stephan Aßmus <superstippi@gmx.de>.
* All rights reserved. Distributed under the terms of the MIT License.
*/
#ifndef PACKAGE_INFO_VIEW_H
#define PACKAGE_INFO_VIEW_H
#include <TabView.h>
class PackageInfoView : public BTabView {
public:
PackageInfoView();
virtual ~PackageInfoView();
virtual void AttachedToWindow();
virtual void MessageReceived(BMessage* message);
private:
BView* fDescriptionView;
BView* fRatingAndCommentsView;
BView* fChangeLogView;
};
#endif // PACKAGE_INFO_VIEW_H