void CTimeOSD::Init() { paint_bg = g_settings.infoClockBackground; m_time_show = time(0); //use current theme colors setColorAll(COL_FRAME_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_SHADOW_PLUS_0); //set text color if (paint_bg){ cl_col_text = COL_MENUCONTENT_TEXT; setColorBody(COL_MENUCONTENT_PLUS_0); }else{ cl_col_text = COL_INFOCLOCK_TEXT; setColorBody(COL_BACKGROUND_PLUS_0); } setClockFont(CInfoClock::getInstance()->getClockFont()); // set corner radius depending on clock height corner_rad = (g_settings.rounded_corners) ? std::max(height/10, CORNER_RADIUS_SMALL) : 0; CComponentsFrmClock::initCCLockItems(); CVolumeHelper::getInstance()->refresh(cl_font); CVolumeHelper::getInstance()->getTimeDimensions(&x, &y, &width, &height); timescale.setType(CProgressBar::PB_TIMESCALE); }
void CTimeOSD::show(time_t time_show, bool force) { time_show /= 1000; if (!force && (m_mode == MODE_HIDE || m_time_show == time_show || CScreenSaver::getInstance()->IsRun())) return; m_time_show = time_show; setColorAll(COL_FRAME_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_SHADOW_PLUS_0); //use current theme colors paint_bg = true; if (g_settings.infoClockBackground) setColorBody(COL_MENUCONTENT_PLUS_0); else setColorBody(COL_BACKGROUND_PLUS_0); enableShadow(g_settings.infoClockBackground); paint(false); }
void dmz::QtCanvasLink::set_arrow_state (const Boolean State) { if (State) { if (!_arrow1) { _arrow1 = new QGraphicsPolygonItem (this); } if (!_arrow2) { _arrow2 = new QGraphicsPolygonItem (this); } QPolygon poly (4); poly.putPoints (0, 4, 0, -9 * _arrowSizeMultiplier, 9 * _arrowSizeMultiplier, 5 * _arrowSizeMultiplier, 0, 0, -9 * _arrowSizeMultiplier, 5 * _arrowSizeMultiplier); if (_arrow1) { _arrow1->setPolygon (poly); _arrow1->setZValue (zValue () - 1.0f); _arrow1->setBrush (QBrush (Qt::SolidPattern)); } if (_arrow2) { _arrow2->setPolygon (poly); _arrow2->setZValue (zValue () - 1.0f); _arrow2->setBrush (QBrush (Qt::SolidPattern)); } setColorAll (pen ()); _set_arrow_transform (); } else { if (_arrow1) { delete _arrow1; _arrow1 = 0; } if (_arrow2) { delete _arrow2; _arrow2 = 0; } } }