mirror of
https://github.com/YACReader/yacreader
synced 2026-03-02 10:50:04 -05:00
Clean leftover code after theming that set QIcons directly
This commit is contained in:
@ -188,7 +188,6 @@ void MainWindowViewer::setupUI()
|
|||||||
void MainWindowViewer::createActions()
|
void MainWindowViewer::createActions()
|
||||||
{
|
{
|
||||||
openAction = new QAction(tr("&Open"), this);
|
openAction = new QAction(tr("&Open"), this);
|
||||||
openAction->setIcon(QIcon(":/images/viewer_toolbar/open.svg"));
|
|
||||||
openAction->setToolTip(tr("Open a comic"));
|
openAction->setToolTip(tr("Open a comic"));
|
||||||
openAction->setData(OPEN_ACTION_Y);
|
openAction->setData(OPEN_ACTION_Y);
|
||||||
openAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPEN_ACTION_Y));
|
openAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPEN_ACTION_Y));
|
||||||
@ -215,7 +214,6 @@ void MainWindowViewer::createActions()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
openFolderAction = new QAction(tr("Open Folder"), this);
|
openFolderAction = new QAction(tr("Open Folder"), this);
|
||||||
openFolderAction->setIcon(QIcon(":/images/viewer_toolbar/openFolder.svg"));
|
|
||||||
openFolderAction->setToolTip(tr("Open image folder"));
|
openFolderAction->setToolTip(tr("Open image folder"));
|
||||||
openFolderAction->setData(OPEN_FOLDER_ACTION_Y);
|
openFolderAction->setData(OPEN_FOLDER_ACTION_Y);
|
||||||
openFolderAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPEN_FOLDER_ACTION_Y));
|
openFolderAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPEN_FOLDER_ACTION_Y));
|
||||||
@ -239,28 +237,24 @@ void MainWindowViewer::createActions()
|
|||||||
connect(clearRecentFilesAction, &QAction::triggered, this, &MainWindowViewer::clearRecentFiles);
|
connect(clearRecentFilesAction, &QAction::triggered, this, &MainWindowViewer::clearRecentFiles);
|
||||||
|
|
||||||
saveImageAction = new QAction(tr("Save"), this);
|
saveImageAction = new QAction(tr("Save"), this);
|
||||||
saveImageAction->setIcon(QIcon(":/images/viewer_toolbar/save.svg"));
|
|
||||||
saveImageAction->setToolTip(tr("Save current page"));
|
saveImageAction->setToolTip(tr("Save current page"));
|
||||||
saveImageAction->setData(SAVE_IMAGE_ACTION_Y);
|
saveImageAction->setData(SAVE_IMAGE_ACTION_Y);
|
||||||
saveImageAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SAVE_IMAGE_ACTION_Y));
|
saveImageAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SAVE_IMAGE_ACTION_Y));
|
||||||
connect(saveImageAction, &QAction::triggered, this, &MainWindowViewer::saveImage);
|
connect(saveImageAction, &QAction::triggered, this, &MainWindowViewer::saveImage);
|
||||||
|
|
||||||
openComicOnTheLeftAction = new QAction(tr("Previous Comic"), this);
|
openComicOnTheLeftAction = new QAction(tr("Previous Comic"), this);
|
||||||
openComicOnTheLeftAction->setIcon(QIcon(":/images/viewer_toolbar/openPrevious.svg"));
|
|
||||||
openComicOnTheLeftAction->setToolTip(tr("Open previous comic"));
|
openComicOnTheLeftAction->setToolTip(tr("Open previous comic"));
|
||||||
openComicOnTheLeftAction->setData(OPEN_PREVIOUS_COMIC_ACTION_Y);
|
openComicOnTheLeftAction->setData(OPEN_PREVIOUS_COMIC_ACTION_Y);
|
||||||
openComicOnTheLeftAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPEN_PREVIOUS_COMIC_ACTION_Y));
|
openComicOnTheLeftAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPEN_PREVIOUS_COMIC_ACTION_Y));
|
||||||
connect(openComicOnTheLeftAction, &QAction::triggered, this, &MainWindowViewer::openLeftComic);
|
connect(openComicOnTheLeftAction, &QAction::triggered, this, &MainWindowViewer::openLeftComic);
|
||||||
|
|
||||||
openComicOnTheRightAction = new QAction(tr("Next Comic"), this);
|
openComicOnTheRightAction = new QAction(tr("Next Comic"), this);
|
||||||
openComicOnTheRightAction->setIcon(QIcon(":/images/viewer_toolbar/openNext.svg"));
|
|
||||||
openComicOnTheRightAction->setToolTip(tr("Open next comic"));
|
openComicOnTheRightAction->setToolTip(tr("Open next comic"));
|
||||||
openComicOnTheRightAction->setData(OPEN_NEXT_COMIC_ACTION_Y);
|
openComicOnTheRightAction->setData(OPEN_NEXT_COMIC_ACTION_Y);
|
||||||
openComicOnTheRightAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPEN_NEXT_COMIC_ACTION_Y));
|
openComicOnTheRightAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPEN_NEXT_COMIC_ACTION_Y));
|
||||||
connect(openComicOnTheRightAction, &QAction::triggered, this, &MainWindowViewer::openRightComic);
|
connect(openComicOnTheRightAction, &QAction::triggered, this, &MainWindowViewer::openRightComic);
|
||||||
|
|
||||||
goToPageOnTheLeftAction = new QAction(tr("&Previous"), this);
|
goToPageOnTheLeftAction = new QAction(tr("&Previous"), this);
|
||||||
goToPageOnTheLeftAction->setIcon(QIcon(":/images/viewer_toolbar/previous.svg"));
|
|
||||||
goToPageOnTheLeftAction->setShortcutContext(Qt::WidgetShortcut);
|
goToPageOnTheLeftAction->setShortcutContext(Qt::WidgetShortcut);
|
||||||
goToPageOnTheLeftAction->setToolTip(tr("Go to previous page"));
|
goToPageOnTheLeftAction->setToolTip(tr("Go to previous page"));
|
||||||
goToPageOnTheLeftAction->setData(PREV_ACTION_Y);
|
goToPageOnTheLeftAction->setData(PREV_ACTION_Y);
|
||||||
@ -268,7 +262,6 @@ void MainWindowViewer::createActions()
|
|||||||
connect(goToPageOnTheLeftAction, &QAction::triggered, viewer, &Viewer::left);
|
connect(goToPageOnTheLeftAction, &QAction::triggered, viewer, &Viewer::left);
|
||||||
|
|
||||||
goToPageOnTheRightAction = new QAction(tr("&Next"), this);
|
goToPageOnTheRightAction = new QAction(tr("&Next"), this);
|
||||||
goToPageOnTheRightAction->setIcon(QIcon(":/images/viewer_toolbar/next.svg"));
|
|
||||||
goToPageOnTheRightAction->setShortcutContext(Qt::WidgetShortcut);
|
goToPageOnTheRightAction->setShortcutContext(Qt::WidgetShortcut);
|
||||||
goToPageOnTheRightAction->setToolTip(tr("Go to next page"));
|
goToPageOnTheRightAction->setToolTip(tr("Go to next page"));
|
||||||
goToPageOnTheRightAction->setData(NEXT_ACTION_Y);
|
goToPageOnTheRightAction->setData(NEXT_ACTION_Y);
|
||||||
@ -276,27 +269,20 @@ void MainWindowViewer::createActions()
|
|||||||
connect(goToPageOnTheRightAction, &QAction::triggered, viewer, &Viewer::right);
|
connect(goToPageOnTheRightAction, &QAction::triggered, viewer, &Viewer::right);
|
||||||
|
|
||||||
adjustHeightAction = new QAction(tr("Fit Height"), this);
|
adjustHeightAction = new QAction(tr("Fit Height"), this);
|
||||||
adjustHeightAction->setIcon(QIcon(":/images/viewer_toolbar/toHeight.svg"));
|
|
||||||
// adjustWidth->setCheckable(true);
|
|
||||||
adjustHeightAction->setToolTip(tr("Fit image to height"));
|
adjustHeightAction->setToolTip(tr("Fit image to height"));
|
||||||
// adjustWidth->setIcon(QIcon(":/images/fitWidth.svg"));
|
|
||||||
adjustHeightAction->setData(ADJUST_HEIGHT_ACTION_Y);
|
adjustHeightAction->setData(ADJUST_HEIGHT_ACTION_Y);
|
||||||
adjustHeightAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ADJUST_HEIGHT_ACTION_Y));
|
adjustHeightAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ADJUST_HEIGHT_ACTION_Y));
|
||||||
adjustHeightAction->setCheckable(true);
|
adjustHeightAction->setCheckable(true);
|
||||||
connect(adjustHeightAction, &QAction::triggered, this, &MainWindowViewer::fitToHeight);
|
connect(adjustHeightAction, &QAction::triggered, this, &MainWindowViewer::fitToHeight);
|
||||||
|
|
||||||
adjustWidthAction = new QAction(tr("Fit Width"), this);
|
adjustWidthAction = new QAction(tr("Fit Width"), this);
|
||||||
adjustWidthAction->setIcon(QIcon(":/images/viewer_toolbar/toWidth.svg"));
|
|
||||||
// adjustWidth->setCheckable(true);
|
|
||||||
adjustWidthAction->setToolTip(tr("Fit image to width"));
|
adjustWidthAction->setToolTip(tr("Fit image to width"));
|
||||||
// adjustWidth->setIcon(QIcon(":/images/fitWidth.svg"));
|
|
||||||
adjustWidthAction->setData(ADJUST_WIDTH_ACTION_Y);
|
adjustWidthAction->setData(ADJUST_WIDTH_ACTION_Y);
|
||||||
adjustWidthAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ADJUST_WIDTH_ACTION_Y));
|
adjustWidthAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ADJUST_WIDTH_ACTION_Y));
|
||||||
adjustWidthAction->setCheckable(true);
|
adjustWidthAction->setCheckable(true);
|
||||||
connect(adjustWidthAction, &QAction::triggered, this, &MainWindowViewer::fitToWidth);
|
connect(adjustWidthAction, &QAction::triggered, this, &MainWindowViewer::fitToWidth);
|
||||||
|
|
||||||
adjustToFullSizeAction = new QAction(tr("Show full size"), this);
|
adjustToFullSizeAction = new QAction(tr("Show full size"), this);
|
||||||
adjustToFullSizeAction->setIcon(QIcon(":/images/viewer_toolbar/full.svg"));
|
|
||||||
adjustToFullSizeAction->setCheckable(false);
|
adjustToFullSizeAction->setCheckable(false);
|
||||||
adjustToFullSizeAction->setData(ADJUST_TO_FULL_SIZE_ACTION_Y);
|
adjustToFullSizeAction->setData(ADJUST_TO_FULL_SIZE_ACTION_Y);
|
||||||
adjustToFullSizeAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ADJUST_TO_FULL_SIZE_ACTION_Y));
|
adjustToFullSizeAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(ADJUST_TO_FULL_SIZE_ACTION_Y));
|
||||||
@ -304,7 +290,6 @@ void MainWindowViewer::createActions()
|
|||||||
connect(adjustToFullSizeAction, &QAction::triggered, this, &MainWindowViewer::adjustToFullSizeSwitch);
|
connect(adjustToFullSizeAction, &QAction::triggered, this, &MainWindowViewer::adjustToFullSizeSwitch);
|
||||||
|
|
||||||
fitToPageAction = new QAction(tr("Fit to page"), this);
|
fitToPageAction = new QAction(tr("Fit to page"), this);
|
||||||
fitToPageAction->setIcon(QIcon(":/images/viewer_toolbar/fitToPage.svg"));
|
|
||||||
fitToPageAction->setData(FIT_TO_PAGE_ACTION_Y);
|
fitToPageAction->setData(FIT_TO_PAGE_ACTION_Y);
|
||||||
fitToPageAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(FIT_TO_PAGE_ACTION_Y));
|
fitToPageAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(FIT_TO_PAGE_ACTION_Y));
|
||||||
fitToPageAction->setCheckable(true);
|
fitToPageAction->setCheckable(true);
|
||||||
@ -312,7 +297,6 @@ void MainWindowViewer::createActions()
|
|||||||
|
|
||||||
continuousScrollAction = new QAction(tr("Continuous scroll"), this);
|
continuousScrollAction = new QAction(tr("Continuous scroll"), this);
|
||||||
continuousScrollAction->setToolTip(tr("Switch to continuous scroll mode"));
|
continuousScrollAction->setToolTip(tr("Switch to continuous scroll mode"));
|
||||||
continuousScrollAction->setIcon(QIcon(":/images/viewer_toolbar/toContinuousScroll.svg"));
|
|
||||||
continuousScrollAction->setCheckable(true);
|
continuousScrollAction->setCheckable(true);
|
||||||
continuousScrollAction->setChecked(Configuration::getConfiguration().getContinuousScroll());
|
continuousScrollAction->setChecked(Configuration::getConfiguration().getContinuousScroll());
|
||||||
connect(continuousScrollAction, &QAction::toggled, viewer, &Viewer::setContinuousScroll);
|
connect(continuousScrollAction, &QAction::toggled, viewer, &Viewer::setContinuousScroll);
|
||||||
@ -350,7 +334,6 @@ void MainWindowViewer::createActions()
|
|||||||
connect(resetZoomAction, &QAction::triggered, this, &MainWindowViewer::resetZoomLevel);
|
connect(resetZoomAction, &QAction::triggered, this, &MainWindowViewer::resetZoomLevel);
|
||||||
|
|
||||||
showZoomSliderlAction = new QAction(tr("Show zoom slider"), this);
|
showZoomSliderlAction = new QAction(tr("Show zoom slider"), this);
|
||||||
showZoomSliderlAction->setIcon(QIcon(":/images/viewer_toolbar/zoom.svg"));
|
|
||||||
|
|
||||||
increasePageZoomAction = new QAction(tr("Zoom+"), this);
|
increasePageZoomAction = new QAction(tr("Zoom+"), this);
|
||||||
increasePageZoomAction->setData(ZOOM_PLUS_ACTION_Y);
|
increasePageZoomAction->setData(ZOOM_PLUS_ACTION_Y);
|
||||||
@ -363,20 +346,17 @@ void MainWindowViewer::createActions()
|
|||||||
connect(decreasePageZoomAction, &QAction::triggered, this, &MainWindowViewer::decreasePageZoomLevel);
|
connect(decreasePageZoomAction, &QAction::triggered, this, &MainWindowViewer::decreasePageZoomLevel);
|
||||||
|
|
||||||
leftRotationAction = new QAction(tr("Rotate image to the left"), this);
|
leftRotationAction = new QAction(tr("Rotate image to the left"), this);
|
||||||
leftRotationAction->setIcon(QIcon(":/images/viewer_toolbar/rotateL.svg"));
|
|
||||||
leftRotationAction->setData(LEFT_ROTATION_ACTION_Y);
|
leftRotationAction->setData(LEFT_ROTATION_ACTION_Y);
|
||||||
leftRotationAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(LEFT_ROTATION_ACTION_Y));
|
leftRotationAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(LEFT_ROTATION_ACTION_Y));
|
||||||
connect(leftRotationAction, &QAction::triggered, viewer, &Viewer::rotateLeft);
|
connect(leftRotationAction, &QAction::triggered, viewer, &Viewer::rotateLeft);
|
||||||
|
|
||||||
rightRotationAction = new QAction(tr("Rotate image to the right"), this);
|
rightRotationAction = new QAction(tr("Rotate image to the right"), this);
|
||||||
rightRotationAction->setIcon(QIcon(":/images/viewer_toolbar/rotateR.svg"));
|
|
||||||
rightRotationAction->setData(RIGHT_ROTATION_ACTION_Y);
|
rightRotationAction->setData(RIGHT_ROTATION_ACTION_Y);
|
||||||
rightRotationAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(RIGHT_ROTATION_ACTION_Y));
|
rightRotationAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(RIGHT_ROTATION_ACTION_Y));
|
||||||
connect(rightRotationAction, &QAction::triggered, viewer, &Viewer::rotateRight);
|
connect(rightRotationAction, &QAction::triggered, viewer, &Viewer::rotateRight);
|
||||||
|
|
||||||
doublePageAction = new QAction(tr("Double page mode"), this);
|
doublePageAction = new QAction(tr("Double page mode"), this);
|
||||||
doublePageAction->setToolTip(tr("Switch to double page mode"));
|
doublePageAction->setToolTip(tr("Switch to double page mode"));
|
||||||
doublePageAction->setIcon(QIcon(":/images/viewer_toolbar/doublePage.svg"));
|
|
||||||
doublePageAction->setCheckable(true);
|
doublePageAction->setCheckable(true);
|
||||||
doublePageAction->setChecked(Configuration::getConfiguration().getDoublePage());
|
doublePageAction->setChecked(Configuration::getConfiguration().getDoublePage());
|
||||||
doublePageAction->setData(DOUBLE_PAGE_ACTION_Y);
|
doublePageAction->setData(DOUBLE_PAGE_ACTION_Y);
|
||||||
@ -386,7 +366,6 @@ void MainWindowViewer::createActions()
|
|||||||
// inversed pictures mode
|
// inversed pictures mode
|
||||||
doubleMangaPageAction = new QAction(tr("Double page manga mode"), this);
|
doubleMangaPageAction = new QAction(tr("Double page manga mode"), this);
|
||||||
doubleMangaPageAction->setToolTip(tr("Reverse reading order in double page mode"));
|
doubleMangaPageAction->setToolTip(tr("Reverse reading order in double page mode"));
|
||||||
doubleMangaPageAction->setIcon(QIcon(":/images/viewer_toolbar/doubleMangaPage.svg"));
|
|
||||||
doubleMangaPageAction->setCheckable(true);
|
doubleMangaPageAction->setCheckable(true);
|
||||||
doubleMangaPageAction->setChecked(Configuration::getConfiguration().getDoubleMangaPage());
|
doubleMangaPageAction->setChecked(Configuration::getConfiguration().getDoubleMangaPage());
|
||||||
doubleMangaPageAction->setData(DOUBLE_MANGA_PAGE_ACTION_Y);
|
doubleMangaPageAction->setData(DOUBLE_MANGA_PAGE_ACTION_Y);
|
||||||
@ -395,7 +374,6 @@ void MainWindowViewer::createActions()
|
|||||||
connect(doubleMangaPageAction, &QAction::triggered, this, &MainWindowViewer::doubleMangaPageSwitch);
|
connect(doubleMangaPageAction, &QAction::triggered, this, &MainWindowViewer::doubleMangaPageSwitch);
|
||||||
|
|
||||||
goToPageAction = new QAction(tr("Go To"), this);
|
goToPageAction = new QAction(tr("Go To"), this);
|
||||||
goToPageAction->setIcon(QIcon(":/images/viewer_toolbar/goto.svg"));
|
|
||||||
goToPageAction->setToolTip(tr("Go to page ..."));
|
goToPageAction->setToolTip(tr("Go to page ..."));
|
||||||
goToPageAction->setData(GO_TO_PAGE_ACTION_Y);
|
goToPageAction->setData(GO_TO_PAGE_ACTION_Y);
|
||||||
goToPageAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(GO_TO_PAGE_ACTION_Y));
|
goToPageAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(GO_TO_PAGE_ACTION_Y));
|
||||||
@ -405,20 +383,17 @@ void MainWindowViewer::createActions()
|
|||||||
optionsAction->setToolTip(tr("YACReader options"));
|
optionsAction->setToolTip(tr("YACReader options"));
|
||||||
optionsAction->setData(OPTIONS_ACTION_Y);
|
optionsAction->setData(OPTIONS_ACTION_Y);
|
||||||
optionsAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPTIONS_ACTION_Y));
|
optionsAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPTIONS_ACTION_Y));
|
||||||
optionsAction->setIcon(QIcon(":/images/viewer_toolbar/options.svg"));
|
|
||||||
|
|
||||||
connect(optionsAction, &QAction::triggered, optionsDialog, &OptionsDialog::show);
|
connect(optionsAction, &QAction::triggered, optionsDialog, &OptionsDialog::show);
|
||||||
|
|
||||||
helpAboutAction = new QAction(tr("Help"), this);
|
helpAboutAction = new QAction(tr("Help"), this);
|
||||||
helpAboutAction->setToolTip(tr("Help, About YACReader"));
|
helpAboutAction->setToolTip(tr("Help, About YACReader"));
|
||||||
helpAboutAction->setIcon(QIcon(":/images/viewer_toolbar/help.svg"));
|
|
||||||
helpAboutAction->setData(HELP_ABOUT_ACTION_Y);
|
helpAboutAction->setData(HELP_ABOUT_ACTION_Y);
|
||||||
helpAboutAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(HELP_ABOUT_ACTION_Y));
|
helpAboutAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(HELP_ABOUT_ACTION_Y));
|
||||||
connect(helpAboutAction, &QAction::triggered, had, &QWidget::show);
|
connect(helpAboutAction, &QAction::triggered, had, &QWidget::show);
|
||||||
|
|
||||||
showMagnifyingGlassAction = new QAction(tr("Magnifying glass"), this);
|
showMagnifyingGlassAction = new QAction(tr("Magnifying glass"), this);
|
||||||
showMagnifyingGlassAction->setToolTip(tr("Switch Magnifying glass"));
|
showMagnifyingGlassAction->setToolTip(tr("Switch Magnifying glass"));
|
||||||
showMagnifyingGlassAction->setIcon(QIcon(":/images/viewer_toolbar/magnifyingGlass.svg"));
|
|
||||||
showMagnifyingGlassAction->setCheckable(true);
|
showMagnifyingGlassAction->setCheckable(true);
|
||||||
showMagnifyingGlassAction->setData(SHOW_MAGNIFYING_GLASS_ACTION_Y);
|
showMagnifyingGlassAction->setData(SHOW_MAGNIFYING_GLASS_ACTION_Y);
|
||||||
showMagnifyingGlassAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_MAGNIFYING_GLASS_ACTION_Y));
|
showMagnifyingGlassAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_MAGNIFYING_GLASS_ACTION_Y));
|
||||||
@ -426,7 +401,6 @@ void MainWindowViewer::createActions()
|
|||||||
|
|
||||||
setBookmarkAction = new QAction(tr("Set bookmark"), this);
|
setBookmarkAction = new QAction(tr("Set bookmark"), this);
|
||||||
setBookmarkAction->setToolTip(tr("Set a bookmark on the current page"));
|
setBookmarkAction->setToolTip(tr("Set a bookmark on the current page"));
|
||||||
setBookmarkAction->setIcon(QIcon(":/images/viewer_toolbar/bookmark.svg"));
|
|
||||||
setBookmarkAction->setCheckable(true);
|
setBookmarkAction->setCheckable(true);
|
||||||
setBookmarkAction->setData(SET_BOOKMARK_ACTION_Y);
|
setBookmarkAction->setData(SET_BOOKMARK_ACTION_Y);
|
||||||
setBookmarkAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SET_BOOKMARK_ACTION_Y));
|
setBookmarkAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SET_BOOKMARK_ACTION_Y));
|
||||||
@ -436,38 +410,32 @@ void MainWindowViewer::createActions()
|
|||||||
|
|
||||||
showBookmarksAction = new QAction(tr("Show bookmarks"), this);
|
showBookmarksAction = new QAction(tr("Show bookmarks"), this);
|
||||||
showBookmarksAction->setToolTip(tr("Show the bookmarks of the current comic"));
|
showBookmarksAction->setToolTip(tr("Show the bookmarks of the current comic"));
|
||||||
showBookmarksAction->setIcon(QIcon(":/images/viewer_toolbar/showBookmarks.svg"));
|
|
||||||
showBookmarksAction->setData(SHOW_BOOKMARKS_ACTION_Y);
|
showBookmarksAction->setData(SHOW_BOOKMARKS_ACTION_Y);
|
||||||
showBookmarksAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_BOOKMARKS_ACTION_Y));
|
showBookmarksAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_BOOKMARKS_ACTION_Y));
|
||||||
connect(showBookmarksAction, &QAction::triggered, viewer->getBookmarksDialog(), &QWidget::show);
|
connect(showBookmarksAction, &QAction::triggered, viewer->getBookmarksDialog(), &QWidget::show);
|
||||||
|
|
||||||
showShorcutsAction = new QAction(tr("Show keyboard shortcuts"), this);
|
showShorcutsAction = new QAction(tr("Show keyboard shortcuts"), this);
|
||||||
showShorcutsAction->setIcon(QIcon(":/images/viewer_toolbar/shortcuts.svg"));
|
|
||||||
showShorcutsAction->setData(SHOW_SHORCUTS_ACTION_Y);
|
showShorcutsAction->setData(SHOW_SHORCUTS_ACTION_Y);
|
||||||
showShorcutsAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_SHORCUTS_ACTION_Y));
|
showShorcutsAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_SHORCUTS_ACTION_Y));
|
||||||
connect(showShorcutsAction, &QAction::triggered, editShortcutsDialog, &QWidget::show);
|
connect(showShorcutsAction, &QAction::triggered, editShortcutsDialog, &QWidget::show);
|
||||||
|
|
||||||
showInfoAction = new QAction(tr("Show Info"), this);
|
showInfoAction = new QAction(tr("Show Info"), this);
|
||||||
showInfoAction->setIcon(QIcon(":/images/viewer_toolbar/info.svg"));
|
|
||||||
showInfoAction->setData(SHOW_INFO_ACTION_Y);
|
showInfoAction->setData(SHOW_INFO_ACTION_Y);
|
||||||
showInfoAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_INFO_ACTION_Y));
|
showInfoAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_INFO_ACTION_Y));
|
||||||
connect(showInfoAction, &QAction::triggered, viewer, &Viewer::informationSwitch);
|
connect(showInfoAction, &QAction::triggered, viewer, &Viewer::informationSwitch);
|
||||||
|
|
||||||
closeAction = new QAction(tr("Close"), this);
|
closeAction = new QAction(tr("Close"), this);
|
||||||
closeAction->setIcon(QIcon(":/images/viewer_toolbar/close.svg"));
|
|
||||||
closeAction->setData(CLOSE_ACTION_Y);
|
closeAction->setData(CLOSE_ACTION_Y);
|
||||||
closeAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(CLOSE_ACTION_Y));
|
closeAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(CLOSE_ACTION_Y));
|
||||||
connect(closeAction, &QAction::triggered, this, &QWidget::close);
|
connect(closeAction, &QAction::triggered, this, &QWidget::close);
|
||||||
|
|
||||||
showDictionaryAction = new QAction(tr("Show Dictionary"), this);
|
showDictionaryAction = new QAction(tr("Show Dictionary"), this);
|
||||||
showDictionaryAction->setIcon(QIcon(":/images/viewer_toolbar/translator.svg"));
|
|
||||||
// showDictionaryAction->setCheckable(true);
|
// showDictionaryAction->setCheckable(true);
|
||||||
showDictionaryAction->setData(SHOW_DICTIONARY_ACTION_Y);
|
showDictionaryAction->setData(SHOW_DICTIONARY_ACTION_Y);
|
||||||
showDictionaryAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_DICTIONARY_ACTION_Y));
|
showDictionaryAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_DICTIONARY_ACTION_Y));
|
||||||
connect(showDictionaryAction, &QAction::triggered, viewer, &Viewer::translatorSwitch);
|
connect(showDictionaryAction, &QAction::triggered, viewer, &Viewer::translatorSwitch);
|
||||||
|
|
||||||
showFlowAction = new QAction(tr("Show go to flow"), this);
|
showFlowAction = new QAction(tr("Show go to flow"), this);
|
||||||
showFlowAction->setIcon(QIcon(":/images/viewer_toolbar/flow.svg"));
|
|
||||||
showFlowAction->setData(SHOW_FLOW_ACTION_Y);
|
showFlowAction->setData(SHOW_FLOW_ACTION_Y);
|
||||||
showFlowAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_FLOW_ACTION_Y));
|
showFlowAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(SHOW_FLOW_ACTION_Y));
|
||||||
connect(showFlowAction, &QAction::triggered, viewer, &Viewer::goToFlowSwitch);
|
connect(showFlowAction, &QAction::triggered, viewer, &Viewer::goToFlowSwitch);
|
||||||
@ -505,8 +473,8 @@ void MainWindowViewer::createToolBars()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Y_MAC_UI
|
#ifdef Y_MAC_UI
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/open")), openAction));
|
comicToolBar->addAction(wrappedToolbarAction(openAction));
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/openFolder")), openFolderAction));
|
comicToolBar->addAction(wrappedToolbarAction(openFolderAction));
|
||||||
#else
|
#else
|
||||||
auto recentmenu = new QMenu(tr("Open recent"));
|
auto recentmenu = new QMenu(tr("Open recent"));
|
||||||
recentmenu->addActions(recentFilesActionList);
|
recentmenu->addActions(recentFilesActionList);
|
||||||
@ -515,10 +483,10 @@ void MainWindowViewer::createToolBars()
|
|||||||
refreshRecentFilesActionList();
|
refreshRecentFilesActionList();
|
||||||
|
|
||||||
openToolButton = new QToolButton();
|
openToolButton = new QToolButton();
|
||||||
auto open = actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/open")), openAction);
|
auto open = wrappedToolbarAction(openAction);
|
||||||
openToolButton->addAction(open);
|
openToolButton->addAction(open);
|
||||||
openToolButton->addAction(actionWithCustomIcon(QIcon(), openLatestComicAction));
|
openToolButton->addAction(wrappedToolbarAction(openLatestComicAction));
|
||||||
openToolButton->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/openFolder")), openFolderAction));
|
openToolButton->addAction(wrappedToolbarAction(openFolderAction));
|
||||||
openToolButton->addAction(recentmenu->menuAction());
|
openToolButton->addAction(recentmenu->menuAction());
|
||||||
openToolButton->setPopupMode(QToolButton::MenuButtonPopup);
|
openToolButton->setPopupMode(QToolButton::MenuButtonPopup);
|
||||||
openToolButton->setDefaultAction(open);
|
openToolButton->setDefaultAction(open);
|
||||||
@ -526,28 +494,28 @@ void MainWindowViewer::createToolBars()
|
|||||||
comicToolBar->addWidget(openToolButton);
|
comicToolBar->addWidget(openToolButton);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/save")), saveImageAction));
|
comicToolBar->addAction(wrappedToolbarAction(saveImageAction));
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/openPrevious")), openComicOnTheLeftAction));
|
comicToolBar->addAction(wrappedToolbarAction(openComicOnTheLeftAction));
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/openNext")), openComicOnTheRightAction));
|
comicToolBar->addAction(wrappedToolbarAction(openComicOnTheRightAction));
|
||||||
|
|
||||||
comicToolBar->addSeparator();
|
comicToolBar->addSeparator();
|
||||||
|
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/previous")), goToPageOnTheLeftAction));
|
comicToolBar->addAction(wrappedToolbarAction(goToPageOnTheLeftAction));
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/next")), goToPageOnTheRightAction));
|
comicToolBar->addAction(wrappedToolbarAction(goToPageOnTheRightAction));
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/goto")), goToPageAction));
|
comicToolBar->addAction(wrappedToolbarAction(goToPageAction));
|
||||||
|
|
||||||
comicToolBar->addSeparator();
|
comicToolBar->addSeparator();
|
||||||
|
|
||||||
auto adjustToWidthTBAction = actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/toWidth")), adjustWidthAction);
|
auto adjustToWidthTBAction = wrappedToolbarAction(adjustWidthAction);
|
||||||
comicToolBar->addAction(adjustToWidthTBAction);
|
comicToolBar->addAction(adjustToWidthTBAction);
|
||||||
auto adjustToHeightTBAction = actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/toHeight")), adjustHeightAction);
|
auto adjustToHeightTBAction = wrappedToolbarAction(adjustHeightAction);
|
||||||
comicToolBar->addAction(adjustToHeightTBAction);
|
comicToolBar->addAction(adjustToHeightTBAction);
|
||||||
auto adjustToFullSizeTBAction = actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/full")), adjustToFullSizeAction);
|
auto adjustToFullSizeTBAction = wrappedToolbarAction(adjustToFullSizeAction);
|
||||||
comicToolBar->addAction(adjustToFullSizeAction);
|
comicToolBar->addAction(adjustToFullSizeAction);
|
||||||
auto fitToPageTBAction = actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/fitToPage")), fitToPageAction);
|
auto fitToPageTBAction = wrappedToolbarAction(fitToPageAction);
|
||||||
comicToolBar->addAction(fitToPageTBAction);
|
comicToolBar->addAction(fitToPageTBAction);
|
||||||
|
|
||||||
auto continuousScroollTBAction = actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/toContinuousScroll")), continuousScrollAction);
|
auto continuousScroollTBAction = wrappedToolbarAction(continuousScrollAction);
|
||||||
|
|
||||||
auto fitModes = new QActionGroup(this);
|
auto fitModes = new QActionGroup(this);
|
||||||
fitModes->addAction(adjustToWidthTBAction);
|
fitModes->addAction(adjustToWidthTBAction);
|
||||||
@ -559,32 +527,32 @@ void MainWindowViewer::createToolBars()
|
|||||||
zoomSliderAction = new YACReaderSlider(this);
|
zoomSliderAction = new YACReaderSlider(this);
|
||||||
zoomSliderAction->hide();
|
zoomSliderAction->hide();
|
||||||
|
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/zoom")), showZoomSliderlAction));
|
comicToolBar->addAction(wrappedToolbarAction(showZoomSliderlAction));
|
||||||
|
|
||||||
connect(showZoomSliderlAction, &QAction::triggered, this, &MainWindowViewer::toggleFitToWidthSlider);
|
connect(showZoomSliderlAction, &QAction::triggered, this, &MainWindowViewer::toggleFitToWidthSlider);
|
||||||
connect(zoomSliderAction, &YACReaderSlider::zoomRatioChanged, viewer, &Viewer::updateZoomRatio);
|
connect(zoomSliderAction, &YACReaderSlider::zoomRatioChanged, viewer, &Viewer::updateZoomRatio);
|
||||||
connect(viewer, &Viewer::zoomUpdated, zoomSliderAction, &YACReaderSlider::updateZoomRatio);
|
connect(viewer, &Viewer::zoomUpdated, zoomSliderAction, &YACReaderSlider::updateZoomRatio);
|
||||||
|
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/rotateL")), leftRotationAction));
|
comicToolBar->addAction(wrappedToolbarAction(leftRotationAction));
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/rotateR")), rightRotationAction));
|
comicToolBar->addAction(wrappedToolbarAction(rightRotationAction));
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/doublePage")), doublePageAction));
|
comicToolBar->addAction(wrappedToolbarAction(doublePageAction));
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/doubleMangaPage")), doubleMangaPageAction));
|
comicToolBar->addAction(wrappedToolbarAction(doubleMangaPageAction));
|
||||||
comicToolBar->addAction(continuousScroollTBAction);
|
comicToolBar->addAction(continuousScroollTBAction);
|
||||||
|
|
||||||
comicToolBar->addSeparator();
|
comicToolBar->addSeparator();
|
||||||
|
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/magnifyingGlass")), showMagnifyingGlassAction));
|
comicToolBar->addAction(wrappedToolbarAction(showMagnifyingGlassAction));
|
||||||
|
|
||||||
comicToolBar->addSeparator();
|
comicToolBar->addSeparator();
|
||||||
|
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/bookmark")), setBookmarkAction));
|
comicToolBar->addAction(wrappedToolbarAction(setBookmarkAction));
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/showBookmarks")), showBookmarksAction));
|
comicToolBar->addAction(wrappedToolbarAction(showBookmarksAction));
|
||||||
|
|
||||||
comicToolBar->addSeparator();
|
comicToolBar->addSeparator();
|
||||||
|
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/translator")), showDictionaryAction));
|
comicToolBar->addAction(wrappedToolbarAction(showDictionaryAction));
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/flow")), showFlowAction));
|
comicToolBar->addAction(wrappedToolbarAction(showFlowAction));
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/info")), showInfoAction));
|
comicToolBar->addAction(wrappedToolbarAction(showInfoAction));
|
||||||
|
|
||||||
#ifdef Y_MAC_UI
|
#ifdef Y_MAC_UI
|
||||||
comicToolBar->addStretch();
|
comicToolBar->addStretch();
|
||||||
@ -592,9 +560,9 @@ void MainWindowViewer::createToolBars()
|
|||||||
comicToolBar->addWidget(new YACReaderToolBarStretch());
|
comicToolBar->addWidget(new YACReaderToolBarStretch());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/shortcuts")), showShorcutsAction));
|
comicToolBar->addAction(wrappedToolbarAction(showShorcutsAction));
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/options")), optionsAction));
|
comicToolBar->addAction(wrappedToolbarAction(optionsAction));
|
||||||
comicToolBar->addAction(actionWithCustomIcon(QIcon(addExtensionToIconPathInToolbar(":/images/viewer_toolbar/help")), helpAboutAction));
|
comicToolBar->addAction(wrappedToolbarAction(helpAboutAction));
|
||||||
|
|
||||||
#ifndef Y_MAC_UI
|
#ifndef Y_MAC_UI
|
||||||
comicToolBar->setMovable(false);
|
comicToolBar->setMovable(false);
|
||||||
@ -1597,7 +1565,7 @@ void MainWindowViewer::applyTheme(const Theme &theme)
|
|||||||
if (action) {
|
if (action) {
|
||||||
action->setIcon(icon);
|
action->setIcon(icon);
|
||||||
|
|
||||||
auto action18x18 = action->property("customIconAction").value<QAction *>();
|
auto action18x18 = action->property("wrappedToolbarAction").value<QAction *>();
|
||||||
if (action18x18) {
|
if (action18x18) {
|
||||||
|
|
||||||
action18x18->setIcon(icon18x18);
|
action18x18->setIcon(icon18x18);
|
||||||
|
|||||||
@ -53,14 +53,9 @@ QList<qulonglong> YACReader::mimeDataToComicsIds(const QMimeData *data)
|
|||||||
return comicIds;
|
return comicIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString YACReader::addExtensionToIconPathInToolbar(const QString &path)
|
QAction *YACReader::wrappedToolbarAction(QAction *action)
|
||||||
{
|
{
|
||||||
return path + "_18x18.svg";
|
auto a = new QAction(action->text());
|
||||||
}
|
|
||||||
|
|
||||||
QAction *YACReader::actionWithCustomIcon(const QIcon &icon, QAction *action)
|
|
||||||
{
|
|
||||||
auto a = new QAction(icon, action->text());
|
|
||||||
|
|
||||||
a->setEnabled(action->isEnabled());
|
a->setEnabled(action->isEnabled());
|
||||||
a->setCheckable(action->isCheckable());
|
a->setCheckable(action->isCheckable());
|
||||||
@ -79,7 +74,7 @@ QAction *YACReader::actionWithCustomIcon(const QIcon &icon, QAction *action)
|
|||||||
QObject::connect(action, &QAction::toggled, a, &QAction::setChecked);
|
QObject::connect(action, &QAction::toggled, a, &QAction::setChecked);
|
||||||
|
|
||||||
// asign a to action somehow so we can retrieve it later
|
// asign a to action somehow so we can retrieve it later
|
||||||
action->setProperty("customIconAction", QVariant::fromValue<QObject *>(a));
|
action->setProperty("wrappedToolbarAction", QVariant::fromValue<QObject *>(a));
|
||||||
|
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -111,8 +111,7 @@ QAction *createSeparator();
|
|||||||
QIcon noHighlightedIcon(const QString &path);
|
QIcon noHighlightedIcon(const QString &path);
|
||||||
void colorize(QImage &img, const QColor &col);
|
void colorize(QImage &img, const QColor &col);
|
||||||
QList<qulonglong> mimeDataToComicsIds(const QMimeData *data);
|
QList<qulonglong> mimeDataToComicsIds(const QMimeData *data);
|
||||||
QString addExtensionToIconPathInToolbar(const QString &path);
|
QAction *wrappedToolbarAction(QAction *action);
|
||||||
QAction *actionWithCustomIcon(const QIcon &icon, QAction *action);
|
|
||||||
QPixmap hdpiPixmap(const QString &file, QSize size);
|
QPixmap hdpiPixmap(const QString &file, QSize size);
|
||||||
QString imageFileLoader(QWidget *parent);
|
QString imageFileLoader(QWidget *parent);
|
||||||
QString imagePathFromMimeData(const QMimeData *mimeData);
|
QString imagePathFromMimeData(const QMimeData *mimeData);
|
||||||
|
|||||||
Reference in New Issue
Block a user