49
51
void OnBackgroundColorChanged(GVariant* args);
51
void Draw(nux::GraphicsEngine& gfx_context, nux::Geometry content_geo, nux::Geometry absolute_geo, nux::Geometry geometry);
53
void Draw(nux::GraphicsEngine& gfx_context, nux::Geometry content_geo, nux::Geometry absolute_geo, nux::Geometry geometry, bool force_draw);
52
54
void DrawContent(nux::GraphicsEngine& gfx_context, nux::Geometry content_geo, nux::Geometry absolute_geo, nux::Geometry geometry);
53
55
void DrawContentCleanup(nux::GraphicsEngine& gfx_context, nux::Geometry content_geo, nux::Geometry absolute_geo, nux::Geometry geometry);
116
118
parent->need_redraw.emit();
119
void OverlayRendererImpl::Draw(nux::GraphicsEngine& gfx_context, nux::Geometry content_geo, nux::Geometry absolute_geo, nux::Geometry geometry)
121
void OverlayRendererImpl::Draw(nux::GraphicsEngine& gfx_context, nux::Geometry content_geo, nux::Geometry absolute_geo, nux::Geometry geometry, bool force_edges)
121
123
bool paint_blur = BackgroundEffectHelper::blur_type != BLUR_NONE;
122
124
nux::Geometry geo = content_geo;
124
if (dash::Settings::Instance().GetFormFactor() != dash::FormFactor::NETBOOK)
126
if (dash::Settings::Instance().GetFormFactor() != dash::FormFactor::NETBOOK || force_edges)
126
128
// Paint the edges
268
270
gfx_context.PopClippingRectangle();
274
// Draw the left and top lines
275
gfx_context.GetRenderStates().SetColorMask(true, true, true, true);
276
gfx_context.GetRenderStates().SetBlend(true);
277
gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
279
const double line_opacity = 0.22;
280
nux::Color line_color = nux::color::White * line_opacity;
281
nux::GetPainter().Paint2DQuadColor(gfx_context,
282
nux::Geometry(geometry.x,
285
content_geo.height + INNER_CORNER_RADIUS),
286
nux::color::Transparent,
289
nux::color::Transparent);
291
nux::GetPainter().Paint2DQuadColor(gfx_context,
292
nux::Geometry(geometry.x,
294
content_geo.width + INNER_CORNER_RADIUS,
296
nux::color::Transparent,
297
nux::color::Transparent,
301
// Draw the background
272
302
bg_darken_layer_->SetGeometry(content_geo);
273
303
nux::GetPainter().RenderSinglePaintLayer(gfx_context, content_geo, bg_darken_layer_);
287
317
content_geo.width, content_geo.height,
288
318
bg_shine_texture_, texxform_absolute_bg, nux::color::White);
290
// Make round corners
293
rop.SrcBlend = GL_ZERO;
294
rop.DstBlend = GL_SRC_ALPHA;
295
nux::GetPainter().PaintShapeCornerROP(gfx_context,
298
nux::eSHAPE_CORNER_ROUND4,
299
nux::eCornerBottomRight,
303
gfx_context.GetRenderStates().SetColorMask(true, true, true, true);
304
gfx_context.GetRenderStates().SetBlend(true);
305
gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
308
nux::GetPainter().Paint2DQuadColor(gfx_context,
312
content_geo.height + 5),
313
nux::Color(0.0f, 0.0f, 0.0f, 0.0f),
314
nux::Color(0.15f, 0.15f, 0.15f, 0.15f),
315
nux::Color(0.15f, 0.15f, 0.15f, 0.15f),
316
nux::Color(0.0f, 0.0f, 0.0f, 0.0f));
317
nux::GetPainter().Paint2DQuadColor(gfx_context,
320
content_geo.width + 5,
322
nux::Color(0.0f, 0.0f, 0.0f, 0.0f),
323
nux::Color(0.0f, 0.0f, 0.0f, 0.0f),
324
nux::Color(0.15f, 0.15f, 0.15f, 0.15f),
325
nux::Color(0.15f, 0.15f, 0.15f, 0.15f));
328
// Fill in corners (meh)
329
for (int i = 1; i < 6; ++i)
320
if (dash::Settings::Instance().GetFormFactor() != dash::FormFactor::NETBOOK)
331
nux::Geometry fill_geo (geo.x + geo.width, geo.y + i - 1, 6 - i, 1);
332
nux::GetPainter().Paint2DQuadColor(gfx_context, fill_geo, bg_color_);
334
nux::Color dark = bg_color_ * 0.8f;
335
dark.alpha = bg_color_.alpha;
336
fill_geo = nux::Geometry(geo.x + i - 1 , geo.y + geo.height, 1, 6 - i);
337
nux::GetPainter().Paint2DQuadColor(gfx_context, fill_geo, dark);
322
// Make bottom-right corner rounded
325
rop.SrcBlend = GL_ZERO;
326
rop.DstBlend = GL_SRC_ALPHA;
327
nux::GetPainter().PaintShapeCornerROP(gfx_context,
330
nux::eSHAPE_CORNER_ROUND4,
331
nux::eCornerBottomRight,
337
gfx_context.GetRenderStates().SetColorMask(true, true, true, true);
338
gfx_context.GetRenderStates().SetBlend(true);
339
gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
341
// Fill in corners (meh)
342
for (int i = 0; i < INNER_CORNER_RADIUS; ++i)
344
nux::Geometry fill_geo (geo.x + geo.width, geo.y + i, INNER_CORNER_RADIUS - i, 1);
345
nux::GetPainter().Paint2DQuadColor(gfx_context, fill_geo, bg_color_);
347
nux::Color dark = bg_color_ * 0.8f;
348
dark.alpha = bg_color_.alpha;
349
fill_geo = nux::Geometry(geo.x + i, geo.y + geo.height, 1, INNER_CORNER_RADIUS - i);
350
nux::GetPainter().Paint2DQuadColor(gfx_context, fill_geo, dark);
403
417
gfx_context.GetRenderStates().SetBlend(false);
404
418
gfx_context.PopClippingRectangle();
406
// Make round corners
409
rop.SrcBlend = GL_ZERO;
410
rop.DstBlend = GL_SRC_ALPHA;
411
nux::GetPainter().PaintShapeCornerROP(gfx_context,
414
nux::eSHAPE_CORNER_ROUND4,
415
nux::eCornerBottomRight,
420
if (dash::Settings::Instance().GetFormFactor() != dash::FormFactor::NETBOOK)
422
// Make bottom-right corner rounded
425
rop.SrcBlend = GL_ZERO;
426
rop.DstBlend = GL_SRC_ALPHA;
427
nux::GetPainter().PaintShapeCornerROP(gfx_context,
430
nux::eSHAPE_CORNER_ROUND4,
431
nux::eCornerBottomRight,
458
475
pimpl_->bg_effect_helper_.blur_type = BLUR_NONE;
461
void OverlayRenderer::DrawFull(nux::GraphicsEngine& gfx_context, nux::Geometry content_geo, nux::Geometry absolute_geo, nux::Geometry geo)
478
void OverlayRenderer::DrawFull(nux::GraphicsEngine& gfx_context, nux::Geometry content_geo, nux::Geometry absolute_geo, nux::Geometry geo, bool force_edges)
463
pimpl_->Draw(gfx_context, content_geo, absolute_geo, geo);
480
pimpl_->Draw(gfx_context, content_geo, absolute_geo, geo, force_edges);
466
483
void OverlayRenderer::DrawInner(nux::GraphicsEngine& gfx_context, nux::Geometry content_geo, nux::Geometry absolute_geo, nux::Geometry geo)