openmw-tes3coop/apps/opencs/view/world/recordstatusdelegate.hpp
graffy76 700d55f1fb Fixed / implemented missing features for RecordStatusDelegate
Implemented updating editor application from preferences menu, loading
settings when editor loads, adding Record Status Display prefernce.

Fixed multiple bugs, made changes to CSM(V)Settings classes to make
implementing new prefrences easier.

Rewrote CSMSettings::UserSettings to retain last-loaded settings.

Adjusted icon position in Record Status column

Capitalized status text

Added delegate to referenceables table
2013-06-15 06:40:18 -05:00

52 lines
1.2 KiB
C++

#ifndef RECORDSTATUSDELEGATE_H
#define RECORDSTATUSDELEGATE_H
#include "util.hpp"
#include <QTextOption>
#include <QFont>
class QIcon;
class QFont;
class QFontMetrics;
namespace CSVWorld
{
class RecordStatusDelegate : public CommandDelegate
{
QFont mFont;
QFontMetrics *mFontMetrics;
QTextOption mTextAlignment;
QIcon *mModifiedIcon;
QIcon *mAddedIcon;
QIcon *mDeletedIcon;
int mStatusDisplay;
int mIconSize;
int mIconTopOffset;
int mTextLeftOffset;
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;
void updateEditorSetting (const QString &settingName, const QString &settingValue);
};
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