mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 21:49:51 +00:00
8c5f097b5d
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18015 a592a061-630c-0410-9148-cb99ea01b6c8
76 lines
1.3 KiB
C++
76 lines
1.3 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file IconPalette.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Edwin Leuven
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#ifndef ICONPALETTE_H
|
|
#define ICONPALETTE_H
|
|
|
|
#include <QWidget>
|
|
#include <QMenu>
|
|
#include <QLayout>
|
|
#include "Action.h"
|
|
|
|
namespace lyx {
|
|
namespace frontend {
|
|
|
|
/**
|
|
* For holding an arbitrary set of icons.
|
|
*/
|
|
class IconPalette : public QWidget {
|
|
Q_OBJECT
|
|
public:
|
|
IconPalette(QWidget * parent);
|
|
void addButton(QAction *);
|
|
|
|
public Q_SLOTS:
|
|
void updateParent();
|
|
|
|
Q_SIGNALS:
|
|
void triggered(QAction *);
|
|
void visible(bool);
|
|
|
|
protected:
|
|
void showEvent(QShowEvent * event);
|
|
void hideEvent(QHideEvent * event);
|
|
void paintEvent(QPaintEvent * event);
|
|
|
|
private Q_SLOTS:
|
|
virtual void clicked(QAction *);
|
|
|
|
private:
|
|
QGridLayout * layout_;
|
|
QList<QAction *> actions_;
|
|
};
|
|
|
|
/**
|
|
* Popup menu for a toolbutton.
|
|
* We need this to keep track whether
|
|
* it is necessary to enable/disable
|
|
* the toolbutton
|
|
*/
|
|
class ButtonMenu : public QMenu {
|
|
Q_OBJECT
|
|
public:
|
|
ButtonMenu(const QString & title, QWidget * parent = 0 );
|
|
void add(QAction *);
|
|
|
|
public Q_SLOTS:
|
|
void updateParent();
|
|
|
|
private:
|
|
QList<QAction *> actions_;
|
|
};
|
|
|
|
|
|
} // namespace frontend
|
|
} // namespace lyx
|
|
|
|
#endif // ICONPALETTE_H
|