* Minor cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31375 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-07-02 15:33:06 +00:00
parent 02b73236ae
commit 1b3303e7ee
+16 -12
View File
@@ -1,27 +1,26 @@
/* /*
* Copyright 2007-2008, Haiku, Inc. All Rights Reserved. * Copyright 2007-2009, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
* Julun <[email protected]> * Julun <[email protected]>
*/ */
#include "CalendarView.h" #include "CalendarView.h"
#include <stdlib.h>
#include <Window.h> #include <Window.h>
#include <stdlib.h>
namespace BPrivate { namespace BPrivate {
namespace { namespace {
float
FontHeight(const BView *view) float
{ FontHeight(const BView *view)
{
if (!view) if (!view)
return 0.0; return 0.0;
@@ -30,13 +29,15 @@ namespace {
font_height fheight; font_height fheight;
font.GetHeight(&fheight); font.GetHeight(&fheight);
return ceilf(fheight.ascent + fheight.descent + fheight.leading); return ceilf(fheight.ascent + fheight.descent + fheight.leading);
}
} }
} // private namespace
BCalendarView::BCalendarView(BRect frame, const char *name, BCalendarView::BCalendarView(BRect frame, const char *name,
uint32 resizeMask, uint32 flags) uint32 resizeMask, uint32 flags)
: BView(frame, name, resizeMask, flags), :
BView(frame, name, resizeMask, flags),
BInvoker(), BInvoker(),
fSelectionMessage(NULL), fSelectionMessage(NULL),
fDay(0), fDay(0),
@@ -54,7 +55,8 @@ BCalendarView::BCalendarView(BRect frame, const char *name,
BCalendarView::BCalendarView(BRect frame, const char *name, week_start start, BCalendarView::BCalendarView(BRect frame, const char *name, week_start start,
uint32 resizeMask, uint32 flags) uint32 resizeMask, uint32 flags)
: BView(frame, name, resizeMask, flags), :
BView(frame, name, resizeMask, flags),
BInvoker(), BInvoker(),
fSelectionMessage(NULL), fSelectionMessage(NULL),
fDay(0), fDay(0),
@@ -77,7 +79,8 @@ BCalendarView::~BCalendarView()
BCalendarView::BCalendarView(BMessage *archive) BCalendarView::BCalendarView(BMessage *archive)
: BView(archive), :
BView(archive),
BInvoker(), BInvoker(),
fSelectionMessage(NULL), fSelectionMessage(NULL),
fDay(0), fDay(0),
@@ -335,6 +338,7 @@ BCalendarView::MakeFocus(bool state)
BView::MakeFocus(state); BView::MakeFocus(state);
// TODO: solve this better
fFocusChanged = true; fFocusChanged = true;
Draw(_RectOfDay(fFocusedDay)); Draw(_RectOfDay(fFocusedDay));
fFocusChanged = false; fFocusChanged = false;