lyx_mirror/src/frontends/qt4/iconpalette.h
Edwin Leuven 4076494889 * allow resizing of detached panel
* FlowLayout comes from:
http://doc.trolltech.com/4.1/layouts-flowlayout.html

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16004 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-21 09:06:12 +00:00

76 lines
1.4 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 <QLayout>
#include <QRect>
#include <QWidgetItem>
#include <string>
#include <utility>
#include <vector>
class QPushButton;
namespace lyx {
namespace frontend {
class FlowLayout : public QLayout
{
public:
FlowLayout(QWidget *parent);
~FlowLayout();
void addItem(QLayoutItem *item);
Qt::Orientations expandingDirections() const;
bool hasHeightForWidth() const;
int heightForWidth(int) const;
QSize minimumSize() const;
void setGeometry(const QRect &rect);
QSize sizeHint() const;
QLayoutItem * takeAt(int index);
QLayoutItem * itemAt(int index) const;
int count() const;
private:
int doLayout(const QRect &rect, bool testOnly) const;
QList<QLayoutItem *> itemList;
};
/**
* For holding an arbitrary set of icons.
*/
class IconPalette : public QWidget {
Q_OBJECT
public:
IconPalette(QWidget * parent, char const ** entries);
Q_SIGNALS:
void button_clicked(const std::string &);
protected Q_SLOTS:
virtual void clicked();
private:
typedef std::pair<QPushButton *, std::string> Button;
std::vector<Button> buttons_;
};
} // namespace frontend
} // namespace lyx
#endif // ICONPALETTE_H