Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24770 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
9a87228642
commit
70f87b87d9
@ -34,15 +34,20 @@ All rights reserved.
|
|||||||
|
|
||||||
// defines the status area drawn in the bottom left corner of a Tracker window
|
// defines the status area drawn in the bottom left corner of a Tracker window
|
||||||
|
|
||||||
|
#include "CountView.h"
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
|
||||||
#include "AutoLock.h"
|
#include "AutoLock.h"
|
||||||
#include "Bitmaps.h"
|
#include "Bitmaps.h"
|
||||||
#include "CountView.h"
|
|
||||||
#include "ContainerWindow.h"
|
#include "ContainerWindow.h"
|
||||||
#include "DirMenu.h"
|
#include "DirMenu.h"
|
||||||
#include "PoseView.h"
|
#include "PoseView.h"
|
||||||
|
|
||||||
|
|
||||||
|
const bigtime_t kBarberPoleDelay = 500000;
|
||||||
|
|
||||||
|
|
||||||
BCountView::BCountView(BRect bounds, BPoseView* view)
|
BCountView::BCountView(BRect bounds, BPoseView* view)
|
||||||
: BView(bounds, "CountVw", B_FOLLOW_LEFT + B_FOLLOW_BOTTOM,
|
: BView(bounds, "CountVw", B_FOLLOW_LEFT + B_FOLLOW_BOTTOM,
|
||||||
B_PULSE_NEEDED | B_WILL_DRAW),
|
B_PULSE_NEEDED | B_WILL_DRAW),
|
||||||
@ -53,17 +58,18 @@ BCountView::BCountView(BRect bounds, BPoseView* view)
|
|||||||
fLastBarberPoleOffset(5),
|
fLastBarberPoleOffset(5),
|
||||||
fStartSpinningAfter(0),
|
fStartSpinningAfter(0),
|
||||||
fTypeAheadString("")
|
fTypeAheadString("")
|
||||||
|
|
||||||
{
|
{
|
||||||
GetTrackerResources()->GetBitmapResource(B_MESSAGE_TYPE, kResBarberPoleBitmap,
|
GetTrackerResources()->GetBitmapResource(B_MESSAGE_TYPE,
|
||||||
&fBarberPoleMap);
|
kResBarberPoleBitmap, &fBarberPoleMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BCountView::~BCountView()
|
BCountView::~BCountView()
|
||||||
{
|
{
|
||||||
delete fBarberPoleMap;
|
delete fBarberPoleMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BCountView::TrySpinningBarberPole()
|
BCountView::TrySpinningBarberPole()
|
||||||
{
|
{
|
||||||
@ -83,12 +89,14 @@ BCountView::TrySpinningBarberPole()
|
|||||||
Invalidate(BarberPoleInnerRect());
|
Invalidate(BarberPoleInnerRect());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BCountView::Pulse()
|
BCountView::Pulse()
|
||||||
{
|
{
|
||||||
TrySpinningBarberPole();
|
TrySpinningBarberPole();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BCountView::EndBarberPole()
|
BCountView::EndBarberPole()
|
||||||
{
|
{
|
||||||
@ -99,7 +107,6 @@ BCountView::EndBarberPole()
|
|||||||
Invalidate();
|
Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
const bigtime_t kBarberPoleDelay = 500000;
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BCountView::StartBarberPole()
|
BCountView::StartBarberPole()
|
||||||
@ -113,6 +120,7 @@ BCountView::StartBarberPole()
|
|||||||
// wait a bit before showing the barber pole
|
// wait a bit before showing the barber pole
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BRect
|
BRect
|
||||||
BCountView::BarberPoleInnerRect() const
|
BCountView::BarberPoleInnerRect() const
|
||||||
{
|
{
|
||||||
@ -123,6 +131,7 @@ BCountView::BarberPoleInnerRect() const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BRect
|
BRect
|
||||||
BCountView::BarberPoleOuterRect() const
|
BCountView::BarberPoleOuterRect() const
|
||||||
{
|
{
|
||||||
@ -131,6 +140,7 @@ BCountView::BarberPoleOuterRect() const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BRect
|
BRect
|
||||||
BCountView::TextInvalRect() const
|
BCountView::TextInvalRect() const
|
||||||
{
|
{
|
||||||
@ -138,12 +148,13 @@ BCountView::TextInvalRect() const
|
|||||||
result.InsetBy(4, 2);
|
result.InsetBy(4, 2);
|
||||||
|
|
||||||
// if the barber pole is not present, use its space for text
|
// if the barber pole is not present, use its space for text
|
||||||
if(fShowingBarberPole)
|
if (fShowingBarberPole)
|
||||||
result.right -= 10;
|
result.right -= 10;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BRect
|
BRect
|
||||||
BCountView::TextAndBarberPoleRect() const
|
BCountView::TextAndBarberPoleRect() const
|
||||||
{
|
{
|
||||||
@ -153,6 +164,7 @@ BCountView::TextAndBarberPoleRect() const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BCountView::CheckCount()
|
BCountView::CheckCount()
|
||||||
{
|
{
|
||||||
@ -165,6 +177,7 @@ BCountView::CheckCount()
|
|||||||
TrySpinningBarberPole();
|
TrySpinningBarberPole();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BCountView::Draw(BRect)
|
BCountView::Draw(BRect)
|
||||||
{
|
{
|
||||||
@ -185,11 +198,12 @@ BCountView::Draw(BRect)
|
|||||||
|
|
||||||
TruncateString(&string, B_TRUNCATE_END, textRect.Width());
|
TruncateString(&string, B_TRUNCATE_END, textRect.Width());
|
||||||
|
|
||||||
if (IsTypingAhead())
|
if (IsTypingAhead()) {
|
||||||
// use a muted gray for the typeahead
|
// use a muted gray for the typeahead
|
||||||
SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_4_TINT));
|
SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_4_TINT));
|
||||||
else
|
} else
|
||||||
SetHighColor(0, 0, 0);
|
SetHighColor(0, 0, 0);
|
||||||
|
|
||||||
MovePenTo(textRect.LeftBottom());
|
MovePenTo(textRect.LeftBottom());
|
||||||
DrawString(string.String());
|
DrawString(string.String());
|
||||||
|
|
||||||
@ -237,6 +251,7 @@ BCountView::Draw(BRect)
|
|||||||
DrawBitmap(fBarberPoleMap, destRect);
|
DrawBitmap(fBarberPoleMap, destRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BCountView::MouseDown(BPoint)
|
BCountView::MouseDown(BPoint)
|
||||||
{
|
{
|
||||||
@ -266,6 +281,7 @@ BCountView::MouseDown(BPoint)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BCountView::AttachedToWindow()
|
BCountView::AttachedToWindow()
|
||||||
{
|
{
|
||||||
@ -278,6 +294,7 @@ BCountView::AttachedToWindow()
|
|||||||
CheckCount();
|
CheckCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BCountView::SetTypeAhead(const char *string)
|
BCountView::SetTypeAhead(const char *string)
|
||||||
{
|
{
|
||||||
@ -285,12 +302,14 @@ BCountView::SetTypeAhead(const char *string)
|
|||||||
Invalidate();
|
Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
BCountView::TypeAhead() const
|
BCountView::TypeAhead() const
|
||||||
{
|
{
|
||||||
return fTypeAheadString.String();
|
return fTypeAheadString.String();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
BCountView::IsTypingAhead() const
|
BCountView::IsTypingAhead() const
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user