mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-28 06:49:43 +00:00
4076494889
* 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
76 lines
1.4 KiB
C++
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
|