mirror of
https://github.com/YACReader/yacreader
synced 2025-07-23 07:24:58 -04:00
fixed switch views item and removed fullscreen toogle item from YACReaderLibrary in MacOSX
This commit is contained in:
@ -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()
|
||||
|
Reference in New Issue
Block a user