void TreeInspector::highlightSprite( const ds::ui::Sprite* sprite ) { auto showHighlight = [&]( const ds::ui::Sprite* s ) { if (!mHighlighter) { mHighlighter = new ds::ui::Sprite( mEngine ); mHighlighter->setTransparent( false ); mHighlighter->setColorA( ci::ColorA::hexA( 0xAA6fa8dc ) ); addChildPtr( mHighlighter ); auto crosshairColor = ci::Color::hex( (0xf6b26b) ); auto hCrosshair = new ds::ui::Sprite( mEngine, 40.0f, 3.0f ); hCrosshair->setTransparent( false ); hCrosshair->setColor( crosshairColor ); mHighlighter->addChildPtr( hCrosshair ); auto vCrosshair = new ds::ui::Sprite( mEngine, 3.0f, 40.0f ); vCrosshair->setTransparent( false ); vCrosshair->setColor( crosshairColor ); mHighlighter->addChildPtr( vCrosshair ); } mHighlighter->show(); mHighlighter->setSize( s->getWidth(), s->getHeight() ); auto pos = s->getGlobalPosition(); mHighlighter->setPosition( globalToLocal( pos ) ); }; if (sprite) { showHighlight(sprite); } else if (mHighlighter) { mHighlighter->hide(); } }
void ePixmap::checkSize() { /* when we have no pixmap, or a pixmap of different size, we need to enable transparency in any case. */ if (m_pixmap && m_pixmap->size() == size() && !m_alphatest) setTransparent(0); else setTransparent(1); /* fall trough. */ }
xpr_bool_t FileScrapDropDlg::OnInitDialog(void) { super::OnInitDialog(); mShellIDListClipFormat = ::RegisterClipboardFormat(CFSTR_SHELLIDLIST); mDropTarget.registerObserver(this); mDropTarget.Register(this); mDlgState = DlgStateManager::instance().getDlgState(XPR_STRING_LITERAL("FileScrapDrop")); if (XPR_IS_NOT_NULL(mDlgState)) { mDlgState->load(); xpr_sint_t x, y; mAlwaysTopMost = mDlgState->getStateB(XPR_STRING_LITERAL("Always Top Most"), XPR_FALSE); mTransparent = mDlgState->getStateB(XPR_STRING_LITERAL("Transparent"), XPR_FALSE); mTransparentPercentage = mDlgState->getStateI(XPR_STRING_LITERAL("Transparent Percentage"), 60); x = mDlgState->getStateI(XPR_STRING_LITERAL("left"), 0); y = mDlgState->getStateI(XPR_STRING_LITERAL("top"), 0); SetWindowPos(XPR_NULL, x, y, 26, 24, SWP_NOZORDER | SWP_NOSIZE); } if (XPR_IS_TRUE(mAlwaysTopMost)) setAlwaysTopMost(mAlwaysTopMost); if (XPR_IS_TRUE(mTransparent )) setTransparent(mTransparent, mTransparentPercentage); return XPR_TRUE; }
void TransparentTop::transparentChanged() { #ifdef WIN32 if (bCanTransparent){ QWidget *p = static_cast<QWidget*>(parent()); if (*useTransparent){ if (!m_bUseTransparent){ SetWindowLongW(p->winId(), GWL_EXSTYLE, GetWindowLongW(p->winId(), GWL_EXSTYLE) | WS_EX_LAYERED); SetLayeredWindowAttributes(p->winId(), p->colorGroup().background().rgb(), 255, LWA_ALPHA); if (p->isVisible()) RedrawWindow(p->winId(), NULL, NULL, RDW_UPDATENOW); p->installEventFilter(this); m_bUseTransparent = true; } }else{ if (m_bUseTransparent){ SetWindowLongW(p->winId(), GWL_EXSTYLE, GetWindowLongW(p->winId(), GWL_EXSTYLE) & ~WS_EX_LAYERED); p->removeEventFilter(this); m_bUseTransparent = false; } } } #endif setTransparent(); }
PanoramicVideo::PanoramicVideo(ds::ui::SpriteEngine& engine) : ds::ui::Sprite(engine) , mVideoSprite(nullptr) , mInvertX(false) , mInvertY(true) , mXSensitivity(0.15f) , mYSensitivity(0.15f) , mFov(60.0f) , mAutoSync(true) , mPanning(0.0f) , mXRot(0.0f) , mYRot(-90.0f) { mBlobType = _BLOB; setUseShaderTexture(true); setTransparent(true); mSphereVbo = ci::gl::VboMesh::create(ci::geom::Sphere().subdivisions(120).radius(200.0f)); resetCamera(); enable(true); enableMultiTouch(ds::ui::MULTITOUCH_INFO_ONLY); setProcessTouchCallback([this](ds::ui::Sprite*, const ds::ui::TouchInfo& ti){ handleDrag(ci::vec2(ti.mDeltaPoint)); }); }
KstViewPicture::KstViewPicture() : KstBorderedViewObject("Picture") { _refresh = 0; _timer = 0L; setTransparent(true); _maintainAspect = true; }
void SketchMainHelpPrivate::enterEventAux() { if(m_shouldGetTransparent) { setWindowOpacity(1.0); QTimer::singleShot(2000, this, SLOT(setTransparent())); } //m_closeButton->doShow(); }
TEST(OsgScreenSpaceQuadRepresentationTests, SetTransparent) { auto quad = std::make_shared<OsgScreenSpaceQuadRepresentation>("quad"); EXPECT_FALSE(quad->isTransparent()); quad->setTransparent(true); EXPECT_TRUE(quad->isTransparent()); }
bool KstViewLabel::readConfigWidget(QWidget *w) { ViewLabelWidget *widget = dynamic_cast<ViewLabelWidget*>(w); if (!widget) { return false; } _txt = widget->_text->text(); // No, this is broken. It kills latex. #if 0 // Replace tabs and newlines in text edit box with \n and \t _txt.replace(QString("\n"), "\\n"); _txt.replace(QString("\t"), "\\t"); #endif setDataPrecision(widget->_precision->value()); setRotation(widget->_rotation->value()); setFontSize(widget->_fontSize->value()); setHorizJustifyWrap(widget->_horizontal->currentItem()); setForegroundColor(widget->_fontColor->color()); setFontName(widget->_font->currentFont().toString()); setTransparent(widget->_transparent->isChecked()); setBorderWidth(widget->_border->value()); setBorderColor(widget->_boxColors->color()); setBackgroundColor(widget->_boxColors->color()); setLabelMargin(widget->_margin->value()); reparse(); // calls setDirty() return true; }
void CCTile3DButton::construct(CCSceneBase *scene) { AddFlag( collideableType, collision_ui ); if( scene != NULL ) { setScene( scene ); } renderDepth = false; setTransparent(); model = new CCModelBase(); baseModel = new CCModelBase(); model->addModel( baseModel ); setBaseColour( CCColour() ); colourInterpolator.setDuration( 0.5f ); baseSquare = NULL; textModel = new CCModelText( this ); if( scale == NULL ) { CCVector3FillPtr( &scale, 0.0f, 0.0f, 1.0f ); } scaleInterpolator.setup( scale, 1.0f ); CCUpdateCollisions( this ); }
KstViewLine::KstViewLine(const QString& type) : KstViewObject(type), _width(0) { setTransparent(true); _container = false; _capStyle = Qt::FlatCap; _penStyle = Qt::SolidLine; setMinimumSize(QSize(1, 1)); }
MusicDownloadTableWidget::MusicDownloadTableWidget(QWidget *parent) : MusicAbstractTableWidget(parent) { setColumnCount(1); QHeaderView *headerview = horizontalHeader(); headerview->resizeSection(0, 400); setTransparent(255); }
bool KstViewLabel::readConfigWidget(QWidget *w, bool editMultipleMode) { ViewLabelWidget *widget = dynamic_cast<ViewLabelWidget*>(w); if (!widget) { return false; } if (!editMultipleMode || widget->_text->text().compare(QString(" ")) != 0) { _txt = widget->_text->text(); } if (!editMultipleMode || widget->_precision->value() != widget->_precision->minValue()) { setDataPrecision(widget->_precision->value()); } if (!editMultipleMode || widget->_rotation->value() != widget->_rotation->minValue()) { setRotation(widget->_rotation->value()); } if (!editMultipleMode || widget->_fontSize->value() != widget->_fontSize->minValue()) { setFontSize(widget->_fontSize->value()); } if (!editMultipleMode || widget->_horizontal->currentText().compare(QString(" ")) != 0) { setHorizJustifyWrap(widget->_horizontal->currentItem()); } if (!editMultipleMode || widget->_fontColor->color() != QColor()) { setForegroundColor(widget->_fontColor->color()); } if (!editMultipleMode || widget->_font->currentText().compare(QString(" ")) != 0) { setFontName(widget->_font->currentFont()); } if (!editMultipleMode || widget->_transparent->state() != QButton::NoChange) { setTransparent(widget->_transparent->isChecked()); } if (!editMultipleMode || widget->_border->value() != widget->_border->minValue()) { setBorderWidth(widget->_border->value()); } if (!editMultipleMode || widget->_changedFgColor) { setBorderColor(widget->_boxColors->foreground()); } if (!editMultipleMode || widget->_changedBgColor) { setBackgroundColor(widget->_boxColors->background()); } if (!editMultipleMode || widget->_margin->value() != widget->_margin->minValue()) { setLabelMargin(widget->_margin->value()); } reparse(); // calls setDirty() return true; }
MusicVideoTableWidget::MusicVideoTableWidget(QWidget *parent) : MusicQueryTableWidget(parent) { setColumnCount(8); resizeWindow(1.0f); setTransparent(255); MusicTime::timeSRand(); M_CONNECTION->setValue("MusicVideoTableWidget", this); }
KstPlotGroup::KstPlotGroup() : KstMetaPlot("PlotGroup") { _standardActions |= Delete | Raise | Zoom | Lower | RaiseToTop | LowerToBottom; _layoutActions |= Delete | Copy | Raise | Lower | RaiseToTop | LowerToBottom | Rename | MoveTo; setTagName(KstObjectTag(i18n("Plot Group %1").arg(++pgcount), KstObjectTag::globalTagContext)); // FIXME: tag context? _type = "PlotGroup"; setBorderColor(Qt::blue); _container = false; // plot group is a container that doesn't behave like one setTransparent(true); setBorderWidth(0); }
KstViewBox::KstViewBox() : KstViewObject("Box"), _borderColor(QColor(0, 0, 0)), _borderWidth(0) { _xRound = 0; _yRound = 0; _cornerStyle = Qt::MiterJoin; _fallThroughTransparency = false; setTransparent(true); _transparentFill = false; setFollowsFlow(true); _standardActions |= Delete | Edit; }
bool TransparentTop::eventFilter(QObject *o, QEvent *e) { switch (e->type()){ case QEvent::WindowActivate: case QEvent::WindowDeactivate: setTransparent(); break; case QEvent::Show: #ifdef WIN32 if (bCanTransparent){ QWidget *w = static_cast<QWidget*>(o); SetLayeredWindowAttributes(w->winId(), w->colorGroup().background().rgb(), 255, LWA_ALPHA); QTimer::singleShot(0, this, SLOT(setTransparent())); } #endif break; default: break; } return false; }
ObjectCollideableParticle::ObjectCollideableParticle(const float inLife) { setDebugName( "Particle" ); life = inLife; setTransparent(); readDepth = false; writeDepth = false; drawOrder = 201; }
MusicLrcSearchTableWidget::MusicLrcSearchTableWidget(QWidget *parent) : MusicQueryTableWidget(parent) { setColumnCount(5); QHeaderView *headerview = horizontalHeader(); headerview->resizeSection(0, 30); headerview->resizeSection(1, 175); headerview->resizeSection(2, 148); headerview->resizeSection(3, 50); headerview->resizeSection(4, 24); setTransparent(255); }
Circle::Circle(SpriteEngine& engine) : inherited(engine) , mFilled(true) , mRadius(0.0f) , mVertices(nullptr) , mIgnoreSizeUpdates(false) , mLineWidth(1.0f) { mBlobType = BLOB_TYPE; setTransparent(false); mLayoutFixedAspect = true; }
void PanoramicVideo::onChildAdded(ds::ui::Sprite& child){ if (mVideoSprite){ DS_LOG_WARNING("Multiple video sprites were attempted to be registered. Gonna ignore it."); return; } else if(auto video = dynamic_cast<ds::ui::Video*>(&child)){ mVideoSprite = video; mVideoSprite->setTransparent(false); setTransparent(false); mVideoSprite->setFinalRenderToTexture(true); } }
MusicLrcSearchTableWidget::MusicLrcSearchTableWidget(QWidget *parent) : MusicQueryTableWidget(parent) { setColumnCount(5); QHeaderView *headerview = horizontalHeader(); headerview->resizeSection(0, 30); headerview->resizeSection(1, 225); headerview->resizeSection(2, 193); headerview->resizeSection(3, 55); headerview->resizeSection(4, 24); setTransparent(255); connect(m_downLoadManager, SIGNAL(resolvedSuccess()), SIGNAL(resolvedSuccess())); }
void HikariWidget::setPropertyOverride(const std::string& _key, const std::string& _value) { if (_key == "Source") load(_value); else if (_key == "Transparent") setTransparent(MyGUI::utility::parseValue<bool>(_value)); else { Base::setProperty(_key, _value); return; } eventChangeProperty(this, _key, _value); }
Pdf::Pdf(ds::ui::SpriteEngine& e) : inherited(e) , mPageSizeMode(kConstantSize) , mPageSizeChangeFn(nullptr) , mPageSizeCache(0, 0) , mHolder(e) { // Should be unnecessary, but make sure we reference the static. INIT.doNothing(); mBlobType = BLOB_TYPE; setTransparent(false); setUseShaderTextuer(true); }
GlobeView::GlobeView(Globals& g) : ds::ui::Sprite(g.mEngine) , mGlobals(g) , mTouchGrabber(ds::ui::Sprite::makeAlloc<ds::ui::Sprite>([&g]()->ds::ui::Sprite*{return new ds::ui::Sprite(g.mEngine); }, this)) , mXMomentum(g) , mYMomentum(g) { const int meshResolution = mGlobals.getSettingsLayout().getInt("globe:mesh_resolution", 0, 50); const float radius = mGlobals.getSettingsLayout().getFloat("globe:radius", 0, 450.0f); setTransparent(false); setPosition(0.0f, 0.0f, radius); // Load the textures for the Earth. std::string earthDiffuse = ds::Environment::expand("%APP%/data/images/globe/earthDiffuse.png"); std::string earthMask = ds::Environment::expand("%APP%/data/images/globe/earthMask.png"); std::string earthNormal = ds::Environment::expand("%APP%/data/images/globe/earthNormal.png"); auto fmt = ci::gl::Texture2d::Format().wrap(GL_REPEAT).mipmap().minFilter(GL_LINEAR_MIPMAP_LINEAR); mTexDiffuse = ci::gl::Texture2d::create(ci::loadImage(ci::loadFile(earthDiffuse)), fmt); mTexNormal = ci::gl::Texture2d::create(ci::loadImage(ci::loadFile(earthNormal)), fmt); mTexMask = ci::gl::Texture2d::create(ci::loadImage(ci::loadFile(earthMask)), fmt); // Create the Earth mesh with a custom shader. std::string vertProg = ds::Environment::expand("%APP%/data/shaders/earth.vert"); std::string fragProg = ds::Environment::expand("%APP%/data/shaders/earth.frag"); auto earthShader = ci::gl::GlslProg::create(ci::loadFile(vertProg), ci::loadFile(fragProg)); earthShader->uniform("texDiffuse", 0); earthShader->uniform("texNormal", 1); earthShader->uniform("texMask", 2); earthShader->uniform("lightDir", glm::normalize(ci::vec3(0.025f, 0.25f, 1.0f))); mEarth = ci::gl::Batch::create(ci::geom::Sphere().radius(radius).subdivisions(meshResolution), earthShader); mTouchGrabber.setCenter(0.5f, 0.5f); mTouchGrabber.setSize(mEngine.getWorldWidth(), mEngine.getWorldHeight()); mTouchGrabber.enable(true); mTouchGrabber.enableMultiTouch(ds::ui::MULTITOUCH_INFO_ONLY); mTouchGrabber.setProcessTouchCallback([this](ds::ui::Sprite* bs, const ds::ui::TouchInfo& ti){ if(ti.mPhase == ds::ui::TouchInfo::Added && ti.mNumberFingers == 1){ mXMomentum.clear(); mYMomentum.clear(); } const float touchMultiplier = mGlobals.getSettingsLayout().getFloat("globe:touch_speed_divisor", 0, 45.0f); // X & Y are transposed intentionally, drag left / right and affect the y rotation axis mXMomentum.addDeltaPosition(ti.mDeltaPoint.y / touchMultiplier); mYMomentum.addDeltaPosition(ti.mDeltaPoint.x / touchMultiplier); }); }
TreeItem::TreeItem(Globals& g, ds::ui::Sprite* linkedItem) : ds::ui::Sprite(g.mEngine) , mGlobals(g) , mLinkedSprite(linkedItem) , mNameText(nullptr) , mLabelTextTwo(nullptr) { ds::ui::ImageButton* deleteButton = new ds::ui::ImageButton(mEngine, "%APP%/data/images/ui/close_button.png", "%APP%/data/images/ui/close_button.png", 10.0f); deleteButton->setScale(0.25f, 0.25f); deleteButton->getHighImage().setColor(ci::Color(0.7f, 0.2f, 0.2f)); addChildPtr(deleteButton); deleteButton->setClickFn([this]{ callAfterDelay([this]{ mEngine.getNotifier().notify(DeleteSpriteRequest(mLinkedSprite)); }, 0.01f); }); float paddin = 10.0f; mLayoutLPad = paddin / 2.0f; mLayoutRPad = paddin/2.0f; float theWiddy = 0.0f; float theHiddy = 0.0f; mNameText = mGlobals.getText("tree:item").create(mEngine, this); mNameText->setText(mLinkedSprite->getSpriteName()); mNameText->setPosition(deleteButton->getScaleWidth(), paddin / 2.0f); theWiddy += mNameText->getWidth() + paddin / 2.0f + deleteButton->getScaleWidth(); theHiddy = mNameText->getFontSize() + paddin; mLabelTextTwo = mGlobals.getText("tree:item_two").create(mEngine, this); mLabelTextTwo->setText(ds::ui::XmlImporter::getSpriteTypeForSprite(mLinkedSprite)); mLabelTextTwo->setPosition(theWiddy, paddin / 2.0f); theWiddy += mLabelTextTwo->getWidth() + paddin / 2.0f; if(mLabelTextTwo->getFontSize() + paddin > theHiddy){ theHiddy = mLabelTextTwo->getFontSize() + paddin; } setTransparent(false); setColor(ci::Color(0.1f, 0.1f, 0.1f)); setSize(theWiddy, theHiddy); enable(true); enableMultiTouch(ds::ui::MULTITOUCH_CAN_POSITION); setTapCallback([this](ds::ui::Sprite* bs, const ci::Vec3f& pos){ if(mLinkedSprite){ mEngine.getNotifier().notify(InspectSpriteRequest(mLinkedSprite)); } }); }
Circle::Circle(SpriteEngine& engine, const bool filled, const float radius) : inherited(engine) , mFilled(filled) , mRadius(radius) , mVertices(nullptr) , mIgnoreSizeUpdates(false) , mLineWidth(1.0f) { mBlobType = BLOB_TYPE; setTransparent(false); setRadius(mRadius); setFilled(mFilled); mLayoutFixedAspect = true; }
void MusicTopAreaWidget::drawWindowBackgroundRectString(const QString &path) { QSize size(950, 620); QPixmap origin(path); QPixmap afterDeal( size ); afterDeal.fill(Qt::transparent); QPainter paint(&afterDeal); paint.fillRect(0, 0, afterDeal.width(), afterDeal.height(), QColor(255, 255, 255, 2.55*m_alpha)); paint.setCompositionMode(QPainter::CompositionMode_SourceIn); paint.drawPixmap(0, 0, QPixmap::fromImage(origin.scaled(size, Qt::KeepAspectRatioByExpanding).toImage())); paint.end(); emit setTransparent(m_listAlpha); m_ui->background->setPixmap(afterDeal); }
MusicSongSearchOnlineTableWidget::MusicSongSearchOnlineTableWidget(QWidget *parent) : MusicQueryTableWidget(parent), m_audition(nullptr) { setColumnCount(6); QHeaderView *headerview = horizontalHeader(); headerview->resizeSection(0, 30); headerview->resizeSection(1, 225); headerview->resizeSection(2, 176); headerview->resizeSection(3, 50); headerview->resizeSection(4, 26); headerview->resizeSection(5, 26); setTransparent(255); m_previousAuditionRow = -1; M_CONNECTION->setValue("MusicSongSearchOnlineTableWidget", this); }
DrawTouchView::DrawTouchView(ds::ui::SpriteEngine& e, const ds::cfg::Settings &settings, ds::ui::TouchManager& tm) : ds::ui::Sprite(e) , mTouchTrailsUse(false) , mTouchTrailsLength(5) , mTouchTrailsIncrement(5.0f) { mTouchTrailsUse = settings.getBool("touch_overlay:trails:use", 0, mTouchTrailsUse); mTouchTrailsLength = settings.getInt("touch_overlay:trails:length", 0, mTouchTrailsLength); mTouchTrailsIncrement = settings.getFloat("touch_overlay:trails:increment", 0, mTouchTrailsIncrement); if(mTouchTrailsUse){ setTransparent(false); setColor(settings.getColor("touch_color", 0, ci::Color(1.0f, 1.0f, 1.0f))); } tm.setCapture(this); }