2013-05-29 11:38:35 +00:00
|
|
|
#ifndef RECORDSTATUSDELEGATE_H
|
|
|
|
#define RECORDSTATUSDELEGATE_H
|
|
|
|
|
|
|
|
#include "util.hpp"
|
2013-05-30 02:55:19 +00:00
|
|
|
#include <QTextOption>
|
|
|
|
#include <QFont>
|
2013-05-29 11:38:35 +00:00
|
|
|
|
|
|
|
class QIcon;
|
2013-05-30 02:55:19 +00:00
|
|
|
class QFont;
|
|
|
|
class QFontMetrics;
|
2013-05-29 11:38:35 +00:00
|
|
|
|
|
|
|
namespace CSVWorld
|
|
|
|
{
|
|
|
|
class RecordStatusDelegate : public CommandDelegate
|
|
|
|
{
|
2013-05-30 02:55:19 +00:00
|
|
|
QFont mFont;
|
|
|
|
QFontMetrics *mFontMetrics;
|
2013-05-29 11:38:35 +00:00
|
|
|
|
2013-05-30 02:55:19 +00:00
|
|
|
QTextOption mTextAlignment;
|
2013-05-29 11:38:35 +00:00
|
|
|
|
2013-05-30 02:55:19 +00:00
|
|
|
QIcon *mModifiedIcon;
|
|
|
|
QIcon *mAddedIcon;
|
|
|
|
QIcon *mDeletedIcon;
|
|
|
|
|
|
|
|
int mStatusDisplay;
|
|
|
|
|
|
|
|
int mIconSize;
|
|
|
|
int mIconTopOffset;
|
|
|
|
int mTextLeftOffset;
|
2013-05-29 11:38:35 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
explicit RecordStatusDelegate(QUndoStack& undoStack, QObject *parent = 0);
|
|
|
|
|
|
|
|
void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
|
|
|
|
|
|
|
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
|
|
|
|
2013-06-15 11:40:18 +00:00
|
|
|
void updateEditorSetting (const QString &settingName, const QString &settingValue);
|
|
|
|
|
2013-05-29 11:38:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class RecordStatusDelegateFactory : public CommandDelegateFactory
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual CommandDelegate *makeDelegate (QUndoStack& undoStack, QObject *parent) const;
|
|
|
|
///< The ownership of the returned CommandDelegate is transferred to the caller.
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif // RECORDSTATUSDELEGATE_H
|
|
|
|
|