From 713ce3be95f86c487245ef502557a70423be16b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 27 Jul 2013 22:54:18 +0200 Subject: [PATCH] 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. --- src/apps/haiku-depot/PackageInfoView.cpp | 61 ++++++++++++++++++++++++ src/apps/haiku-depot/PackageInfoView.h | 25 ++++++++++ 2 files changed, 86 insertions(+) create mode 100644 src/apps/haiku-depot/PackageInfoView.cpp create mode 100644 src/apps/haiku-depot/PackageInfoView.h diff --git a/src/apps/haiku-depot/PackageInfoView.cpp b/src/apps/haiku-depot/PackageInfoView.cpp new file mode 100644 index 0000000000..662f1abb8b --- /dev/null +++ b/src/apps/haiku-depot/PackageInfoView.cpp @@ -0,0 +1,61 @@ +/* + * Copyright 2013, Stephan Aßmus . + * All rights reserved. Distributed under the terms of the MIT License. + */ + +#include "PackageInfoView.h" + +#include +#include + +#include +#include +#include +#include + + +#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; + } +} diff --git a/src/apps/haiku-depot/PackageInfoView.h b/src/apps/haiku-depot/PackageInfoView.h new file mode 100644 index 0000000000..d1749887c6 --- /dev/null +++ b/src/apps/haiku-depot/PackageInfoView.h @@ -0,0 +1,25 @@ +/* + * Copyright 2013, Stephan Aßmus . + * All rights reserved. Distributed under the terms of the MIT License. + */ +#ifndef PACKAGE_INFO_VIEW_H +#define PACKAGE_INFO_VIEW_H + +#include + + +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