Example #1
0
SplashScreen::SplashScreen(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::SplashScreen)
{
    ui->setupUi(this);
    setWindowTitle("pi|game CREATOR");
    setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint);
    setAttribute(Qt::WA_TranslucentBackground);

    ssInitThread = new initThread();

    QGraphicsDropShadowEffect* ds = new QGraphicsDropShadowEffect;
    ds->setBlurRadius(4);
    ds->setXOffset(1);
    ds->setYOffset(1);
    ds->setColor(Qt::black);
    ui->splashLabel->setGraphicsEffect(ds);
    canClose = true;

    initThread* t = new initThread;
    t->splash = this;
    connect(t,SIGNAL(finished()), this, SLOT(initcomplete()));
    connect(t,SIGNAL(terminated()), this, SLOT(initcomplete()));
    connect(t,SIGNAL(messageChanged(QString)),this,SLOT(setMessage(QString)));
    t->start();
}
Example #2
0
//-----------------------------------------------------------------------------
// Function: BusInterfaceItem()
//-----------------------------------------------------------------------------
BusInterfaceItem::BusInterfaceItem(LibraryInterface* lh, QSharedPointer<Component> component,
                                   QSharedPointer<BusInterface> busIf,
                                   QGraphicsItem *parent)
    : HWConnectionEndpoint(parent, busIf == 0, QVector2D(1.0f, 0.0f)),
      lh_(lh),
	  nameLabel_("", this),
      busInterface_(),
      component_(component),
      oldColumn_(0),
      oldPos_(),
      oldInterfacePositions_(),
      offPageConnector_(0),
      portsCopied_(false)
{
    setType(ENDPOINT_TYPE_BUS);
    setTypeLocked(busIf != 0 && busIf->getInterfaceMode() != General::INTERFACE_MODE_COUNT);

    busInterface_ = busIf;
    int squareSize = GridSize;

    QPolygonF shape;
    shape << QPointF(-squareSize/2, squareSize / 2)
          << QPointF(-squareSize/2, -squareSize)
          << QPointF(squareSize/2, -squareSize)
          << QPointF(squareSize/2, squareSize / 2)
          << QPointF(0, squareSize);
    setPolygon(shape);
    
	QFont font = nameLabel_.font();
    font.setPointSize(8);
    nameLabel_.setFont(font);
    nameLabel_.setRotation(-rotation());
    nameLabel_.setFlag(ItemStacksBehindParent);
	
	QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect;
    shadow->setXOffset(0);
    shadow->setYOffset(0);
    shadow->setBlurRadius(5);
	nameLabel_.setGraphicsEffect(shadow);

    setFlag(ItemIsMovable);
    setFlag(ItemIsSelectable);
    setFlag(ItemSendsGeometryChanges);
    setFlag(ItemSendsScenePositionChanges);

    // Create the off-page connector.
    offPageConnector_ = new OffPageConnectorItem(this);
    offPageConnector_->setPos(0.0, -GridSize * 3);
    offPageConnector_->setFlag(ItemStacksBehindParent);
    offPageConnector_->setVisible(false);

    updateInterface();
}
PopupColorPaletteWidget::PopupColorPaletteWidget( ScribbleArea *parent ) :
    QWidget ( parent, Qt::Window ),
    m_pContainer ( parent )
{
    QVBoxLayout *mainLayout = new QVBoxLayout( this );

    setVisible( false );

    this->setFixedWidth(200);
    m_pColorBox = new ColorBox();
    mainLayout->addWidget(m_pColorBox);
    m_pColorBox->adjustSize();

    QGraphicsDropShadowEffect* effect = new QGraphicsDropShadowEffect();
    effect->setXOffset(2);
    effect->setYOffset(2);
    effect->setBlurRadius(5);
    setGraphicsEffect(effect);

    setAutoFillBackground(true);
    setWindowTitle("Color palette");
    setWindowFlags( ( (windowFlags()
                       | Qt::CustomizeWindowHint)
                      & ~Qt::WindowMaximizeButtonHint
                      & ~Qt::WindowMinimizeButtonHint) );

    // --- bottom buttons layout ---
    QHBoxLayout *buttonsLayout = new QHBoxLayout();
    mainLayout->addLayout(buttonsLayout);
    closeButton = new QPushButton(this);
    closeButton->setText("close/toggle");
    buttonsLayout->addWidget(closeButton);

    // --- connections ---
    connect( closeButton , SIGNAL( clicked() ) , m_pContainer , SLOT( togglePopupPalette() ) );
    connect( m_pColorBox, SIGNAL( colorChanged(QColor) ), this, SLOT( onColorChanged(QColor) ) );
}
Example #4
0
void window::set_window_content(widget *a_widget_ptr) {
  if (priv->m_window_content) {
    return;
  }

  priv->m_window_content = a_widget_ptr;
  priv->m_window_content->setParentItem(this);

  float window_bordr_height = window_title_height();

  QRectF content_geometry(a_widget_ptr->boundingRect());
#ifdef __APPLE__
  content_geometry.setHeight(content_geometry.height() + window_title_height() +
                             30);
  content_geometry.setWidth(content_geometry.width() + 30);
#else
  content_geometry.setHeight(content_geometry.height() + window_title_height());
  content_geometry.setWidth(content_geometry.width() + 2);
#endif

  if (priv->m_window_type == kApplicationWindow) {
#ifdef __APPLE__
    priv->m_window_content->setPos(15.0, window_bordr_height + 10);
    content_geometry.setHeight(content_geometry.height());
#else
    priv->m_window_content->setPos(1.0, window_bordr_height);
    content_geometry.setHeight(content_geometry.height() + 8);
#endif
    setGeometry(content_geometry);
  } else if (priv->m_window_type == kNotificationWindow) {
#ifdef __APPLE__
    priv->m_window_content->setPos(15.0, window_bordr_height + 10);
#else
    priv->m_window_content->setPos(0.0, window_bordr_height);
#endif

    priv->m_window_close_button->hide();
    setGeometry(content_geometry);
  } else if (priv->m_window_type == kPanelWindow) {
    priv->m_window_close_button->hide();
#ifdef __APPLE__
    setGeometry(content_geometry);
    priv->m_window_content->setPos(15.0, window_bordr_height);
    a_widget_ptr->setFlag(QGraphicsItem::ItemIsMovable, false);
#else
    setGeometry(priv->m_window_content->geometry());
    priv->m_window_content->setPos(0, 4);
#endif
    setFlag(QGraphicsItem::ItemIsMovable, false);
    setFlag(QGraphicsItem::ItemIsFocusable, true);
  } else if (priv->m_window_type == kPopupWindow) {
    priv->m_window_close_button->hide();
    setGeometry(content_geometry);
#ifdef __APPLE__
    priv->m_window_content->setPos(15, window_bordr_height + 10);
#else
    priv->m_window_content->setPos(0, window_bordr_height);
#endif
  } else {
    priv->m_window_close_button->hide();
    setGeometry(content_geometry);
    priv->m_window_content->setPos(0,
                                   window_bordr_height + window_title_height());
  }

  if (priv->m_window_type != kFramelessWindow) {
#ifndef __APPLE__
    QGraphicsDropShadowEffect *lEffect = new QGraphicsDropShadowEffect(this);
    lEffect->setColor(QColor("#111111"));
    lEffect->setBlurRadius(26);
    lEffect->setXOffset(0);
    lEffect->setYOffset(0);
    setGraphicsEffect(lEffect);
    setCacheMode(NoCache);
#endif
  }

  if (priv->m_window_type == kFramelessWindow) {
    setFlag(QGraphicsItem::ItemIsMovable, false);
    setFlag(QGraphicsItem::ItemIsFocusable, true);
    enable_window_background(false);
  }

  request_update();
}