* Patch from diver: use vector icons in ColumnListView

* style cleanup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40535 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2011-02-16 18:20:40 +00:00
parent 0812493886
commit 5788aadfe3
2 changed files with 33 additions and 29 deletions

View File

@ -51,7 +51,7 @@ const char* ShortcutsSpec::sCommandName;
#define ICON_BITMAP_RECT BRect(0.0f, 0.0f, 15.0f, 15.0f)
#define ICON_BITMAP_SPACE B_COLOR_8_BIT
#define ICON_BITMAP_SPACE B_RGBA32
// Returns the (pos)'th char in the string, or '\0' if (pos) if off the end of
@ -441,7 +441,7 @@ ShortcutsSpec::DrawItemColumn(BView* owner, BRect item_column_rect,
bitmapRegion.Include(item_column_rect);
owner->ConstrainClippingRegion(&bitmapRegion);
owner->SetDrawingMode(B_OP_OVER);
owner->SetDrawingMode(B_OP_ALPHA);
if ((fCommand != NULL) && (fCommand[0] == '*'))
owner->DrawBitmap(sActuatorBitmaps[fBitmapValid ? 1 : 0],

View File

@ -60,8 +60,9 @@ class CLVContainerView : public BScrollView
CLVContainerView::CLVContainerView(char* name, BView* target, uint32 resizingMode, uint32 flags,
bool horizontal, bool vertical, border_style border) :
BScrollView(name,target,resizingMode,flags,horizontal,vertical,border)
bool horizontal, bool vertical, border_style border)
:
BScrollView(name, target, resizingMode, flags, horizontal, vertical, border)
{
IsBeingDestroyed = false;
};
@ -73,35 +74,38 @@ CLVContainerView::~CLVContainerView()
}
ColumnListView::ColumnListView(BRect Frame, BScrollView **ContainerView, const char *Name,
uint32 ResizingMode, uint32 flags, list_view_type Type, bool hierarchical, bool horizontal,
bool vertical, border_style border, const BFont *LabelFont)
: BListView(Frame,Name,Type,B_FOLLOW_ALL_SIDES,flags|B_PULSE_NEEDED),
fHierarchical(hierarchical),
fColumnList(6),
fColumnDisplayList(6),
fDataWidth(0),
fDataHeight(0),
fPageWidth(0),
fPageHeight(0),
fSortKeyList(6),
fRightArrow(BRect(0.0,0.0,10.0,10.0),B_COLOR_8_BIT,CLVRightArrowData,false,false),
fDownArrow(BRect(0.0,0.0,10.0,10.0),B_COLOR_8_BIT,CLVDownArrowData,false,false),
fFullItemList(32),
_selectedColumn(-1),
_editMessage(NULL)
ColumnListView::ColumnListView(BRect frame, BScrollView **containerView,
const char *name, uint32 resizingMode, uint32 flags, list_view_type type,
bool hierarchical, bool horizontal, bool vertical, border_style border,
const BFont *labelFont)
:
BListView(frame, name, type, B_FOLLOW_ALL_SIDES, flags | B_PULSE_NEEDED),
fHierarchical(hierarchical),
fColumnList(6),
fColumnDisplayList(6),
fDataWidth(0),
fDataHeight(0),
fPageWidth(0),
fPageHeight(0),
fSortKeyList(6),
fRightArrow(BRect(0, 0, 10, 10), B_RGBA32, CLVRightArrowData, false, false),
fDownArrow(BRect(0, 0, 10, 10), B_RGBA32, CLVDownArrowData, false, false),
fFullItemList(32),
_selectedColumn(-1),
_editMessage(NULL)
{
//Create the column titles bar view
font_height FontAttributes;
LabelFont->GetHeight(&FontAttributes);
float fLabelFontHeight = ceil(FontAttributes.ascent) + ceil(FontAttributes.descent);
float ColumnLabelViewBottom = Frame.top+1.0+fLabelFontHeight+3.0;
fColumnLabelView = new CLVColumnLabelView(BRect(Frame.left,Frame.top,Frame.right,
ColumnLabelViewBottom),this,LabelFont);
font_height fontAttributes;
labelFont->GetHeight(&fontAttributes);
float fLabelFontHeight = ceil(fontAttributes.ascent)
+ ceil(fontAttributes.descent);
float columnLabelViewBottom = frame.top + 1 + fLabelFontHeight + 3;
fColumnLabelView = new CLVColumnLabelView(BRect(frame.left, frame.top,
frame.right, columnLabelViewBottom), this, labelFont);
//Create the container view
CreateContainer(horizontal,vertical,border,ResizingMode,flags);
*ContainerView = fScrollView;
CreateContainer(horizontal, vertical, border, resizingMode, flags);
*containerView = fScrollView;
//Complete the setup
UpdateColumnSizesDataRectSizeScrollBars();