A bunch of style fixes
No functional changes intended
This commit is contained in:
@@ -13,7 +13,9 @@
|
||||
#ifndef _COLUMN_TYPES_H
|
||||
#define _COLUMN_TYPES_H
|
||||
|
||||
|
||||
#include "ColumnListView.h"
|
||||
|
||||
#include <String.h>
|
||||
#include <Font.h>
|
||||
#include <Bitmap.h>
|
||||
@@ -24,28 +26,23 @@
|
||||
|
||||
class BTitledColumn : public BColumn
|
||||
{
|
||||
public:
|
||||
BTitledColumn (const char *title,
|
||||
float width,
|
||||
float minWidth,
|
||||
float maxWidth,
|
||||
alignment align = B_ALIGN_LEFT);
|
||||
virtual void DrawTitle (BRect rect,
|
||||
BView* parent);
|
||||
virtual void GetColumnName (BString* into) const;
|
||||
public:
|
||||
BTitledColumn(const char* title, float width, float minWidth,
|
||||
float maxWidth, alignment align = B_ALIGN_LEFT);
|
||||
virtual void DrawTitle(BRect rect, BView* parent);
|
||||
virtual void GetColumnName(BString* into) const;
|
||||
|
||||
void DrawString (const char*,
|
||||
BView*,
|
||||
BRect);
|
||||
void SetTitle (const char* title);
|
||||
void Title (BString* forTitle) const; // sets the BString arg to be the title
|
||||
float FontHeight () const;
|
||||
void DrawString(const char*, BView*, BRect);
|
||||
void SetTitle(const char* title);
|
||||
void Title(BString* forTitle) const;
|
||||
// sets the BString arg to be the title
|
||||
float FontHeight() const;
|
||||
|
||||
virtual float GetPreferredWidth(BField* field, BView* parent) const;
|
||||
virtual float GetPreferredWidth(BField* field, BView* parent) const;
|
||||
|
||||
private:
|
||||
float fFontHeight;
|
||||
BString fTitle;
|
||||
private:
|
||||
float fFontHeight;
|
||||
BString fTitle;
|
||||
};
|
||||
|
||||
|
||||
@@ -54,21 +51,21 @@ class BTitledColumn : public BColumn
|
||||
|
||||
class BStringField : public BField
|
||||
{
|
||||
public:
|
||||
BStringField (const char* string);
|
||||
public:
|
||||
BStringField(const char* string);
|
||||
|
||||
void SetString (const char* string);
|
||||
const char* String () const;
|
||||
void SetClippedString (const char* string);
|
||||
bool HasClippedString () const;
|
||||
const char* ClippedString ();
|
||||
void SetWidth (float);
|
||||
float Width ();
|
||||
void SetString(const char* string);
|
||||
const char* String() const;
|
||||
void SetClippedString(const char* string);
|
||||
bool HasClippedString() const;
|
||||
const char* ClippedString();
|
||||
void SetWidth(float);
|
||||
float Width();
|
||||
|
||||
private:
|
||||
float fWidth;
|
||||
BString fString;
|
||||
BString fClippedString;
|
||||
private:
|
||||
float fWidth;
|
||||
BString fString;
|
||||
BString fClippedString;
|
||||
};
|
||||
|
||||
|
||||
@@ -76,23 +73,17 @@ class BStringField : public BField
|
||||
|
||||
class BStringColumn : public BTitledColumn
|
||||
{
|
||||
public:
|
||||
BStringColumn (const char *title,
|
||||
float width,
|
||||
float minWidth,
|
||||
float maxWidth,
|
||||
uint32 truncate,
|
||||
alignment align = B_ALIGN_LEFT);
|
||||
virtual void DrawField (BField* field,
|
||||
BRect rect,
|
||||
BView* parent);
|
||||
virtual int CompareFields (BField* field1,
|
||||
BField* field2);
|
||||
virtual float GetPreferredWidth(BField* field, BView* parent) const;
|
||||
virtual bool AcceptsField (const BField* field) const;
|
||||
public:
|
||||
BStringColumn(const char* title, float width,
|
||||
float minWidth, float maxWidth, uint32 truncate,
|
||||
alignment align = B_ALIGN_LEFT);
|
||||
virtual void DrawField(BField* field, BRect rect, BView* parent);
|
||||
virtual int CompareFields(BField* field1, BField* field2);
|
||||
virtual float GetPreferredWidth(BField* field, BView* parent) const;
|
||||
virtual bool AcceptsField(const BField* field) const;
|
||||
|
||||
private:
|
||||
uint32 fTruncate;
|
||||
private:
|
||||
uint32 fTruncate;
|
||||
};
|
||||
|
||||
|
||||
@@ -101,21 +92,21 @@ class BStringColumn : public BTitledColumn
|
||||
|
||||
class BDateField : public BField
|
||||
{
|
||||
public:
|
||||
BDateField (time_t* t);
|
||||
void SetWidth (float);
|
||||
float Width ();
|
||||
void SetClippedString (const char*);
|
||||
const char* ClippedString ();
|
||||
time_t Seconds ();
|
||||
time_t UnixTime ();
|
||||
public:
|
||||
BDateField(time_t* t);
|
||||
void SetWidth(float);
|
||||
float Width();
|
||||
void SetClippedString(const char*);
|
||||
const char* ClippedString();
|
||||
time_t Seconds();
|
||||
time_t UnixTime();
|
||||
|
||||
private:
|
||||
struct tm fTime;
|
||||
time_t fUnixTime;
|
||||
time_t fSeconds;
|
||||
BString fClippedString;
|
||||
float fWidth;
|
||||
private:
|
||||
struct tm fTime;
|
||||
time_t fUnixTime;
|
||||
time_t fSeconds;
|
||||
BString fClippedString;
|
||||
float fWidth;
|
||||
};
|
||||
|
||||
|
||||
@@ -123,19 +114,15 @@ class BDateField : public BField
|
||||
|
||||
class BDateColumn : public BTitledColumn
|
||||
{
|
||||
public:
|
||||
BDateColumn (const char* title,
|
||||
float width,
|
||||
float minWidth,
|
||||
float maxWidth,
|
||||
alignment align = B_ALIGN_LEFT);
|
||||
virtual void DrawField (BField* field,
|
||||
BRect rect,
|
||||
BView* parent);
|
||||
virtual int CompareFields (BField* field1,
|
||||
BField* field2);
|
||||
private:
|
||||
BString fTitle;
|
||||
public:
|
||||
BDateColumn(const char* title, float width,
|
||||
float minWidth, float maxWidth,
|
||||
alignment align = B_ALIGN_LEFT);
|
||||
virtual void DrawField(BField* field, BRect rect, BView* parent);
|
||||
virtual int CompareFields(BField* field1, BField* field2);
|
||||
|
||||
private:
|
||||
BString fTitle;
|
||||
};
|
||||
|
||||
|
||||
@@ -144,13 +131,13 @@ class BDateColumn : public BTitledColumn
|
||||
|
||||
class BSizeField : public BField
|
||||
{
|
||||
public:
|
||||
BSizeField (off_t size);
|
||||
void SetSize (off_t);
|
||||
off_t Size ();
|
||||
public:
|
||||
BSizeField(off_t size);
|
||||
void SetSize(off_t);
|
||||
off_t Size();
|
||||
|
||||
private:
|
||||
off_t fSize;
|
||||
private:
|
||||
off_t fSize;
|
||||
};
|
||||
|
||||
|
||||
@@ -158,17 +145,12 @@ class BSizeField : public BField
|
||||
|
||||
class BSizeColumn : public BTitledColumn
|
||||
{
|
||||
public:
|
||||
BSizeColumn (const char* title,
|
||||
float width,
|
||||
float minWidth,
|
||||
float maxWidth,
|
||||
alignment align = B_ALIGN_LEFT);
|
||||
virtual void DrawField (BField* field,
|
||||
BRect rect,
|
||||
BView* parent);
|
||||
virtual int CompareFields (BField* field1,
|
||||
BField* field2);
|
||||
public:
|
||||
BSizeColumn(const char* title, float width,
|
||||
float minWidth, float maxWidth,
|
||||
alignment align = B_ALIGN_LEFT);
|
||||
virtual void DrawField(BField* field, BRect rect, BView* parent);
|
||||
virtual int CompareFields(BField* field1, BField* field2);
|
||||
};
|
||||
|
||||
|
||||
@@ -177,13 +159,13 @@ class BSizeColumn : public BTitledColumn
|
||||
|
||||
class BIntegerField : public BField
|
||||
{
|
||||
public:
|
||||
BIntegerField (int32 number);
|
||||
void SetValue (int32);
|
||||
int32 Value ();
|
||||
public:
|
||||
BIntegerField(int32 number);
|
||||
void SetValue(int32);
|
||||
int32 Value();
|
||||
|
||||
private:
|
||||
int32 fInteger;
|
||||
private:
|
||||
int32 fInteger;
|
||||
};
|
||||
|
||||
|
||||
@@ -191,17 +173,12 @@ class BIntegerField : public BField
|
||||
|
||||
class BIntegerColumn : public BTitledColumn
|
||||
{
|
||||
public:
|
||||
BIntegerColumn (const char* title,
|
||||
float width,
|
||||
float minWidth,
|
||||
float maxWidth,
|
||||
alignment align = B_ALIGN_LEFT);
|
||||
virtual void DrawField (BField* field,
|
||||
BRect rect,
|
||||
BView* parent);
|
||||
virtual int CompareFields (BField* field1,
|
||||
BField* field2);
|
||||
public:
|
||||
BIntegerColumn(const char* title, float width,
|
||||
float minWidth, float maxWidth,
|
||||
alignment align = B_ALIGN_LEFT);
|
||||
virtual void DrawField(BField* field, BRect rect, BView* parent);
|
||||
virtual int CompareFields(BField* field1, BField* field2);
|
||||
};
|
||||
|
||||
|
||||
@@ -210,13 +187,13 @@ class BIntegerColumn : public BTitledColumn
|
||||
|
||||
class BBitmapField : public BField
|
||||
{
|
||||
public:
|
||||
BBitmapField (BBitmap* bitmap);
|
||||
const BBitmap* Bitmap ();
|
||||
void SetBitmap (BBitmap* bitmap);
|
||||
public:
|
||||
BBitmapField(BBitmap* bitmap);
|
||||
const BBitmap* Bitmap();
|
||||
void SetBitmap(BBitmap* bitmap);
|
||||
|
||||
private:
|
||||
BBitmap* fBitmap;
|
||||
private:
|
||||
BBitmap* fBitmap;
|
||||
};
|
||||
|
||||
|
||||
@@ -224,17 +201,13 @@ class BBitmapField : public BField
|
||||
|
||||
class BBitmapColumn : public BTitledColumn
|
||||
{
|
||||
public:
|
||||
BBitmapColumn (const char* title,
|
||||
float width,
|
||||
float minWidth,
|
||||
float maxWidth,
|
||||
alignment align = B_ALIGN_LEFT);
|
||||
virtual void DrawField (BField*field,
|
||||
BRect rect,
|
||||
BView* parent);
|
||||
virtual int CompareFields (BField* field1, BField* field2);
|
||||
virtual bool AcceptsField (const BField* field) const;
|
||||
public:
|
||||
BBitmapColumn(const char* title, float width,
|
||||
float minWidth, float maxWidth,
|
||||
alignment align = B_ALIGN_LEFT);
|
||||
virtual void DrawField(BField* field, BRect rect, BView* parent);
|
||||
virtual int CompareFields(BField* field1, BField* field2);
|
||||
virtual bool AcceptsField(const BField* field) const;
|
||||
};
|
||||
|
||||
|
||||
@@ -243,16 +216,12 @@ class BBitmapColumn : public BTitledColumn
|
||||
|
||||
class GraphColumn : public BIntegerColumn
|
||||
{
|
||||
public:
|
||||
GraphColumn (const char* name,
|
||||
float width,
|
||||
float minWidth,
|
||||
float maxWidth,
|
||||
alignment align = B_ALIGN_LEFT);
|
||||
virtual void DrawField (BField*field,
|
||||
BRect rect,
|
||||
BView* parent);
|
||||
public:
|
||||
GraphColumn(const char* name, float width,
|
||||
float minWidth, float maxWidth,
|
||||
alignment align = B_ALIGN_LEFT);
|
||||
virtual void DrawField(BField* field, BRect rect, BView* parent);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // _COLUMN_TYPES_H
|
||||
|
||||
@@ -70,12 +70,14 @@ All rights reserved.
|
||||
#include "ColorTools.h"
|
||||
#include "ObjectList.h"
|
||||
|
||||
|
||||
#define DOUBLE_BUFFERED_COLUMN_RESIZE 1
|
||||
#define SMART_REDRAW 1
|
||||
#define DRAG_TITLE_OUTLINE 1
|
||||
#define CONSTRAIN_CLIPPING_REGION 1
|
||||
#define LOWER_SCROLLBAR 0
|
||||
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
static const unsigned char kDownSortArrow8x8[] = {
|
||||
@@ -247,6 +249,7 @@ private:
|
||||
BCursor* fColumnMoveCursor;
|
||||
};
|
||||
|
||||
|
||||
class OutlineView : public BView {
|
||||
typedef BView _inherited;
|
||||
public:
|
||||
@@ -371,6 +374,7 @@ private:
|
||||
friend class RecursiveOutlineIterator;
|
||||
};
|
||||
|
||||
|
||||
class RecursiveOutlineIterator {
|
||||
public:
|
||||
RecursiveOutlineIterator(
|
||||
@@ -550,26 +554,25 @@ BRow::ValidateField(const BField* field, int32 logicalFieldIndex) const
|
||||
// The Fields may be moved by the user, but the logicalFieldIndexes
|
||||
// do not change, so we need to map them over when checking the
|
||||
// Field types.
|
||||
BColumn* col = NULL;
|
||||
BColumn* column = NULL;
|
||||
int32 items = fList->CountColumns();
|
||||
for (int32 i = 0 ; i < items; ++i) {
|
||||
col = fList->ColumnAt(i);
|
||||
if( col->LogicalFieldNum() == logicalFieldIndex )
|
||||
column = fList->ColumnAt(i);
|
||||
if(column->LogicalFieldNum() == logicalFieldIndex )
|
||||
break;
|
||||
}
|
||||
|
||||
if (NULL == col) {
|
||||
if (column == NULL) {
|
||||
BString dbmessage("\n\n\tThe parent BColumnListView does not have "
|
||||
"\n\ta BColumn at the logical field index ");
|
||||
"\n\ta BColumn at the logical field index ");
|
||||
dbmessage << logicalFieldIndex << ".\n\n";
|
||||
printf(dbmessage.String());
|
||||
} else {
|
||||
if (!col->AcceptsField(field)) {
|
||||
if (!column->AcceptsField(field)) {
|
||||
BString dbmessage("\n\n\tThe BColumn of type ");
|
||||
dbmessage << typeid(*col).name() << "\n\tat logical field index "
|
||||
<< logicalFieldIndex << "\n\tdoes not support the "
|
||||
"field type "
|
||||
<< typeid(*field).name() << ".\n\n";
|
||||
dbmessage << typeid(*column).name() << "\n\tat logical field index "
|
||||
<< logicalFieldIndex << "\n\tdoes not support the field type "
|
||||
<< typeid(*field).name() << ".\n\n";
|
||||
debugger(dbmessage.String());
|
||||
}
|
||||
}
|
||||
@@ -940,7 +943,8 @@ BColumnListView::SetSortingEnabled(bool enabled)
|
||||
{
|
||||
fSortingEnabled = enabled;
|
||||
fSortColumns.MakeEmpty();
|
||||
fTitleView->Invalidate(); // Erase sort indicators
|
||||
fTitleView->Invalidate();
|
||||
// erase sort indicators
|
||||
}
|
||||
|
||||
|
||||
@@ -973,7 +977,8 @@ void
|
||||
BColumnListView::ClearSortColumns()
|
||||
{
|
||||
fSortColumns.MakeEmpty();
|
||||
fTitleView->Invalidate(); // Erase sort indicators
|
||||
fTitleView->Invalidate();
|
||||
// erase sort indicators
|
||||
}
|
||||
|
||||
|
||||
@@ -1033,7 +1038,7 @@ BColumnListView::AddColumn(BColumn* column, int32 logicalFieldIndex)
|
||||
column->fList = this;
|
||||
column->fFieldID = logicalFieldIndex;
|
||||
|
||||
// sanity check. If there is already a field with this ID, remove it.
|
||||
// sanity check -- if there is already a field with this ID, remove it.
|
||||
for (int32 index = 0; index < fColumns.CountItems(); index++) {
|
||||
BColumn* existingColumn = (BColumn*) fColumns.ItemAt(index);
|
||||
if (existingColumn && existingColumn->fFieldID == logicalFieldIndex) {
|
||||
@@ -1117,7 +1122,7 @@ void
|
||||
BColumnListView::SetColumnVisible(int32 index, bool isVisible)
|
||||
{
|
||||
BColumn* column = ColumnAt(index);
|
||||
if (column)
|
||||
if (column != NULL)
|
||||
column->SetVisible(isVisible);
|
||||
}
|
||||
|
||||
@@ -1126,7 +1131,7 @@ bool
|
||||
BColumnListView::IsColumnVisible(int32 index) const
|
||||
{
|
||||
BColumn* column = ColumnAt(index);
|
||||
if (column)
|
||||
if (column != NULL)
|
||||
return column->IsVisible();
|
||||
|
||||
return false;
|
||||
@@ -1355,10 +1360,10 @@ BColumnListView::InvalidateRow(BRow* row)
|
||||
}
|
||||
|
||||
|
||||
// This method is deprecated.
|
||||
void
|
||||
BColumnListView::SetFont(const BFont* font, uint32 mask)
|
||||
{
|
||||
// This method is deprecated.
|
||||
fOutlineView->SetFont(font, mask);
|
||||
fTitleView->SetFont(font, mask);
|
||||
}
|
||||
@@ -1404,36 +1409,36 @@ BColumnListView::GetFont(ColumnListViewFont font_num, BFont* font) const
|
||||
|
||||
|
||||
void
|
||||
BColumnListView::SetColor(ColumnListViewColor color_num, const rgb_color color)
|
||||
BColumnListView::SetColor(ColumnListViewColor colorIndex, const rgb_color color)
|
||||
{
|
||||
if ((int)color_num < 0) {
|
||||
if ((int)colorIndex < 0) {
|
||||
ASSERT(false);
|
||||
color_num = (ColumnListViewColor) 0;
|
||||
colorIndex = (ColumnListViewColor)0;
|
||||
}
|
||||
|
||||
if ((int)color_num >= (int)B_COLOR_TOTAL) {
|
||||
if ((int)colorIndex >= (int)B_COLOR_TOTAL) {
|
||||
ASSERT(false);
|
||||
color_num = (ColumnListViewColor) (B_COLOR_TOTAL - 1);
|
||||
colorIndex = (ColumnListViewColor)(B_COLOR_TOTAL - 1);
|
||||
}
|
||||
|
||||
fColorList[color_num] = color;
|
||||
fColorList[colorIndex] = color;
|
||||
}
|
||||
|
||||
|
||||
rgb_color
|
||||
BColumnListView::Color(ColumnListViewColor color_num) const
|
||||
BColumnListView::Color(ColumnListViewColor colorIndex) const
|
||||
{
|
||||
if ((int)color_num < 0) {
|
||||
if ((int)colorIndex < 0) {
|
||||
ASSERT(false);
|
||||
color_num = (ColumnListViewColor) 0;
|
||||
colorIndex = (ColumnListViewColor)0;
|
||||
}
|
||||
|
||||
if ((int)color_num >= (int)B_COLOR_TOTAL) {
|
||||
if ((int)colorIndex >= (int)B_COLOR_TOTAL) {
|
||||
ASSERT(false);
|
||||
color_num = (ColumnListViewColor) (B_COLOR_TOTAL - 1);
|
||||
colorIndex = (ColumnListViewColor)(B_COLOR_TOTAL - 1);
|
||||
}
|
||||
|
||||
return fColorList[color_num];
|
||||
return fColorList[colorIndex];
|
||||
}
|
||||
|
||||
|
||||
@@ -1441,10 +1446,10 @@ void
|
||||
BColumnListView::SetHighColor(rgb_color color)
|
||||
{
|
||||
BView::SetHighColor(color);
|
||||
// fOutlineView->Invalidate(); // Redraw things with the new color
|
||||
// Note that this will currently cause
|
||||
// an infinite loop, refreshing over and over.
|
||||
// A better solution is needed.
|
||||
// fOutlineView->Invalidate();
|
||||
// Redraw with the new color.
|
||||
// Note that this will currently cause an infinite loop, refreshing
|
||||
// over and over. A better solution is needed.
|
||||
}
|
||||
|
||||
|
||||
@@ -1459,7 +1464,8 @@ void
|
||||
BColumnListView::SetBackgroundColor(rgb_color color)
|
||||
{
|
||||
fColorList[B_COLOR_BACKGROUND] = color;
|
||||
fOutlineView->Invalidate(); // Repaint with new color
|
||||
fOutlineView->Invalidate();
|
||||
// repaint with new color
|
||||
}
|
||||
|
||||
|
||||
@@ -1517,7 +1523,7 @@ BColumnListView::SuggestTextPosition(const BRow* row,
|
||||
font_height fh;
|
||||
fOutlineView->GetFontHeight(&fh);
|
||||
float baseline = floor(rect.top + fh.ascent
|
||||
+ (rect.Height()+1-(fh.ascent+fh.descent))/2);
|
||||
+ (rect.Height() + 1 - (fh.ascent + fh.descent)) / 2);
|
||||
return BPoint(rect.left + 8, baseline);
|
||||
}
|
||||
|
||||
@@ -1543,12 +1549,12 @@ BColumnListView::DrawLatch(BView* view, BRect rect, LatchType position, BRow*)
|
||||
|
||||
view->SetHighColor(0, 0, 0);
|
||||
|
||||
// Make Square
|
||||
// make square
|
||||
int32 sideLen = rect.IntegerWidth();
|
||||
if (sideLen > rect.IntegerHeight())
|
||||
sideLen = rect.IntegerHeight();
|
||||
|
||||
// Make Center
|
||||
// make center
|
||||
int32 halfWidth = rect.IntegerWidth() / 2;
|
||||
int32 halfHeight = rect.IntegerHeight() / 2;
|
||||
int32 halfSide = sideLen / 2;
|
||||
@@ -1563,7 +1569,7 @@ BColumnListView::DrawLatch(BView* view, BRect rect, LatchType position, BRow*)
|
||||
|
||||
itemRect.InsetBy(rectInset, rectInset);
|
||||
|
||||
// Make it an odd number of pixels wide, the latch looks better this way
|
||||
// make it an odd number of pixels wide, the latch looks better this way
|
||||
if ((itemRect.IntegerWidth() % 2) == 1) {
|
||||
itemRect.right += 1;
|
||||
itemRect.bottom += 1;
|
||||
@@ -1763,9 +1769,10 @@ void
|
||||
BColumnListView::WindowActivated(bool active)
|
||||
{
|
||||
fOutlineView->Invalidate();
|
||||
// Focus and selection appearance changes with focus
|
||||
// focus and selection appearance changes with focus
|
||||
|
||||
Invalidate(); // Redraw focus marks around view
|
||||
Invalidate();
|
||||
// redraw focus marks around view
|
||||
BView::WindowActivated(active);
|
||||
}
|
||||
|
||||
@@ -1851,56 +1858,56 @@ BColumnListView::Draw(BRect updateRect)
|
||||
|
||||
|
||||
void
|
||||
BColumnListView::SaveState(BMessage* msg)
|
||||
BColumnListView::SaveState(BMessage* message)
|
||||
{
|
||||
msg->MakeEmpty();
|
||||
message->MakeEmpty();
|
||||
|
||||
for (int32 i = 0; BColumn* col = (BColumn*)fColumns.ItemAt(i); i++) {
|
||||
msg->AddInt32("ID",col->fFieldID);
|
||||
msg->AddFloat("width", col->fWidth);
|
||||
msg->AddBool("visible", col->fVisible);
|
||||
for (int32 i = 0; BColumn* column = (BColumn*)fColumns.ItemAt(i); i++) {
|
||||
message->AddInt32("ID", column->fFieldID);
|
||||
message->AddFloat("width", column->fWidth);
|
||||
message->AddBool("visible", column->fVisible);
|
||||
}
|
||||
|
||||
msg->AddBool("sortingenabled", fSortingEnabled);
|
||||
message->AddBool("sortingenabled", fSortingEnabled);
|
||||
|
||||
if (fSortingEnabled) {
|
||||
for (int32 i = 0; BColumn* col = (BColumn*)fSortColumns.ItemAt(i);
|
||||
for (int32 i = 0; BColumn* column = (BColumn*)fSortColumns.ItemAt(i);
|
||||
i++) {
|
||||
msg->AddInt32("sortID", col->fFieldID);
|
||||
msg->AddBool("sortascending", col->fSortAscending);
|
||||
message->AddInt32("sortID", column->fFieldID);
|
||||
message->AddBool("sortascending", column->fSortAscending);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BColumnListView::LoadState(BMessage* msg)
|
||||
BColumnListView::LoadState(BMessage* message)
|
||||
{
|
||||
int32 id;
|
||||
for (int i = 0; msg->FindInt32("ID", i, &id) == B_OK; i++) {
|
||||
for (int i = 0; message->FindInt32("ID", i, &id) == B_OK; i++) {
|
||||
for (int j = 0; BColumn* column = (BColumn*)fColumns.ItemAt(j); j++) {
|
||||
if (column->fFieldID == id) {
|
||||
// move this column to position 'i' and set its attributes
|
||||
MoveColumn(column, i);
|
||||
float width;
|
||||
if (msg->FindFloat("width", i, &width) == B_OK)
|
||||
if (message->FindFloat("width", i, &width) == B_OK)
|
||||
column->SetWidth(width);
|
||||
bool visible;
|
||||
if (msg->FindBool("visible", i, &visible) == B_OK)
|
||||
if (message->FindBool("visible", i, &visible) == B_OK)
|
||||
column->SetVisible(visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
bool b;
|
||||
if (msg->FindBool("sortingenabled", &b) == B_OK) {
|
||||
if (message->FindBool("sortingenabled", &b) == B_OK) {
|
||||
SetSortingEnabled(b);
|
||||
for (int k = 0; msg->FindInt32("sortID", k, &id) == B_OK; k++) {
|
||||
for (int k = 0; message->FindInt32("sortID", k, &id) == B_OK; k++) {
|
||||
for (int j = 0; BColumn* column = (BColumn*)fColumns.ItemAt(j);
|
||||
j++) {
|
||||
if (column->fFieldID == id) {
|
||||
// add this column to the sort list
|
||||
bool value;
|
||||
if (msg->FindBool("sortascending", k, &value) == B_OK)
|
||||
if (message->FindBool("sortascending", k, &value) == B_OK)
|
||||
SetSortColumn(column, true, value);
|
||||
}
|
||||
}
|
||||
@@ -2051,6 +2058,7 @@ BColumnListView::_Init()
|
||||
BRect bounds(Bounds());
|
||||
if (bounds.Width() <= 0)
|
||||
bounds.right = 100;
|
||||
|
||||
if (bounds.Height() <= 0)
|
||||
bounds.bottom = 100;
|
||||
|
||||
@@ -2682,14 +2690,14 @@ TitleView::Draw(BRect invalidRect)
|
||||
}
|
||||
|
||||
|
||||
// Bevels for right title margin
|
||||
// bevels for right title margin
|
||||
if (columnLeftEdge <= invalidRect.right) {
|
||||
BRect titleRect(columnLeftEdge, 0, Bounds().right + 2,
|
||||
fVisibleRect.Height());
|
||||
DrawTitle(this, titleRect, NULL, false);
|
||||
}
|
||||
|
||||
// Bevels for left title margin
|
||||
// bevels for left title margin
|
||||
if (invalidRect.left < MAX(kLeftMargin, fMasterView->LatchWidth())) {
|
||||
BRect titleRect(0, 0, MAX(kLeftMargin, fMasterView->LatchWidth()) - 1,
|
||||
fVisibleRect.Height());
|
||||
@@ -2697,7 +2705,7 @@ TitleView::Draw(BRect invalidRect)
|
||||
}
|
||||
|
||||
#if DRAG_TITLE_OUTLINE
|
||||
// (Internal) Column Drag Indicator
|
||||
// (internal) column drag indicator
|
||||
if (fCurrentState == DRAG_COLUMN_INSIDE_TITLE) {
|
||||
BRect dragRect(fSelectedColumnRect);
|
||||
dragRect.OffsetTo(fCurrentDragPosition.x - fClickPoint.x, 0);
|
||||
@@ -2737,23 +2745,24 @@ TitleView::MessageReceived(BMessage* message)
|
||||
if (message->FindInt32("be:field_num", &num) == B_OK) {
|
||||
for (int index = 0; index < fColumns->CountItems(); index++) {
|
||||
BColumn* column = (BColumn*) fColumns->ItemAt(index);
|
||||
if (!column)
|
||||
if (column == NULL)
|
||||
continue;
|
||||
|
||||
if (column->LogicalFieldNum() == num)
|
||||
column->SetVisible(!column->IsVisible());
|
||||
}
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
BView::MessageReceived(message);
|
||||
}
|
||||
|
||||
BView::MessageReceived(message);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TitleView::MouseDown(BPoint position)
|
||||
{
|
||||
if(fEditMode)
|
||||
if (fEditMode)
|
||||
return;
|
||||
|
||||
int32 buttons = 1;
|
||||
@@ -2761,46 +2770,52 @@ TitleView::MouseDown(BPoint position)
|
||||
if (buttons == B_SECONDARY_MOUSE_BUTTON
|
||||
&& (fColumnFlags & B_ALLOW_COLUMN_POPUP)) {
|
||||
// Right mouse button -- bring up menu to show/hide columns.
|
||||
if (!fColumnPop) fColumnPop = new BPopUpMenu("Columns", false, false);
|
||||
if (fColumnPop == NULL)
|
||||
fColumnPop = new BPopUpMenu("Columns", false, false);
|
||||
|
||||
fColumnPop->RemoveItems(0, fColumnPop->CountItems(), true);
|
||||
BMessenger me(this);
|
||||
for (int index = 0; index < fColumns->CountItems(); index++) {
|
||||
BColumn* column = (BColumn*) fColumns->ItemAt(index);
|
||||
if (!column) continue;
|
||||
if (column == NULL)
|
||||
continue;
|
||||
|
||||
BString name;
|
||||
column->GetColumnName(&name);
|
||||
BMessage* msg = new BMessage(kToggleColumn);
|
||||
msg->AddInt32("be:field_num", column->LogicalFieldNum());
|
||||
BMenuItem* it = new BMenuItem(name.String(), msg);
|
||||
it->SetMarked(column->IsVisible());
|
||||
it->SetTarget(me);
|
||||
fColumnPop->AddItem(it);
|
||||
BMessage* message = new BMessage(kToggleColumn);
|
||||
message->AddInt32("be:field_num", column->LogicalFieldNum());
|
||||
BMenuItem* item = new BMenuItem(name.String(), message);
|
||||
item->SetMarked(column->IsVisible());
|
||||
item->SetTarget(me);
|
||||
fColumnPop->AddItem(item);
|
||||
}
|
||||
|
||||
BPoint screenPosition = ConvertToScreen(position);
|
||||
BRect sticky(screenPosition, screenPosition);
|
||||
sticky.InsetBy(-5, -5);
|
||||
fColumnPop->Go(ConvertToScreen(position), true, false, sticky, true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
fResizingFirstColumn = true;
|
||||
float leftEdge = MAX(kLeftMargin, fMasterView->LatchWidth());
|
||||
for (int index = 0; index < fColumns->CountItems(); index++) {
|
||||
BColumn* column = (BColumn*) fColumns->ItemAt(index);
|
||||
if (!column->IsVisible())
|
||||
BColumn* column = (BColumn*)fColumns->ItemAt(index);
|
||||
if (column == NULL || !column->IsVisible())
|
||||
continue;
|
||||
|
||||
if (leftEdge > position.x + kColumnResizeAreaWidth / 2)
|
||||
break;
|
||||
|
||||
// Check for resizing a column
|
||||
// check for resizing a column
|
||||
float rightEdge = leftEdge + column->Width();
|
||||
|
||||
if (column->ShowHeading()) {
|
||||
if (position.x > rightEdge - kColumnResizeAreaWidth / 2
|
||||
&& position.x < rightEdge + kColumnResizeAreaWidth / 2
|
||||
&& column->MaxWidth() > column->MinWidth()
|
||||
&& (fColumnFlags & B_ALLOW_COLUMN_RESIZE)) {
|
||||
&& (fColumnFlags & B_ALLOW_COLUMN_RESIZE) != 0) {
|
||||
|
||||
int32 clicks = 0;
|
||||
Window()->CurrentMessage()->FindInt32("clicks", &clicks);
|
||||
@@ -2822,7 +2837,7 @@ TitleView::MouseDown(BPoint position)
|
||||
|
||||
fResizingFirstColumn = false;
|
||||
|
||||
// Check for clicking on a column.
|
||||
// check for clicking on a column
|
||||
if (position.x > leftEdge && position.x < rightEdge) {
|
||||
fCurrentState = PRESSING_COLUMN;
|
||||
fSelectedColumn = column;
|
||||
@@ -3060,7 +3075,7 @@ TitleView::FrameResized(float width, float height)
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - OutlineView
|
||||
|
||||
|
||||
OutlineView::OutlineView(BRect rect, BList* visibleColumns, BList* sortColumns,
|
||||
@@ -3556,6 +3571,7 @@ OutlineView::FindRow(float ypos, int32* _rowIndent, float* _top)
|
||||
line += rowHeight + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,12 +20,27 @@
|
||||
#define kTEXT_MARGIN 8
|
||||
|
||||
|
||||
const int64 kKB_SIZE = 1024;
|
||||
const int64 kMB_SIZE = 1048576;
|
||||
const int64 kGB_SIZE = 1073741824;
|
||||
const int64 kTB_SIZE = kGB_SIZE * kKB_SIZE;
|
||||
|
||||
const char* kSIZE_FORMATS[] = {
|
||||
"%.2f %s",
|
||||
"%.1f %s",
|
||||
"%.f %s",
|
||||
"%.f%s",
|
||||
0
|
||||
};
|
||||
|
||||
|
||||
BTitledColumn::BTitledColumn(const char* title, float width, float minWidth,
|
||||
float maxWidth, alignment align)
|
||||
: BColumn(width, minWidth, maxWidth, align),
|
||||
float maxWidth, alignment align)
|
||||
:
|
||||
BColumn(width, minWidth, maxWidth, align),
|
||||
fTitle(title)
|
||||
{
|
||||
font_height fh;
|
||||
font_height fh;
|
||||
|
||||
be_plain_font->GetHeight(&fh);
|
||||
fFontHeight = fh.descent + fh.leading;
|
||||
@@ -60,7 +75,8 @@ BTitledColumn::DrawString(const char* string, BView* parent, BRect rect)
|
||||
|
||||
parent->GetFont(&font);
|
||||
font.GetHeight(&finfo);
|
||||
y = rect.top + ((rect.Height() - (finfo.ascent + finfo.descent + finfo.leading)) / 2)
|
||||
y = rect.top + ((rect.Height()
|
||||
- (finfo.ascent + finfo.descent + finfo.leading)) / 2)
|
||||
+ (finfo.ascent + finfo.descent) - 2;
|
||||
|
||||
switch (Alignment()) {
|
||||
@@ -70,13 +86,16 @@ BTitledColumn::DrawString(const char* string, BView* parent, BRect rect)
|
||||
break;
|
||||
|
||||
case B_ALIGN_CENTER:
|
||||
parent->MovePenTo(rect.left + kTEXT_MARGIN + ((width - font.StringWidth(string)) / 2), y);
|
||||
parent->MovePenTo(rect.left + kTEXT_MARGIN
|
||||
+ ((width - font.StringWidth(string)) / 2), y);
|
||||
break;
|
||||
|
||||
case B_ALIGN_RIGHT:
|
||||
parent->MovePenTo(rect.right - kTEXT_MARGIN - font.StringWidth(string), y);
|
||||
parent->MovePenTo(rect.right - kTEXT_MARGIN
|
||||
- font.StringWidth(string), y);
|
||||
break;
|
||||
}
|
||||
|
||||
parent->DrawString(string);
|
||||
}
|
||||
|
||||
@@ -110,7 +129,7 @@ BTitledColumn::GetPreferredWidth(BField *_field, BView* parent) const
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - BStringField
|
||||
|
||||
|
||||
BStringField::BStringField(const char* string)
|
||||
@@ -173,12 +192,13 @@ BStringField::ClippedString()
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - BStringColumn
|
||||
|
||||
|
||||
BStringColumn::BStringColumn(const char* title, float width, float minWidth,
|
||||
float maxWidth, uint32 truncate, alignment align)
|
||||
: BTitledColumn(title, width, minWidth, maxWidth, align),
|
||||
float maxWidth, uint32 truncate, alignment align)
|
||||
:
|
||||
BTitledColumn(title, width, minWidth, maxWidth, align),
|
||||
fTruncate(truncate)
|
||||
{
|
||||
}
|
||||
@@ -203,8 +223,9 @@ BStringColumn::DrawField(BField* _field, BRect rect, BView* parent)
|
||||
field->SetWidth(width);
|
||||
}
|
||||
|
||||
DrawString(field->HasClippedString() ? field->ClippedString()
|
||||
: field->String(), parent, rect);
|
||||
DrawString(field->HasClippedString()
|
||||
? field->ClippedString()
|
||||
: field->String(), parent, rect);
|
||||
}
|
||||
|
||||
|
||||
@@ -231,13 +252,13 @@ BStringColumn::AcceptsField(const BField *field) const
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - BDateField
|
||||
|
||||
|
||||
BDateField::BDateField(time_t *t)
|
||||
BDateField::BDateField(time_t* time)
|
||||
:
|
||||
fTime(*localtime(t)),
|
||||
fUnixTime(*t),
|
||||
fTime(*localtime(time)),
|
||||
fUnixTime(*time),
|
||||
fSeconds(0),
|
||||
fClippedString(""),
|
||||
fWidth(0)
|
||||
@@ -261,9 +282,9 @@ BDateField::Width()
|
||||
|
||||
|
||||
void
|
||||
BDateField::SetClippedString(const char* val)
|
||||
BDateField::SetClippedString(const char* string)
|
||||
{
|
||||
fClippedString = val;
|
||||
fClippedString = string;
|
||||
}
|
||||
|
||||
|
||||
@@ -288,12 +309,13 @@ BDateField::UnixTime()
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - BDateColumn
|
||||
|
||||
|
||||
BDateColumn::BDateColumn(const char* title, float width, float minWidth,
|
||||
float maxWidth, alignment align)
|
||||
: BTitledColumn(title, width, minWidth, maxWidth, align),
|
||||
float maxWidth, alignment align)
|
||||
:
|
||||
BTitledColumn(title, width, minWidth, maxWidth, align),
|
||||
fTitle(title)
|
||||
{
|
||||
}
|
||||
@@ -314,20 +336,21 @@ void
|
||||
BDateColumn::DrawField(BField* _field, BRect rect, BView* parent)
|
||||
{
|
||||
float width = rect.Width() - (2 * kTEXT_MARGIN);
|
||||
BDateField* field = (BDateField*)_field;
|
||||
BDateField* field = (BDateField*)_field;
|
||||
|
||||
if (field->Width() != rect.Width()) {
|
||||
char dateString[256];
|
||||
time_t curtime = field->UnixTime();
|
||||
time_t currentTime = field->UnixTime();
|
||||
tm time_data;
|
||||
BFont font;
|
||||
|
||||
parent->GetFont(&font);
|
||||
localtime_r(&curtime, &time_data);
|
||||
localtime_r(¤tTime, &time_data);
|
||||
|
||||
for (int32 index = 0; ; index++) {
|
||||
if (!kTIME_FORMATS[index])
|
||||
break;
|
||||
|
||||
strftime(dateString, 256, kTIME_FORMATS[index], &time_data);
|
||||
if (font.StringWidth(dateString) <= width)
|
||||
break;
|
||||
@@ -354,7 +377,7 @@ BDateColumn::CompareFields(BField* field1, BField* field2)
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - BSizeField
|
||||
|
||||
|
||||
BSizeField::BSizeField(off_t size)
|
||||
@@ -378,29 +401,17 @@ BSizeField::Size()
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - BSizeColumn
|
||||
|
||||
|
||||
BSizeColumn::BSizeColumn(const char* title, float width, float minWidth,
|
||||
float maxWidth, alignment align)
|
||||
: BTitledColumn(title, width, minWidth, maxWidth, align)
|
||||
float maxWidth, alignment align)
|
||||
:
|
||||
BTitledColumn(title, width, minWidth, maxWidth, align)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
const int64 kKB_SIZE = 1024;
|
||||
const int64 kMB_SIZE = 1048576;
|
||||
const int64 kGB_SIZE = 1073741824;
|
||||
const int64 kTB_SIZE = kGB_SIZE * kKB_SIZE;
|
||||
|
||||
const char *kSIZE_FORMATS[] = {
|
||||
"%.2f %s",
|
||||
"%.1f %s",
|
||||
"%.f %s",
|
||||
"%.f%s",
|
||||
0
|
||||
};
|
||||
|
||||
void
|
||||
BSizeColumn::DrawField(BField* _field, BRect rect, BView* parent)
|
||||
{
|
||||
@@ -468,7 +479,7 @@ BSizeColumn::CompareFields(BField* field1, BField* field2)
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - BIntegerField
|
||||
|
||||
|
||||
BIntegerField::BIntegerField(int32 number)
|
||||
@@ -492,12 +503,13 @@ BIntegerField::Value()
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - BIntegerColumn
|
||||
|
||||
|
||||
BIntegerColumn::BIntegerColumn(const char* title, float width, float minWidth,
|
||||
float maxWidth, alignment align)
|
||||
: BTitledColumn(title, width, minWidth, maxWidth, align)
|
||||
float maxWidth, alignment align)
|
||||
:
|
||||
BTitledColumn(title, width, minWidth, maxWidth, align)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -507,7 +519,7 @@ BIntegerColumn::DrawField(BField *field, BRect rect, BView* parent)
|
||||
{
|
||||
char formatted[256];
|
||||
float width = rect.Width() - (2 * kTEXT_MARGIN);
|
||||
BString string;
|
||||
BString string;
|
||||
|
||||
sprintf(formatted, "%d", (int)((BIntegerField*)field)->Value());
|
||||
|
||||
@@ -524,12 +536,13 @@ BIntegerColumn::CompareFields(BField *field1, BField *field2)
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - GraphColumn
|
||||
|
||||
|
||||
GraphColumn::GraphColumn(const char* name, float width, float minWidth,
|
||||
float maxWidth, alignment align)
|
||||
: BIntegerColumn(name, width, minWidth, maxWidth, align)
|
||||
float maxWidth, alignment align)
|
||||
:
|
||||
BIntegerColumn(name, width, minWidth, maxWidth, align)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -537,7 +550,7 @@ GraphColumn::GraphColumn(const char* name, float width, float minWidth,
|
||||
void
|
||||
GraphColumn::DrawField(BField* field, BRect rect, BView* parent)
|
||||
{
|
||||
int number = ((BIntegerField*)field)->Value();
|
||||
int number = ((BIntegerField*)field)->Value();
|
||||
|
||||
if (number > 100)
|
||||
number = 100;
|
||||
@@ -549,27 +562,27 @@ GraphColumn::DrawField(BField* field, BRect rect, BView* parent)
|
||||
parent->StrokeRect(graphRect);
|
||||
if (number > 0) {
|
||||
graphRect.InsetBy(1, 1);
|
||||
float val = graphRect.Width() * (float) number / 100;
|
||||
graphRect.right = graphRect.left + val;
|
||||
float value = graphRect.Width() * (float)number / 100;
|
||||
graphRect.right = graphRect.left + value;
|
||||
parent->SetHighColor(0, 0, 190);
|
||||
parent->FillRect(graphRect);
|
||||
}
|
||||
|
||||
parent->SetDrawingMode(B_OP_INVERT);
|
||||
parent->SetHighColor(128, 128, 128);
|
||||
char numstr[256];
|
||||
sprintf(numstr, "%d%%", number);
|
||||
char numberString[256];
|
||||
sprintf(numberString, "%d%%", number);
|
||||
|
||||
float width = be_plain_font->StringWidth(numstr);
|
||||
float width = be_plain_font->StringWidth(numberString);
|
||||
parent->MovePenTo(rect.left + rect.Width() / 2 - width / 2, rect.bottom - FontHeight());
|
||||
parent->DrawString(numstr);
|
||||
parent->DrawString(numberString);
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - BBitmapField
|
||||
|
||||
|
||||
BBitmapField::BBitmapField(BBitmap *bitmap)
|
||||
BBitmapField::BBitmapField(BBitmap* bitmap)
|
||||
:
|
||||
fBitmap(bitmap)
|
||||
{
|
||||
@@ -590,12 +603,13 @@ BBitmapField::SetBitmap(BBitmap* bitmap)
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - BBitmapColumn
|
||||
|
||||
|
||||
BBitmapColumn::BBitmapColumn(const char* title, float width, float minWidth,
|
||||
float maxWidth, alignment align)
|
||||
: BTitledColumn(title, width, minWidth, maxWidth, align)
|
||||
float maxWidth, alignment align)
|
||||
:
|
||||
BTitledColumn(title, width, minWidth, maxWidth, align)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -603,8 +617,8 @@ BBitmapColumn::BBitmapColumn(const char* title, float width, float minWidth,
|
||||
void
|
||||
BBitmapColumn::DrawField(BField* field, BRect rect, BView* parent)
|
||||
{
|
||||
BBitmapField *bitmapField = static_cast<BBitmapField *>(field);
|
||||
const BBitmap *bitmap = bitmapField->Bitmap();
|
||||
BBitmapField* bitmapField = static_cast<BBitmapField*>(field);
|
||||
const BBitmap* bitmap = bitmapField->Bitmap();
|
||||
|
||||
if (bitmap != NULL) {
|
||||
float x = 0.0;
|
||||
@@ -656,5 +670,3 @@ BBitmapColumn::AcceptsField(const BField *field) const
|
||||
{
|
||||
return static_cast<bool>(dynamic_cast<const BBitmapField*>(field));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -668,8 +668,10 @@ BControlLook::DrawScrollViewFrame(BView* view, BRect& rect,
|
||||
// calculate scroll corner rect before messing with the "rect"
|
||||
BRect scrollCornerFillRect(rect.right, rect.bottom,
|
||||
rect.right, rect.bottom);
|
||||
|
||||
if (horizontalScrollBarFrame.IsValid())
|
||||
scrollCornerFillRect.left = horizontalScrollBarFrame.right + 1;
|
||||
|
||||
if (verticalScrollBarFrame.IsValid())
|
||||
scrollCornerFillRect.top = verticalScrollBarFrame.bottom + 1;
|
||||
|
||||
@@ -718,7 +720,6 @@ BControlLook::DrawScrollViewFrame(BView* view, BRect& rect,
|
||||
scrollbarFrameColor, scrollbarFrameColor, scrollbarFrameColor,
|
||||
borders);
|
||||
|
||||
|
||||
verticalScrollBarFrame.InsetBy(-1, -1);
|
||||
// do not overdraw the left edge
|
||||
verticalScrollBarFrame.left += 2;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/*
|
||||
* Copyright 2010-2011, Haiku Inc.
|
||||
* Copyright 2010-2011 Haiku, Inc. All rights reserved.
|
||||
* Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
@@ -474,25 +475,25 @@ status_t
|
||||
BGridLayout::Archive(BMessage* into, bool deep) const
|
||||
{
|
||||
BArchiver archiver(into);
|
||||
status_t err = BTwoDimensionalLayout::Archive(into, deep);
|
||||
status_t result = BTwoDimensionalLayout::Archive(into, deep);
|
||||
|
||||
for (int32 i = 0; i < fRowCount && err == B_OK; i++) {
|
||||
err = into->AddFloat(kRowWeightField, fRowInfos->Weight(i));
|
||||
if (err == B_OK)
|
||||
err = into->AddFloat(kRowSizesField, fRowInfos->MinSize(i));
|
||||
if (err == B_OK)
|
||||
err = into->AddFloat(kRowSizesField, fRowInfos->MaxSize(i));
|
||||
for (int32 i = 0; i < fRowCount && result == B_OK; i++) {
|
||||
result = into->AddFloat(kRowWeightField, fRowInfos->Weight(i));
|
||||
if (result == B_OK)
|
||||
result = into->AddFloat(kRowSizesField, fRowInfos->MinSize(i));
|
||||
if (result == B_OK)
|
||||
result = into->AddFloat(kRowSizesField, fRowInfos->MaxSize(i));
|
||||
}
|
||||
|
||||
for (int32 i = 0; i < fColumnCount && err == B_OK; i++) {
|
||||
err = into->AddFloat(kColumnWeightField, fColumnInfos->Weight(i));
|
||||
if (err == B_OK)
|
||||
err = into->AddFloat(kColumnSizesField, fColumnInfos->MinSize(i));
|
||||
if (err == B_OK)
|
||||
err = into->AddFloat(kColumnSizesField, fColumnInfos->MaxSize(i));
|
||||
for (int32 i = 0; i < fColumnCount && result == B_OK; i++) {
|
||||
result = into->AddFloat(kColumnWeightField, fColumnInfos->Weight(i));
|
||||
if (result == B_OK)
|
||||
result = into->AddFloat(kColumnSizesField, fColumnInfos->MinSize(i));
|
||||
if (result == B_OK)
|
||||
result = into->AddFloat(kColumnSizesField, fColumnInfos->MaxSize(i));
|
||||
}
|
||||
|
||||
return archiver.Finish(err);
|
||||
return archiver.Finish(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -524,15 +525,17 @@ BGridLayout::ItemArchived(BMessage* into, BLayoutItem* item, int32 index) const
|
||||
{
|
||||
ItemLayoutData* data = _LayoutDataForItem(item);
|
||||
|
||||
status_t err = into->AddInt32(kItemDimensionsField, data->dimensions.x);
|
||||
if (err == B_OK)
|
||||
err = into->AddInt32(kItemDimensionsField, data->dimensions.y);
|
||||
if (err == B_OK)
|
||||
err = into->AddInt32(kItemDimensionsField, data->dimensions.width);
|
||||
if (err == B_OK)
|
||||
err = into->AddInt32(kItemDimensionsField, data->dimensions.height);
|
||||
status_t result = into->AddInt32(kItemDimensionsField, data->dimensions.x);
|
||||
if (result == B_OK)
|
||||
result = into->AddInt32(kItemDimensionsField, data->dimensions.y);
|
||||
|
||||
return err;
|
||||
if (result == B_OK)
|
||||
result = into->AddInt32(kItemDimensionsField, data->dimensions.width);
|
||||
|
||||
if (result == B_OK)
|
||||
result = into->AddInt32(kItemDimensionsField, data->dimensions.height);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -545,20 +548,20 @@ BGridLayout::ItemUnarchived(const BMessage* from,
|
||||
|
||||
index *= 4;
|
||||
// each item stores 4 int32s into kItemDimensionsField
|
||||
status_t err = from->FindInt32(kItemDimensionsField, index, &dimensions.x);
|
||||
if (err == B_OK)
|
||||
err = from->FindInt32(kItemDimensionsField, ++index, &dimensions.y);
|
||||
status_t result = from->FindInt32(kItemDimensionsField, index, &dimensions.x);
|
||||
if (result == B_OK)
|
||||
result = from->FindInt32(kItemDimensionsField, ++index, &dimensions.y);
|
||||
|
||||
if (err == B_OK)
|
||||
err = from->FindInt32(kItemDimensionsField, ++index, &dimensions.width);
|
||||
if (result == B_OK)
|
||||
result = from->FindInt32(kItemDimensionsField, ++index, &dimensions.width);
|
||||
|
||||
if (err == B_OK) {
|
||||
err = from->FindInt32(kItemDimensionsField,
|
||||
if (result == B_OK) {
|
||||
result = from->FindInt32(kItemDimensionsField,
|
||||
++index, &dimensions.height);
|
||||
}
|
||||
|
||||
if (err != B_OK)
|
||||
return err;
|
||||
if (result != B_OK)
|
||||
return result;
|
||||
|
||||
if (!_AreGridCellsEmpty(dimensions.x, dimensions.y,
|
||||
dimensions.width, dimensions.height))
|
||||
@@ -569,10 +572,11 @@ BGridLayout::ItemUnarchived(const BMessage* from,
|
||||
|
||||
if (dimensions.width > 1)
|
||||
fMultiColumnItems++;
|
||||
|
||||
if (dimensions.height > 1)
|
||||
fMultiRowItems++;
|
||||
|
||||
return err;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -594,6 +598,7 @@ BGridLayout::ItemRemoved(BLayoutItem* item, int32 fromIndex)
|
||||
|
||||
if (itemDimensions.width > 1)
|
||||
fMultiColumnItems--;
|
||||
|
||||
if (itemDimensions.height > 1)
|
||||
fMultiRowItems--;
|
||||
|
||||
@@ -639,14 +644,14 @@ BGridLayout::ItemRemoved(BLayoutItem* item, int32 fromIndex)
|
||||
bool
|
||||
BGridLayout::HasMultiColumnItems()
|
||||
{
|
||||
return (fMultiColumnItems > 0);
|
||||
return fMultiColumnItems > 0;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
BGridLayout::HasMultiRowItems()
|
||||
{
|
||||
return (fMultiRowItems > 0);
|
||||
return fMultiRowItems > 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -693,6 +698,7 @@ BGridLayout::_IsGridCellEmpty(int32 column, int32 row)
|
||||
{
|
||||
if (column < 0 || row < 0)
|
||||
return false;
|
||||
|
||||
if (column >= fColumnCount || row >= fRowCount)
|
||||
return true;
|
||||
|
||||
@@ -746,6 +752,7 @@ BGridLayout::_InsertItemIntoGrid(BLayoutItem* item)
|
||||
fGrid[column + x][row + y] = OCCUPIED_GRID_CELL;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -760,8 +767,9 @@ BGridLayout::_ResizeGrid(int32 columnCount, int32 rowCount)
|
||||
|
||||
// allocate new grid
|
||||
BLayoutItem*** grid = new(nothrow) BLayoutItem**[columnCount];
|
||||
if (!grid)
|
||||
if (grid == NULL)
|
||||
return false;
|
||||
|
||||
memset(grid, 0, sizeof(BLayoutItem**) * columnCount);
|
||||
|
||||
bool success = true;
|
||||
@@ -788,6 +796,7 @@ BGridLayout::_ResizeGrid(int32 columnCount, int32 rowCount)
|
||||
// delete the old, respectively on error the partially created grid
|
||||
for (int32 i = 0; i < columnCount; i++)
|
||||
delete[] grid[i];
|
||||
|
||||
delete[] grid;
|
||||
|
||||
return success;
|
||||
@@ -820,4 +829,3 @@ void BGridLayout::_ReservedGridLayout7() {}
|
||||
void BGridLayout::_ReservedGridLayout8() {}
|
||||
void BGridLayout::_ReservedGridLayout9() {}
|
||||
void BGridLayout::_ReservedGridLayout10() {}
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/*
|
||||
* Copyright 2010, Haiku, Inc.
|
||||
* Copyright 2010 Haiku, Inc. All rights reserved.
|
||||
* Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
@@ -81,4 +82,3 @@ void BGridView::_ReservedGridView7() {}
|
||||
void BGridView::_ReservedGridView8() {}
|
||||
void BGridView::_ReservedGridView9() {}
|
||||
void BGridView::_ReservedGridView10() {}
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/*
|
||||
* Copyright 2010, Haiku, Inc.
|
||||
* Copyright 2010 Haiku, Inc. All rights reserved.
|
||||
* Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
@@ -189,12 +190,12 @@ status_t
|
||||
BGroupLayout::Archive(BMessage* into, bool deep) const
|
||||
{
|
||||
BArchiver archiver(into);
|
||||
status_t err = BTwoDimensionalLayout::Archive(into, deep);
|
||||
status_t result = BTwoDimensionalLayout::Archive(into, deep);
|
||||
|
||||
if (err == B_OK)
|
||||
err = into->AddBool(kVerticalField, fOrientation == B_VERTICAL);
|
||||
if (result == B_OK)
|
||||
result = into->AddBool(kVerticalField, fOrientation == B_VERTICAL);
|
||||
|
||||
return archiver.Finish(err);
|
||||
return archiver.Finish(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -234,12 +235,12 @@ BGroupLayout::ItemUnarchived(const BMessage* from,
|
||||
BLayoutItem* item, int32 index)
|
||||
{
|
||||
float weight;
|
||||
status_t err = from->FindFloat(kItemWeightField, index, &weight);
|
||||
status_t result = from->FindFloat(kItemWeightField, index, &weight);
|
||||
|
||||
if (err == B_OK)
|
||||
if (result == B_OK)
|
||||
_LayoutDataForItem(item)->weight = weight;
|
||||
|
||||
return err;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -329,9 +330,7 @@ BGroupLayout::GetItemDimensions(BLayoutItem* item, Dimensions* dimensions)
|
||||
BGroupLayout::ItemLayoutData*
|
||||
BGroupLayout::_LayoutDataForItem(BLayoutItem* item) const
|
||||
{
|
||||
if (!item)
|
||||
return NULL;
|
||||
return (ItemLayoutData*)item->LayoutData();
|
||||
return item == NULL ? NULL : (ItemLayoutData*)item->LayoutData();
|
||||
}
|
||||
|
||||
|
||||
@@ -352,4 +351,3 @@ void BGroupLayout::_ReservedGroupLayout7() {}
|
||||
void BGroupLayout::_ReservedGroupLayout8() {}
|
||||
void BGroupLayout::_ReservedGroupLayout9() {}
|
||||
void BGroupLayout::_ReservedGroupLayout10() {}
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/*
|
||||
* Copyright 2010, Haiku, Inc.
|
||||
* Copyright 2010 Haiku, Inc. All rights reserved.
|
||||
* Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
@@ -17,7 +18,7 @@ BGroupView::BGroupView(orientation orientation, float spacing)
|
||||
|
||||
|
||||
BGroupView::BGroupView(const char* name, orientation orientation,
|
||||
float spacing)
|
||||
float spacing)
|
||||
:
|
||||
BView(name, 0, new BGroupLayout(orientation, spacing))
|
||||
{
|
||||
@@ -53,6 +54,7 @@ BGroupView::Instantiate(BMessage* from)
|
||||
{
|
||||
if (validate_instantiation(from, "BGroupView"))
|
||||
return new BGroupView(from);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -81,4 +83,3 @@ void BGroupView::_ReservedGroupView7() {}
|
||||
void BGroupView::_ReservedGroupView8() {}
|
||||
void BGroupView::_ReservedGroupView9() {}
|
||||
void BGroupView::_ReservedGroupView10() {}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2001-2010, Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2001-2010 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
@@ -32,7 +32,8 @@ BListItem::BListItem(uint32 level, bool expanded)
|
||||
|
||||
|
||||
BListItem::BListItem(BMessage* data)
|
||||
: BArchivable(data),
|
||||
:
|
||||
BArchivable(data),
|
||||
fTop(0.0),
|
||||
fWidth(0),
|
||||
fHeight(0),
|
||||
@@ -219,4 +220,3 @@ BListItem::SetItemVisible(bool visible)
|
||||
{
|
||||
fVisible = visible;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2001-2013 Haiku, Inc.
|
||||
* Copyright 2001-2013 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
@@ -10,8 +10,10 @@
|
||||
* John Scipione, jscipione@gmail.com
|
||||
*/
|
||||
|
||||
|
||||
//! BOutlineListView represents a "nestable" list view.
|
||||
|
||||
|
||||
#include <OutlineListView.h>
|
||||
|
||||
#include <algorithm>
|
||||
@@ -27,6 +29,7 @@
|
||||
|
||||
typedef int (*compare_func)(const BListItem* a, const BListItem* b);
|
||||
|
||||
|
||||
struct ListItemComparator {
|
||||
ListItemComparator(compare_func compareFunc)
|
||||
:
|
||||
@@ -73,7 +76,7 @@ _DoSwap(BList& list, int32 firstIndex, int32 secondIndex, BList* firstItems,
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - BOutlineListView
|
||||
|
||||
|
||||
BOutlineListView::BOutlineListView(BRect frame, const char* name,
|
||||
@@ -1059,6 +1062,7 @@ BOutlineListView::_SwapItems(int32 first, int32 second)
|
||||
|
||||
if (Superitem(firstItem) != Superitem(secondItem))
|
||||
return false;
|
||||
|
||||
if (!firstItem->IsItemVisible() || !secondItem->IsItemVisible())
|
||||
return false;
|
||||
|
||||
@@ -1077,6 +1081,7 @@ BOutlineListView::_SwapItems(int32 first, int32 second)
|
||||
_RecalcItemTops(firstIndex);
|
||||
_RescanSelection(firstIndex, secondIndex + secondSubItems.CountItems());
|
||||
Invalidate(Bounds());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1125,6 +1130,7 @@ BOutlineListView::_RemoveItem(BListItem* item, int32 fullListIndex)
|
||||
if (child == NULL || child->OutlineLevel() <= super->OutlineLevel())
|
||||
super->fHasSubitems = false;
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,8 +34,7 @@ BSeparatorView::BSeparatorView(orientation orientation, border_style border)
|
||||
|
||||
|
||||
BSeparatorView::BSeparatorView(const char* name, const char* label,
|
||||
orientation orientation, border_style border,
|
||||
const BAlignment& alignment)
|
||||
orientation orientation, border_style border, const BAlignment& alignment)
|
||||
:
|
||||
BView(name, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE)
|
||||
{
|
||||
@@ -44,8 +43,7 @@ BSeparatorView::BSeparatorView(const char* name, const char* label,
|
||||
|
||||
|
||||
BSeparatorView::BSeparatorView(const char* name, BView* labelView,
|
||||
orientation orientation, border_style border,
|
||||
const BAlignment& alignment)
|
||||
orientation orientation, border_style border, const BAlignment& alignment)
|
||||
:
|
||||
BView(name, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE)
|
||||
{
|
||||
@@ -54,8 +52,7 @@ BSeparatorView::BSeparatorView(const char* name, BView* labelView,
|
||||
|
||||
|
||||
BSeparatorView::BSeparatorView(const char* label,
|
||||
orientation orientation, border_style border,
|
||||
const BAlignment& alignment)
|
||||
orientation orientation, border_style border, const BAlignment& alignment)
|
||||
:
|
||||
BView("", B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE)
|
||||
{
|
||||
@@ -64,8 +61,7 @@ BSeparatorView::BSeparatorView(const char* label,
|
||||
|
||||
|
||||
BSeparatorView::BSeparatorView(BView* labelView,
|
||||
orientation orientation, border_style border,
|
||||
const BAlignment& alignment)
|
||||
orientation orientation, border_style border, const BAlignment& alignment)
|
||||
:
|
||||
BView("", B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE)
|
||||
{
|
||||
@@ -115,7 +111,7 @@ BSeparatorView::~BSeparatorView()
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark - archiving
|
||||
// #pragma mark - Archiving
|
||||
|
||||
|
||||
BArchivable*
|
||||
@@ -132,28 +128,28 @@ status_t
|
||||
BSeparatorView::Archive(BMessage* into, bool deep) const
|
||||
{
|
||||
// TODO: Test this.
|
||||
status_t ret = BView::Archive(into, deep);
|
||||
if (ret != B_OK)
|
||||
return ret;
|
||||
status_t result = BView::Archive(into, deep);
|
||||
if (result != B_OK)
|
||||
return result;
|
||||
|
||||
if (fLabelView != NULL)
|
||||
ret = into->AddString("_labelview", fLabelView->Name());
|
||||
result = into->AddString("_labelview", fLabelView->Name());
|
||||
else
|
||||
ret = into->AddString("_label", fLabel.String());
|
||||
result = into->AddString("_label", fLabel.String());
|
||||
|
||||
if (ret == B_OK)
|
||||
ret = into->AddInt32("_orientation", fOrientation);
|
||||
if (result == B_OK)
|
||||
result = into->AddInt32("_orientation", fOrientation);
|
||||
|
||||
if (ret == B_OK)
|
||||
ret = into->AddInt32("_halignment", fAlignment.horizontal);
|
||||
if (result == B_OK)
|
||||
result = into->AddInt32("_halignment", fAlignment.horizontal);
|
||||
|
||||
if (ret == B_OK)
|
||||
ret = into->AddInt32("_valignment", fAlignment.vertical);
|
||||
if (result == B_OK)
|
||||
result = into->AddInt32("_valignment", fAlignment.vertical);
|
||||
|
||||
if (ret == B_OK)
|
||||
ret = into->AddInt32("_border", fBorder);
|
||||
if (result == B_OK)
|
||||
result = into->AddInt32("_border", fBorder);
|
||||
|
||||
return ret;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -177,13 +173,15 @@ BSeparatorView::Draw(BRect updateRect)
|
||||
float labelWidth = StringWidth(fLabel.String());
|
||||
if (fOrientation == B_HORIZONTAL) {
|
||||
switch (fAlignment.horizontal) {
|
||||
default:
|
||||
case B_ALIGN_LEFT:
|
||||
default:
|
||||
labelBounds.right = labelBounds.left + labelWidth;
|
||||
break;
|
||||
|
||||
case B_ALIGN_RIGHT:
|
||||
labelBounds.left = labelBounds.right - labelWidth;
|
||||
break;
|
||||
|
||||
case B_ALIGN_CENTER:
|
||||
labelBounds.left = (labelBounds.left + labelBounds.right
|
||||
- labelWidth) / 2;
|
||||
@@ -192,13 +190,15 @@ BSeparatorView::Draw(BRect updateRect)
|
||||
}
|
||||
} else {
|
||||
switch (fAlignment.vertical) {
|
||||
default:
|
||||
case B_ALIGN_TOP:
|
||||
default:
|
||||
labelBounds.bottom = labelBounds.top + labelWidth;
|
||||
break;
|
||||
|
||||
case B_ALIGN_BOTTOM:
|
||||
labelBounds.top = labelBounds.bottom - labelWidth;
|
||||
break;
|
||||
|
||||
case B_ALIGN_MIDDLE:
|
||||
labelBounds.top = (labelBounds.top + labelBounds.bottom
|
||||
- labelWidth) / 2;
|
||||
@@ -234,6 +234,7 @@ BSeparatorView::Draw(BRect updateRect)
|
||||
}
|
||||
if (labelBounds.IsValid())
|
||||
region.Include(labelBounds);
|
||||
|
||||
ConstrainClippingRegion(®ion);
|
||||
}
|
||||
|
||||
@@ -291,6 +292,7 @@ BSeparatorView::GetPreferredSize(float* _width, float* _height)
|
||||
|
||||
if (_width != NULL)
|
||||
*_width = width;
|
||||
|
||||
if (_height != NULL)
|
||||
*_height = height;
|
||||
}
|
||||
@@ -313,6 +315,7 @@ BSeparatorView::MaxSize()
|
||||
size.width = B_SIZE_UNLIMITED;
|
||||
else
|
||||
size.height = B_SIZE_UNLIMITED;
|
||||
|
||||
return BLayoutUtils::ComposeSize(ExplicitMaxSize(), size);
|
||||
}
|
||||
|
||||
@@ -322,6 +325,7 @@ BSeparatorView::PreferredSize()
|
||||
{
|
||||
BSize size;
|
||||
GetPreferredSize(&size.width, &size.height);
|
||||
|
||||
return BLayoutUtils::ComposeSize(ExplicitPreferredSize(), size);
|
||||
}
|
||||
|
||||
@@ -341,6 +345,7 @@ BSeparatorView::SetOrientation(orientation orientation)
|
||||
GetFont(&font);
|
||||
if (fOrientation == B_VERTICAL)
|
||||
font.SetRotation(90.0f);
|
||||
|
||||
SetFont(&font);
|
||||
|
||||
Invalidate();
|
||||
@@ -378,6 +383,7 @@ BSeparatorView::SetLabel(const char* label)
|
||||
{
|
||||
if (label == NULL)
|
||||
label = "";
|
||||
|
||||
if (fLabel == label)
|
||||
return;
|
||||
|
||||
@@ -461,6 +467,7 @@ BSeparatorView::_BorderSize() const
|
||||
switch (fBorder) {
|
||||
case B_PLAIN_BORDER:
|
||||
return 1.0f;
|
||||
|
||||
case B_FANCY_BORDER:
|
||||
return 2.0f;
|
||||
|
||||
@@ -479,6 +486,7 @@ BSeparatorView::_MaxLabelBounds() const
|
||||
bounds.InsetBy(kMinBorderLength, 0.0f);
|
||||
else
|
||||
bounds.InsetBy(0.0f, kMinBorderLength);
|
||||
|
||||
return bounds;
|
||||
}
|
||||
|
||||
@@ -496,4 +504,3 @@ void BSeparatorView::_ReservedSeparatorView7() {}
|
||||
void BSeparatorView::_ReservedSeparatorView8() {}
|
||||
void BSeparatorView::_ReservedSeparatorView9() {}
|
||||
void BSeparatorView::_ReservedSeparatorView10() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user