Skip to content

Commit

Permalink
first pass fritzing logo
Browse files Browse the repository at this point in the history
  • Loading branch information
irascible committed Oct 31, 2013
1 parent 3aefc35 commit 8a3662a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
1 change: 1 addition & 0 deletions phoenixresources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<file>resources/images/watermark_fritzing_outline.svg</file>
<file>resources/images/dot.png</file>
<file>resources/images/fritzing_icon.png</file>
<file>resources/images/fritzing_logo_background.png</file>
<file>resources/images/breadboard_icon.png</file>
<file>resources/images/schematic_icon.png</file>
<file>resources/images/pcb_icon.png</file>
Expand Down
Binary file added resources/images/fritzing_logo_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 21 additions & 22 deletions src/sketch/sketchwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7436,6 +7436,27 @@ void SketchWidget::drawBackground( QPainter * painter, const QRectF & rect )

InfoGraphicsView::drawForeground(painter, rect);

// always draw the logo in the same place in the window
// no matter how the view is zoomed or scrolled

static QPixmap * bgPixmap = NULL;
if (bgPixmap == NULL) {
bgPixmap = new QPixmap(":resources/images/fritzing_logo_background.png");
}
if (bgPixmap) {
QPointF p = painter->viewport().bottomLeft();
int hOffset = 0;
if (horizontalScrollBar()->isVisible()) {
hOffset = horizontalScrollBar()->height();
}
p += QPointF(25, hOffset - 25 - bgPixmap->height());
painter->save();
painter->setWindow(painter->viewport());
painter->setTransform(QTransform());
painter->drawPixmap(p,*bgPixmap);
painter->restore();
}

if (m_showGrid) {
QColor gridColor(0, 0, 0, 20);
double gridSize = m_gridSizeInches * GraphicsUtils::SVGDPI;
Expand Down Expand Up @@ -7475,29 +7496,7 @@ void SketchWidget::drawBackground( QPainter * painter, const QRectF & rect )
}


/*
// always draw the widget in the same place in the window
// no matter how the view is zoomed or scrolled
if (m_fixedToCenterItem != NULL) {
if (m_fixedToCenterItem->getVisible()) {
QWidget * widget = m_fixedToCenterItem->widget();
if (widget != NULL) {
QSizeF helpSize = m_fixedToCenterItem->size();
m_fixedToCenterItemOffset = calcFixedToCenterItemOffset(painter->viewport(), helpSize);
painter->save();
painter->setWindow(painter->viewport());
painter->setTransform(QTransform());
painter->drawPixmap(m_fixedToCenterItemOffset, m_fixedToCenterItem->getPixmap());
//painter->fillRect(m_fixedToCenterItemOffset.x(), m_fixedToCenterItemOffset.y(), helpsize.width(), helpsize.height(), QBrush(QColor(Qt::blue)));
painter->restore();
}
}
}

*/
}

/*
Expand Down

0 comments on commit 8a3662a

Please sign in to comment.