コード例 #1
0
ファイル: RatingView.cpp プロジェクト: looncraz/haiku
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());
}
コード例 #2
0
ファイル: DataView.cpp プロジェクト: AmirAbrams/haiku
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);
}
コード例 #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();
}
コード例 #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();
}
コード例 #5
0
ファイル: AbstractSpinner.cpp プロジェクト: bhanug/haiku
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);
}
コード例 #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();
}