a?adido di?logo "social" falta por implementar la integraci?n con las redes sociales y depurar el aspecto visual

This commit is contained in:
Luis Ángel San Martín 2013-05-31 21:26:00 +02:00
parent a8e6a5e718
commit 8b6a600122
15 changed files with 199 additions and 5 deletions

View File

@ -82,5 +82,12 @@
<file>../images/deleting_progress/imgBottomMiddle.png</file>
<file>../images/deleting_progress/imgBottomRight.png</file>
<file>../images/deleting_progress/icon.png</file>
<file>../images/social_dialog/close.png</file>
<file>../images/social_dialog/facebook.png</file>
<file>../images/social_dialog/google+.png</file>
<file>../images/social_dialog/icon.png</file>
<file>../images/social_dialog/shadow.png</file>
<file>../images/social_dialog/twitter.png</file>
<file>../images/social_dialog/separator.png</file>
</qresource>
</RCC>

View File

@ -48,6 +48,8 @@
#include "yacreader_dark_menu.h"
#include "yacreader_titled_toolbar.h"
//#include "yacreader_social_dialog.h"
//
LibraryWindow::LibraryWindow()
@ -100,6 +102,9 @@ void LibraryWindow::setupUI()
comicView->horizontalHeader()->restoreState(settings->value(COMICS_VIEW_HEADERS).toByteArray());
/*if(settings->contains(COMICS_VIEW_HEADERS_GEOMETRY))
comicView->horizontalHeader()->restoreGeometry(settings->value(COMICS_VIEW_HEADERS_GEOMETRY).toByteArray());*/
/*socialDialog = new YACReaderSocialDialog(this);
socialDialog->setHidden(true);*/
}
void LibraryWindow::doLayout()
@ -413,6 +418,8 @@ void LibraryWindow::createActions()
serverConfigAction->setToolTip(tr("Show comics server options dialog"));
serverConfigAction->setIcon(QIcon(":/images/server.png"));
//socialAction = new QAction(this);
//disable actions
disableAllActions();
@ -554,6 +561,7 @@ void LibraryWindow::createToolBars()
#endif
libraryToolBar->addAction(optionsAction);
libraryToolBar->addAction(helpAboutAction);
//libraryToolBar->addAction(socialAction);
libraryToolBar->setMovable(false);
@ -700,6 +708,8 @@ void LibraryWindow::createConnections()
connect(hideComicViewAction, SIGNAL(toggled(bool)),this, SLOT(hideComicFlow(bool)));
//connect(socialAction,SIGNAL(triggered()),this,SLOT(showSocial()));
}
void LibraryWindow::loadLibrary(const QString & name)
@ -1460,4 +1470,17 @@ void LibraryWindow::deleteComics()
comicFlow->remove(mi.row());
}
}
}
}
/*
void LibraryWindow::showSocial()
{
socialDialog->move(this->mapToGlobal(QPoint(width()-socialDialog->width()-10, centralWidget()->pos().y()+10)));
QModelIndexList indexList = getSelectedComics();
ComicDB comic = dmCV->getComic(indexList.at(0));
socialDialog->setComic(comic,currentPath());
socialDialog->setHidden(false);
}*/

View File

@ -44,6 +44,7 @@ class ImportWidget;
class QSettings;
class LibraryItem;
class YACReaderTableView;
//class YACReaderSocialDialog;
#include "comic_db.h"
class LibraryWindow : public QMainWindow
@ -63,6 +64,7 @@ private:
HelpAboutDialog * had;
RenameLibraryDialog * renameLibraryDialog;
PropertiesDialog * propertiesDialog;
//YACReaderSocialDialog * socialDialog;
bool fullscreen;
bool importedCovers; //if true, the library is read only (not updates,open comic or properties)
bool fromMaximized;
@ -120,6 +122,7 @@ private:
QAction * toggleFullScreenAction;
QAction * optionsAction;
QAction * serverConfigAction;
//QAction * socialAction;
//tree actions
QAction * setRootIndexAction;
@ -235,6 +238,7 @@ public:
void manageOpeningLibraryError(const QString & error);
QModelIndexList getSelectedComics();
void deleteComics();
//void showSocial();
};
#endif

View File

@ -14,7 +14,8 @@ HEADERS += $$PWD/help_about_dialog.h \
$$PWD/yacreader_dark_menu.h \
$$PWD/yacreader_titled_toolbar.h \
$$PWD/yacreader_deleting_progress.h \
$$PWD/yacreader_table_view.h
$$PWD/yacreader_table_view.h \
$$PWD/yacreader_social_dialog.h
SOURCES += $$PWD/help_about_dialog.cpp \
$$PWD/yacreader_field_edit.cpp \
@ -29,4 +30,5 @@ SOURCES += $$PWD/help_about_dialog.cpp \
$$PWD/yacreader_dark_menu.cpp \
$$PWD/yacreader_titled_toolbar.cpp \
$$PWD/yacreader_deleting_progress.cpp \
$$PWD/yacreader_table_view.cpp
$$PWD/yacreader_table_view.cpp \
$$PWD/yacreader_social_dialog.cpp

View File

@ -51,6 +51,8 @@ YACReaderDeletingProgress::YACReaderDeletingProgress(QWidget *parent) :
setLayout(contentLayout);
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
resize( sizeHint() );
}
void YACReaderDeletingProgress::paintEvent(QPaintEvent * event)
@ -95,8 +97,6 @@ void YACReaderDeletingProgress::paintEvent(QPaintEvent * event)
painter.fillRect(borderLeft,borderTop,width,height,QColor("#FAFAFA"));
QWidget::paintEvent(event);
resize( sizeHint() );
}

View File

@ -0,0 +1,130 @@
#include "yacreader_social_dialog.h"
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QProgressBar>
#include <QPushButton>
#include <QLabel>
#include <QPainter>
#include <QToolButton>
#include <QPlainTextEdit>
#include <QGraphicsDropShadowEffect>
#include "comic_db.h"
YACReaderSocialDialog::YACReaderSocialDialog(QWidget *parent) :
QWidget(parent)
{
//setWindowFlags(Qt::Window | Qt::Dialog | Qt::FramelessWindowHint);
//setModal(true);
QToolButton * close = new QToolButton(this);
close->setIcon(QIcon(":/images/social_dialog/close.png"));
QToolButton * facebook = new QToolButton(this);
facebook->setIcon(QIcon(":/images/social_dialog/facebook.png"));
QToolButton * twitter = new QToolButton(this);
twitter->setIcon(QIcon(":/images/social_dialog/twitter.png"));
QToolButton * google = new QToolButton(this);
google->setIcon(QIcon(":/images/social_dialog/google+.png"));
QString styleSheet = "QToolButton {border:none; }";
close->setStyleSheet(styleSheet);
facebook->setStyleSheet(styleSheet);
twitter->setStyleSheet(styleSheet);
google->setStyleSheet(styleSheet);
QLabel * icon = new QLabel(this);
icon->setPixmap(QPixmap(":/images/social_dialog/icon.png"));
plainText = new QTextEdit (this);
plainText->setStyleSheet("QTextEdit {border:none; padding:11px; font-size:12px; font-weight:bold; color:#525757;}");
QTextCursor cursor(plainText->textCursor());
QTextBlockFormat blockFormat = cursor.blockFormat();
blockFormat.setLineHeight(12,QTextBlockFormat::SingleHeight);
cursor.setBlockFormat(blockFormat);
QLabel * sendTo = new QLabel(tr("send to:"),this);
sendTo->setStyleSheet("QLabel{color:#ABABAB; font-size:12px; font-weight:bold;}");
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
resize( sizeHint() );
close->move(437,5);
QWidget * send = new QWidget(this);
QHBoxLayout * sendLayout = new QHBoxLayout;
QPushButton * follow = new QPushButton(tr("Follow YACReader!"),this);
follow->setStyleSheet("QPushButton{border:none; color:#FFFFFF;background:#404040; padding: 9px 25px 9px 25px; font-weight:bold; font-size:12px;}"
"QPushButton:hover{background:#E3B800;}");
sendLayout->setMargin(0);
sendLayout->setSpacing(0);
sendLayout->addWidget(sendTo,1,Qt::AlignHCenter);
sendLayout->addSpacing(11);
sendLayout->addWidget(facebook,0,Qt::AlignHCenter);
sendLayout->addSpacing(6);
sendLayout->addWidget(twitter,0,Qt::AlignHCenter);
sendLayout->addSpacing(6);
sendLayout->addWidget(google,0,Qt::AlignHCenter);
send->setLayout(sendLayout);
send->move(317,259);
icon->move(279,14);
plainText->setFixedSize(291,155);
plainText->move(169,96);
follow->move(230,307);
connect(close,SIGNAL(released()),this,SLOT(close()));
}
void YACReaderSocialDialog::paintEvent(QPaintEvent * event)
{
QPainter painter(this);
//center
painter.fillRect(169,0,291,369,QColor("#F0F0F0"));
painter.fillRect(169,96,291,155,QColor("#FFFFFF"));
//QPixmap cover = QPixmap("c:/temp/6.jpg").scaledToHeight(369,Qt::SmoothTransformation);
painter.drawPixmap(0,0,169,369,cover,0,0, (169 * cover.height())/369 ,cover.height());
QPixmap shadow(":/images/social_dialog/shadow.png");
painter.drawPixmap(169-shadow.width(),0,shadow.width(),369,shadow);
QPixmap separtor(":/images/social_dialog/separator.png");
painter.drawPixmap(169,96-separtor.height(),separtor);
QPen pen("#C3CAD6");
painter.setPen(pen);
painter.drawLine(169,251,460,251);
QWidget::paintEvent(event);
}
QSize YACReaderSocialDialog::sizeHint() const
{
return QSize(460,369);
}
void YACReaderSocialDialog::setComic(ComicDB & comic, QString & basePath)
{
this->cover = comic.info.getCover(basePath).scaledToHeight(369,Qt::SmoothTransformation);
plainText->setText(tr("I am reading %1 using YACReader.").arg(comic.path.split('/').last()));
}

View File

@ -0,0 +1,28 @@
#ifndef YACREADER_SOCIAL_DIALOG_H
#define YACREADER_SOCIAL_DIALOG_H
#include <QWidget>
class QPixmap;
class QTextEdit;
class ComicDB;
class YACReaderSocialDialog : public QWidget
{
Q_OBJECT
public:
explicit YACReaderSocialDialog(QWidget *parent = 0);
QSize sizeHint() const;
signals:
public slots:
void setComic(ComicDB & comic,QString & basePath);
protected:
void paintEvent(QPaintEvent *);
private:
QPixmap cover;
QTextEdit * plainText;
};
#endif // YACREADER_SOCIAL_DIALOG_H

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B