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
|
||||
comicToolBar->addStretch();
|
||||
#else
|
||||
comicToolBar->addWidget(new QToolBarStretch());
|
||||
comicToolBar->addWidget(new YACReaderToolBarStretch());
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -1,11 +1,12 @@
|
||||
#include "classic_comics_view.h"
|
||||
|
||||
#include "yacreader_table_view.h"
|
||||
#include "QStackedWidget"
|
||||
|
||||
#include "comic_flow_widget.h"
|
||||
#include "QsLog.h"
|
||||
|
||||
#include "QStackedWidget"
|
||||
#include "shortcuts_manager.h"
|
||||
#include "yacreader_table_view.h"
|
||||
#include "yacreader_tool_bar_stretch.h"
|
||||
|
||||
ClassicComicsView::ClassicComicsView(QWidget *parent)
|
||||
:ComicsView(parent),searching(false)
|
||||
@ -86,11 +87,48 @@ ClassicComicsView::ClassicComicsView(QWidget *parent)
|
||||
if(settings->contains(COMICS_VIEW_FLOW_SPLITTER_STATUS))
|
||||
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)
|
||||
{
|
||||
static_cast<QVBoxLayout *>(comics->layout())->insertWidget(0,toolBar);
|
||||
this->toolbar = toolBar;
|
||||
|
||||
toolBarStretchAction = toolBar->addWidget(toolBarStretch);
|
||||
toolBar->addAction(hideFlowViewAction);
|
||||
}
|
||||
|
||||
void ClassicComicsView::setModel(ComicModel *model)
|
||||
@ -302,6 +340,9 @@ void ClassicComicsView::closeEvent(QCloseEvent *event)
|
||||
saveTableHeadersStatus();
|
||||
saveSplitterStatus();
|
||||
ComicsView::closeEvent(event);
|
||||
|
||||
toolbar->removeAction(toolBarStretchAction);
|
||||
toolbar->removeAction(hideFlowViewAction);
|
||||
}
|
||||
|
||||
void ClassicComicsView::setupSearchingIcon()
|
||||
|
@ -6,12 +6,14 @@
|
||||
#include <QModelIndex>
|
||||
#include <QModelIndexList>
|
||||
|
||||
class YACReaderTableView;
|
||||
class QSplitter;
|
||||
class ComicFlowWidget;
|
||||
class QToolBar;
|
||||
class ComicModel;
|
||||
class QStackedWidget;
|
||||
class QToolBar;
|
||||
|
||||
class ComicFlowWidget;
|
||||
class ComicModel;
|
||||
class YACReaderTableView;
|
||||
class YACReaderToolBarStretch;
|
||||
|
||||
class ClassicComicsView : public ComicsView
|
||||
{
|
||||
@ -44,16 +46,22 @@ public slots:
|
||||
void selectedComicForOpening(const QModelIndex & mi);
|
||||
|
||||
protected slots:
|
||||
void hideComicFlow(bool hide);
|
||||
void requestedViewContextMenu(const QPoint & point);
|
||||
void requestedItemContextMenu(const QPoint & point);
|
||||
|
||||
|
||||
private:
|
||||
YACReaderTableView * tableView;
|
||||
YACReaderToolBarStretch * toolBarStretch;
|
||||
QAction * toolBarStretchAction;
|
||||
QToolBar * toolbar;
|
||||
QWidget *comics;
|
||||
QSplitter * sVertical;
|
||||
ComicFlowWidget * comicFlow;
|
||||
QSettings * settings;
|
||||
void closeEvent ( QCloseEvent * event );
|
||||
QAction * hideFlowViewAction;
|
||||
|
||||
QStackedWidget * stack;
|
||||
|
||||
|
@ -251,7 +251,6 @@ void LibraryWindow::doLayout()
|
||||
|
||||
doComicsViewConnections();
|
||||
|
||||
comicsView->setToolBar(editInfoToolBar);
|
||||
comicsViewStack->addWidget(comicsViewTransition = new ComicsViewTransition());
|
||||
comicsViewStack->addWidget(emptyFolderWidget = new EmptyFolderWidget());
|
||||
comicsViewStack->addWidget(emptyLabelWidget = new EmptyLabelWidget());
|
||||
@ -419,8 +418,7 @@ void LibraryWindow::setUpShortcutsManagement()
|
||||
#ifndef Q_OS_MAC
|
||||
<< toggleFullScreenAction
|
||||
#endif
|
||||
<< toggleComicsViewAction
|
||||
<< hideComicViewAction);
|
||||
<< toggleComicsViewAction);
|
||||
|
||||
allActions << tmpList;
|
||||
|
||||
@ -725,14 +723,6 @@ void LibraryWindow::createActions()
|
||||
deleteComicsAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(DELETE_COMICS_ACTION_YL));
|
||||
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->setData(GET_INFO_ACTION_YL);
|
||||
getInfoAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(GET_INFO_ACTION_YL));
|
||||
@ -938,8 +928,8 @@ void LibraryWindow::createToolBars()
|
||||
|
||||
editInfoToolBar->addAction(deleteComicsAction);
|
||||
|
||||
/*editInfoToolBar->addWidget(new QToolBarStretch());
|
||||
editInfoToolBar->addAction(hideComicViewAction);*/
|
||||
|
||||
comicsView->setToolBar(editInfoToolBar);
|
||||
}
|
||||
|
||||
void LibraryWindow::createMenus()
|
||||
@ -1148,8 +1138,6 @@ void LibraryWindow::createConnections()
|
||||
|
||||
connect(deleteComicsAction,SIGNAL(triggered()),this,SLOT(deleteComics()));
|
||||
|
||||
connect(hideComicViewAction, SIGNAL(toggled(bool)),this, SLOT(hideComicFlow(bool)));
|
||||
|
||||
connect(getInfoAction,SIGNAL(triggered()),this,SLOT(showComicVineScraper()));
|
||||
|
||||
//connect(socialAction,SIGNAL(triggered()),this,SLOT(showSocial()));
|
||||
@ -2464,30 +2452,6 @@ QString LibraryWindow::currentFolderPath()
|
||||
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()
|
||||
{
|
||||
exportComicsInfoDialog->source = currentPath() + "/.yacreaderlibrary/library.ydb";
|
||||
|
@ -205,7 +205,6 @@ private:
|
||||
QAction * asignOrderAction;
|
||||
QAction * forceCoverExtractedAction;
|
||||
QAction * deleteComicsAction;
|
||||
QAction * hideComicViewAction;
|
||||
|
||||
QAction *showEditShortcutsAction;
|
||||
|
||||
@ -339,7 +338,6 @@ public slots:
|
||||
void setCurrentComicsStatusReaded(YACReaderComicReadStatus readStatus);
|
||||
void setCurrentComicReaded();
|
||||
void setCurrentComicUnreaded();
|
||||
void hideComicFlow(bool hide);
|
||||
void showExportComicsInfo();
|
||||
void showImportComicsInfo();
|
||||
void asignNumbers();
|
||||
|
Loading…
Reference in New Issue
Block a user