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