forked from qt-creator/qt-creator
IOutputPane: Refactor zoom function into base class
Try to make zoom and font handling in the panes more similar and put common stuff into IOutputPane. Change-Id: I59c38c5eecbf67b7ca6c9d84a6f61b1292a787df Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
committed by
André Hartmann
parent
e127d599ac
commit
48073b2990
@@ -32,6 +32,7 @@
|
||||
#include <QString>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QToolButton;
|
||||
class QWidget;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
@@ -46,7 +47,7 @@ public:
|
||||
~IOutputPane() override;
|
||||
|
||||
virtual QWidget *outputWidget(QWidget *parent) = 0;
|
||||
virtual QList<QWidget *> toolBarWidgets() const = 0;
|
||||
virtual QList<QWidget *> toolBarWidgets() const;
|
||||
virtual QString displayName() const = 0;
|
||||
|
||||
virtual int priorityInStatusBar() const = 0;
|
||||
@@ -64,6 +65,9 @@ public:
|
||||
virtual void goToNext() = 0;
|
||||
virtual void goToPrev() = 0;
|
||||
|
||||
void setFont(const QFont &font);
|
||||
void setWheelZoomEnabled(bool enabled);
|
||||
|
||||
enum Flag { NoModeSwitch = 0, ModeSwitch = 1, WithFocus = 2, EnsureSizeHint = 4};
|
||||
Q_DECLARE_FLAGS(Flags, Flag)
|
||||
|
||||
@@ -83,6 +87,17 @@ signals:
|
||||
void navigateStateUpdate();
|
||||
void flashButton();
|
||||
void setBadgeNumber(int number);
|
||||
void zoomIn(int range);
|
||||
void zoomOut(int range);
|
||||
void wheelZoomEnabledChanged(bool enabled);
|
||||
void fontChanged(const QFont &font);
|
||||
|
||||
protected:
|
||||
void setZoomButtonsEnabled(bool enabled);
|
||||
|
||||
private:
|
||||
QToolButton * const m_zoomInButton = nullptr;
|
||||
QToolButton * const m_zoomOutButton = nullptr;
|
||||
};
|
||||
|
||||
} // namespace Core
|
||||
|
||||
Reference in New Issue
Block a user