mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Added an icon for the show info toolbar action and a setting for remembering its configuration.
This commit is contained in:
parent
64b77586fc
commit
0486e5eb5f
@ -100,12 +100,15 @@ GridComicsView::GridComicsView(QWidget *parent) :
|
|||||||
ctxt->setContextProperty("dragManager", this);
|
ctxt->setContextProperty("dragManager", this);
|
||||||
ctxt->setContextProperty("dropManager", this);
|
ctxt->setContextProperty("dropManager", this);
|
||||||
|
|
||||||
ctxt->setContextProperty("showInfo", false);
|
bool showInfo = settings->value(COMICS_GRID_SHOW_INFO, false).toBool();
|
||||||
|
ctxt->setContextProperty("showInfo", showInfo);
|
||||||
|
|
||||||
view->setSource(QUrl("qrc:/qml/GridComicsView.qml"));
|
view->setSource(QUrl("qrc:/qml/GridComicsView.qml"));
|
||||||
|
|
||||||
showInfoAction = new QAction("Show info",this);
|
showInfoAction = new QAction(tr("Show info"),this);
|
||||||
|
showInfoAction->setIcon(QIcon(":/images/comics_view_toolbar/show_comic_info.png"));
|
||||||
showInfoAction->setCheckable(true);
|
showInfoAction->setCheckable(true);
|
||||||
|
showInfoAction->setChecked(showInfo);
|
||||||
connect(showInfoAction, &QAction::toggled, this, &GridComicsView::showInfo);
|
connect(showInfoAction, &QAction::toggled, this, &GridComicsView::showInfo);
|
||||||
|
|
||||||
setShowMarks(true);//TODO save this in settings
|
setShowMarks(true);//TODO save this in settings
|
||||||
@ -166,6 +169,7 @@ void GridComicsView::setToolBar(QToolBar *toolBar)
|
|||||||
|
|
||||||
toolBarStretchAction = toolBar->addWidget(toolBarStretch);
|
toolBarStretchAction = toolBar->addWidget(toolBarStretch);
|
||||||
toolBar->addAction(showInfoAction);
|
toolBar->addAction(showInfoAction);
|
||||||
|
showInfoSeparatorAction = toolBar->addSeparator();
|
||||||
coverSizeSliderAction = toolBar->addWidget(coverSizeSliderWidget);
|
coverSizeSliderAction = toolBar->addWidget(coverSizeSliderWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -433,6 +437,7 @@ void GridComicsView::closeEvent(QCloseEvent *event)
|
|||||||
{
|
{
|
||||||
toolbar->removeAction(toolBarStretchAction);
|
toolbar->removeAction(toolBarStretchAction);
|
||||||
toolbar->removeAction(showInfoAction);
|
toolbar->removeAction(showInfoAction);
|
||||||
|
toolbar->removeAction(showInfoSeparatorAction);
|
||||||
toolbar->removeAction(coverSizeSliderAction);
|
toolbar->removeAction(coverSizeSliderAction);
|
||||||
|
|
||||||
/*QObject *object = view->rootObject();
|
/*QObject *object = view->rootObject();
|
||||||
@ -445,4 +450,5 @@ void GridComicsView::closeEvent(QCloseEvent *event)
|
|||||||
|
|
||||||
//save settings
|
//save settings
|
||||||
settings->setValue(COMICS_GRID_COVER_SIZES, coverSizeSlider->value());
|
settings->setValue(COMICS_GRID_COVER_SIZES, coverSizeSlider->value());
|
||||||
|
settings->setValue(COMICS_GRID_SHOW_INFO, showInfoAction->isChecked());
|
||||||
}
|
}
|
||||||
|
@ -77,6 +77,7 @@ private:
|
|||||||
QSlider * coverSizeSlider;
|
QSlider * coverSizeSlider;
|
||||||
QAction * coverSizeSliderAction;
|
QAction * coverSizeSliderAction;
|
||||||
QAction * showInfoAction;
|
QAction * showInfoAction;
|
||||||
|
QAction * showInfoSeparatorAction;
|
||||||
|
|
||||||
YACReaderComicsSelectionHelper * selectionHelper;
|
YACReaderComicsSelectionHelper * selectionHelper;
|
||||||
YACReaderComicInfoHelper * comicInfoHelper;
|
YACReaderComicInfoHelper * comicInfoHelper;
|
||||||
|
@ -35,7 +35,9 @@
|
|||||||
<file>../images/comics_view_toolbar/small_size_grid_zoom.png</file>
|
<file>../images/comics_view_toolbar/small_size_grid_zoom.png</file>
|
||||||
<file>../images/comics_view_toolbar/small_size_grid_zoom@2x.png</file>
|
<file>../images/comics_view_toolbar/small_size_grid_zoom@2x.png</file>
|
||||||
<file>../images/comics_view_toolbar/trash.png</file>
|
<file>../images/comics_view_toolbar/trash.png</file>
|
||||||
<file>../images/comics_view_toolbar/trash.png</file>
|
<file>../images/comics_view_toolbar/trash@2x.png</file>
|
||||||
|
<file>../images/comics_view_toolbar/show_comic_info.png</file>
|
||||||
|
<file>../images/comics_view_toolbar/show_comic_info@2x.png</file>
|
||||||
<file>../images/coversPackage.png</file>
|
<file>../images/coversPackage.png</file>
|
||||||
<file>../images/db.png</file>
|
<file>../images/db.png</file>
|
||||||
<file>../images/defaultCover.png</file>
|
<file>../images/defaultCover.png</file>
|
||||||
|
@ -471,7 +471,7 @@ Rectangle {
|
|||||||
anchors.rightMargin: 10
|
anchors.rightMargin: 10
|
||||||
pixelAligned: true
|
pixelAligned: true
|
||||||
//flickDeceleration: -2000
|
//flickDeceleration: -2000
|
||||||
snapMode: GridView.SnapToRow
|
|
||||||
currentIndex: 0
|
currentIndex: 0
|
||||||
cacheBuffer: 0
|
cacheBuffer: 0
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@
|
|||||||
#define COMICS_VIEW_FLOW_SPLITTER_STATUS "COMICS_VIEW_FLOW_SPLITTER_STATUS"
|
#define COMICS_VIEW_FLOW_SPLITTER_STATUS "COMICS_VIEW_FLOW_SPLITTER_STATUS"
|
||||||
#define SIDEBAR_SPLITTER_STATUS "SIDEBAR_SPLITTER_STATUS"
|
#define SIDEBAR_SPLITTER_STATUS "SIDEBAR_SPLITTER_STATUS"
|
||||||
#define COMICS_GRID_COVER_SIZES "COMICS_GRID_COVER_SIZES"
|
#define COMICS_GRID_COVER_SIZES "COMICS_GRID_COVER_SIZES"
|
||||||
|
#define COMICS_GRID_SHOW_INFO "COMICS_GRID_SHOW_INFO"
|
||||||
|
|
||||||
#define COMIC_VINE_API_KEY "COMIC_VINE_API_KEY"
|
#define COMIC_VINE_API_KEY "COMIC_VINE_API_KEY"
|
||||||
#define COMIC_VINE_BASE_URL "COMIC_VINE_BASE_URL"
|
#define COMIC_VINE_BASE_URL "COMIC_VINE_BASE_URL"
|
||||||
|
BIN
images/comics_view_toolbar/show_comic_info.png
Normal file
BIN
images/comics_view_toolbar/show_comic_info.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 133 B |
BIN
images/comics_view_toolbar/show_comic_info@2x.png
Normal file
BIN
images/comics_view_toolbar/show_comic_info@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 154 B |
Loading…
x
Reference in New Issue
Block a user