Skip to content

Commit

Permalink
Work on welcome view: Use https links. Replace shop with donations pa…
Browse files Browse the repository at this point in the history
…ge. Increase some font sizes.
  • Loading branch information
KjellMorgenstern committed Sep 27, 2019
1 parent 32ab1e8 commit 526fd31
Show file tree
Hide file tree
Showing 15 changed files with 77 additions and 39 deletions.
2 changes: 2 additions & 0 deletions phoenixresources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<file>resources/images/aboutbox_scrollfade.png</file>
<file>resources/images/watermark_fritzing_outline.svg</file>
<file>resources/images/welcome_kit.png</file>
<file>resources/images/donate_zoom.png</file>
<file>resources/images/pcbs_2013.png</file>
<file>resources/images/dot.png</file>
<file>resources/images/fritzing_icon.png</file>
Expand Down Expand Up @@ -143,6 +144,7 @@
<file>resources/images/icons/WS-galleryLogo.png</file>
<file>resources/images/icons/WS-shopLogo.png</file>
<file>resources/images/icons/WS-fabLogo.png</file>
<file>resources/images/icons/WS-donateLogo.png</file>
<file>resources/images/icons/arrowButtonUp.png</file>
<file>resources/images/icons/arrowButtonDown.png</file>
<file>resources/images/icons/arrowButtonLeft.png</file>
Expand Down
Binary file added resources/images/donate_zoom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons/WS-appLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/icons/WS-blogLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons/WS-donateLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/icons/WS-fabLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons/WS-forumLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/icons/WS-galleryLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/icons/WS-shopLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 7 additions & 5 deletions resources/styles/fritzing.qss
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ background:transparent;
#blogLogo {
background:#fff;
min-height:22px;
max-height:22px;
max-height:44px;
}


Expand Down Expand Up @@ -1012,7 +1012,8 @@ background:transparent;
#fabContentTextHeadline {
font-size:16px;
font-weight:bold;
max-height:20px;
qproperty-wordWrap: true;
max-height:40px;
font-family: Droid Sans;
background:#fff;
}
Expand All @@ -1032,8 +1033,8 @@ background:transparent;
{
font-weight: regular;
font-family: Droid Sans;
font-size:11px;
max-height:14px;
font-size:14px;
max-height:16px;
background:#fff;
}

Expand All @@ -1050,14 +1051,15 @@ background:#fff;
padding-right:5px;
/* padding:8px 0px 8px 0px; */
min-height:25px;
max-height:25px;
max-height:100px;

}

#blogLogoText,
#shopLogoText,
#fabLogoText {
margin-right:5px;
font-size:14px;
}


Expand Down
2 changes: 1 addition & 1 deletion src/dialogs/quotedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,6 @@ bool QuoteDialog::quoteSucceeded() {

void QuoteDialog::initCounts() {
if (Counts.isEmpty()) {
Counts << 1 << 2 << 5 << 10;
Counts << 1 << 3 << 12 ;
}
}
3 changes: 2 additions & 1 deletion src/help/aboutbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ AboutBox::AboutBox(QWidget *parent)
tr("Travis Robertson, Stefan Hermann, Brendan Howell, ") +
tr("Mariano Crowe, Johannes Landstorfer, ") +
tr("Jenny Chowdhury, Lionel Michel, Fabian Althaus, Jannis Leidel, ") +
tr("Bryant Mairs, Uleshka Asher, and Daniel Tzschentke. ") +
tr("Bryant Mairs, Uleshka Asher, Daniel Tzschentke, ") +
tr("and Kjell Morgenstern ") +
"</p>" +

"<p>" +
Expand Down
10 changes: 5 additions & 5 deletions src/mainwindow/mainwindow_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2287,23 +2287,23 @@ void MainWindow::showPartsBinListView() {
}

void MainWindow::openHelp() {
QDesktopServices::openUrl(QString("http://fritzing.org/learning/"));
QDesktopServices::openUrl(QString("https://fritzing.org/learning/"));
}

void MainWindow::openDonate() {
QDesktopServices::openUrl(QString("http://fritzing.org/shop/donations/"));
QDesktopServices::openUrl(QString("https://fritzing.org/shop/donations/"));
}

void MainWindow::openExamples() {
QDesktopServices::openUrl(QString("http://fritzing.org/projects/"));
QDesktopServices::openUrl(QString("https://fritzing.org/projects/"));
}

void MainWindow::openPartsReference() {
QDesktopServices::openUrl(QString("http://fritzing.org/parts/"));
QDesktopServices::openUrl(QString("https://fritzing.org/parts/"));
}

void MainWindow::visitFritzingDotOrg() {
QDesktopServices::openUrl(QString("http://www.fritzing.org"));
QDesktopServices::openUrl(QString("https://www.fritzing.org"));
}

void MainWindow::reportBug() {
Expand Down
83 changes: 57 additions & 26 deletions src/sketch/welcomeview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,24 +456,35 @@ QWidget * WelcomeView::initShop() {
QVBoxLayout * frameLayout = new QVBoxLayout;
zeroMargin(frameLayout);

QWidget * headerFrame = createHeaderFrame( tr("Shop"), "Shop", tr("Fab"), "Fab", m_inactiveHeaderLabelColor, m_activeHeaderLabelColor, m_shopLabel, m_fabLabel);
QWidget * headerFrame = createHeaderFrame( tr("Donate"), "Donate", tr("Fab"), "Fab", m_inactiveHeaderLabelColor, m_activeHeaderLabelColor, m_donateLabel, m_fabLabel);
frameLayout->addWidget(headerFrame);

m_shopUberFrame = createShopContentFrame(":/resources/images/welcome_kit.png",
tr("Fritzing CreatorKit"),
tr("The Fritzing Creator Kit is out of Stock. For Updates please visit the fritzing.blog"),
"http://creatorkit.fritzing.org/",
tr(""),
tr(""),
":/resources/images/icons/WS-shopLogo.png",
"#f5a400"
);
frameLayout->addWidget(m_shopUberFrame);
m_donateUberFrame = createShopContentFrame(":/resources/images/donate_zoom.png",
tr("Fritzing development needs you"),
tr("Software development and maintenance is a lot of work. Without your support, it is not possible to keep that up."),
"https://fritzing.org/shop/donations/",
tr("Donate and leave a comment."),
tr("Donate now"),
":/resources/images/icons/WS-donateLogo.png",
"#2D81C5");

frameLayout->addWidget(m_donateUberFrame);

// m_shopUberFrame = createShopContentFrame(":/resources/images/welcome_kit.png",
// tr("Fritzing CreatorKit"),
// tr("The Fritzing Creator Kit is out of Stock."),
// "https://fritzing.org/creatorkit",
// tr(""),
// tr(""),
// ":/resources/images/icons/WS-shopLogo.png",
// "#f5a400"
// );
// frameLayout->addWidget(m_shopUberFrame);

m_fabUberFrame = createShopContentFrame(":/resources/images/pcbs_2013.png",
tr("Fritzing Fab"),
tr("Fritzing Fab is an easy and affordable service for producing professional PCBs from your Fritzing sketches."),
"http://fab.fritzing.org/",
"http://fab.fritzing.org/",
tr("produce your first pcb now >>"),
tr("Order your PCB now."),
":/resources/images/icons/WS-fabLogo.png",
Expand All @@ -483,7 +494,12 @@ QWidget * WelcomeView::initShop() {

frame->setLayout(frameLayout);

clickBlog("fab");
QDate cd = QDate::currentDate();
if (cd.day()<3) {
clickBlog("donate");
} else {
clickBlog("fab");
}

return frame;
}
Expand Down Expand Up @@ -515,6 +531,7 @@ QWidget * WelcomeView::createShopContentFrame(const QString & imagePath, const Q
contentTextFrameLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::Expanding));

label = new QLabel(headline);
label->setTextFormat(Qt::RichText);
label->setObjectName("shopContentTextHeadline");
//label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
contentTextFrameLayout->addWidget(label);
Expand All @@ -524,11 +541,11 @@ QWidget * WelcomeView::createShopContentFrame(const QString & imagePath, const Q
//label->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
contentTextFrameLayout->addWidget(label);

label = new QLabel(QString("<a href='%1' style='text-decoration:none; color:#802742;'>%2</a>").arg(url).arg(urlText));
label = new QLabel(QString("<a href='%1' style='text-decoration:none; color:#802742;'>%2</a>").arg(url).arg(urlText));
label->setObjectName("shopContentTextCaption");
contentTextFrameLayout->addWidget(label);
//label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(label, SIGNAL(linkActivated(const QString &)), this, SLOT(clickBlog(const QString &)));
connect(label, &QLabel::linkActivated, this, &WelcomeView::clickBlog);

contentTextFrameLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::Expanding));

Expand All @@ -547,15 +564,15 @@ QWidget * WelcomeView::createShopContentFrame(const QString & imagePath, const Q
zeroMargin(footerFrameLayout);
footerFrameLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Expanding));

QLabel * footerLabel = new QLabel(QString("<a href='%1' style='text-decoration:none; color:%3;'>%2</a>").arg(url).arg(urlText2).arg(footerLabelColor));
QLabel * footerLabel = new QLabel(QString("<a href='%1' style='text-decoration:none; color:%3;'>%2</a>").arg(url).arg(urlText2).arg(footerLabelColor));
footerLabel->setObjectName("shopLogoText");
footerFrameLayout->addWidget(footerLabel);
connect(footerLabel, SIGNAL(linkActivated(const QString &)), this, SLOT(clickBlog(const QString &)));
connect(footerLabel, &QLabel::linkActivated, this, &WelcomeView::clickBlog);

QLabel * footerLogoLabel = new QLabel(tr("<a href='%1'><img src='%2'/></a>").arg(url).arg(logoPath));
footerLogoLabel->setObjectName("shopLogo");
footerFrameLayout->addWidget(footerLogoLabel);
connect(footerLogoLabel, SIGNAL(linkActivated(const QString &)), this, SLOT(clickBlog(const QString &)));
connect(footerLogoLabel, &QLabel::linkActivated, this, &WelcomeView::clickBlog);

shopFooterFrame->setLayout(footerFrameLayout);

Expand All @@ -574,12 +591,12 @@ QWidget * WelcomeView::initBlog() {
QWidget * headerFrame = createHeaderFrame(tr("Projects"), "Projects", tr("Blog"), "Blog", m_inactiveHeaderLabelColor, m_activeHeaderLabelColor, m_projectsLabel, m_blogLabel);
frameLayout->addWidget(headerFrame);

m_blogListWidget = createBlogContentFrame("http://blog.fritzing.org", tr("Fritzing News."), ":/resources/images/icons/WS-blogLogo.png", "#802742");
m_blogListWidget = createBlogContentFrame("https://blog.fritzing.org", tr("Fritzing News."), ":/resources/images/icons/WS-blogLogo.png", "#802742");
m_blogUberFrame = m_blogListWidget;
while (m_blogUberFrame->parentWidget()) m_blogUberFrame = m_blogUberFrame->parentWidget();
frameLayout->addWidget(m_blogUberFrame);

m_projectListWidget = createBlogContentFrame("http://fritzing.org/projects/", tr("Fritzing Projects."), ":/resources/images/icons/WS-galleryLogo.png", "#00a55b");
m_projectListWidget = createBlogContentFrame("https://fritzing.org/projects/", tr("Fritzing Projects."), ":/resources/images/icons/WS-galleryLogo.png", "#00a55b");
m_projectsUberFrame = m_projectListWidget;
while (m_projectsUberFrame->parentWidget()) m_projectsUberFrame = m_projectsUberFrame->parentWidget();
frameLayout->addWidget(m_projectsUberFrame);
Expand Down Expand Up @@ -641,13 +658,13 @@ BlogListWidget * WelcomeView::createBlogContentFrame(const QString & url, const
zeroMargin(footerFrameLayout);
footerFrameLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Expanding));

QLabel * footerLabel = new QLabel(QString("<a href='%1' style='font-family:Droid Sans; text-decoration:none; color:%3;'>%2</a>").arg(url).arg(urlText).arg(footerLabelColor));
QLabel * footerLabel = new QLabel(QString("<a href='%1' style='font-family:Droid Sans; text-decoration:none; color:%3;'>%2</a>").arg(url).arg(urlText).arg(footerLabelColor));
footerLabel->setObjectName("blogLogoText");
footerFrameLayout->addWidget(footerLabel);
connect(footerLabel, SIGNAL(linkActivated(const QString &)), this, SLOT(clickBlog(const QString &)));

footerLabel = new QLabel(tr("<a href='%1'><img src='%2' /></a>").arg(url).arg(logoPath));
footerLabel->setObjectName("blogLogo");

footerFrameLayout->addWidget(footerLabel);
connect(footerLabel, SIGNAL(linkActivated(const QString &)), this, SLOT(clickBlog(const QString &)));

Expand Down Expand Up @@ -739,22 +756,36 @@ void WelcomeView::gotBlogSnippet(QNetworkReply * networkReply) {

void WelcomeView::clickBlog(const QString & url) {
if (url.toLower() == "fab") {
m_shopUberFrame->setVisible(false);
// m_shopUberFrame->setVisible(false);
m_fabUberFrame->setVisible(true);
m_donateUberFrame->setVisible(false);
m_fabLabel->setText(hackColor(m_fabLabel->text(), m_activeHeaderLabelColor));
m_shopLabel->setText(hackColor(m_shopLabel->text(), m_inactiveHeaderLabelColor));
// m_shopLabel->setText(hackColor(m_shopLabel->text(), m_inactiveHeaderLabelColor));
m_donateLabel->setText(hackColor(m_donateLabel->text(), m_inactiveHeaderLabelColor));

return;
}

if (url.toLower() == "shop") {
m_shopUberFrame->setVisible(true);
// m_shopUberFrame->setVisible(true);
m_fabUberFrame->setVisible(false);
m_donateUberFrame->setVisible(false);
m_fabLabel->setText(hackColor(m_fabLabel->text(), m_inactiveHeaderLabelColor));
m_shopLabel->setText(hackColor(m_shopLabel->text(), m_activeHeaderLabelColor));
// m_shopLabel->setText(hackColor(m_shopLabel->text(), m_activeHeaderLabelColor));
m_donateLabel->setText(hackColor(m_donateLabel->text(), m_inactiveHeaderLabelColor));
return;
}

if (url.toLower() == "donate") {
// m_shopUberFrame->setVisible(false);
m_fabUberFrame->setVisible(false);
m_donateUberFrame->setVisible(true);
m_fabLabel->setText(hackColor(m_fabLabel->text(), m_inactiveHeaderLabelColor));
// m_shopLabel->setText(hackColor(m_shopLabel->text(), m_inactiveHeaderLabelColor));
m_donateLabel->setText(hackColor(m_donateLabel->text(), m_activeHeaderLabelColor));
return;
}

if (url.toLower() == "nexttip") {
nextTip();
return;
Expand Down
4 changes: 3 additions & 1 deletion src/sketch/welcomeview.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class WelcomeView : public QFrame
const QString & url, const QString & urlText, const QString & urlText2, const QString & logoPath, const QString & footerLabelColor);
BlogListWidget * createBlogContentFrame(const QString & url, const QString & urlText, const QString & logoPath, const QString & footerLabelColor);

QFrame * createHeaderFrame(const QString & url1, const QString & urlText1, const QString & url2, const QString & urlText2, const QString & inactiveColor, const QString & activeColor, QLabel * & label1, QLabel * & label2);
QFrame * createHeaderFrame(const QString & url1, const QString & urlText1, const QString & url2, const QString & urlText2, const QString & inactiveColor, const QString & activeColor, QLabel * & label1, QLabel * & label2);


signals:
Expand All @@ -155,10 +155,12 @@ protected slots:
QListWidget * m_recentListWidget;
QWidget * m_fabUberFrame;
QWidget * m_shopUberFrame;
QWidget * m_donateUberFrame;
QLabel * m_projectsLabel;
QLabel * m_blogLabel;
QLabel * m_fabLabel;
QLabel * m_shopLabel;
QLabel * m_donateLabel;

static QString m_activeHeaderLabelColor;
static QString m_inactiveHeaderLabelColor;
Expand Down

0 comments on commit 526fd31

Please sign in to comment.