Skip to content

Commit

Permalink
rough first draft welcome view
Browse files Browse the repository at this point in the history
  • Loading branch information
irascible committed Nov 18, 2013
1 parent 91e0c4f commit 839d9f5
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 2 deletions.
1 change: 1 addition & 0 deletions phoenixresources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<file>resources/images/aboutbox_FHP.png</file>
<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/dot.png</file>
<file>resources/images/fritzing_icon.png</file>
<file>resources/images/fritzing_logo_background.png</file>
Expand Down
File renamed without changes
Binary file added resources/images/welcome_kit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
130 changes: 128 additions & 2 deletions src/sketch/welcomeview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ along with Fritzing. If not, see <http://www.gnu.org/licenses/>.
#include <QTextEdit>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QPixmap>
#include <QSpacerItem>

//////////////////////////////////////

Expand All @@ -45,6 +47,129 @@ void WelcomeView::initLayout()
{
QVBoxLayout * mainLayout = new QVBoxLayout();

QFrame * upper = new QFrame;
QHBoxLayout * upperLayout = new QHBoxLayout;

QWidget * recent = initRecent();
upperLayout->addWidget(recent);

QWidget * right = initRight();
upperLayout->addWidget(right);

upper->setLayout(upperLayout);

QFrame * tipFrame = new QFrame();
QHBoxLayout * tipLayout = new QHBoxLayout();

QLabel * tipTitle = new QLabel(tr("Tip:"));
tipTitle->setObjectName("tipTitle");
tipLayout->addWidget(tipTitle);

m_tip = new QLabel(tr("Some initial text for testing the tip of the day."));
m_tip->setObjectName("tip");
tipLayout->addWidget(m_tip);

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

tipFrame->setLayout(tipLayout);


mainLayout->addWidget(upper);
mainLayout->addWidget(tipFrame);
this->setLayout(mainLayout);
}


QWidget * WelcomeView::initRecent() {
QFrame * frame = new QFrame;
frame->setObjectName("recentFrame");
QVBoxLayout * frameLayout = new QVBoxLayout;

QStringList names;
names << "recentTitle" << "recentItem" << "recentItem" << "recentItem" << "recentItem" << "recentItem" << "recentItem" << "recentItem" << "recentSpace" << "recentNewSketch" << "recentOpenSketch";

foreach (QString name, names) {
QWidget * widget = NULL;
if (name == "recentSpace") {
widget = new QFrame;
}
else {
widget = new QLabel(name + " test >>");
}
widget->setObjectName(name);
frameLayout->addWidget(widget);
}

frame->setLayout(frameLayout);
return frame;
}

QWidget * WelcomeView::initRight() {
QFrame * frame = new QFrame;
frame->setObjectName("rightFrame");
QVBoxLayout * frameLayout = new QVBoxLayout;

QWidget * widget = initBlog();
frameLayout->addWidget(widget);

widget = initKit();
frameLayout->addWidget(widget);

frame->setLayout(frameLayout);
return frame;
}

QWidget * WelcomeView::initKit() {
QLabel * label = new QLabel;
label->setObjectName("kitFrame");
QPixmap pixmap(":/resources/images/welcome_kit.png");
label->setPixmap(pixmap);

return label;
}


QWidget * WelcomeView::initBlog() {
QFrame * frame = new QFrame;
frame->setObjectName("blogFrame");
QVBoxLayout * frameLayout = new QVBoxLayout;

QFrame * titleFrame = new QFrame;
titleFrame->setObjectName("blogTitleFrame");

QHBoxLayout * titleFrameLayout = new QHBoxLayout;

QLabel * titleLabel = new QLabel(tr("Fritzing Blog"));
titleLabel->setObjectName("blogTitle");
titleFrameLayout->addWidget(titleLabel);

QLabel * label = new QLabel("go to Fritzing Blog >>");
label->setObjectName("blogTitleGoto");
titleFrameLayout->addWidget(label);

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

titleFrame->setLayout(titleFrameLayout);
frameLayout->addWidget(titleFrame);

for (int i = 0; i < 3; i++) {
QLabel * label = new QLabel("blog line title test");
label->setObjectName("blogLineTitle");
frameLayout->addWidget(label);

label = new QLabel("blog line text test");
label->setObjectName("blogLineText");
frameLayout->addWidget(label);
}

frame->setLayout(frameLayout);
return frame;

}


/*
QTextEdit * textEdit = new QTextEdit();
QString breadboardHelpText = tr(
Expand Down Expand Up @@ -102,5 +227,6 @@ void WelcomeView::initLayout()
mainLayout->addWidget(textEdit);
this->setLayout(mainLayout);
}
*/
13 changes: 13 additions & 0 deletions src/sketch/welcomeview.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ along with Fritzing. If not, see <http://www.gnu.org/licenses/>.
#define WELCOMEVIEW_H

#include <QFrame>
#include <QLabel>
#include <QList>
#include <QWidget>

class WelcomeView : public QFrame
{
Expand All @@ -41,6 +44,16 @@ Q_OBJECT

protected:
void initLayout();
QWidget * initRecent();
QWidget * initRight();
QWidget * initBlog();
QWidget * initKit();

protected:
QList<QLabel *> m_recentList;
QLabel * m_tip;
QFrame * m_blog;
QFrame * m_creatorKit;
};


Expand Down

0 comments on commit 839d9f5

Please sign in to comment.