示例#1
0
bool PlotCellValue::operator==(const PlotCellValue& rhs) const {
    if (isValue()) {
        return rhs.isValue() && (getValue() == rhs.getValue())
            && (isHighlighted() == rhs.isHighlighted());
    }
    else {
        return rhs.isTag() && (getTag() == rhs.getTag())
            && (isHighlighted() == rhs.isHighlighted());
    }
}
示例#2
0
文件: cell.cpp 项目: Tilka/epsilon
void Cell::reloadCell() {
  HighlightCell::reloadCell();
  KDColor backgroundColor = isHighlighted()? Palette::Select : KDColorWhite;
  m_labelView.setBackgroundColor(backgroundColor);
  if (isHighlighted()) {
    m_iconView.setImage(m_focusedIcon);
  } else {
    m_iconView.setImage(m_icon);
  }
}
void ofxNUIWidgetNode::setHighlight(bool _isHighlighted)
{
    
    ofxNUINode::setHighlight(_isHighlighted);
    
    if (!isHighlighted() && !isActive()) {
        getCanvas()->setVisible(false);
    }
    
    else if (isHighlighted()) {
        getCanvas()->setVisible(true);
        updateSuperCanvas();
        getCanvas()->autoSizeToFitWidgets();
    }
    
}
示例#4
0
void VertexCell::drawRaw(Time time, ViewSettings & viewSettings)
{
    if(isHighlighted() || isSelected())
    {
        Cell::drawRaw(time, viewSettings);
    }
}
bool CPetInventoryGlyph::doAction(CGlyphAction *action) {
	CInventoryGlyphAction *invAction = static_cast<CInventoryGlyphAction *>(action);
	CPetInventoryGlyphs *owner = dynamic_cast<CPetInventoryGlyphs *>(_owner);
	if (!invAction)
		return false;

	switch (invAction->getMode()) {
	case ACTION_REMOVED:
		if (invAction->_item == _item) {
			_item = nullptr;
			_background = nullptr;
			_field34 = 0;
		}
		break;

	case ACTION_REMOVE:
		if (_item == invAction->_item && _owner) {
			int v = populateItem(_item, 0);
			_background = owner->getBackground(v);

			if (isHighlighted()) {
				Point glyphPos = _owner->getHighlightedGlyphPos();
				reposition(glyphPos);
				updateTooltip();
			}
		}
		break;

	default:
		break;
	}

	return true;
}
示例#6
0
void Goldmine::setConstructedBuildingSound()
{
    sound.pause();
    sound.openFromFile(Sound::goldmine);
    if (isHighlighted())
    {
        sound.play();
    }
}
示例#7
0
文件: cell.cpp 项目: Tilka/epsilon
void Cell::drawRect(KDContext * ctx, KDRect rect) const {
  KDCoordinate width = bounds().width();
  KDCoordinate height = bounds().height();
  KDColor backgroundColor = isHighlighted() ? Palette::Select : KDColorWhite;
  ctx->fillRect(KDRect(1, 1, width-2, height-1), backgroundColor);
  ctx->fillRect(KDRect(0, 0, width, 1), Palette::GreyBright);
  ctx->fillRect(KDRect(0, 1, 1, height-1), Palette::GreyBright);
  ctx->fillRect(KDRect(width-1, 1, 1, height-1), Palette::GreyBright);
  ctx->fillRect(KDRect(0, height-1, width, 1), Palette::GreyBright);
 }
示例#8
0
void PlotCellValue::serialize(XmlSerializer& s) const {
    s.serialize("isValue", isValue());
    s.serialize("isTag", isTag());
    s.serialize("isHighlighted", isHighlighted());

    if (isTag())
        s.serialize("tag", getTag());
    if (isValue())
        s.serialize("value", getValue());
}
示例#9
0
void Applet::animateHighlight()
{
	static const qreal highlightAnimationSpeed = 0.15;
	qreal targetIntensity = isHighlighted() ? 1.0 : 0.0;
	bool needAnotherStep = false;
	m_highlightIntensity = AnimationUtils::animate(m_highlightIntensity, targetIntensity, highlightAnimationSpeed, needAnotherStep);
	if(needAnotherStep)
		QTimer::singleShot(20, this, SLOT(animateHighlight()));
	update();
}
示例#10
0
void HistoryViewCell::setHighlighted(bool highlight) {
  m_highlighted = highlight;
  m_inputView.setBackgroundColor(backgroundColor());
  m_scrollableOutputView.outputView()->setHighlighted(false);
  if (isHighlighted()) {
    if (m_selectedSubviewType == SubviewType::Input) {
      m_inputView.setBackgroundColor(Palette::Select);
    } else {
      m_scrollableOutputView.outputView()->setHighlighted(true);
    }
  }
  reloadScroll();
}
示例#11
0
void SubassemblyView::draw ( void ) const
{
  lC::Render::Mode mode = lC::Render::REGULAR;

  if ( isActivated() )
    mode = lC::Render::ACTIVATED;
  else if ( isHighlighted() )
    mode = lC::Render::HIGHLIGHTED;

  drawer_->draw( parent()->renderStyle(), parent()->selectionType().entity_, mode );

  // If activated and we have any dimensioned constraints, draw the dimensions

  if ( isActivated() )
    for ( uint i = 0; i < 3; i++ )
      if ( dimensions_[i] != 0 )
	dimensions_[i]->draw();
}
示例#12
0
void CHighlightableButton::clickLeft(tribool down, bool previousState)
{
	if(isBlocked())
		return;

	if (down && !(onlyOn && isHighlighted()))
	{
		CCS->soundh->playSound(soundBase::button);
		setState(PRESSED);
	}

	if(previousState)//mouse up
	{
		if(down == false && getState() == PRESSED)
			select(!selected);
		else
			setState(selected?HIGHLIGHTED:NORMAL);
	}
}
示例#13
0
void ofxNUIWidgetNode::updateNode()
{
    
    ofxNUINode::updateNode();
    
    if (isActive()) {
        getCanvas()->setVisible(true);
        getCanvas()->autoSizeToFitWidgets();
    }
    else if (isHighlighted()) {
        getCanvas()->setVisible(true);
        getCanvas()->autoSizeToFitWidgets();
    }
    else {
        getCanvas()->setVisible(false);
    }
    
    updateSuperCanvas();
    
}
示例#14
0
void ThumbnailLabel::paintEvent(QPaintEvent *event) {
    Q_UNUSED(event)

    QPainter painter(this);
    if(thumbnail) {
        if(thumbnail->image) {
            painter.setOpacity(currentOpacity);
            painter.drawPixmap(borderW, borderH, *thumbnail->image);
        }

        painter.setOpacity(0.9f);

        //setup font
        painter.setFont(font);

        //nameLabel
        painter.fillRect(nameRect, *nameColor);
        painter.setPen(QColor(10, 10, 10, 200));
        painter.drawText(nameRect.adjusted(3, 2, 0, 0), thumbnail->name);
        painter.setPen(QColor(255, 255, 255, 255));
        painter.drawText(nameRect.adjusted(2, 1, 0, 0), thumbnail->name);

        painter.setOpacity(1.0f);
        //typeLabel
        if(showLabel) {
            painter.fillRect(labelRect, *labelColor);
            QPointF labelTextPos = labelRect.bottomLeft() + QPointF(2, -5);
            painter.setPen(QColor(10, 10, 10, 200));
            painter.drawText(labelTextPos + QPointF(1, 1), thumbnail->label);
            painter.setPen(QColor(255, 255, 255, 255));
            painter.drawText(labelTextPos, thumbnail->label);
        }

        //colored bar and shadow on the top
        if(isHighlighted()) {
            painter.fillRect(highlightRect, *highlightColor);
            //painter->fillRect(shadowRect, *shadowGradient);
        }
    }
}
示例#15
0
void ofxNUIWidgetNode::updateSuperCanvasWidgetDimensions()
{
    
    /* If node is active */
    if (isActive()) {
        
        for (int i=0; i < getCanvas()->getWidgets().size(); i++) {
            ofxUIWidget *widget = getCanvas()->getWidgets()[i];
            ofxUIRectangle *rect = widget->getRect();
            
            if (widget->getKind() == OFX_UI_WIDGET_SLIDER_H) {
                rect->setWidth(SLIDER_WIDTH);
                rect->setHeight(SLIDER_HEIGHT);
            }
            else if (widget->getKind() == OFX_UI_WIDGET_LABELBUTTON) {
                rect->setWidth(BUTTON_WIDTH);
                rect->setHeight(BUTTON_HEIGHT);
            }
            else if (widget->getKind() == OFX_UI_WIDGET_2DPAD) {
                rect->setWidth(ENVELOPE_EDITOR_WIDTH);
                rect->setHeight(ENVELOPE_EDITOR_HEIGHT);
            }
            
            /* Set new widget position */
            if (i == 0) {
                /* rect->setX(0);
                rect->setY(0); */
            }
            else {
                /* rect->setX(widgets[i-1]->getRect()->getX());
                rect->setY(widgets[i-1]->getRect()->getHeight()
                           + widgets[i-1]->getRect()->getY()); */
            }
            
        }
        
    }
    
    /* If node is highlighted */
    else if (isHighlighted()) {
        
        highlightHeightMax = highlightWidth / (float)getCanvas()->getWidgets().size();
        
        for (int i=0; i < getCanvas()->getWidgets().size(); i++) {
            ofxUIWidget *widget = getCanvas()->getWidgets()[i];
            ofxUIRectangle *rect = widget->getRect();
            
            if (widget->getKind() == OFX_UI_WIDGET_NUMBERDIALER) { }
            
            else {
                rect->setWidth(highlightWidth);
                if (rect->getHeight() > highlightHeightMax) {
                    highlightHeight = highlightHeightMax;
                }
                else {
                    highlightHeight = rect->getHeight();
                }
                rect->setHeight(highlightHeight);
            }
            
            /* Set new widget position */
            if (i == 0) {
                /* rect->setX(0);
                rect->setY(0); */
            }
            else {
                /* rect->setX(widgets[i-1]->getRect()->getX());
                rect->setY(widgets[i-1]->getRect()->getHeight()
                           + widgets[i-1]->getRect()->getY()); */
            }
            
        }
        
    }
    
}
示例#16
0
void HistoryViewCell::setSelectedSubviewType(HistoryViewCell::SubviewType subviewType) {
  m_selectedSubviewType = subviewType;
  setHighlighted(isHighlighted());
}
void MessageTableCellWithMessage::setHighlighted(bool highlight) {
  MessageTableCell::setHighlighted(highlight);
  KDColor backgroundColor = isHighlighted()? Palette::Select : KDColorWhite;
  m_accessoryView.setBackgroundColor(backgroundColor);
}