Create wrappers for the search edit and the main toolbar.

So we can hide native implementations from classes using these elements.
This commit is contained in:
Luis Ángel San Martín
2018-09-11 16:50:29 +02:00
committed by Luis Ángel San Martín
parent 00f8adfa54
commit 655cdc619e
5 changed files with 327 additions and 2 deletions

View File

@ -0,0 +1,55 @@
#ifndef YACREADER_LIBRARY_TOOLBAR_H
#define YACREADER_LIBRARY_TOOLBAR_H
#include <QtWidgets>
#include "yacreader_main_toolbar.h"
#ifdef Q_OS_MAC
#include "yacreader_macosx_toolbar.h"
#endif
#include "yacreader_library_search_edit.h"
class YACReaderLibraryToolbar: public QObject
{
public:
YACReaderLibraryToolbar(QMainWindow *mainWindow, bool isMacosNative, bool useNativeFullScreen, QSettings *settings);
QWidget * widget() { return defaultToolbar; }
QAction * backAction;
QAction * forwardAction;
QAction * optionsAction;
QAction * serverConfigAction;
QAction * toggleComicsViewAction;
QAction * helpAboutAction;
QAction * toggleFullScreenAction = nullptr;
YACReaderLibrarySearchEdit *searchEdit;
public slots:
void show();
void hide();
void updateViewSelectorIcon(const QIcon &icon);
void setDisabled(bool disabled);
private:
QMainWindow *mainWindow;
bool isMacosNative;
bool useNativeFullScreen;
QSettings * settings;
#ifdef Q_OS_MAC
YACReaderMacOSXToolbar *macosxToolbar;
#endif
YACReaderMainToolBar *defaultToolbar = nullptr;
};
#endif // YACREADER_LIBRARY_TOOLBAR_H