Patch by Łukasz 'Sil2100' Zemczak: Made BStatusBar layout friendly.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21936 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -14,6 +14,8 @@ class BStatusBar : public BView {
|
|||||||
public:
|
public:
|
||||||
BStatusBar(BRect frame, const char* name, const char* label = NULL,
|
BStatusBar(BRect frame, const char* name, const char* label = NULL,
|
||||||
const char* trailingLabel = NULL);
|
const char* trailingLabel = NULL);
|
||||||
|
BStatusBar(const char* name, const char* label = NULL,
|
||||||
|
const char* trailingLabel = NULL);
|
||||||
BStatusBar(BMessage* archive);
|
BStatusBar(BMessage* archive);
|
||||||
virtual ~BStatusBar();
|
virtual ~BStatusBar();
|
||||||
|
|
||||||
@@ -69,6 +71,11 @@ class BStatusBar : public BView {
|
|||||||
|
|
||||||
virtual status_t Perform(perform_code d, void* arg);
|
virtual status_t Perform(perform_code d, void* arg);
|
||||||
|
|
||||||
|
// Layout methods
|
||||||
|
virtual BSize MinSize();
|
||||||
|
virtual BSize MaxSize();
|
||||||
|
virtual BSize PreferredSize();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void _ReservedStatusBar2();
|
virtual void _ReservedStatusBar2();
|
||||||
virtual void _ReservedStatusBar3();
|
virtual void _ReservedStatusBar3();
|
||||||
|
|||||||
@@ -13,6 +13,9 @@
|
|||||||
#include <Region.h>
|
#include <Region.h>
|
||||||
#include <StatusBar.h>
|
#include <StatusBar.h>
|
||||||
|
|
||||||
|
#include <Layout.h>
|
||||||
|
#include <LayoutUtils.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@@ -30,6 +33,17 @@ BStatusBar::BStatusBar(BRect frame, const char *name, const char *label,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BStatusBar::BStatusBar(const char *name, const char *label,
|
||||||
|
const char *trailingLabel)
|
||||||
|
: BView(BRect(0, 0, -1, -1), name, B_FOLLOW_LEFT | B_FOLLOW_TOP,
|
||||||
|
B_WILL_DRAW | B_SUPPORTS_LAYOUT),
|
||||||
|
fLabel(label),
|
||||||
|
fTrailingLabel(trailingLabel)
|
||||||
|
{
|
||||||
|
_InitObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BStatusBar::BStatusBar(BMessage *archive)
|
BStatusBar::BStatusBar(BMessage *archive)
|
||||||
: BView(archive)
|
: BView(archive)
|
||||||
{
|
{
|
||||||
@@ -580,6 +594,37 @@ BStatusBar::GetSupportedSuites(BMessage* data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BSize
|
||||||
|
BStatusBar::MinSize()
|
||||||
|
{
|
||||||
|
float width, height;
|
||||||
|
GetPreferredSize(&width, &height);
|
||||||
|
|
||||||
|
return BLayoutUtils::ComposeSize(ExplicitMaxSize(), BSize(width, height));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BSize
|
||||||
|
BStatusBar::MaxSize()
|
||||||
|
{
|
||||||
|
float width, height;
|
||||||
|
GetPreferredSize(&width, &height);
|
||||||
|
|
||||||
|
return BLayoutUtils::ComposeSize(ExplicitMaxSize(),
|
||||||
|
BSize(B_SIZE_UNLIMITED, height));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BSize
|
||||||
|
BStatusBar::PreferredSize()
|
||||||
|
{
|
||||||
|
float width, height;
|
||||||
|
GetPreferredSize(&width, &height);
|
||||||
|
|
||||||
|
return BLayoutUtils::ComposeSize(ExplicitMaxSize(), BSize(width, height));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BStatusBar::Perform(perform_code d, void* arg)
|
BStatusBar::Perform(perform_code d, void* arg)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user