* 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_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 // 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); bitmapRegion.Include(item_column_rect);
owner->ConstrainClippingRegion(&bitmapRegion); owner->ConstrainClippingRegion(&bitmapRegion);
owner->SetDrawingMode(B_OP_OVER); owner->SetDrawingMode(B_OP_ALPHA);
if ((fCommand != NULL) && (fCommand[0] == '*')) if ((fCommand != NULL) && (fCommand[0] == '*'))
owner->DrawBitmap(sActuatorBitmaps[fBitmapValid ? 1 : 0], owner->DrawBitmap(sActuatorBitmaps[fBitmapValid ? 1 : 0],

View File

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