a?adida nueva barra de herramientas principal a yacreaderlibrary
@ -75,6 +75,7 @@ HEADERS += comic_flow.h \
|
|||||||
no_libraries_widget.h \
|
no_libraries_widget.h \
|
||||||
import_widget.h \
|
import_widget.h \
|
||||||
yacreader_local_server.h \
|
yacreader_local_server.h \
|
||||||
|
yacreader_main_toolbar.h
|
||||||
|
|
||||||
SOURCES += comic_flow.cpp \
|
SOURCES += comic_flow.cpp \
|
||||||
create_library_dialog.cpp \
|
create_library_dialog.cpp \
|
||||||
@ -112,6 +113,7 @@ SOURCES += comic_flow.cpp \
|
|||||||
no_libraries_widget.cpp \
|
no_libraries_widget.cpp \
|
||||||
import_widget.cpp \
|
import_widget.cpp \
|
||||||
yacreader_local_server.cpp \
|
yacreader_local_server.cpp \
|
||||||
|
yacreader_main_toolbar.cpp
|
||||||
|
|
||||||
|
|
||||||
include(./server/server.pri)
|
include(./server/server.pri)
|
||||||
|
@ -89,5 +89,15 @@
|
|||||||
<file>../images/social_dialog/shadow.png</file>
|
<file>../images/social_dialog/shadow.png</file>
|
||||||
<file>../images/social_dialog/twitter.png</file>
|
<file>../images/social_dialog/twitter.png</file>
|
||||||
<file>../images/social_dialog/separator.png</file>
|
<file>../images/social_dialog/separator.png</file>
|
||||||
|
<file>../images/main_toolbar/back.png</file>
|
||||||
|
<file>../images/main_toolbar/back_disabled.png</file>
|
||||||
|
<file>../images/main_toolbar/forward.png</file>
|
||||||
|
<file>../images/main_toolbar/forward_disabled.png</file>
|
||||||
|
<file>../images/main_toolbar/divider.png</file>
|
||||||
|
<file>../images/main_toolbar/settings.png</file>
|
||||||
|
<file>../images/main_toolbar/server.png</file>
|
||||||
|
<file>../images/main_toolbar/help.png</file>
|
||||||
|
<file>../images/main_toolbar/fullscreen.png</file>
|
||||||
|
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
|
|
||||||
#include "yacreader_dark_menu.h"
|
#include "yacreader_dark_menu.h"
|
||||||
#include "yacreader_titled_toolbar.h"
|
#include "yacreader_titled_toolbar.h"
|
||||||
|
#include "yacreader_main_toolbar.h"
|
||||||
|
|
||||||
//#include "yacreader_social_dialog.h"
|
//#include "yacreader_social_dialog.h"
|
||||||
//
|
//
|
||||||
@ -223,7 +224,7 @@ void LibraryWindow::doLayout()
|
|||||||
sHorizontal->addWidget(sideBar);
|
sHorizontal->addWidget(sideBar);
|
||||||
#ifdef NEW_LAYOUT
|
#ifdef NEW_LAYOUT
|
||||||
QVBoxLayout * rightLayout = new QVBoxLayout;
|
QVBoxLayout * rightLayout = new QVBoxLayout;
|
||||||
rightLayout->addWidget(libraryToolBar);
|
rightLayout->addWidget(new YACReaderMainToolBar);
|
||||||
rightLayout->addWidget(sVertical);
|
rightLayout->addWidget(sVertical);
|
||||||
|
|
||||||
rightLayout->setMargin(0);
|
rightLayout->setMargin(0);
|
||||||
|
128
YACReaderLibrary/yacreader_main_toolbar.cpp
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
#include "yacreader_main_toolbar.h"
|
||||||
|
|
||||||
|
#include <QPainter>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include <QToolButton>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QResizeEvent>
|
||||||
|
#include <QPaintEvent>
|
||||||
|
|
||||||
|
YACReaderMainToolBar::YACReaderMainToolBar(QWidget *parent) :
|
||||||
|
QWidget(parent)
|
||||||
|
{
|
||||||
|
mainLayout = new QHBoxLayout;
|
||||||
|
|
||||||
|
currentFolder = new QLabel(tr("Root"),this);
|
||||||
|
currentFolder->setAlignment(Qt::AlignCenter);
|
||||||
|
currentFolder->setStyleSheet(" QLabel {color:#404040; font-size:22px; font-weight:bold;}");
|
||||||
|
|
||||||
|
QFont f=currentFolder->font();
|
||||||
|
f.setStyleStrategy(QFont::PreferAntialias);
|
||||||
|
currentFolder->setFont(f);
|
||||||
|
|
||||||
|
QString qToolButtonStyleSheet = "QToolButton {border:none;}";
|
||||||
|
|
||||||
|
backButton = new QToolButton();
|
||||||
|
backButton->setStyleSheet(qToolButtonStyleSheet);
|
||||||
|
QIcon icoBackButton;
|
||||||
|
icoBackButton.addPixmap(QPixmap(":/images/main_toolbar/back.png"), QIcon::Normal);
|
||||||
|
icoBackButton.addPixmap(QPixmap(":/images/main_toolbar/back_disabled.png"), QIcon::Disabled);
|
||||||
|
backButton->setIcon(icoBackButton);
|
||||||
|
|
||||||
|
forwardButton = new QToolButton();
|
||||||
|
forwardButton->setStyleSheet(qToolButtonStyleSheet);
|
||||||
|
forwardButton->setDisabled(true);
|
||||||
|
QIcon icoFordwardButton;
|
||||||
|
icoFordwardButton.addPixmap(QPixmap(":/images/main_toolbar/forward.png"), QIcon::Normal);
|
||||||
|
icoFordwardButton.addPixmap(QPixmap(":/images/main_toolbar/forward_disabled.png"), QIcon::Disabled);
|
||||||
|
forwardButton->setIcon(icoFordwardButton);
|
||||||
|
|
||||||
|
settingsButton = new QToolButton();
|
||||||
|
settingsButton->setStyleSheet(qToolButtonStyleSheet);
|
||||||
|
QIcon icoSettingsButton;
|
||||||
|
settingsButton->setIconSize(QSize(24,24));
|
||||||
|
icoSettingsButton.addPixmap(QPixmap(":/images/main_toolbar/settings.png"), QIcon::Normal);
|
||||||
|
settingsButton->setIcon(icoSettingsButton);
|
||||||
|
|
||||||
|
serverButton = new QToolButton();
|
||||||
|
serverButton->setStyleSheet(qToolButtonStyleSheet);
|
||||||
|
QIcon icoServerButton;
|
||||||
|
serverButton->setIconSize(QSize(17,24));
|
||||||
|
icoServerButton.addPixmap(QPixmap(":/images/main_toolbar/server.png"), QIcon::Normal);
|
||||||
|
serverButton->setIcon(icoServerButton);
|
||||||
|
|
||||||
|
helpButton = new QToolButton();
|
||||||
|
helpButton->setStyleSheet(qToolButtonStyleSheet);
|
||||||
|
QIcon icoHelpButton;
|
||||||
|
helpButton->setIconSize(QSize(14,25));
|
||||||
|
icoHelpButton.addPixmap(QPixmap(":/images/main_toolbar/help.png"), QIcon::Normal);
|
||||||
|
helpButton->setIcon(icoHelpButton);
|
||||||
|
|
||||||
|
fullscreenButton = new QToolButton();
|
||||||
|
fullscreenButton->setStyleSheet(qToolButtonStyleSheet);
|
||||||
|
QIcon icoFullscreenButton;
|
||||||
|
fullscreenButton->setIconSize(QSize(24,24));
|
||||||
|
icoFullscreenButton.addPixmap(QPixmap(":/images/main_toolbar/fullscreen.png"), QIcon::Normal);
|
||||||
|
fullscreenButton->setIcon(icoFullscreenButton);
|
||||||
|
|
||||||
|
mainLayout->setMargin(0);
|
||||||
|
mainLayout->setSpacing(0);
|
||||||
|
|
||||||
|
mainLayout->addSpacing(12);
|
||||||
|
mainLayout->addWidget(backButton);
|
||||||
|
addDivider();
|
||||||
|
mainLayout->addWidget(forwardButton);
|
||||||
|
|
||||||
|
mainLayout->addSpacing(34);
|
||||||
|
mainLayout->addWidget(settingsButton);
|
||||||
|
addWideDivider();
|
||||||
|
mainLayout->addWidget(serverButton);
|
||||||
|
addWideDivider();
|
||||||
|
mainLayout->addWidget(helpButton);
|
||||||
|
|
||||||
|
mainLayout->addStretch();
|
||||||
|
|
||||||
|
mainLayout->addWidget(fullscreenButton);
|
||||||
|
mainLayout->addSpacing(10);
|
||||||
|
|
||||||
|
setLayout(mainLayout);
|
||||||
|
|
||||||
|
setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QSize YACReaderMainToolBar::sizeHint() const
|
||||||
|
{
|
||||||
|
return QSize(200,40);
|
||||||
|
}
|
||||||
|
|
||||||
|
void YACReaderMainToolBar::paintEvent(QPaintEvent * event)
|
||||||
|
{
|
||||||
|
Q_UNUSED(event);
|
||||||
|
|
||||||
|
QPainter painter (this);
|
||||||
|
painter.fillRect(0,0,width(),height(),QColor("#F0F0F0"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void YACReaderMainToolBar::resizeEvent(QResizeEvent * event)
|
||||||
|
{
|
||||||
|
currentFolder->move((event->size().width()-currentFolder->width())/2,(event->size().height()-currentFolder->height())/2);
|
||||||
|
}
|
||||||
|
|
||||||
|
void YACReaderMainToolBar::addDivider()
|
||||||
|
{
|
||||||
|
QPixmap img(":/images/main_toolbar/divider.png");
|
||||||
|
QLabel * divider = new QLabel();
|
||||||
|
divider->setPixmap(img);
|
||||||
|
|
||||||
|
mainLayout->addSpacing(5);
|
||||||
|
mainLayout->addWidget(divider);
|
||||||
|
mainLayout->addSpacing(5);
|
||||||
|
}
|
||||||
|
|
||||||
|
void YACReaderMainToolBar::addWideDivider()
|
||||||
|
{
|
||||||
|
mainLayout->addSpacing(3);
|
||||||
|
addDivider();
|
||||||
|
mainLayout->addSpacing(3);
|
||||||
|
}
|
43
YACReaderLibrary/yacreader_main_toolbar.h
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
#ifndef YACREADER_MAIN_TOOLBAR_H
|
||||||
|
#define YACREADER_MAIN_TOOLBAR_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
class QToolButton;
|
||||||
|
class QLabel;
|
||||||
|
class QResizeEvent;
|
||||||
|
class QPaintEvent;
|
||||||
|
class QHBoxLayout;
|
||||||
|
|
||||||
|
class YACReaderMainToolBar : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit YACReaderMainToolBar(QWidget *parent = 0);
|
||||||
|
QSize sizeHint() const;
|
||||||
|
signals:
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
private:
|
||||||
|
void paintEvent(QPaintEvent *);
|
||||||
|
void resizeEvent(QResizeEvent *);
|
||||||
|
|
||||||
|
QToolButton * backButton;
|
||||||
|
QToolButton * forwardButton;
|
||||||
|
QToolButton * settingsButton;
|
||||||
|
QToolButton * serverButton;
|
||||||
|
QToolButton * helpButton;
|
||||||
|
QToolButton * fullscreenButton;
|
||||||
|
|
||||||
|
QHBoxLayout * mainLayout;
|
||||||
|
|
||||||
|
QLabel * currentFolder;
|
||||||
|
|
||||||
|
void addDivider();
|
||||||
|
void addWideDivider();
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // YACREADER_MAIN_TOOLBAR_H
|
BIN
images/main_toolbar/back.png
Normal file
After Width: | Height: | Size: 225 B |
BIN
images/main_toolbar/back_disabled.png
Normal file
After Width: | Height: | Size: 225 B |
BIN
images/main_toolbar/divider.png
Normal file
After Width: | Height: | Size: 207 B |
BIN
images/main_toolbar/forward.png
Normal file
After Width: | Height: | Size: 234 B |
BIN
images/main_toolbar/forward_disabled.png
Normal file
After Width: | Height: | Size: 240 B |
BIN
images/main_toolbar/fullscreen.png
Normal file
After Width: | Height: | Size: 259 B |
BIN
images/main_toolbar/help.png
Normal file
After Width: | Height: | Size: 384 B |
BIN
images/main_toolbar/server.png
Normal file
After Width: | Height: | Size: 196 B |
BIN
images/main_toolbar/settings.png
Normal file
After Width: | Height: | Size: 369 B |