BAboutWindow: style fixes
* mostly whitespace fixes * reorder methods
This commit is contained in:
@@ -20,7 +20,7 @@ class BBitmap;
|
|||||||
class BPoint;
|
class BPoint;
|
||||||
|
|
||||||
class BAboutWindow : public BWindow {
|
class BAboutWindow : public BWindow {
|
||||||
public:
|
public:
|
||||||
BAboutWindow(const char* appName,
|
BAboutWindow(const char* appName,
|
||||||
const char* signature);
|
const char* signature);
|
||||||
virtual ~BAboutWindow();
|
virtual ~BAboutWindow();
|
||||||
@@ -48,8 +48,10 @@ class BAboutWindow : public BWindow {
|
|||||||
|
|
||||||
const char* Version();
|
const char* Version();
|
||||||
void SetVersion(const char* version);
|
void SetVersion(const char* version);
|
||||||
private:
|
|
||||||
|
private:
|
||||||
AboutView* fAboutView;
|
AboutView* fAboutView;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // B_ABOUT_WINDOW_H
|
#endif // B_ABOUT_WINDOW_H
|
||||||
|
|||||||
@@ -42,12 +42,13 @@ static const float kStripeWidth = 30.0;
|
|||||||
|
|
||||||
using BPrivate::gSystemCatalog;
|
using BPrivate::gSystemCatalog;
|
||||||
|
|
||||||
|
|
||||||
#undef B_TRANSLATION_CONTEXT
|
#undef B_TRANSLATION_CONTEXT
|
||||||
#define B_TRANSLATION_CONTEXT "AboutWindow"
|
#define B_TRANSLATION_CONTEXT "AboutWindow"
|
||||||
|
|
||||||
|
|
||||||
class StripeView : public BView {
|
class StripeView : public BView {
|
||||||
public:
|
public:
|
||||||
StripeView(BBitmap* icon);
|
StripeView(BBitmap* icon);
|
||||||
virtual ~StripeView();
|
virtual ~StripeView();
|
||||||
|
|
||||||
@@ -56,13 +57,13 @@ class StripeView : public BView {
|
|||||||
BBitmap* Icon() const { return fIcon; };
|
BBitmap* Icon() const { return fIcon; };
|
||||||
void SetIcon(BBitmap* icon);
|
void SetIcon(BBitmap* icon);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BBitmap* fIcon;
|
BBitmap* fIcon;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class AboutView : public BGroupView {
|
class AboutView : public BGroupView {
|
||||||
public:
|
public:
|
||||||
AboutView(const char* name,
|
AboutView(const char* name,
|
||||||
const char* signature);
|
const char* signature);
|
||||||
virtual ~AboutView();
|
virtual ~AboutView();
|
||||||
@@ -78,11 +79,11 @@ class AboutView : public BGroupView {
|
|||||||
const char* Version();
|
const char* Version();
|
||||||
status_t SetVersion(const char* version);
|
status_t SetVersion(const char* version);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const char* _GetVersionFromSignature(const char* signature);
|
const char* _GetVersionFromSignature(const char* signature);
|
||||||
BBitmap* _GetIconFromSignature(const char* signature);
|
BBitmap* _GetIconFromSignature(const char* signature);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BStringView* fNameView;
|
BStringView* fNameView;
|
||||||
BStringView* fVersionView;
|
BStringView* fVersionView;
|
||||||
BTextView* fInfoView;
|
BTextView* fInfoView;
|
||||||
@@ -90,7 +91,7 @@ class AboutView : public BGroupView {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark - StripeView
|
||||||
|
|
||||||
|
|
||||||
StripeView::StripeView(BBitmap* icon)
|
StripeView::StripeView(BBitmap* icon)
|
||||||
@@ -304,6 +305,28 @@ AboutView::_GetIconFromSignature(const char* signature)
|
|||||||
// #pragma mark - AboutView public methods
|
// #pragma mark - AboutView public methods
|
||||||
|
|
||||||
|
|
||||||
|
BBitmap*
|
||||||
|
AboutView::Icon()
|
||||||
|
{
|
||||||
|
if (fStripeView == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return fStripeView->Icon();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
AboutView::SetIcon(BBitmap* icon)
|
||||||
|
{
|
||||||
|
if (fStripeView == NULL)
|
||||||
|
return B_NO_INIT;
|
||||||
|
|
||||||
|
fStripeView->SetIcon(icon);
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const char*
|
const char*
|
||||||
AboutView::Name()
|
AboutView::Name()
|
||||||
{
|
{
|
||||||
@@ -336,35 +359,14 @@ AboutView::SetVersion(const char* version)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BBitmap*
|
|
||||||
AboutView::Icon()
|
|
||||||
{
|
|
||||||
if (fStripeView == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
return fStripeView->Icon();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
AboutView::SetIcon(BBitmap* icon)
|
|
||||||
{
|
|
||||||
if (fStripeView == NULL)
|
|
||||||
return B_NO_INIT;
|
|
||||||
|
|
||||||
fStripeView->SetIcon(icon);
|
|
||||||
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - BAboutWindow
|
// #pragma mark - BAboutWindow
|
||||||
|
|
||||||
|
|
||||||
BAboutWindow::BAboutWindow(const char* appName, const char* signature)
|
BAboutWindow::BAboutWindow(const char* appName, const char* signature)
|
||||||
: BWindow(BRect(0.0, 0.0, 200.0, 200.0), appName, B_MODAL_WINDOW,
|
:
|
||||||
B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_NOT_RESIZABLE
|
BWindow(BRect(0.0, 0.0, 200.0, 200.0), appName, B_MODAL_WINDOW,
|
||||||
| B_AUTO_UPDATE_SIZE_LIMITS | B_CLOSE_ON_ESCAPE)
|
B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_NOT_RESIZABLE
|
||||||
|
| B_AUTO_UPDATE_SIZE_LIMITS | B_CLOSE_ON_ESCAPE)
|
||||||
{
|
{
|
||||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||||
|
|
||||||
@@ -417,9 +419,9 @@ BAboutWindow::AboutPosition(float width, float height)
|
|||||||
dynamic_cast<BWindow*>(BLooper::LooperForThread(find_thread(NULL)));
|
dynamic_cast<BWindow*>(BLooper::LooperForThread(find_thread(NULL)));
|
||||||
|
|
||||||
BScreen screen(window);
|
BScreen screen(window);
|
||||||
BRect screenFrame(0, 0, 640, 480);
|
BRect screenFrame(0, 0, 640, 480);
|
||||||
if (screen.IsValid())
|
if (screen.IsValid())
|
||||||
screenFrame = screen.Frame();
|
screenFrame = screen.Frame();
|
||||||
|
|
||||||
// Horizontally, we're smack in the middle
|
// Horizontally, we're smack in the middle
|
||||||
result.x = screenFrame.left + (screenFrame.Width() / 2.0) - (width / 2.0);
|
result.x = screenFrame.left + (screenFrame.Width() / 2.0) - (width / 2.0);
|
||||||
@@ -577,6 +579,20 @@ BAboutWindow::AddText(const char* header, const char** contents)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BBitmap*
|
||||||
|
BAboutWindow::Icon()
|
||||||
|
{
|
||||||
|
return fAboutView->Icon();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
BAboutWindow::SetIcon(BBitmap* icon)
|
||||||
|
{
|
||||||
|
fAboutView->SetIcon(icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const char*
|
const char*
|
||||||
BAboutWindow::Name()
|
BAboutWindow::Name()
|
||||||
{
|
{
|
||||||
@@ -603,18 +619,3 @@ BAboutWindow::SetVersion(const char* version)
|
|||||||
{
|
{
|
||||||
fAboutView->SetVersion(version);
|
fAboutView->SetVersion(version);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BBitmap*
|
|
||||||
BAboutWindow::Icon()
|
|
||||||
{
|
|
||||||
return fAboutView->Icon();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
BAboutWindow::SetIcon(BBitmap* icon)
|
|
||||||
{
|
|
||||||
fAboutView->SetIcon(icon);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user