Example #1
0
RatingView::RatingView(const char* name)
	:
	BView(name, B_WILL_DRAW),
	fStarBlueBitmap(RSRC_STAR_BLUE),
	fStarGrayBitmap(RSRC_STAR_GREY),
	fRating(RATING_MISSING)
{
	SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
	SetLowUIColor(ViewUIColor());
}
Example #2
0
void
DataView::AttachedToWindow()
{
	fEditor.StartWatching(this);
	MakeFocus(true);
		// this seems to be necessary - if we don't do this here,
		// the view is sometimes focus, but IsFocus() returns false...

	SetViewUIColor(B_DOCUMENT_BACKGROUND_COLOR);
	SetLowUIColor(ViewUIColor());
	SetHighUIColor(B_DOCUMENT_TEXT_COLOR);
}
Example #3
0
void
NetworkStatusView::AttachedToWindow()
{
	BView::AttachedToWindow();
	if (Parent() != NULL) {
		if ((Parent()->Flags() & B_DRAW_ON_CHILDREN) != 0)
			SetViewColor(B_TRANSPARENT_COLOR);
		else
			AdoptParentColors();
	} else
		SetViewUIColor(B_PANEL_BACKGROUND_COLOR);

	if (ViewUIColor() != B_NO_COLOR)
		SetLowUIColor(ViewUIColor());
	else
		SetLowColor(ViewColor());

	start_watching_network(
		B_WATCH_NETWORK_INTERFACE_CHANGES | B_WATCH_NETWORK_LINK_CHANGES, this);

	_Update();
}
Example #4
0
void
PowerStatusView::AttachedToWindow()
{
	BView::AttachedToWindow();
	AdoptParentColors();

	float tint = B_NO_TINT;
	color_which which = ViewUIColor(&tint);

	if (which == B_NO_COLOR)
		SetLowUIColor(B_PANEL_BACKGROUND_COLOR);
	else
		SetLowUIColor(which, tint);

	Update();
}
Example #5
0
void
BAbstractSpinner::_UpdateTextViewColors(bool enable)
{
	// Mimick BTextControl's appearance.
	rgb_color textColor = ui_color(B_DOCUMENT_TEXT_COLOR);

	if (enable) {
		fTextView->SetViewUIColor(B_DOCUMENT_BACKGROUND_COLOR);
		fTextView->SetLowUIColor(ViewUIColor());
	} else {
		rgb_color color = ui_color(B_DOCUMENT_BACKGROUND_COLOR);
		color = disable_color(ViewColor(), color);
		textColor = disable_color(textColor, ViewColor());

		fTextView->SetViewColor(color);
		fTextView->SetLowColor(color);
	}

	BFont font;
	fTextView->GetFontAndColor(0, &font);
	fTextView->SetFontAndColor(&font, B_FONT_ALL, &textColor);
}
Example #6
0
void
NetPulseView::AttachedToWindow()
{
	BView::AttachedToWindow();

	fMessageRunner = new BMessageRunner(BMessenger(this),
		new BMessage(kMsgUpdate), fUpdateInterval);

	fModemDownBitmap = new BBitmap(
		BRect(0, 0, C_MODEM_ICON_WIDTH - 1, C_MODEM_ICON_HEIGHT - 1), B_COLOR_8_BIT);

	if (fModemDownBitmap != NULL) {
		fModemDownBitmap->SetBits(kModemDownIconBits, sizeof(kModemDownIconBits),
			0, B_COLOR_8_BIT);
	}

	fModemUpBitmap = new BBitmap(
		BRect(0, 0, C_MODEM_ICON_WIDTH - 1, C_MODEM_ICON_HEIGHT - 1), B_COLOR_8_BIT);
	if (fModemUpBitmap != NULL) {
		fModemUpBitmap->SetBits(kModemUpIconBits, sizeof(kModemUpIconBits),
			0, B_COLOR_8_BIT);
	}

	AdoptParentColors();

	float tint = B_NO_TINT;
	color_which which = ViewUIColor(&tint);

	if (which == B_NO_COLOR)
		SetLowUIColor(B_PANEL_BACKGROUND_COLOR);
	else
		SetLowUIColor(which, tint);

	UpdateColorTable();
	Update();
}