mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 13:04:28 -04:00
Implement native toolbars on macos on Qt6 to have a modern looking unified toolbars
This commit is contained in:
@ -99,6 +99,7 @@ class YACReaderMacOSXSearchLineEdit : public YACReaderSearchLineEdit
|
||||
|
||||
class YACReaderMacOSXToolbar : public YACReaderMainToolBar
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit YACReaderMacOSXToolbar(QWidget *parent = 0);
|
||||
QSize sizeHint() const override;
|
||||
@ -109,20 +110,41 @@ public:
|
||||
void updateViewSelectorIcon(const QIcon &icon);
|
||||
void attachToWindow(QMainWindow *window);
|
||||
|
||||
void *getSearchEditDelegate() { return searchEditDelegate; };
|
||||
|
||||
void emitFilterChange(const QString &filter) { emit filterChanged(filter); };
|
||||
|
||||
QAction *actionFromIdentifier(const QString &identifier);
|
||||
signals:
|
||||
void filterChanged(QString);
|
||||
|
||||
private:
|
||||
void paintEvent(QPaintEvent *) override;
|
||||
|
||||
void *searchEditDelegate;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
class YACReaderMacOSXToolbar : public QToolBar
|
||||
class YACReaderMacOSXToolbar : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit YACReaderMacOSXToolbar(QWidget *parent = 0);
|
||||
void attachToWindow(QMainWindow *window);
|
||||
void addStretch();
|
||||
|
||||
void setMovable(bool movable) {};
|
||||
void addSeparator() {};
|
||||
|
||||
void setIconSize(const QSize &size) {};
|
||||
|
||||
public slots:
|
||||
void setHidden(bool hidden);
|
||||
void show();
|
||||
void hide();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user