void UserPromptView::DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw) { nux::Geometry const& geo = GetGeometry(); graphics_engine.PushClippingRectangle(geo); if (!IsFullRedraw()) { bg_layer_.reset(CrateBackgroundLayer(geo.width, geo.height)); nux::GetPainter().PushLayer(graphics_engine, geo, bg_layer_.get()); } if (caps_lock_on_) { for (auto const& text_entry : focus_queue_) PaintWarningIcon(graphics_engine, text_entry->GetGeometry()); if (focus_queue_.empty()) PaintWarningIcon(graphics_engine, cached_focused_geo_); } if (GetLayout()) GetLayout()->ProcessDraw(graphics_engine, force_draw); if (!IsFullRedraw()) nux::GetPainter().PopBackground(); graphics_engine.PopClippingRectangle(); }
void FilterExpanderLabel::DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw) { graphics_engine.PushClippingRectangle(GetGeometry()); int pushed_paint_layers = 0; if (!IsFullRedraw()) { if (RedirectedAncestor()) { if (cairo_label_->IsRedrawNeeded()) graphics::ClearGeometry(cairo_label_->GetGeometry()); if (expand_icon_->IsRedrawNeeded()) graphics::ClearGeometry(expand_icon_->GetGeometry()); if (right_hand_contents_ && right_hand_contents_->IsRedrawNeeded()) graphics::ClearGeometry(right_hand_contents_->GetGeometry()); if (expanded()) ClearRedirectedRenderChildArea(); } if (focus_layer_ && ShouldBeHighlighted()) { ++pushed_paint_layers; nux::GetPainter().PushLayer(graphics_engine, focus_layer_->GetGeometry(), focus_layer_.get()); } } else { nux::GetPainter().PushPaintLayerStack(); } GetLayout()->ProcessDraw(graphics_engine, force_draw); if (IsFullRedraw()) { nux::GetPainter().PopPaintLayerStack(); } else if (pushed_paint_layers > 0) { nux::GetPainter().PopBackground(pushed_paint_layers); } graphics_engine.PopClippingRectangle(); }
void UserPromptView::DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw) { nux::Geometry const& geo = GetGeometry(); graphics_engine.PushClippingRectangle(geo); if (!IsFullRedraw()) { EnsureBGLayer(); nux::GetPainter().PushLayer(graphics_engine, geo, bg_layer_.get()); } if (GetLayout()) GetLayout()->ProcessDraw(graphics_engine, force_draw); if (!IsFullRedraw()) nux::GetPainter().PopBackground(); graphics_engine.PopClippingRectangle(); }
void HudButton::DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw) { if (skip_draw_) return; if (IsFullRedraw()) { GfxContext.PushClippingRectangle(GetGeometry()); hlayout_->ProcessDraw(GfxContext, force_draw); GfxContext.PopClippingRectangle(); } }
void PaymentPreview::DrawContent(nux::GraphicsEngine& gfx_engine, bool force_draw) { nux::Geometry const& base = GetGeometry(); gfx_engine.PushClippingRectangle(base); if (!IsFullRedraw()) nux::GetPainter().PushLayer(gfx_engine, details_bg_layer_->GetGeometry(), details_bg_layer_.get()); unsigned int alpha, src, dest = 0; gfx_engine.GetRenderStates().GetBlend(alpha, src, dest); gfx_engine.GetRenderStates().SetBlend(true, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); if (GetCompositionLayout()) GetCompositionLayout()->ProcessDraw(gfx_engine, force_draw); gfx_engine.GetRenderStates().SetBlend(alpha, src, dest); if (!IsFullRedraw()) nux::GetPainter().PopBackground(); gfx_engine.PopClippingRectangle(); }
void FilterBar::DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw) { graphics_engine.PushClippingRectangle(GetGeometry()); if (!IsFullRedraw() && RedirectedAncestor()) { for (auto iter: filter_map_) { FilterExpanderLabel* filter_view = iter.second; if (filter_view && filter_view->IsVisible() && filter_view->IsRedrawNeeded()) graphics::ClearGeometry(filter_view->GetGeometry()); } } GetLayout()->ProcessDraw(graphics_engine, force_draw); graphics_engine.PopClippingRectangle(); }