Skip to content

Commit

Permalink
Add titles to the welcome page
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Aug 19, 2015
1 parent 651a223 commit 23edcdb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
1 change: 0 additions & 1 deletion doc/whatsnew.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
</script>
</head>
<body>
<h1>QGIS News</h1>
<div id="feed"></div>
</body>
</html>
25 changes: 21 additions & 4 deletions src/app/qgswelcomepage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@ QgsWelcomePage::QgsWelcomePage( QWidget* parent )

mainLayout->addLayout( layout );

QWidget* recentProjctsContainer = new QWidget;
recentProjctsContainer->setLayout( new QVBoxLayout );
QLabel* recentProjectsTitle = new QLabel( QString( "<h1>%1</h1>").arg( tr( "Recent Projects" ) ) );
recentProjctsContainer->layout()->addWidget( recentProjectsTitle );

QListView* welcomeScreenListView = new QListView();
mModel = new QgsWelcomePageItemsModel();
welcomeScreenListView->setModel( mModel );
welcomeScreenListView->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
layout->addWidget( welcomeScreenListView );
welcomeScreenListView->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::MinimumExpanding );
welcomeScreenListView->setStyleSheet( "QListView::item {"
" margin-top: 5px;"
" margin-bottom: 5px;"
Expand All @@ -57,12 +61,25 @@ QgsWelcomePage::QgsWelcomePage( QWidget* parent )
" background: #aaaaaa;"
"}");

recentProjctsContainer->layout()->addWidget( welcomeScreenListView );

layout->addWidget( recentProjctsContainer );


QWidget* whatsNewContainer = new QWidget;
whatsNewContainer->setLayout( new QVBoxLayout );
QLabel* whatsNewTitle = new QLabel( QString( "<h1>%1</h1>").arg( tr( "QGIS News" ) ) );
whatsNewContainer->layout()->addWidget( whatsNewTitle );

QgsWebView* whatsNewPage = new QgsWebView();
whatsNewPage->setUrl( QUrl::fromLocalFile( QgsApplication::whatsNewFilePath() ) );
whatsNewPage->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
whatsNewPage->setContextMenuPolicy( Qt::NoContextMenu );
whatsNewPage->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
layout->addWidget( whatsNewPage );
whatsNewPage->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::MinimumExpanding );

whatsNewContainer->layout()->addWidget( whatsNewPage );
layout->addWidget( whatsNewContainer );

connect( whatsNewPage, SIGNAL(linkClicked(QUrl)), this, SLOT(whatsNewLinkClicked(QUrl)));

mVersionInformation = new QLabel;
Expand Down

0 comments on commit 23edcdb

Please sign in to comment.