2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file iconpalette.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2007-04-19 22:01:28 +00:00
|
|
|
* \author Edwin Leuven
|
2006-03-05 17:24:44 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ICONPALETTE_H
|
|
|
|
#define ICONPALETTE_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
2007-04-19 20:29:27 +00:00
|
|
|
#include <QMenu>
|
2007-04-20 07:29:02 +00:00
|
|
|
#include <QLayout>
|
2007-04-19 20:29:27 +00:00
|
|
|
#include "Action.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
2006-11-19 17:12:33 +00:00
|
|
|
namespace frontend {
|
2006-10-21 00:16:43 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
/**
|
|
|
|
* For holding an arbitrary set of icons.
|
|
|
|
*/
|
|
|
|
class IconPalette : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2007-04-19 22:01:28 +00:00
|
|
|
IconPalette(QWidget * parent);
|
2007-04-19 20:29:27 +00:00
|
|
|
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_;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-11-19 17:12:33 +00:00
|
|
|
} // namespace frontend
|
2006-10-21 00:16:43 +00:00
|
|
|
} // namespace lyx
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
#endif // ICONPALETTE_H
|