mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 22:55:04 -04:00
added help system to the MainPage class. Each page can now derive its own help string and show it using a two-states help button. To try it, I have implemented it on the NewsFeed page
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6514 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
7c6a7edfde
commit
a07e8d889a
8 changed files with 101 additions and 5 deletions
35
retroshare-gui/src/gui/MainPage.cpp
Normal file
35
retroshare-gui/src/gui/MainPage.cpp
Normal file
|
@ -0,0 +1,35 @@
|
|||
#include <iostream>
|
||||
#include <retroshare-gui/mainpage.h>
|
||||
#include <QGraphicsBlurEffect>
|
||||
#include <QGraphicsDropShadowEffect>
|
||||
|
||||
MainPage::MainPage(QWidget *parent , Qt::WindowFlags flags ) : QWidget(parent, flags)
|
||||
{
|
||||
help_browser = NULL ;
|
||||
}
|
||||
|
||||
|
||||
void MainPage::showHelp(bool b)
|
||||
{
|
||||
if(help_browser == NULL)
|
||||
{
|
||||
help_browser = new QTextBrowser(this) ;
|
||||
help_browser->setHtml(helpHtmlText()) ;
|
||||
|
||||
QGraphicsDropShadowEffect * effect = new QGraphicsDropShadowEffect(help_browser) ;
|
||||
effect->setBlurRadius(30.0);
|
||||
help_browser->setGraphicsEffect(effect);
|
||||
|
||||
help_browser->setSizePolicy(QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum)) ;
|
||||
help_browser->resize(size()*0.5) ;
|
||||
help_browser->move(width()/2 - help_browser->width()/2,height()/2 - help_browser->height()/2);
|
||||
help_browser->update() ;
|
||||
}
|
||||
std::cerr << "Toggling help to " << b << std::endl;
|
||||
if(b)
|
||||
help_browser->show() ;
|
||||
else
|
||||
help_browser->hide() ;
|
||||
}
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue