mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
restore 'hide comic flow' action
This commit is contained in:
parent
be9e2045d0
commit
a0438f8bed
@ -549,7 +549,7 @@ void MainWindowViewer::createToolBars()
|
|||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
comicToolBar->addStretch();
|
comicToolBar->addStretch();
|
||||||
#else
|
#else
|
||||||
comicToolBar->addWidget(new QToolBarStretch());
|
comicToolBar->addWidget(new YACReaderToolBarStretch());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
#include "classic_comics_view.h"
|
#include "classic_comics_view.h"
|
||||||
|
|
||||||
#include "yacreader_table_view.h"
|
#include "QStackedWidget"
|
||||||
|
|
||||||
#include "comic_flow_widget.h"
|
#include "comic_flow_widget.h"
|
||||||
#include "QsLog.h"
|
#include "QsLog.h"
|
||||||
|
#include "shortcuts_manager.h"
|
||||||
#include "QStackedWidget"
|
#include "yacreader_table_view.h"
|
||||||
|
#include "yacreader_tool_bar_stretch.h"
|
||||||
|
|
||||||
ClassicComicsView::ClassicComicsView(QWidget *parent)
|
ClassicComicsView::ClassicComicsView(QWidget *parent)
|
||||||
:ComicsView(parent),searching(false)
|
:ComicsView(parent),searching(false)
|
||||||
@ -86,11 +87,48 @@ ClassicComicsView::ClassicComicsView(QWidget *parent)
|
|||||||
if(settings->contains(COMICS_VIEW_FLOW_SPLITTER_STATUS))
|
if(settings->contains(COMICS_VIEW_FLOW_SPLITTER_STATUS))
|
||||||
sVertical->restoreState(settings->value(COMICS_VIEW_FLOW_SPLITTER_STATUS).toByteArray());
|
sVertical->restoreState(settings->value(COMICS_VIEW_FLOW_SPLITTER_STATUS).toByteArray());
|
||||||
|
|
||||||
|
//hide flow widgets
|
||||||
|
toolBarStretch = new YACReaderToolBarStretch(this);
|
||||||
|
|
||||||
|
hideFlowViewAction = new QAction(this);
|
||||||
|
hideFlowViewAction->setText(tr("Hide comic flow"));
|
||||||
|
hideFlowViewAction->setData(HIDE_COMIC_VIEW_ACTION_YL);
|
||||||
|
hideFlowViewAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(HIDE_COMIC_VIEW_ACTION_YL));
|
||||||
|
hideFlowViewAction->setIcon(QIcon(":/images/hideComicFlow.png"));
|
||||||
|
hideFlowViewAction->setCheckable(true);
|
||||||
|
hideFlowViewAction->setChecked(false);
|
||||||
|
|
||||||
|
connect(hideFlowViewAction, SIGNAL(toggled(bool)),this, SLOT(hideComicFlow(bool)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClassicComicsView::hideComicFlow(bool hide)
|
||||||
|
{
|
||||||
|
if(hide)
|
||||||
|
{
|
||||||
|
QList<int> sizes;
|
||||||
|
sizes.append(0);
|
||||||
|
int total = sVertical->sizes().at(0) + sVertical->sizes().at(1);
|
||||||
|
sizes.append(total);
|
||||||
|
sVertical->setSizes(sizes);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QList<int> sizes;
|
||||||
|
int total = sVertical->sizes().at(0) + sVertical->sizes().at(1);
|
||||||
|
sizes.append(2*total/3);
|
||||||
|
sizes.append(total/3);
|
||||||
|
sVertical->setSizes(sizes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//the toolbar has to be populated
|
||||||
void ClassicComicsView::setToolBar(QToolBar *toolBar)
|
void ClassicComicsView::setToolBar(QToolBar *toolBar)
|
||||||
{
|
{
|
||||||
static_cast<QVBoxLayout *>(comics->layout())->insertWidget(0,toolBar);
|
static_cast<QVBoxLayout *>(comics->layout())->insertWidget(0,toolBar);
|
||||||
|
this->toolbar = toolBar;
|
||||||
|
|
||||||
|
toolBarStretchAction = toolBar->addWidget(toolBarStretch);
|
||||||
|
toolBar->addAction(hideFlowViewAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClassicComicsView::setModel(ComicModel *model)
|
void ClassicComicsView::setModel(ComicModel *model)
|
||||||
@ -302,6 +340,9 @@ void ClassicComicsView::closeEvent(QCloseEvent *event)
|
|||||||
saveTableHeadersStatus();
|
saveTableHeadersStatus();
|
||||||
saveSplitterStatus();
|
saveSplitterStatus();
|
||||||
ComicsView::closeEvent(event);
|
ComicsView::closeEvent(event);
|
||||||
|
|
||||||
|
toolbar->removeAction(toolBarStretchAction);
|
||||||
|
toolbar->removeAction(hideFlowViewAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClassicComicsView::setupSearchingIcon()
|
void ClassicComicsView::setupSearchingIcon()
|
||||||
|
@ -6,12 +6,14 @@
|
|||||||
#include <QModelIndex>
|
#include <QModelIndex>
|
||||||
#include <QModelIndexList>
|
#include <QModelIndexList>
|
||||||
|
|
||||||
class YACReaderTableView;
|
|
||||||
class QSplitter;
|
class QSplitter;
|
||||||
class ComicFlowWidget;
|
|
||||||
class QToolBar;
|
|
||||||
class ComicModel;
|
|
||||||
class QStackedWidget;
|
class QStackedWidget;
|
||||||
|
class QToolBar;
|
||||||
|
|
||||||
|
class ComicFlowWidget;
|
||||||
|
class ComicModel;
|
||||||
|
class YACReaderTableView;
|
||||||
|
class YACReaderToolBarStretch;
|
||||||
|
|
||||||
class ClassicComicsView : public ComicsView
|
class ClassicComicsView : public ComicsView
|
||||||
{
|
{
|
||||||
@ -44,16 +46,22 @@ public slots:
|
|||||||
void selectedComicForOpening(const QModelIndex & mi);
|
void selectedComicForOpening(const QModelIndex & mi);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
|
void hideComicFlow(bool hide);
|
||||||
void requestedViewContextMenu(const QPoint & point);
|
void requestedViewContextMenu(const QPoint & point);
|
||||||
void requestedItemContextMenu(const QPoint & point);
|
void requestedItemContextMenu(const QPoint & point);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
YACReaderTableView * tableView;
|
YACReaderTableView * tableView;
|
||||||
|
YACReaderToolBarStretch * toolBarStretch;
|
||||||
|
QAction * toolBarStretchAction;
|
||||||
|
QToolBar * toolbar;
|
||||||
QWidget *comics;
|
QWidget *comics;
|
||||||
QSplitter * sVertical;
|
QSplitter * sVertical;
|
||||||
ComicFlowWidget * comicFlow;
|
ComicFlowWidget * comicFlow;
|
||||||
QSettings * settings;
|
QSettings * settings;
|
||||||
void closeEvent ( QCloseEvent * event );
|
void closeEvent ( QCloseEvent * event );
|
||||||
|
QAction * hideFlowViewAction;
|
||||||
|
|
||||||
QStackedWidget * stack;
|
QStackedWidget * stack;
|
||||||
|
|
||||||
|
@ -251,7 +251,6 @@ void LibraryWindow::doLayout()
|
|||||||
|
|
||||||
doComicsViewConnections();
|
doComicsViewConnections();
|
||||||
|
|
||||||
comicsView->setToolBar(editInfoToolBar);
|
|
||||||
comicsViewStack->addWidget(comicsViewTransition = new ComicsViewTransition());
|
comicsViewStack->addWidget(comicsViewTransition = new ComicsViewTransition());
|
||||||
comicsViewStack->addWidget(emptyFolderWidget = new EmptyFolderWidget());
|
comicsViewStack->addWidget(emptyFolderWidget = new EmptyFolderWidget());
|
||||||
comicsViewStack->addWidget(emptyLabelWidget = new EmptyLabelWidget());
|
comicsViewStack->addWidget(emptyLabelWidget = new EmptyLabelWidget());
|
||||||
@ -419,8 +418,7 @@ void LibraryWindow::setUpShortcutsManagement()
|
|||||||
#ifndef Q_OS_MAC
|
#ifndef Q_OS_MAC
|
||||||
<< toggleFullScreenAction
|
<< toggleFullScreenAction
|
||||||
#endif
|
#endif
|
||||||
<< toggleComicsViewAction
|
<< toggleComicsViewAction);
|
||||||
<< hideComicViewAction);
|
|
||||||
|
|
||||||
allActions << tmpList;
|
allActions << tmpList;
|
||||||
|
|
||||||
@ -725,14 +723,6 @@ void LibraryWindow::createActions()
|
|||||||
deleteComicsAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(DELETE_COMICS_ACTION_YL));
|
deleteComicsAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(DELETE_COMICS_ACTION_YL));
|
||||||
deleteComicsAction->setIcon(QIcon(":/images/trash.png"));
|
deleteComicsAction->setIcon(QIcon(":/images/trash.png"));
|
||||||
|
|
||||||
hideComicViewAction = new QAction(this);
|
|
||||||
hideComicViewAction->setText(tr("Hide comic flow"));
|
|
||||||
hideComicViewAction->setData(HIDE_COMIC_VIEW_ACTION_YL);
|
|
||||||
hideComicViewAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(HIDE_COMIC_VIEW_ACTION_YL));
|
|
||||||
hideComicViewAction->setIcon(QIcon(":/images/hideComicFlow.png"));
|
|
||||||
hideComicViewAction->setCheckable(true);
|
|
||||||
hideComicViewAction->setChecked(false);
|
|
||||||
|
|
||||||
getInfoAction = new QAction(this);
|
getInfoAction = new QAction(this);
|
||||||
getInfoAction->setData(GET_INFO_ACTION_YL);
|
getInfoAction->setData(GET_INFO_ACTION_YL);
|
||||||
getInfoAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(GET_INFO_ACTION_YL));
|
getInfoAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(GET_INFO_ACTION_YL));
|
||||||
@ -938,8 +928,8 @@ void LibraryWindow::createToolBars()
|
|||||||
|
|
||||||
editInfoToolBar->addAction(deleteComicsAction);
|
editInfoToolBar->addAction(deleteComicsAction);
|
||||||
|
|
||||||
/*editInfoToolBar->addWidget(new QToolBarStretch());
|
|
||||||
editInfoToolBar->addAction(hideComicViewAction);*/
|
comicsView->setToolBar(editInfoToolBar);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LibraryWindow::createMenus()
|
void LibraryWindow::createMenus()
|
||||||
@ -1148,8 +1138,6 @@ void LibraryWindow::createConnections()
|
|||||||
|
|
||||||
connect(deleteComicsAction,SIGNAL(triggered()),this,SLOT(deleteComics()));
|
connect(deleteComicsAction,SIGNAL(triggered()),this,SLOT(deleteComics()));
|
||||||
|
|
||||||
connect(hideComicViewAction, SIGNAL(toggled(bool)),this, SLOT(hideComicFlow(bool)));
|
|
||||||
|
|
||||||
connect(getInfoAction,SIGNAL(triggered()),this,SLOT(showComicVineScraper()));
|
connect(getInfoAction,SIGNAL(triggered()),this,SLOT(showComicVineScraper()));
|
||||||
|
|
||||||
//connect(socialAction,SIGNAL(triggered()),this,SLOT(showSocial()));
|
//connect(socialAction,SIGNAL(triggered()),this,SLOT(showSocial()));
|
||||||
@ -2464,30 +2452,6 @@ QString LibraryWindow::currentFolderPath()
|
|||||||
return QDir::cleanPath(currentPath()+path);
|
return QDir::cleanPath(currentPath()+path);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO ComicsView: some actions in the comics toolbar can be relative to a certain view
|
|
||||||
//show/hide actions on show/hide widget
|
|
||||||
void LibraryWindow::hideComicFlow(bool hide)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
if(hide)
|
|
||||||
{
|
|
||||||
QList<int> sizes;
|
|
||||||
sizes.append(0);
|
|
||||||
int total = sVertical->sizes().at(0) + sVertical->sizes().at(1);
|
|
||||||
sizes.append(total);
|
|
||||||
sVertical->setSizes(sizes);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
QList<int> sizes;
|
|
||||||
int total = sVertical->sizes().at(0) + sVertical->sizes().at(1);
|
|
||||||
sizes.append(2*total/3);
|
|
||||||
sizes.append(total/3);
|
|
||||||
sVertical->setSizes(sizes);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
void LibraryWindow::showExportComicsInfo()
|
void LibraryWindow::showExportComicsInfo()
|
||||||
{
|
{
|
||||||
exportComicsInfoDialog->source = currentPath() + "/.yacreaderlibrary/library.ydb";
|
exportComicsInfoDialog->source = currentPath() + "/.yacreaderlibrary/library.ydb";
|
||||||
|
@ -205,7 +205,6 @@ private:
|
|||||||
QAction * asignOrderAction;
|
QAction * asignOrderAction;
|
||||||
QAction * forceCoverExtractedAction;
|
QAction * forceCoverExtractedAction;
|
||||||
QAction * deleteComicsAction;
|
QAction * deleteComicsAction;
|
||||||
QAction * hideComicViewAction;
|
|
||||||
|
|
||||||
QAction *showEditShortcutsAction;
|
QAction *showEditShortcutsAction;
|
||||||
|
|
||||||
@ -339,7 +338,6 @@ public slots:
|
|||||||
void setCurrentComicsStatusReaded(YACReaderComicReadStatus readStatus);
|
void setCurrentComicsStatusReaded(YACReaderComicReadStatus readStatus);
|
||||||
void setCurrentComicReaded();
|
void setCurrentComicReaded();
|
||||||
void setCurrentComicUnreaded();
|
void setCurrentComicUnreaded();
|
||||||
void hideComicFlow(bool hide);
|
|
||||||
void showExportComicsInfo();
|
void showExportComicsInfo();
|
||||||
void showImportComicsInfo();
|
void showImportComicsInfo();
|
||||||
void asignNumbers();
|
void asignNumbers();
|
||||||
|
Loading…
Reference in New Issue
Block a user