mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 21:49:51 +00:00
12e5a52b92
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13294 a592a061-630c-0410-9148-cb99ea01b6c8
58 lines
1.1 KiB
C++
58 lines
1.1 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 John Levon
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#ifndef ICONPALETTE_H
|
|
#define ICONPALETTE_H
|
|
|
|
|
|
#include <QWidget>
|
|
//#include <QPixmap>
|
|
//#include <Q3GridLayout>
|
|
//#include <QResizeEvent>
|
|
|
|
#include <string>
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
|
|
class QPixmap;
|
|
class QPushButton;
|
|
class Q3GridLayout;
|
|
class QResizeEvent;
|
|
|
|
/**
|
|
* For holding an arbitrary set of icons.
|
|
*/
|
|
class IconPalette : public QWidget {
|
|
Q_OBJECT
|
|
public:
|
|
IconPalette(QWidget * parent, char const * name = 0);
|
|
|
|
/// add a button
|
|
void add(QPixmap const & pixmap, std::string name, std::string tooltip);
|
|
signals:
|
|
void button_clicked(const std::string &);
|
|
protected:
|
|
virtual void resizeEvent(QResizeEvent * e);
|
|
protected slots:
|
|
virtual void clicked();
|
|
private:
|
|
int maxcol_;
|
|
|
|
Q3GridLayout * layout_;
|
|
|
|
typedef std::pair<QPushButton *, std::string> Button;
|
|
|
|
std::vector<Button> buttons_;
|
|
};
|
|
|
|
#endif // ICONPALETTE_H
|