void Box::setLazyNutType(const QString &lazyNutType) { m_lazyNutType = lazyNutType; if (m_lazyNutType == "layer") { m_qColor = m_colour.isEmpty() ? layerCol : QColor(m_colour); // layerFilter = new ObjectCacheFilter(SessionManager::instance()->descriptionCache, this); // layerUpdater = new ObjectUpdater(this); // layerUpdater->setProxyModel(layerFilter); // if (m_name == "letters") // qDebug() << Q_FUNC_INFO << "this " << this << "layerUpdater" << layerUpdater; // connect(layerUpdater, SIGNAL(objectUpdated(QDomDocument*,QString)), this, SLOT(cacheDefaultPlotTypes(QDomDocument*))); //// connect(layerUpdater, &ObjectUpdater::objectUpdated, [=](QDomDocument* domdoc,QString name) //// { //// qDebug() << "ObjectUpdater::objectUpdated" << (domdoc != 0) << name; //// }); // layerFilter->setName(m_name); // layerUpdater->requestObject(m_name); } else if (m_lazyNutType == "representation") { m_qColor = m_colour.isEmpty() ? representationCol : QColor(m_colour); } setFillColour(m_qColor); emit lazyNutTypeChanged(); }
static void mainBackgroundUpdateProc(Layer* this_layer, GContext *ctx) { // Colour background setFillColour(ctx, s_colourBackground); graphics_fill_rect(ctx, layer_get_bounds(this_layer), 0, GCornersAll); // Colour fourground setFillColour(ctx, s_colourFourground); GRect L = s_liquid; L.origin.y /= SUB_PIXEL; graphics_fill_rect(ctx, L, 0, GCornersAll); // Colour waves if (s_nWaves) { setFillColour(ctx, s_colourBackground); for (int i = 0; i < s_nWaves; ++i) { GRect W = s_wave[i]; W.origin.y /= SUB_PIXEL; graphics_fill_rect(ctx, W, 0, GCornersAll); } } // Draw current level indicator GRect b = layer_get_bounds(this_layer); GRect levelRect = GRect( ((b.size.w - BOARD_SIZE_X)/2), b.size.h - 15, PIECE_PIXELS, 15); #ifdef PBL_ROUND levelRect.origin.x = 0; // Round screens - level indicator is centered levelRect.size.w = b.size.w; levelRect.origin.y -= 4; #endif static char levelBuffer[5]; snprintf(levelBuffer, 5, "%i", s_score.level); graphics_context_set_text_color(ctx, GColorBlack); graphics_draw_text(ctx, levelBuffer, fonts_get_system_font(FONT_KEY_GOTHIC_14_BOLD), levelRect, GTextOverflowModeWordWrap, GTextAlignmentCenter, NULL); // Draw FPS indicator (dbg only) #ifdef DEBUG_MODE static char FPSBuffer[5]; snprintf(FPSBuffer, 5, "%i", s_lastSecondFPS); GRect fpsRect = GRect( 100, b.size.h - 15, PIECE_PIXELS, 15); graphics_draw_text(ctx, FPSBuffer, fonts_get_system_font(FONT_KEY_GOTHIC_14_BOLD), fpsRect, GTextOverflowModeWordWrap, GTextAlignmentCenter, NULL); #endif }
Box::Box() : QObject(), DiagramItem(DiagramItem::Layer,"",new QMenu,0), m_longNameToDisplayIntact("Orthographic"), m_widthMarginProportionToLongestLabel(0.1), m_labelPointSize(9), default_input_observer_Rex("input_channel ([^)]*)\\) default_observer\\)"), enabledObserverSet(), m_qColor(layerCol), anyEnabled(false) { setFlag(QGraphicsItem::ItemIsSelectable); setFlag(QGraphicsItem::ItemIsMovable); setFlag(QGraphicsItem::ItemSendsGeometryChanges); labelFont = QFont("Anka Coder", 10); //, QFont::Bold scene() ? scene()->font() : QFont(); connect(this, SIGNAL(lazyNutTypeChanged()), this, SLOT(setupDefaultObserverFilter())); m_ports.clear(); setZValue(10); autoFontSize(); setFillColour(m_qColor); }
void Box::setColour(const QString &colour) { m_colour = colour; m_qColor = QColor(m_colour); setFillColour(m_qColor); }