这篇教程C++ tint_color函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中tint_color函数的典型用法代码示例。如果您正苦于以下问题:C++ tint_color函数的具体用法?C++ tint_color怎么用?C++ tint_color使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了tint_color函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ui_color// DrawSlidervoidPopupSlider::DrawSlider(BRect frame, bool enabled){ rgb_color background = ui_color(B_PANEL_BACKGROUND_COLOR); rgb_color lightShadow; rgb_color darkShadow; if (enabled) { lightShadow = tint_color(background, B_DARKEN_2_TINT); darkShadow = tint_color(background, B_DARKEN_4_TINT); } else { lightShadow = tint_color(background, B_DARKEN_1_TINT); darkShadow = tint_color(background, B_DARKEN_2_TINT); } BeginLineArray(4); AddLine(BPoint(frame.left, frame.bottom), BPoint(frame.left, frame.top), lightShadow); AddLine(BPoint(frame.left + 1.0, frame.top), BPoint(frame.right, frame.top), lightShadow); AddLine(BPoint(frame.right, frame.top + 1.0), BPoint(frame.right, frame.bottom), darkShadow); AddLine(BPoint(frame.right - 1.0, frame.bottom), BPoint(frame.left + 1.0, frame.bottom), darkShadow); EndLineArray(); frame.InsetBy(1.0, 1.0); SliderView::DrawSliderButton(this, frame, Value(), FormatString(), enabled);}
开发者ID:stippi,项目名称:Clockwerk,代码行数:29,
示例2: ui_colorvoidColorPreview::Draw(BRect update){ rgb_color color; if (is_enabled) color = currentcol; else color = disabledcol; if (is_rect) { if (is_enabled) { rgb_color background = ui_color(B_PANEL_BACKGROUND_COLOR); rgb_color shadow = tint_color(background, B_DARKEN_1_TINT); rgb_color darkShadow = tint_color(background, B_DARKEN_3_TINT); rgb_color light = tint_color(background, B_LIGHTEN_MAX_TINT); BRect bounds(Bounds()); BeginLineArray(4); AddLine(BPoint(bounds.left, bounds.bottom), BPoint(bounds.left, bounds.top), shadow); AddLine(BPoint(bounds.left + 1.0, bounds.top), BPoint(bounds.right, bounds.top), shadow); AddLine(BPoint(bounds.right, bounds.top + 1.0), BPoint(bounds.right, bounds.bottom), light); AddLine(BPoint(bounds.right - 1.0, bounds.bottom), BPoint(bounds.left + 1.0, bounds.bottom), light); EndLineArray(); bounds.InsetBy(1.0, 1.0); BeginLineArray(4); AddLine(BPoint(bounds.left, bounds.bottom), BPoint(bounds.left, bounds.top), darkShadow); AddLine(BPoint(bounds.left + 1.0, bounds.top), BPoint(bounds.right, bounds.top), darkShadow); AddLine(BPoint(bounds.right, bounds.top + 1.0), BPoint(bounds.right, bounds.bottom), background); AddLine(BPoint(bounds.right - 1.0, bounds.bottom), BPoint(bounds.left + 1.0, bounds.bottom), background); EndLineArray(); bounds.InsetBy(1.0, 1.0); SetHighColor(color); FillRect(bounds); } else { SetHighColor(color); FillRect(Bounds()); } } else { // fill background SetHighColor(ui_color(B_PANEL_BACKGROUND_COLOR)); FillRect(update); SetHighColor(color); FillEllipse(Bounds()); if (is_enabled) StrokeEllipse(Bounds(), B_SOLID_LOW); }}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:59,
示例3: ViewColorvoidAppGroupView::Draw(BRect updateRect){ rgb_color menuColor = ViewColor(); BRect bounds = Bounds(); rgb_color hilite = tint_color(menuColor, B_DARKEN_1_TINT); rgb_color vlight = tint_color(menuColor, B_LIGHTEN_2_TINT); bounds.bottom = bounds.top + kHeaderSize; // Draw the header background SetHighColor(tint_color(menuColor, 1.22)); SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)); StrokeLine(bounds.LeftTop(), bounds.LeftBottom()); uint32 borders = BControlLook::B_TOP_BORDER | BControlLook::B_BOTTOM_BORDER | BControlLook::B_RIGHT_BORDER; be_control_look->DrawButtonBackground(this, bounds, bounds, menuColor, 0, borders); // Draw the buttons fCollapseRect.top = (kHeaderSize - kExpandSize) / 2; fCollapseRect.left = kEdgePadding * 2; fCollapseRect.right = fCollapseRect.left + 1.5 * kExpandSize; fCollapseRect.bottom = fCollapseRect.top + kExpandSize; fCloseRect = bounds; fCloseRect.top = (kHeaderSize - kExpandSize) / 2; fCloseRect.right -= kEdgePadding * 2; fCloseRect.left = fCloseRect.right - kCloseSize; fCloseRect.bottom = fCloseRect.top + kCloseSize; uint32 arrowDirection = fCollapsed ? BControlLook::B_DOWN_ARROW : BControlLook::B_UP_ARROW; be_control_look->DrawArrowShape(this, fCollapseRect, fCollapseRect, LowColor(), arrowDirection, 0, B_DARKEN_3_TINT); SetPenSize(kPenSize); // Draw the dismiss widget BRect closeCross = fCloseRect; closeCross.InsetBy(kSmallPadding, kSmallPadding); rgb_color detailCol = ui_color(B_CONTROL_BORDER_COLOR); detailCol = tint_color(detailCol, B_LIGHTEN_2_TINT); StrokeRoundRect(fCloseRect, kSmallPadding, kSmallPadding); StrokeLine(closeCross.LeftTop(), closeCross.RightBottom()); StrokeLine(closeCross.RightTop(), closeCross.LeftBottom()); // Draw the label SetHighColor(ui_color(B_PANEL_TEXT_COLOR)); BString label = fLabel; if (fCollapsed) label << " (" << fInfo.size() << ")"; SetFont(be_bold_font); DrawString(label.String(), BPoint(fCollapseRect.right + 2 * kEdgePadding, fCloseRect.bottom));}
开发者ID:mmadia,项目名称:Haiku-services-branch,代码行数:59,
示例4: SetViewColorvoid AgentDockHeaderString::MouseDown(BPoint where){ SetViewColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), B_DARKEN_2_TINT)); Parent()->SetViewColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), B_DARKEN_2_TINT)); Invalidate(); Parent()->Invalidate(); BStringView::MouseDown(where);}
开发者ID:carriercomm,项目名称:Vision,代码行数:8,
示例5: ViewColorvoidAppGroupView::Draw(BRect updateRect){ rgb_color menuColor = ViewColor(); BRect bounds = Bounds(); rgb_color hilite = tint_color(menuColor, B_DARKEN_1_TINT); rgb_color vlight = tint_color(menuColor, B_LIGHTEN_2_TINT); bounds.bottom = bounds.top + kHeaderSize; // Draw the header background SetHighColor(tint_color(menuColor, 1.22)); SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)); StrokeLine(bounds.LeftTop(), bounds.LeftBottom()); uint32 borders = BControlLook::B_TOP_BORDER | BControlLook::B_BOTTOM_BORDER | BControlLook::B_RIGHT_BORDER; be_control_look->DrawButtonBackground(this, bounds, bounds, menuColor, 0, borders); // Draw the buttons fCollapseRect.top = (kHeaderSize - kExpandSize) / 2; fCollapseRect.left = kEdgePadding * 3; fCollapseRect.right = fCollapseRect.left + 1.5 * kExpandSize; fCollapseRect.bottom = fCollapseRect.top + kExpandSize; fCloseRect = bounds; fCloseRect.top = (kHeaderSize - kCloseSize) / 2; // Take off the 1 to line this up with the close button on the // notification view fCloseRect.right -= kEdgePadding * 3 - 1; fCloseRect.left = fCloseRect.right - kCloseSize; fCloseRect.bottom = fCloseRect.top + kCloseSize; uint32 arrowDirection = fCollapsed ? BControlLook::B_DOWN_ARROW : BControlLook::B_UP_ARROW; be_control_look->DrawArrowShape(this, fCollapseRect, fCollapseRect, LowColor(), arrowDirection, 0, B_DARKEN_3_TINT); SetPenSize(kPenSize); // Draw the dismiss widget _DrawCloseButton(updateRect); // Draw the label SetHighColor(ui_color(B_PANEL_TEXT_COLOR)); BString label = fLabel; if (fCollapsed) label << " (" << fInfo.size() << ")"; SetFont(be_bold_font); font_height fontHeight; GetFontHeight(&fontHeight); float y = (bounds.top + bounds.bottom - ceilf(fontHeight.ascent) - ceilf(fontHeight.descent)) / 2.0 + ceilf(fontHeight.ascent); DrawString(label.String(), BPoint(fCollapseRect.right + 4 * kEdgePadding, y));}
开发者ID:garodimb,项目名称:haiku,代码行数:58,
示例6: BView//******************************************************************************************************//**** TextEntryAlertBackgroundView//******************************************************************************************************TextEntryAlertBackgroundView::TextEntryAlertBackgroundView(BRect frame, BRect entry_text_rect): BView(frame,NULL,B_FOLLOW_ALL_SIDES,B_WILL_DRAW|B_FRAME_EVENTS){ m_entry_text_rect = entry_text_rect; m_cached_bounds = Bounds(); rgb_color background_color = ui_color(B_PANEL_BACKGROUND_COLOR); m_dark_1_color = tint_color(background_color,B_DARKEN_1_TINT); m_dark_2_color = tint_color(background_color,B_DARKEN_4_TINT); SetViewColor(background_color); SetDrawingMode(B_OP_COPY);}
开发者ID:HaikuArchives,项目名称:Beam,代码行数:14,
示例7: rectvoidControlView::Draw(BRect updateRect){ BRect rect(Bounds()); SetHighColor(tint_color(ViewColor(), B_LIGHTEN_2_TINT)); StrokeLine(rect.LeftTop(), rect.RightTop()); StrokeLine(rect.LeftTop(), rect.LeftBottom()); SetHighColor(tint_color(ViewColor(), B_DARKEN_2_TINT)); StrokeLine(rect.LeftBottom(), rect.RightBottom()); StrokeLine(rect.RightBottom(), rect.RightTop());}
开发者ID:nielx,项目名称:haiku-serviceskit,代码行数:12,
示例8: LockLoopervoidColorField::_DrawBorder(){ bool looperLocked = LockLooper(); fBgBitmap[1]->Lock(); rgb_color background = ui_color(B_PANEL_BACKGROUND_COLOR); rgb_color shadow = tint_color(background, B_DARKEN_1_TINT); rgb_color darkShadow = tint_color(background, B_DARKEN_3_TINT); rgb_color light = tint_color(background, B_LIGHTEN_MAX_TINT); BRect bounds(fBgView[1]->Bounds()); bounds.OffsetBy(-2.0, -2.0); BRegion region(bounds); fBgView[1]->ConstrainClippingRegion(®ion); bounds = COLOR_FIELD_RECT; bounds.OffsetBy(-2.0, -2.0); fBgView[1]->BeginLineArray(4); fBgView[1]->AddLine(BPoint(bounds.left, bounds.bottom), BPoint(bounds.left, bounds.top), shadow); fBgView[1]->AddLine(BPoint(bounds.left + 1.0, bounds.top), BPoint(bounds.right, bounds.top), shadow); fBgView[1]->AddLine(BPoint(bounds.right, bounds.top + 1.0), BPoint(bounds.right, bounds.bottom), light); fBgView[1]->AddLine(BPoint(bounds.right - 1.0, bounds.bottom), BPoint(bounds.left + 1.0, bounds.bottom), light); fBgView[1]->EndLineArray(); bounds.InsetBy(1.0, 1.0); fBgView[1]->BeginLineArray(4); fBgView[1]->AddLine(BPoint(bounds.left, bounds.bottom), BPoint(bounds.left, bounds.top), darkShadow); fBgView[1]->AddLine(BPoint(bounds.left + 1.0, bounds.top), BPoint(bounds.right, bounds.top), darkShadow); fBgView[1]->AddLine(BPoint(bounds.right, bounds.top + 1.0), BPoint(bounds.right, bounds.bottom), background); fBgView[1]->AddLine(BPoint(bounds.right - 1.0, bounds.bottom), BPoint(bounds.left + 1.0, bounds.bottom), background); fBgView[1]->EndLineArray(); bounds.InsetBy(1.0, 1.0); region.Set(bounds); fBgView[1]->ConstrainClippingRegion(®ion); fBgBitmap[1]->Unlock(); if (looperLocked) UnlockLooper();}
开发者ID:diversys,项目名称:Colors,代码行数:52,
示例9: tint_colorvoidSATDecorator::UpdateColors(DesktopSettings& settings){ DefaultDecorator::UpdateColors(settings); // Called during construction, and during any changes fHighlightTabColor = tint_color(fFocusTabColor, B_DARKEN_2_TINT); fHighlightTabColorLight = tint_color(fHighlightTabColor, (B_LIGHTEN_MAX_TINT + B_LIGHTEN_2_TINT) / 2); fHighlightTabColorBevel = tint_color(fHighlightTabColor, B_LIGHTEN_2_TINT); fHighlightTabColorShadow= tint_color(fHighlightTabColor, (B_DARKEN_1_TINT + B_NO_TINT) / 2);}
开发者ID:garodimb,项目名称:haiku,代码行数:13,
示例10: topvoid DCCConnect::Draw(BRect){ BView* top(Window()->ChildAt(0)); if (this != top) { BeginLineArray(2); AddLine(Bounds().LeftTop(), Bounds().RightTop(), tint_color(ViewColor(), B_DARKEN_2_TINT)); AddLine(Bounds().LeftTop() + BPoint(0.0, 1.0), Bounds().RightTop() + BPoint(0.0, 1.0), tint_color(ViewColor(), B_LIGHTEN_MAX_TINT)); EndLineArray(); }}
开发者ID:carriercomm,项目名称:Vision,代码行数:13,
示例11: b// DrawvoidFontValueView::Draw(BRect updateRect){ BRect b(Bounds()); // focus indication if (IsFocus()) { SetHighColor(ui_color(B_KEYBOARD_NAVIGATION_COLOR)); StrokeRect(b); b.InsetBy(1.0, 1.0); BRegion clipping; clipping.Include(b); ConstrainClippingRegion(&clipping); b.left --; } // background FillRect(b, B_SOLID_LOW); rgb_color labelColor = LowColor(); if (fEnabled) labelColor = tint_color(labelColor, B_DARKEN_MAX_TINT); else labelColor = tint_color(labelColor, B_DISABLED_LABEL_TINT); SetHighColor(labelColor); b.InsetBy(2.0, 1.0); float center = floorf(b.top + b.Height() / 2.0); BPoint arrow[3]; arrow[0] = BPoint(b.left, center - 3.0); arrow[1] = BPoint(b.left, center + 3.0); arrow[2] = BPoint(b.left + 3.0, center); FillPolygon(arrow, 3); b.left += 6.0; BFont font; GetFont(&font); font_height fh; font.GetHeight(&fh); BString truncated(fCurrentFont); font.TruncateString(&truncated, B_TRUNCATE_END, b.Width()); DrawString(truncated.String(), BPoint(b.left, floorf(center + fh.ascent / 2.0)));}
开发者ID:stippi,项目名称:Clockwerk,代码行数:51,
示例12: tint_colorvoid ArpIntControl::DrawControlBackgroundOn(BRect bounds, BView* view){ rgb_color bg, fg; if (IsEnabled() == false) { bg = mViewColor; fg = tint_color(Prefs().GetColor(ARP_INT_FG_C), B_LIGHTEN_1_TINT); if (bgImage != 0) { DrawBitmapBackgroundOn(bounds, view, bgImage); } else { view->SetHighColor(bg); view->FillRect(bounds); } view->SetLowColor(bg); } else if (IsFocus()) { bg = Prefs().GetColor(ARP_INT_BGF_C); fg = Prefs().GetColor(ARP_INT_FGF_C); view->SetHighColor(bg); view->SetLowColor(bg); // Changed this so GratuitousShadeOn() can set the low colour... GratuitousShadeOn(view, bounds, bg, -3); } else { bg = Prefs().GetColor(ARP_INT_BG_C); fg = Prefs().GetColor(ARP_INT_FG_C); view->SetHighColor(bg); view->SetLowColor(bg); // Changed this so GratuitousShadeOn() can set the low colour... GratuitousShadeOn(view, bounds, bg, -3); } BRect r = bounds; if (IsEnabled() == false) { view->SetHighColor( tint_color(bg, B_DARKEN_2_TINT) ); view->StrokeRect(bounds); view->StrokeLine(BPoint(r.left+1, r.top+1), BPoint(r.right-1, r.top+1)); view->StrokeLine(BPoint(r.left+1, r.top+2), BPoint(r.left+1, r.bottom-1)); } else { view->SetHighColor( tint_color( tint_color(bg, B_DARKEN_3_TINT), B_DARKEN_2_TINT ) ); view->StrokeRect(bounds); view->StrokeLine(BPoint(r.left+1, r.bottom-1), BPoint(r.left+1, r.bottom-1)); view->StrokeLine(BPoint(r.right-1, r.top+1), BPoint(r.right-1, r.top+1)); view->SetHighColor(tint_color(bg, B_DARKEN_3_TINT)); view->StrokeLine(BPoint(r.left+2, r.bottom-1), BPoint(r.right-1, r.bottom-1)); view->StrokeLine(BPoint(r.right-1, r.bottom-1), BPoint(r.right-1, r.top+2)); } view->SetHighColor(fg);// view->SetLowColor(bg);}
开发者ID:tgkokk,项目名称:Sequitur,代码行数:50,
示例13: draw_backgroundstatic void draw_background(BView* view, BRect b, rgb_color bgc, float borderL, float borderR, float bottomIndent){ view->SetHighColor( bgc ); view->FillRect( BRect( b.left + borderL - 1, b.top + 10, b.right - borderR, b.bottom - bottomIndent - 3) ); view->SetLowColor( bgc ); /* Shade the edges - black outline */ view->SetHighColor( 0, 0, 0 ); view->StrokeLine( BPoint(b.left + borderL - 1, b.top + 2), BPoint(b.right - borderR, b.top + 2) ); view->FillRect( BRect( b.left + borderL - 1, b.bottom - bottomIndent + 1, b.right - borderR, b.bottom - bottomIndent + 3) ); /* Shade the edges - lighten the top */ view->SetHighColor( tint_color( view->LowColor(), B_DARKEN_2_TINT ) ); view->StrokeLine( BPoint(b.left + borderL, b.top + 3), BPoint(b.right - borderR, b.top + 3) ); view->SetHighColor( tint_color( view->LowColor(), B_DARKEN_1_TINT ) ); view->StrokeLine( BPoint(b.left + borderL, b.top + 4), BPoint(b.right - borderR, b.top + 4) ); view->SetHighColor( view->LowColor() ); view->StrokeLine( BPoint(b.left + borderL, b.top + 5), BPoint(b.right - borderR, b.top + 5) ); view->SetHighColor( tint_color( view->LowColor(), B_LIGHTEN_1_TINT ) ); view->StrokeLine( BPoint(b.left + borderL, b.top + 6), BPoint(b.right - borderR, b.top + 6) ); view->SetHighColor( tint_color( view->LowColor(), B_LIGHTEN_2_TINT ) ); view->FillRect( BRect( b.left + borderL, b.top + 7, b.right - borderR, b.top + 8) ); view->SetHighColor( tint_color( view->LowColor(), B_LIGHTEN_1_TINT ) ); view->StrokeLine( BPoint(b.left + borderL, b.top + 9), BPoint(b.right - borderR, b.top + 9) ); /* Shade the edges - darken the bottom */ view->SetHighColor( tint_color( view->LowColor(), B_DARKEN_1_TINT ) ); view->StrokeLine( BPoint(b.left + borderL, b.bottom - bottomIndent - 2), BPoint(b.right - borderR, b.bottom - bottomIndent - 2) ); view->SetHighColor( tint_color( view->LowColor(), B_DARKEN_2_TINT ) ); view->StrokeLine( BPoint(b.left + borderL, b.bottom - bottomIndent - 1), BPoint(b.right - borderR, b.bottom - bottomIndent - 1) ); view->SetHighColor( tint_color( view->LowColor(), B_DARKEN_3_TINT ) ); view->StrokeLine( BPoint(b.left + borderL, b.bottom - bottomIndent + 0), BPoint(b.right - borderR, b.bottom - bottomIndent + 0) );}
开发者ID:tgkokk,项目名称:Sequitur,代码行数:34,
示例14: boundsvoidBMenuField::Draw(BRect update){ BRect bounds(Bounds()); bool active = IsFocus() && Window()->IsActive(); DrawLabel(bounds, update); BRect frame(fMenuBar->Frame()); if (be_control_look != NULL) { frame.InsetBy(-kVMargin, -kVMargin); rgb_color base = fMenuBar->LowColor(); rgb_color background = LowColor(); uint32 flags = 0; if (!fMenuBar->IsEnabled()) flags |= BControlLook::B_DISABLED; if (active) flags |= BControlLook::B_FOCUSED; be_control_look->DrawMenuFieldFrame(this, frame, update, base, background, flags); return; } if (frame.InsetByCopy(-kVMargin, -kVMargin).Intersects(update)) { SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), B_DARKEN_2_TINT)); StrokeLine(BPoint(frame.left - 1.0f, frame.top - 1.0f), BPoint(frame.left - 1.0f, frame.bottom - 1.0f)); StrokeLine(BPoint(frame.left - 1.0f, frame.top - 1.0f), BPoint(frame.right - 1.0f, frame.top - 1.0f)); StrokeLine(BPoint(frame.left + 1.0f, frame.bottom + 1.0f), BPoint(frame.right + 1.0f, frame.bottom + 1.0f)); StrokeLine(BPoint(frame.right + 1.0f, frame.top + 1.0f)); SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), B_DARKEN_4_TINT)); StrokeLine(BPoint(frame.left - 1.0f, frame.bottom), BPoint(frame.left - 1.0f, frame.bottom)); StrokeLine(BPoint(frame.right, frame.top - 1.0f), BPoint(frame.right, frame.top - 1.0f)); } if (active || fTransition) { SetHighColor(active ? ui_color(B_KEYBOARD_NAVIGATION_COLOR) : ViewColor()); StrokeRect(frame.InsetByCopy(-kVMargin, -kVMargin)); fTransition = false; }}
开发者ID:michael-manley,项目名称:haiku,代码行数:50,
示例15: Bounds/*------------------------------------------------------------------------------*/ ( ) - /*------------------------------------------------------------------------------*/void BmToolbar::Draw( BRect updateRect) { BRect bounds = Bounds(); SetHighColor( tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_LIGHTEN_1_TINT)); StrokeLine(BPoint(bounds.left, bounds.bottom - 1), BPoint(bounds.left, bounds.top)); StrokeLine(BPoint(bounds.left + 1, bounds.top), BPoint(bounds.right, bounds.top)); SetHighColor( tint_color(HighColor(), B_DARKEN_1_TINT)); StrokeLine(BPoint(bounds.right, bounds.top + 1), BPoint(bounds.right, bounds.bottom - 1)); StrokeLine(BPoint(bounds.left, bounds.bottom), BPoint(bounds.right, bounds.bottom));}
开发者ID:HaikuArchives,项目名称:Beam,代码行数:18,
示例16: tint_colorvoidTWindowMenuItem::Draw(){ if (!fExpanded) { BMenuItem::Draw(); return; } // TODO: Tint this smartly based on the low color, this does // nothing to black. rgb_color menuColor = tint_color(Menu()->LowColor(), 1.07); BRect frame(Frame()); BMenu* menu = Menu(); menu->PushState(); // if not selected or being tracked on, fill with gray TBarView* barview = (static_cast<TBarApp*>(be_app))->BarView(); if ((!IsSelected() && !menu->IsRedrawAfterSticky()) || barview->Dragging() || !IsEnabled()) { rgb_color shadow = tint_color(menuColor, 1.09); menu->SetHighColor(shadow); frame.right = frame.left + kHPad / 2; menu->FillRect(frame); menu->SetHighColor(menuColor); frame.left = frame.right + 1; frame.right = Frame().right; menu->FillRect(frame); } if (IsEnabled() && IsSelected() && !menu->IsRedrawAfterSticky()) { // fill rgb_color backColor = tint_color(menuColor, B_HIGHLIGHT_BACKGROUND_TINT); menu->SetLowColor(backColor); menu->SetHighColor(backColor); menu->FillRect(frame); } else { menu->SetLowColor(menuColor); menu->SetHighColor(menuColor); } DrawContent(); menu->PopState();}
开发者ID:SummerSnail2014,项目名称:haiku,代码行数:48,
示例17: memcpy// _MakeBitmapsvoidVolumeSlider::_MakeBitmaps(){ if (!IsValid()) return; // left side of slider memcpy(fLeftSideBits->Bits(), kVolumeSliderLeftBitmapBits, fLeftSideBits->BitsLength()); // right side of slider memcpy(fRightSideBits->Bits(), kVolumeSliderRightBits, fRightSideBits->BitsLength()); // slider knob int32 length = fKnobBits->BitsLength(); memcpy(fKnobBits->Bits(), kVolumeSliderKnobBits, length); uint8* bits = (uint8*)fKnobBits->Bits(); // black was used in the knob to represent transparency // use screen to get index for the "transarent" color used in the bitmap BScreen screen(B_MAIN_SCREEN_ID); uint8 blackIndex = screen.IndexForColor(kBlack); // replace black index with transparent index for (int32 i = 0; i < length; i++) if (bits[i] == blackIndex) bits[i] = B_TRANSPARENT_MAGIC_CMAP8; if (!IsEnabled()) { // make ghosted versions of the bitmaps dim_bitmap(fLeftSideBits, kBackground, DIM_LEVEL); dim_bitmap(fRightSideBits, kBackground, DIM_LEVEL); dim_bitmap(fKnobBits, kBackground, DIM_LEVEL); } else if (fMuted) { // replace green color (and shadow) in left slider side bits = (uint8*)fLeftSideBits->Bits(); length = fLeftSideBits->BitsLength(); uint8 greenIndex = screen.IndexForColor(kGreen); uint8 greenShadowIndex = screen.IndexForColor(kGreenShadow); rgb_color shadow = tint_color(kBackground, B_DARKEN_3_TINT); rgb_color midShadow = tint_color(kBackground, B_DARKEN_4_TINT); uint8 replaceIndex = screen.IndexForColor(shadow); uint8 replaceShadowIndex = screen.IndexForColor(midShadow); for (int32 i = 0; i < length; i++) { if (bits[i] == greenIndex) bits[i] = replaceIndex; else if (bits[i] == greenShadowIndex) bits[i] = replaceShadowIndex; } }}
开发者ID:mmanley,项目名称:Antares,代码行数:49,
示例18: keyboard_navigation_color// DrawvoidYBScrollView::Draw(BRect updateRect){ rgb_color keyboardFocus = keyboard_navigation_color(); rgb_color light = tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_LIGHTEN_MAX_TINT); rgb_color shadow = tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_1_TINT); rgb_color darkShadow = tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_2_TINT); rgb_color darkerShadow = tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_3_TINT); BRect bounds = Bounds(); if (fWindowActive && Target() && Target()->IsFocus()) { BeginLineArray(4); AddLine(BPoint(bounds.left, bounds.bottom), BPoint(bounds.left, bounds.top), keyboardFocus); AddLine(BPoint(bounds.left + 1.0, bounds.top), BPoint(bounds.right, bounds.top), keyboardFocus); AddLine(BPoint(bounds.right, bounds.top + 1.0), BPoint(bounds.right, bounds.bottom), keyboardFocus); AddLine(BPoint(bounds.right - 1.0, bounds.bottom), BPoint(bounds.left + 1.0, bounds.bottom), keyboardFocus); EndLineArray(); } else { BeginLineArray(4); AddLine(BPoint(bounds.left, bounds.bottom), BPoint(bounds.left, bounds.top), shadow); AddLine(BPoint(bounds.left + 1.0, bounds.top), BPoint(bounds.right, bounds.top), shadow); AddLine(BPoint(bounds.right, bounds.top + 1.0), BPoint(bounds.right, bounds.bottom), light); AddLine(BPoint(bounds.right - 1.0, bounds.bottom), BPoint(bounds.left + 1.0, bounds.bottom), light); EndLineArray(); } bounds.InsetBy(1.0, 1.0); BeginLineArray(4); AddLine(BPoint(bounds.left, bounds.bottom), BPoint(bounds.left, bounds.top), darkerShadow); AddLine(BPoint(bounds.left + 1.0, bounds.top), BPoint(bounds.right, bounds.top), darkShadow); AddLine(BPoint(bounds.right, bounds.top + 1.0), BPoint(bounds.right, bounds.bottom), darkShadow); AddLine(BPoint(bounds.right - 1.0, bounds.bottom), BPoint(bounds.left + 1.0, bounds.bottom), darkShadow); EndLineArray();}
开发者ID:stippi,项目名称:Clockwerk,代码行数:49,
示例19: MenuvoidTSeparatorItem::Draw(){ BMenu* menu = Menu(); if (menu == NULL) return; BRect frame(Frame()); frame.right = frame.left + kSepItemWidth; rgb_color base = ui_color(B_MENU_BACKGROUND_COLOR); menu->PushState(); menu->SetHighColor(tint_color(base, 1.22)); frame.top--; // need to expand the frame for some reason // stroke a darker line on the left edge menu->StrokeLine(frame.LeftTop(), frame.LeftBottom()); frame.left++; // fill in background be_control_look->DrawButtonBackground(menu, frame, frame, base); menu->PopState();}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:26,
示例20: BView// constructorObjectView::ObjectView(BRect frame, const char* name, uint32 resizeFlags, uint32 flags) : BView(frame, name, resizeFlags, flags), fState(NULL), fObjectType(OBJECT_LINE), fStateList(20), fColor((rgb_color){ 0, 80, 255, 100 }), fDrawingMode(B_OP_ALPHA), fFill(false), fPenSize(10.0), fScrolling(false), fInitiatingDrag(false), fLastMousePos(0.0, 0.0){ SetLowColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_LIGHTEN_1_TINT));// BFont font;// GetFont(&font);// font.SetFamilyAndStyle("Bitstream Vera Serif", "Roman");// font.SetSize(20.0);//// font.SetRotation(6.0);// SetFont(&font, B_FONT_FAMILY_AND_STYLE | B_FONT_ROTATION | B_FONT_SIZE);// State* state = State::StateFor(OBJECT_ROUND_RECT, fColor, B_OP_COPY,// false, 50.0);// state->MouseDown(BPoint(15, 15));// state->MouseMoved(BPoint(255, 305));// state->MouseUp();//// AddObject(state); SetBlendingMode(B_CONSTANT_ALPHA, B_ALPHA_OVERLAY);}
开发者ID:SummerSnail2014,项目名称:haiku,代码行数:35,
示例21: GetFontHeight//------------------------------------------------------------------------------void BMenuField::DrawLabel(BRect bounds, BRect update){ font_height fh; GetFontHeight(&fh); if (Label()) { SetLowColor(ViewColor()); float y = (float)ceil(fh.ascent + fh.descent + fh.leading) + 2.0f; float x; switch (fAlign) { case B_ALIGN_RIGHT: x = fDivider - StringWidth(Label()) - 3.0f; break; case B_ALIGN_CENTER: x = fDivider - StringWidth(Label()) / 2.0f; break; default: x = 3.0f; break; } SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), IsEnabled() ? B_DARKEN_MAX_TINT : B_DISABLED_LABEL_TINT)); DrawString(Label(), BPoint(x, y)); }}
开发者ID:Ithamar,项目名称:cosmoe,代码行数:33,
示例22: bmvoid CMimeItem::DrawItem(BView *owner, BRect bounds, bool){ BBitmap bm(BRect(0, 0, 15, 15), B_COLOR_8_BIT); if (IsSelected()) { bm.SetBits(fIconSelected, 256, 0, B_COLOR_8_BIT); owner->SetLowColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_1_TINT)); } else { bm.SetBits(fIcon, 256, 0, B_COLOR_8_BIT); owner->SetLowColor(kWhite); } BRect r(bounds); owner->FillRect(r, B_SOLID_LOW); r.InsetBy(1, 1); font_height fh; be_plain_font->GetHeight(&fh); owner->SetDrawingMode(B_OP_OVER); owner->DrawBitmap(&bm, BPoint(r.left + 2, r.top)); owner->SetDrawingMode(B_OP_COPY); owner->DrawString(fMime.Type(), BPoint(r.left + 22, r.bottom - fh.descent)); owner->SetLowColor(kWhite);} /* CMimeItem::DrawItem */
开发者ID:jscipione,项目名称:Paladin,代码行数:30,
示例23: PushStatevoidAppGroupView::_DrawCloseButton(const BRect& updateRect){ PushState(); BRect closeRect = fCloseRect; rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR); float tint = B_DARKEN_2_TINT; if (fCloseClicked) { BRect buttonRect(closeRect.InsetByCopy(-4, -4)); be_control_look->DrawButtonFrame(this, buttonRect, updateRect, base, base, BControlLook::B_ACTIVATED | BControlLook::B_BLEND_FRAME); be_control_look->DrawButtonBackground(this, buttonRect, updateRect, base, BControlLook::B_ACTIVATED); tint *= 1.2; closeRect.OffsetBy(1, 1); } base = tint_color(base, tint); SetHighColor(base); SetPenSize(2); StrokeLine(closeRect.LeftTop(), closeRect.RightBottom()); StrokeLine(closeRect.LeftBottom(), closeRect.RightTop()); PopState();}
开发者ID:garodimb,项目名称:haiku,代码行数:27,
示例24: WindowvoidBComboBox::AttachedToWindow(){ Window()->AddFilter(fWinMovedFilter); if (Parent()) { SetViewColor(Parent()->ViewColor()); SetLowColor(ViewColor()); } bool enabled = IsEnabled(); rgb_color mc = HighColor(); rgb_color base; BFont textFont; // mc used to be base in this line if (mc.red == 255 && mc.green == 255 && mc.blue == 255) base = ViewColor(); else base = LowColor(); fText->GetFontAndColor(0, &textFont); mc = enabled ? mc : disable_color(base); fText->SetFontAndColor(&textFont, B_FONT_ALL, &mc); if (!enabled) base = tint_color(base, B_DISABLED_MARK_TINT); else base.red = base.green = base.blue = 255; fText->SetLowColor(base); fText->SetViewColor(base); fText->MakeEditable(enabled);}
开发者ID:anevilyak,项目名称:haiku,代码行数:35,
示例25: nowvoidClipView::AdjustColors(){ bool fade; int32 delay; int32 step; float maxlevel; bool pause; ClipdingerSettings* settings = my_app->Settings(); if (settings->Lock()) { fade = settings->GetFade(); step = settings->GetFadeStep(); delay = settings->GetFadeDelay() * kMinuteUnits; maxlevel = 1.0 + 0.025 * settings->GetFadeMaxLevel(); pause = settings->GetFadePause(); settings->Unlock(); } if (pause) return; bigtime_t now(real_time_clock()); for (int32 i = 0; i < CountItems(); i++) { ClipItem* sItem = dynamic_cast<ClipItem *> (ItemAt(i)); if (fade) { bigtime_t minutes = (now - sItem->GetTimeSince()) / 60; float level = B_NO_TINT + (maxlevel / step * ((float)minutes / delay) / kMinuteUnits); sItem->SetColor(tint_color(ui_color(B_LIST_BACKGROUND_COLOR), (level < maxlevel) ? level : maxlevel)); // limit to maxlevel } else sItem->SetColor(ui_color(B_LIST_BACKGROUND_COLOR)); }}
开发者ID:humdingerb,项目名称:clipdinger,代码行数:34,
示例26: /* virtual */voidHeaderListItem::DrawItem(BView *owner, BRect itemRect, bool drawEverthing){ owner->SetDrawingMode(B_OP_COPY); owner->PushState(); if (IsSelected()) { rgb_color lowColor = owner->LowColor(); owner->SetHighColor(tint_color(lowColor, B_DARKEN_2_TINT)); owner->FillRect(itemRect); } owner->PopState(); itemRect.InsetBy(0, 1); owner->StrokeRect(itemRect); itemRect.InsetBy(1, 0); owner->SetDrawingMode(B_OP_OVER); BFont font; owner->GetFont(&font); float baseLine = itemRect.top + (itemRect.IntegerHeight() / 2 + font.Size() / 2); for (int32 c = 0; c < sizeof(fLabels) / sizeof(fLabels[0]); c++) { owner->MovePenTo(itemRect.left + 1 + (fRect.Width() + kDistance) * c, baseLine); owner->DrawString(fLabels[c]); }}
开发者ID:looncraz,项目名称:haiku,代码行数:31,
示例27: BoundsvoidWidgetFrame::Draw(BRect rect){ rect = Bounds(); rgb_color background = ui_color(B_PANEL_BACKGROUND_COLOR); rgb_color shadowColor = {120,120,120}; float lightTint = 1.6; rgb_color high = tint_color(background, lightTint); rgb_color black = {120,120,120}; float x = 15; float y = 15; rect.left++; rect.top++; SetDrawingMode(B_OP_OVER); SetHighColor(shadowColor); SetDrawingMode(B_OP_ALPHA); BGradientRadialFocus frameGradient; frameGradient.AddColor(black, 0); frameGradient.AddColor(high, 255); frameGradient.AddColor(high, 0); FillRoundRect(rect, x, y, frameGradient);}
开发者ID:Barrett17,项目名称:Faber,代码行数:30,
注:本文中的tint_color函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ tip函数代码示例 C++ timevar_push函数代码示例 |