mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 22:55:04 -04:00
Remorked GUI layout a little bit:
- made all pages have a bar with full width - added help button to each of them (needs adding text) - improved help system so that it's easy to register a new help button FriendsDialog still needs some cleaning. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6518 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9c40fb878f
commit
d7e25e24e5
13 changed files with 848 additions and 714 deletions
|
@ -1,6 +1,7 @@
|
|||
#include <iostream>
|
||||
#include <retroshare-gui/mainpage.h>
|
||||
#include <QGraphicsBlurEffect>
|
||||
#include <QPushButton>
|
||||
#include <QGraphicsDropShadowEffect>
|
||||
|
||||
MainPage::MainPage(QWidget *parent , Qt::WindowFlags flags ) : QWidget(parent, flags)
|
||||
|
@ -11,25 +12,33 @@ MainPage::MainPage(QWidget *parent , Qt::WindowFlags flags ) : QWidget(parent, f
|
|||
|
||||
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() ;
|
||||
}
|
||||
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() ;
|
||||
}
|
||||
|
||||
void MainPage::registerHelpButton(QPushButton *button,const QString& help_html_txt)
|
||||
{
|
||||
if(help_browser == NULL)
|
||||
{
|
||||
help_browser = new QTextBrowser(this) ;
|
||||
|
||||
QGraphicsDropShadowEffect * effect = new QGraphicsDropShadowEffect(help_browser) ;
|
||||
effect->setBlurRadius(30.0);
|
||||
help_browser->setGraphicsEffect(effect);
|
||||
|
||||
help_browser->setSizePolicy(QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum)) ;
|
||||
help_browser->hide() ;
|
||||
}
|
||||
|
||||
help_browser->setHtml(help_html_txt) ;
|
||||
|
||||
QObject::connect(button,SIGNAL(toggled(bool)), this, SLOT( showHelp(bool) ) ) ;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue