mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
fixed switch views item and removed fullscreen toogle item from YACReaderLibrary in MacOSX
This commit is contained in:
parent
6b4225d2ec
commit
33e022de5e
@ -384,7 +384,9 @@ void LibraryWindow::setUpShortcutsManagement()
|
||||
editShortcutsDialog->addActionsGroup("Visualization",QIcon(":/images/shortcuts_group_visualization.png"),
|
||||
tmpList = QList<QAction *>()
|
||||
<< showHideMarksAction
|
||||
#ifndef Q_OS_MAC
|
||||
<< toggleFullScreenAction
|
||||
#endif
|
||||
<< toggleComicsViewAction
|
||||
<< hideComicViewAction);
|
||||
|
||||
@ -535,7 +537,7 @@ void LibraryWindow::createActions()
|
||||
showHideMarksAction->setCheckable(true);
|
||||
showHideMarksAction->setIcon(QIcon(":/images/showMarks.png"));
|
||||
showHideMarksAction->setChecked(true);
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
toggleFullScreenAction = new QAction(tr("Fullscreen mode on/off"),this);
|
||||
toggleFullScreenAction->setToolTip(tr("Fullscreen mode on/off"));
|
||||
toggleFullScreenAction->setData(TOGGLE_FULL_SCREEN_ACTION_YL);
|
||||
@ -543,7 +545,7 @@ void LibraryWindow::createActions()
|
||||
QIcon icoFullscreenButton;
|
||||
icoFullscreenButton.addPixmap(QPixmap(":/images/main_toolbar/fullscreen.png"), QIcon::Normal);
|
||||
toggleFullScreenAction->setIcon(icoFullscreenButton);
|
||||
|
||||
#endif
|
||||
helpAboutAction = new QAction(this);
|
||||
helpAboutAction->setToolTip(tr("Help, About YACReader"));
|
||||
helpAboutAction->setData(HELP_ABOUT_ACTION_YL);
|
||||
@ -735,7 +737,9 @@ void LibraryWindow::createActions()
|
||||
void LibraryWindow::disableComicsActions(bool disabled)
|
||||
{
|
||||
//if there aren't comics, no fullscreen option will be available
|
||||
#ifndef Q_OS_MAC
|
||||
toggleFullScreenAction->setDisabled(disabled);
|
||||
#endif
|
||||
//edit toolbar
|
||||
openComicAction->setDisabled(disabled);
|
||||
editSelectedComicsAction->setDisabled(disabled);
|
||||
@ -822,7 +826,9 @@ void LibraryWindow::createToolBars()
|
||||
libraryToolBar->addSpace(10);
|
||||
|
||||
libraryToolBar->addAction(toggleComicsViewAction);
|
||||
#ifndef Q_OS_MAC
|
||||
libraryToolBar->addAction(toggleFullScreenAction);
|
||||
#endif
|
||||
|
||||
libraryToolBar->addStretch();
|
||||
|
||||
@ -911,8 +917,14 @@ void LibraryWindow::createMenus()
|
||||
<< showHideMarksAction
|
||||
<< YACReader::createSeparator()
|
||||
<< deleteComicsAction
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
<< YACReader::createSeparator()
|
||||
<< toggleFullScreenAction;
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
|
||||
comicsView->setItemActions(itemActions);
|
||||
comicsView->setViewActions(viewActions);
|
||||
@ -1084,7 +1096,9 @@ void LibraryWindow::createConnections()
|
||||
connect(setRootIndexAction,SIGNAL(triggered()),this,SLOT(setRootIndex()));
|
||||
connect(expandAllNodesAction,SIGNAL(triggered()),foldersView,SLOT(expandAll()));
|
||||
connect(colapseAllNodesAction,SIGNAL(triggered()),foldersView,SLOT(collapseAll()));
|
||||
connect(toggleFullScreenAction,SIGNAL(triggered()),this,SLOT(toggleFullScreen()));
|
||||
#ifndef Q_OS_MAC
|
||||
connect(toggleFullScreenAction,SIGNAL(triggered()),this,SLOT(toggleFullScreen()));
|
||||
#endif
|
||||
connect(toggleComicsViewAction,SIGNAL(triggered()),this,SLOT(toggleComicsView()));
|
||||
connect(optionsAction, SIGNAL(triggered()),optionsDialog,SLOT(show()));
|
||||
#ifdef SERVER_RELEASE
|
||||
@ -1205,7 +1219,9 @@ void LibraryWindow::loadLibrary(const QString & name)
|
||||
updateLibraryAction->setDisabled(true);
|
||||
openContainingFolderAction->setDisabled(true);
|
||||
disableComicsActions(true);
|
||||
#ifndef Q_OS_MAC
|
||||
toggleFullScreenAction->setEnabled(true);
|
||||
#endif
|
||||
|
||||
importedCovers = true;
|
||||
}
|
||||
@ -1639,8 +1655,10 @@ void LibraryWindow::checkEmptyFolder(QStringList * paths)
|
||||
else
|
||||
{
|
||||
disableComicsActions(true);
|
||||
#ifndef Q_OS_MAC
|
||||
if(paths->size()>0)
|
||||
toggleFullScreenAction->setEnabled(true);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -2110,6 +2128,9 @@ void LibraryWindow::toggleComicsView_delayed()
|
||||
QIcon icoViewsButton;
|
||||
icoViewsButton.addPixmap(QPixmap(":/images/main_toolbar/flow.png"), QIcon::Normal);
|
||||
toggleComicsViewAction->setIcon(icoViewsButton);
|
||||
#ifdef Q_OS_MAC
|
||||
libraryToolBar->updateViewSelectorIcon(icoViewsButton);
|
||||
#endif
|
||||
switchToComicsView(classicComicsView, gridComicsView = new GridComicsView());
|
||||
comicsViewStatus = Grid;
|
||||
}
|
||||
@ -2117,6 +2138,9 @@ void LibraryWindow::toggleComicsView_delayed()
|
||||
QIcon icoViewsButton;
|
||||
icoViewsButton.addPixmap(QPixmap(":/images/main_toolbar/grid.png"), QIcon::Normal);
|
||||
toggleComicsViewAction->setIcon(icoViewsButton);
|
||||
#ifdef Q_OS_MAC
|
||||
libraryToolBar->updateViewSelectorIcon(icoViewsButton);
|
||||
#endif
|
||||
switchToComicsView(gridComicsView, classicComicsView = new ClassicComicsView());
|
||||
comicsViewStatus = Flow;
|
||||
}
|
||||
|
@ -152,7 +152,9 @@ private:
|
||||
QAction * removeLibraryAction;
|
||||
QAction * helpAboutAction;
|
||||
QAction * renameLibraryAction;
|
||||
#ifndef Q_OS_MAC
|
||||
QAction * toggleFullScreenAction;
|
||||
#endif
|
||||
QAction * optionsAction;
|
||||
QAction * serverConfigAction;
|
||||
QAction * toggleComicsViewAction;
|
||||
|
@ -44,8 +44,11 @@ public:
|
||||
void hide();
|
||||
QMap<QString, QAction *> actions;
|
||||
|
||||
//hacks everywhere
|
||||
//convenience method for YACReaderLibrary search edit
|
||||
YACReaderMacOSXSearchLineEdit *addSearchEdit();
|
||||
//convenience method for switching the icon of the view selector
|
||||
void updateViewSelectorIcon(const QIcon & icon);
|
||||
|
||||
signals:
|
||||
|
||||
@ -55,7 +58,7 @@ protected:
|
||||
NSToolbar * nativeToolBar;
|
||||
void *delegate;
|
||||
bool yosemite;
|
||||
|
||||
QMacToolBarItem * viewSelector;
|
||||
|
||||
};
|
||||
|
||||
|
@ -10,6 +10,8 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#import "shortcuts_manager.h"
|
||||
|
||||
//----------------------------
|
||||
//A custom items separator for NSToolbar
|
||||
@interface CustomSeparator : NSView
|
||||
@ -152,6 +154,7 @@
|
||||
//----------------------------
|
||||
|
||||
YACReaderMacOSXToolbar::YACReaderMacOSXToolbar(QObject *parent)
|
||||
:viewSelector(0)
|
||||
{
|
||||
//setup native toolbar
|
||||
nativeToolBar= nativeToolbar();
|
||||
@ -177,6 +180,8 @@ YACReaderMacOSXToolbar::YACReaderMacOSXToolbar(QObject *parent)
|
||||
void YACReaderMacOSXToolbar::addAction(QAction *action)
|
||||
{
|
||||
QMacToolBarItem *toolBarItem = addItem(action->icon(),action->text());
|
||||
if(action->data().toString() == TOGGLE_COMICS_VIEW_ACTION_YL)
|
||||
viewSelector = toolBarItem;
|
||||
connect(toolBarItem,SIGNAL(activated()),action, SIGNAL(triggered()));
|
||||
NSToolbarItem * nativeItem = toolBarItem->nativeToolBarItem();
|
||||
actions.insert(QString::fromNSString(nativeItem.itemIdentifier),action);
|
||||
@ -268,6 +273,12 @@ YACReaderMacOSXSearchLineEdit * YACReaderMacOSXToolbar::addSearchEdit()
|
||||
return searchEdit;
|
||||
}
|
||||
|
||||
void YACReaderMacOSXToolbar::updateViewSelectorIcon(const QIcon &icon)
|
||||
{
|
||||
if(viewSelector)
|
||||
viewSelector->setIcon(icon);
|
||||
}
|
||||
|
||||
|
||||
YACReaderMacOSXSearchLineEdit::YACReaderMacOSXSearchLineEdit()
|
||||
:QObject()
|
||||
|
Loading…
x
Reference in New Issue
Block a user