2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "toonzqt/paramfield.h"
|
|
|
|
|
#include "toonzqt/gutil.h"
|
|
|
|
|
#include "toonzqt/fxsettings.h"
|
|
|
|
|
#include "toonzqt/intfield.h"
|
|
|
|
|
#include "toonzqt/spectrumfield.h"
|
|
|
|
|
#include "toonzqt/colorfield.h"
|
|
|
|
|
#include "toonzqt/doublepairfield.h"
|
|
|
|
|
#include "toonzqt/tonecurvefield.h"
|
|
|
|
|
#include "toonzqt/checkbox.h"
|
|
|
|
|
|
|
|
|
|
#include "tdoubleparam.h"
|
|
|
|
|
#include "tnotanimatableparam.h"
|
|
|
|
|
#include "tparamset.h"
|
|
|
|
|
#include "tw/stringtable.h"
|
|
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
#include <QPainter>
|
|
|
|
|
#include <QComboBox>
|
2018-12-18 18:55:22 +13:00
|
|
|
|
#include <QFontComboBox>
|
|
|
|
|
#include <QKeyEvent>
|
2020-07-08 18:31:12 +12:00
|
|
|
|
#include <QPainterPath>
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
using namespace DVGui;
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
/*! FxSettingsに共通のUndo
|
2019-09-19 20:19:58 +12:00
|
|
|
|
*/
|
2016-06-15 18:43:10 +12:00
|
|
|
|
class FxSettingsUndo : public TUndo {
|
2016-03-19 06:57:51 +13:00
|
|
|
|
protected:
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TFxHandle *m_fxHandle;
|
|
|
|
|
QString m_name;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
|
FxSettingsUndo(QString name, TFxHandle *fxHandle)
|
|
|
|
|
: m_name(name), m_fxHandle(fxHandle) {}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
int getSize() const override { return sizeof(*this); }
|
|
|
|
|
int getHistoryType() override { return HistoryType::Fx; }
|
2016-03-19 06:57:51 +13:00
|
|
|
|
};
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
class AnimatableFxSettingsUndo : public FxSettingsUndo {
|
2016-03-19 06:57:51 +13:00
|
|
|
|
protected:
|
2016-06-15 18:43:10 +12:00
|
|
|
|
bool m_wasKeyframe;
|
|
|
|
|
int m_frame;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
|
AnimatableFxSettingsUndo(QString name, int frame, TFxHandle *fxHandle)
|
|
|
|
|
: FxSettingsUndo(name, fxHandle), m_frame(frame) {}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
QString getHistoryString() override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
QString str = QObject::tr("Modify Fx Param : %1").arg(m_name);
|
|
|
|
|
if (m_wasKeyframe)
|
|
|
|
|
str += QString(" Frame : %1").arg(QString::number(m_frame + 1));
|
|
|
|
|
else
|
|
|
|
|
str += QString(" (Default Value)");
|
|
|
|
|
return str;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
/*! MeasuredDoubleParamField Undo
|
2019-09-19 20:19:58 +12:00
|
|
|
|
*/
|
2016-06-29 18:17:12 +12:00
|
|
|
|
class MeasuredDoubleParamFieldUndo final : public AnimatableFxSettingsUndo {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TDoubleParamP m_param;
|
|
|
|
|
double m_oldValue, m_newValue;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
|
MeasuredDoubleParamFieldUndo(const TDoubleParamP param, QString name,
|
|
|
|
|
int frame, TFxHandle *fxHandle)
|
|
|
|
|
: AnimatableFxSettingsUndo(name, frame, fxHandle), m_param(param) {
|
|
|
|
|
m_oldValue = param->getValue(frame);
|
|
|
|
|
m_newValue = m_oldValue;
|
|
|
|
|
m_wasKeyframe = m_param->isKeyframe(frame);
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void onAdd() override { m_newValue = m_param->getValue(m_frame); }
|
2016-06-15 18:43:10 +12:00
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void undo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!m_wasKeyframe)
|
|
|
|
|
m_param->setDefaultValue(m_oldValue);
|
|
|
|
|
else
|
|
|
|
|
m_param->setValue(m_frame, m_oldValue);
|
|
|
|
|
|
|
|
|
|
if (m_fxHandle) {
|
|
|
|
|
m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void redo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!m_wasKeyframe)
|
|
|
|
|
m_param->setDefaultValue(m_newValue);
|
|
|
|
|
else
|
|
|
|
|
m_param->setValue(m_frame, m_newValue);
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
/*! RangeParamField Undo
|
2019-09-19 20:19:58 +12:00
|
|
|
|
*/
|
2016-06-29 18:17:12 +12:00
|
|
|
|
class RangeParamFieldUndo final : public AnimatableFxSettingsUndo {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TRangeParamP m_param;
|
|
|
|
|
DoublePair m_oldValue, m_newValue;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
|
RangeParamFieldUndo(const TRangeParamP param, QString name, int frame,
|
|
|
|
|
TFxHandle *fxHandle)
|
|
|
|
|
: AnimatableFxSettingsUndo(name, frame, fxHandle), m_param(param) {
|
|
|
|
|
m_oldValue = param->getValue(frame);
|
|
|
|
|
m_newValue = m_oldValue;
|
|
|
|
|
m_wasKeyframe = m_param->isKeyframe(frame);
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void onAdd() override { m_newValue = m_param->getValue(m_frame); }
|
2016-06-15 18:43:10 +12:00
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void undo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!m_wasKeyframe)
|
|
|
|
|
m_param->setDefaultValue(m_oldValue);
|
|
|
|
|
else
|
|
|
|
|
m_param->setValue(m_frame, m_oldValue);
|
|
|
|
|
|
|
|
|
|
if (m_fxHandle) {
|
|
|
|
|
m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void redo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!m_wasKeyframe)
|
|
|
|
|
m_param->setDefaultValue(m_newValue);
|
|
|
|
|
else
|
|
|
|
|
m_param->setValue(m_frame, m_newValue);
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
/*! PixelParamField Undo
|
2019-09-19 20:19:58 +12:00
|
|
|
|
*/
|
2016-06-29 18:17:12 +12:00
|
|
|
|
class PixelParamFieldUndo final : public AnimatableFxSettingsUndo {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TPixelParamP m_param;
|
|
|
|
|
TPixel32 m_oldValue, m_newValue;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
|
PixelParamFieldUndo(const TPixelParamP param, QString name, int frame,
|
|
|
|
|
TFxHandle *fxHandle)
|
|
|
|
|
: AnimatableFxSettingsUndo(name, frame, fxHandle), m_param(param) {
|
|
|
|
|
m_oldValue = param->getValue(frame);
|
|
|
|
|
m_newValue = m_oldValue;
|
|
|
|
|
m_wasKeyframe = m_param->isKeyframe(frame);
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void onAdd() override { m_newValue = m_param->getValue(m_frame); }
|
2016-06-15 18:43:10 +12:00
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void undo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!m_wasKeyframe)
|
|
|
|
|
m_param->setDefaultValue(m_oldValue);
|
|
|
|
|
else
|
|
|
|
|
m_param->setValue(m_frame, m_oldValue);
|
|
|
|
|
|
|
|
|
|
if (m_fxHandle) {
|
|
|
|
|
m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void redo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!m_wasKeyframe)
|
|
|
|
|
m_param->setDefaultValue(m_newValue);
|
|
|
|
|
else
|
|
|
|
|
m_param->setValue(m_frame, m_newValue);
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
/*! PointParamField Undo
|
2019-09-19 20:19:58 +12:00
|
|
|
|
*/
|
2016-06-29 18:17:12 +12:00
|
|
|
|
class PointParamFieldUndo final : public AnimatableFxSettingsUndo {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TPointParamP m_param;
|
|
|
|
|
TPointD m_oldValue, m_newValue;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
|
PointParamFieldUndo(const TPointParamP param, QString name, int frame,
|
|
|
|
|
TFxHandle *fxHandle)
|
|
|
|
|
: AnimatableFxSettingsUndo(name, frame, fxHandle), m_param(param) {
|
|
|
|
|
m_oldValue = param->getValue(frame);
|
|
|
|
|
m_newValue = m_oldValue;
|
|
|
|
|
m_wasKeyframe = m_param->isKeyframe(frame);
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void onAdd() override { m_newValue = m_param->getValue(m_frame); }
|
2016-06-15 18:43:10 +12:00
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void undo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!m_wasKeyframe)
|
|
|
|
|
m_param->setDefaultValue(m_oldValue);
|
|
|
|
|
else
|
|
|
|
|
m_param->setValue(m_frame, m_oldValue);
|
|
|
|
|
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void redo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!m_wasKeyframe)
|
|
|
|
|
m_param->setDefaultValue(m_newValue);
|
|
|
|
|
else
|
|
|
|
|
m_param->setValue(m_frame, m_newValue);
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
/*! EnumParamField Undo
|
2019-09-19 20:19:58 +12:00
|
|
|
|
*/
|
2016-06-29 18:17:12 +12:00
|
|
|
|
class EnumParamFieldUndo final : public FxSettingsUndo {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TIntEnumParamP m_param;
|
|
|
|
|
std::string m_oldString, m_newString;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
|
EnumParamFieldUndo(const TIntEnumParamP param, std::string oldString,
|
|
|
|
|
std::string newString, QString name, TFxHandle *fxHandle)
|
|
|
|
|
: FxSettingsUndo(name, fxHandle)
|
|
|
|
|
, m_param(param)
|
|
|
|
|
, m_oldString(oldString)
|
|
|
|
|
, m_newString(newString) {}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void undo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_param->setValue(m_oldString);
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void redo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_param->setValue(m_newString);
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
QString getHistoryString() override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
QString str = QObject::tr("Modify Fx Param : %1 : %2 -> %3")
|
|
|
|
|
.arg(m_name)
|
|
|
|
|
.arg(QString::fromStdString(m_oldString))
|
|
|
|
|
.arg(QString::fromStdString(m_newString));
|
|
|
|
|
return str;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
/*! IntParamFieldのUndo
|
2019-09-19 20:19:58 +12:00
|
|
|
|
*/
|
2016-06-29 18:17:12 +12:00
|
|
|
|
class IntParamFieldUndo final : public FxSettingsUndo {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TIntParamP m_param;
|
|
|
|
|
int m_oldValue, m_newValue;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
|
IntParamFieldUndo(const TIntParamP param, QString name, TFxHandle *fxHandle)
|
|
|
|
|
: FxSettingsUndo(name, fxHandle), m_param(param) {
|
|
|
|
|
m_oldValue = param->getValue();
|
|
|
|
|
m_newValue = m_oldValue;
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void onAdd() override { m_newValue = m_param->getValue(); }
|
2016-06-15 18:43:10 +12:00
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void undo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_param->setValue(m_oldValue);
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void redo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_param->setValue(m_newValue);
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
QString getHistoryString() override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
QString str = QObject::tr("Modify Fx Param : %1 : %2 -> %3")
|
|
|
|
|
.arg(m_name)
|
|
|
|
|
.arg(QString::number(m_oldValue))
|
|
|
|
|
.arg(QString::number(m_newValue));
|
|
|
|
|
return str;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
/*! BoolParamFieldのUndo
|
2019-09-19 20:19:58 +12:00
|
|
|
|
*/
|
2016-06-29 18:17:12 +12:00
|
|
|
|
class BoolParamFieldUndo final : public FxSettingsUndo {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TBoolParamP m_param;
|
|
|
|
|
bool m_newState;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
|
BoolParamFieldUndo(const TBoolParamP param, QString name, TFxHandle *fxHandle)
|
|
|
|
|
: FxSettingsUndo(name, fxHandle), m_param(param) {
|
|
|
|
|
m_newState = param->getValue();
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void undo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_param->setValue(!m_newState);
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void redo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_param->setValue(m_newState);
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
QString getHistoryString() override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
QString str = QObject::tr("Modify Fx Param : ");
|
|
|
|
|
if (m_newState)
|
|
|
|
|
str += QObject::tr("ON : %1").arg(m_name);
|
|
|
|
|
else
|
|
|
|
|
str += QObject::tr("OFF : %1").arg(m_name);
|
|
|
|
|
return str;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
/*! SpectrumParamFieldのUndo
|
2019-09-19 20:19:58 +12:00
|
|
|
|
*/
|
2016-06-29 18:17:12 +12:00
|
|
|
|
class SpectrumParamFieldUndo final : public AnimatableFxSettingsUndo {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TSpectrumParamP m_param;
|
|
|
|
|
TSpectrum m_oldSpectrum, m_newSpectrum;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
|
SpectrumParamFieldUndo(const TSpectrumParamP param, QString name, int frame,
|
|
|
|
|
TFxHandle *fxHandle)
|
|
|
|
|
: AnimatableFxSettingsUndo(name, frame, fxHandle), m_param(param) {
|
|
|
|
|
m_oldSpectrum = param->getValue(frame);
|
|
|
|
|
m_newSpectrum = m_oldSpectrum;
|
|
|
|
|
m_wasKeyframe = m_param->isKeyframe(frame);
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void onAdd() override { m_newSpectrum = m_param->getValue(m_frame); }
|
2016-06-15 18:43:10 +12:00
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void undo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!m_wasKeyframe)
|
|
|
|
|
m_param->setDefaultValue(m_oldSpectrum);
|
|
|
|
|
else
|
|
|
|
|
m_param->setValue(m_frame, m_oldSpectrum);
|
|
|
|
|
|
|
|
|
|
if (m_fxHandle) {
|
|
|
|
|
m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void redo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!m_wasKeyframe)
|
|
|
|
|
m_param->setDefaultValue(m_newSpectrum);
|
|
|
|
|
else
|
|
|
|
|
m_param->setValue(m_frame, m_newSpectrum);
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
/*! SpectrumParamField Undo
|
2016-06-15 18:43:10 +12:00
|
|
|
|
※
|
|
|
|
|
SpectrumParamFieldは、表示更新時にactualParamとcurrentParamのKeyの数が
|
|
|
|
|
一致していなくてはならないので、2つ同時に変更する必要が有る。
|
2016-03-19 06:57:51 +13:00
|
|
|
|
*/
|
2016-06-29 18:17:12 +12:00
|
|
|
|
class SpectrumParamFieldAddRemoveKeyUndo final : public FxSettingsUndo {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TSpectrumParamP m_actualParam;
|
|
|
|
|
TSpectrumParamP m_currentParam;
|
|
|
|
|
TSpectrum::ColorKey m_key;
|
|
|
|
|
int m_index;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
bool m_isAddUndo;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
|
SpectrumParamFieldAddRemoveKeyUndo(const TSpectrumParamP actualParam,
|
|
|
|
|
const TSpectrumParamP currentParam,
|
|
|
|
|
TSpectrum::ColorKey key, int index,
|
|
|
|
|
bool isAddUndo, QString name,
|
|
|
|
|
TFxHandle *fxHandle)
|
|
|
|
|
: FxSettingsUndo(name, fxHandle)
|
|
|
|
|
, m_actualParam(actualParam)
|
|
|
|
|
, m_currentParam(currentParam)
|
|
|
|
|
, m_key(key)
|
|
|
|
|
, m_index(index)
|
|
|
|
|
, m_isAddUndo(isAddUndo) {}
|
|
|
|
|
|
|
|
|
|
void removeKeys() const {
|
|
|
|
|
m_actualParam->removeKey(m_index);
|
|
|
|
|
m_currentParam->removeKey(m_index);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void addKeys() const {
|
|
|
|
|
m_actualParam->insertKey(m_index, m_key.first, m_key.second);
|
|
|
|
|
m_currentParam->insertKey(m_index, m_key.first, m_key.second);
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void undo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (m_isAddUndo)
|
|
|
|
|
removeKeys();
|
|
|
|
|
else
|
|
|
|
|
addKeys();
|
|
|
|
|
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void redo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (m_isAddUndo)
|
|
|
|
|
addKeys();
|
|
|
|
|
else
|
|
|
|
|
removeKeys();
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
QString getHistoryString() override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
QString str =
|
|
|
|
|
QObject::tr("Modify Fx Param : %1 : %2 Key")
|
|
|
|
|
.arg(m_name)
|
|
|
|
|
.arg((m_isAddUndo) ? QObject::tr("Add") : QObject::tr("Remove"));
|
|
|
|
|
return str;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
/*! StringParamField Undo
|
2019-09-19 20:19:58 +12:00
|
|
|
|
*/
|
2016-06-29 18:17:12 +12:00
|
|
|
|
class StringParamFieldUndo final : public FxSettingsUndo {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TStringParamP m_param;
|
|
|
|
|
std::wstring m_oldValue, m_newValue;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
|
StringParamFieldUndo(const TStringParamP param, QString name,
|
|
|
|
|
TFxHandle *fxHandle)
|
|
|
|
|
: FxSettingsUndo(name, fxHandle), m_param(param) {
|
|
|
|
|
m_oldValue = param->getValue();
|
|
|
|
|
m_newValue = m_oldValue;
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void onAdd() override { m_newValue = m_param->getValue(); }
|
2016-06-15 18:43:10 +12:00
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void undo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_param->setValue(m_oldValue);
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void redo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_param->setValue(m_newValue);
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
QString getHistoryString() override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
QString str = QObject::tr("Modify Fx Param : %1 : %2 -> %3")
|
|
|
|
|
.arg(m_name)
|
|
|
|
|
.arg(QString::fromStdWString(m_oldValue))
|
|
|
|
|
.arg(QString::fromStdWString(m_newValue));
|
|
|
|
|
return str;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
};
|
|
|
|
|
|
2018-12-18 18:55:22 +13:00
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
/*! FontParamFieldUndo
|
2019-09-19 20:19:58 +12:00
|
|
|
|
*/
|
2018-12-18 18:55:22 +13:00
|
|
|
|
class FontParamFieldUndo final : public FxSettingsUndo {
|
|
|
|
|
TFontParamP m_param;
|
|
|
|
|
std::wstring m_oldValue, m_newValue;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
FontParamFieldUndo(const TFontParamP param, QString name, TFxHandle *fxHandle)
|
|
|
|
|
: FxSettingsUndo(name, fxHandle), m_param(param) {
|
|
|
|
|
m_oldValue = param->getValue();
|
|
|
|
|
m_newValue = m_oldValue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void onAdd() override { m_newValue = m_param->getValue(); }
|
|
|
|
|
|
|
|
|
|
void undo() const override {
|
|
|
|
|
m_param->setValue(m_oldValue);
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void redo() const override {
|
|
|
|
|
m_param->setValue(m_newValue);
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString getHistoryString() override {
|
|
|
|
|
QString str = QObject::tr("Modify Fx Param : %1").arg(m_name);
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2016-03-19 06:57:51 +13:00
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
/*! ToneCurveParamField Undo
|
2019-09-19 20:19:58 +12:00
|
|
|
|
*/
|
2016-06-29 18:17:12 +12:00
|
|
|
|
class ToneCurveParamFieldUndo final : public AnimatableFxSettingsUndo {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TToneCurveParamP m_param;
|
|
|
|
|
QList<TPointD> m_oldPoints, m_newPoints;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
|
ToneCurveParamFieldUndo(const TToneCurveParamP param, QString name, int frame,
|
|
|
|
|
TFxHandle *fxHandle)
|
|
|
|
|
: AnimatableFxSettingsUndo(name, frame, fxHandle), m_param(param) {
|
|
|
|
|
m_oldPoints = param->getValue(frame);
|
|
|
|
|
m_newPoints = m_oldPoints;
|
|
|
|
|
m_wasKeyframe = m_param->isKeyframe(frame);
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void onAdd() override { m_newPoints = m_param->getValue(m_frame); }
|
2016-06-15 18:43:10 +12:00
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void undo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!m_wasKeyframe)
|
|
|
|
|
m_param->setDefaultValue(m_oldPoints);
|
|
|
|
|
else
|
|
|
|
|
m_param->setValue(m_frame, m_oldPoints);
|
|
|
|
|
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void redo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!m_wasKeyframe)
|
|
|
|
|
m_param->setDefaultValue(m_newPoints);
|
|
|
|
|
else
|
|
|
|
|
m_param->setValue(m_frame, m_newPoints);
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
/*! ToneCurveParamField Undo
|
2016-06-15 18:43:10 +12:00
|
|
|
|
※
|
|
|
|
|
ToneCurveParamFieldは、表示更新時にactualParamとcurrentParamのPointの数が
|
|
|
|
|
一致していなくてはならないので、2つ同時に変更する必要が有る。
|
2016-03-19 06:57:51 +13:00
|
|
|
|
*/
|
|
|
|
|
|
2016-06-29 18:17:12 +12:00
|
|
|
|
class ToneCurveParamFieldAddRemovePointUndo final : public FxSettingsUndo {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TToneCurveParamP m_actualParam;
|
|
|
|
|
TToneCurveParamP m_currentParam;
|
|
|
|
|
QList<TPointD> m_value;
|
|
|
|
|
int m_index;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
bool m_isAddUndo;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
|
ToneCurveParamFieldAddRemovePointUndo(const TToneCurveParamP actualParam,
|
|
|
|
|
const TToneCurveParamP currentParam,
|
|
|
|
|
QList<TPointD> value, int index,
|
|
|
|
|
bool isAddUndo, QString name,
|
|
|
|
|
TFxHandle *fxHandle)
|
|
|
|
|
: FxSettingsUndo(name, fxHandle)
|
|
|
|
|
, m_actualParam(actualParam)
|
|
|
|
|
, m_currentParam(currentParam)
|
|
|
|
|
, m_value(value)
|
|
|
|
|
, m_index(index)
|
|
|
|
|
, m_isAddUndo(isAddUndo) {}
|
|
|
|
|
|
|
|
|
|
void removePoints() const {
|
|
|
|
|
m_actualParam->removeValue(0, m_index);
|
|
|
|
|
m_currentParam->removeValue(0, m_index);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void addPoints() const {
|
|
|
|
|
m_actualParam->addValue(0, m_value, m_index);
|
|
|
|
|
m_currentParam->addValue(0, m_value, m_index);
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void undo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (m_isAddUndo)
|
|
|
|
|
removePoints();
|
|
|
|
|
else
|
|
|
|
|
addPoints();
|
|
|
|
|
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void redo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (m_isAddUndo)
|
|
|
|
|
addPoints();
|
|
|
|
|
else
|
|
|
|
|
removePoints();
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
QString getHistoryString() override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
QString str =
|
|
|
|
|
QObject::tr("Modify Fx Param : %1 : %2 Point")
|
|
|
|
|
.arg(m_name)
|
|
|
|
|
.arg((m_isAddUndo) ? QObject::tr("Add") : QObject::tr("Remove"));
|
|
|
|
|
return str;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
/*! ToneCurveParamField Undo (Linearのトグル)
|
2019-09-19 20:19:58 +12:00
|
|
|
|
*/
|
2016-06-29 18:17:12 +12:00
|
|
|
|
class ToneCurveParamFieldToggleLinearUndo final : public FxSettingsUndo {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TToneCurveParamP m_actualParam;
|
|
|
|
|
TToneCurveParamP m_currentParam;
|
|
|
|
|
bool m_newState;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
|
ToneCurveParamFieldToggleLinearUndo(const TToneCurveParamP actualParam,
|
|
|
|
|
const TToneCurveParamP currentParam,
|
|
|
|
|
QString name, TFxHandle *fxHandle)
|
|
|
|
|
: FxSettingsUndo(name, fxHandle)
|
|
|
|
|
, m_actualParam(actualParam)
|
|
|
|
|
, m_currentParam(currentParam) {
|
|
|
|
|
m_newState = actualParam->isLinear();
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void undo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_actualParam->setIsLinear(!m_newState);
|
|
|
|
|
m_currentParam->setIsLinear(!m_newState);
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
void redo() const override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_actualParam->setIsLinear(m_newState);
|
|
|
|
|
m_currentParam->setIsLinear(m_newState);
|
|
|
|
|
if (m_fxHandle) m_fxHandle->notifyFxChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
|
QString getHistoryString() override {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
QString str = QObject::tr("Modify Fx Param : ");
|
|
|
|
|
if (m_newState)
|
|
|
|
|
str += QObject::tr("%1 : Linear ON").arg(m_name);
|
|
|
|
|
else
|
|
|
|
|
str += QObject::tr("%1 : Linear OFF").arg(m_name);
|
|
|
|
|
return str;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
// ParamField
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
ParamField::ParamField(QWidget *parent, QString paramName, const TParamP ¶m,
|
2016-06-15 18:43:10 +12:00
|
|
|
|
bool addEmptyLabel)
|
|
|
|
|
: QWidget(parent)
|
|
|
|
|
, m_paramName(paramName)
|
|
|
|
|
, m_interfaceName(param->hasUILabel()
|
|
|
|
|
? QString::fromStdString(param->getUILabel())
|
|
|
|
|
: paramName)
|
|
|
|
|
, m_description(QString::fromStdString(param->getDescription())) {
|
|
|
|
|
QString str;
|
|
|
|
|
m_layout = new QHBoxLayout(this);
|
|
|
|
|
m_layout->setMargin(0);
|
|
|
|
|
m_layout->setSpacing(5);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
ParamField::~ParamField() {}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
TFxHandle *ParamField::m_fxHandleStat = 0;
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void ParamField::setFxHandle(TFxHandle *fxHandle) {
|
|
|
|
|
ParamField::m_fxHandleStat = fxHandle;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
// ParamFieldKeyToggle
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-04-19 19:32:17 +12:00
|
|
|
|
ParamFieldKeyToggle::ParamFieldKeyToggle(QWidget *parent, std::string name)
|
2016-06-15 18:43:10 +12:00
|
|
|
|
: QWidget(parent), m_status(NOT_ANIMATED), m_highlighted(false) {
|
2020-06-05 16:40:15 +12:00
|
|
|
|
setFixedSize(20, 20);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void ParamFieldKeyToggle::setStatus(Status status) {
|
|
|
|
|
m_status = status;
|
|
|
|
|
update();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void ParamFieldKeyToggle::setStatus(bool hasKeyframes, bool isKeyframe,
|
|
|
|
|
bool hasBeenChanged) {
|
|
|
|
|
if (!hasKeyframes)
|
|
|
|
|
setStatus(NOT_ANIMATED);
|
|
|
|
|
else if (hasBeenChanged)
|
|
|
|
|
setStatus(MODIFIED);
|
|
|
|
|
else if (isKeyframe)
|
|
|
|
|
setStatus(KEYFRAME);
|
|
|
|
|
else
|
|
|
|
|
setStatus(NOT_KEYFRAME);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
ParamFieldKeyToggle::Status ParamFieldKeyToggle::getStatus() const {
|
|
|
|
|
return m_status;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void ParamFieldKeyToggle::paintEvent(QPaintEvent *e) {
|
UI update and Icons from Konero (#126)
* add multi arc mockup
* implement mutli arc
* add join and smooth option
* reset multiarc and arc when deactivated
* create self loop if the last point is the same as the first
* make join option in multiarc consistent with tape tool
* fix a bug where thickness don't affect mutliarc in vector level
* remove join option in geometric tool
* stop mutliarc after closing shape
* double click can also end multi arc
* fix a bug where multiArc will produce buggy stroke
* fix a bug where geometric tools is not deactivated
* add multiArc shortcut
* rewrite multiArc
* revert changes to tvectorimage
* add undo data for multiArc
* Paste as Copy Command for XSheet
* Remove unneeded code
* Bug fix
* prevent guide lines from jumping around in MultiArc
* make stroke color consistent in MultiArc
* remove color in MultiArc's undo data
* make color consistent in MultiArc with previous version
* Fix single image raster levels
* fix compilation error
* fix a bug where multiArc might generate bugged stroke
* Remove ICONV dep (#3304)
* fix crash on saving studio palette
* Move to Paste Special Menu
* Don't Set Fixed Width if Docking a Floating Panel
* Update how_to_build_win.md
New draft of pr for requested changes to windows build instructions.
* fix geometric tool multiarc smooth option
* fix level saving failure
* fix wrong warning after saving palette
* fix a bug where moving a control point while holding alt has unintended result
* fix travis-install (#3389)
* Fix assert debug crash in flipconsole.cpp
Fix crash when using the viewer controls in the console (debug)
* Redraw Audio Waveform
Fills the waveform rather than outlines it.
* Update .gitignore
* fix undo data when drawing arc and mutliarc
* fix overwriting raster drawing palette (#3387)
* mode sensitive fx settings
* Create New Style Command Button (#3394)
* Create New Style Command Button
This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz.
Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com>
* Update paletteviewergui.cpp
Made changes to the PR per request by Shun.
* Fixed a space within the code that wasn't suppose to be there.
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
* tahoma license (#3396)
* new style button optional
* fix loading pegbars (removing updateKeyframes)
* periodic random expression
* add fx in linear color space
this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd.
in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories.
* fractal noise iwa fx
* skip unnecessary icon invalidation
* fix frame range fill with tablet
* stop function editor to open by dbl clicking key
* Expanding the radius of the rotation handle.
This just changes when the cursor transforms into the rotation tool.
(cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39)
* fix vector img patern stroke style
* Update Stylesheets
- Support the new icon sizes
- XSheet and Timeline significantly redesigned
- Lots of margin fixes and refactoring
- Remove deprecated icons, as some icons are moved into binary
- New Light theme
* New Icons
- Redesigns almost every icon as symbolic
- Adds icons for most commands
* Add Option for Icon Themes
- Adds option for icon themes
- Removes useless label from Preferences category list
* Update Icon Functions
- Adds themePath() boolean
- Adds function for recoloring black pixels in pixmaps to any color
- Rebuilds createQIcon to use fromTheme() and recolorPixmap()
- Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon
- Removes a grey horizontal line drawn above the console play bar in the viewer
* Set Default Icon Theme and Paths
- Sets search paths for icons for use with QIcon::fromTheme()
- Sets default start icon theme on first install
- Sets flag for displaying icons in menus, so we can selectively hide them
* Set Icons for Commands
- Sets icons for the commands
- Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16
- Selectively allows icons to display for Tools in menus
* Change Icon Sizes, General Fixes and Stylesheet Additions
- Change icon sizes to new size
- Remove margin around FX Editor window
- Remove white line under color sliders in Style Editor
- Make keyframe icons uniform and color stylable in the stylesheets
- Removes deprecated stylesheet strings
- Redesign GUI for palette list view
- Make tree list header sort row stylable
- Remove black lines from scrollbars in New Project window
- Remove margin around combobox in Level Strip
- Alter how some lines are drawn in the Timeline to fix some alpha issues
- Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility
- Make text always viewable in the FPS field in console bar
- Increase size of radio buttons in Cleanup Settings
- Increase size of switches in motion path nodes
- Remove unessesary "Layer" label in Timeline and other rects
- Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more
- Moves some external stylesheet icons into binary
* Make TPanelTitleBar Icon States Stylable
- Makes icon states for TPanelTitleBar buttons stylable in stylesheets
* Travis Fixes
* Swap Startup Popup Logos
They were in the wrong folders
* Revert "Swap Startup Popup Logos"
This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d.
* Fix Startup Popup Logo
It wasn't switching
* Feedback Changes
- Change render visualization to clapboard
- Fix text contrast on levels in XSheet
* Make Cell Selection More Clear
* Darken Light Theme and Tint Empty Cell Selection
* Fix missing icons
* Fix memo button
* Bring back colors
* Hide Motion Tab
* Fix Play Range Area (Light)
Make play range area more visible
* Vector Column Color
Co-authored-by: pojienie <pojienie@gmail.com>
Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp>
Co-authored-by: Rodney <rodney.baker@gmail.com>
Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com>
Co-authored-by: Kite <konero@users.noreply.github.com>
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
|
|
|
|
QIcon icon;
|
|
|
|
|
const int iconSize = 20;
|
|
|
|
|
const int radius = 2;
|
2020-06-05 16:40:15 +12:00
|
|
|
|
|
UI update and Icons from Konero (#126)
* add multi arc mockup
* implement mutli arc
* add join and smooth option
* reset multiarc and arc when deactivated
* create self loop if the last point is the same as the first
* make join option in multiarc consistent with tape tool
* fix a bug where thickness don't affect mutliarc in vector level
* remove join option in geometric tool
* stop mutliarc after closing shape
* double click can also end multi arc
* fix a bug where multiArc will produce buggy stroke
* fix a bug where geometric tools is not deactivated
* add multiArc shortcut
* rewrite multiArc
* revert changes to tvectorimage
* add undo data for multiArc
* Paste as Copy Command for XSheet
* Remove unneeded code
* Bug fix
* prevent guide lines from jumping around in MultiArc
* make stroke color consistent in MultiArc
* remove color in MultiArc's undo data
* make color consistent in MultiArc with previous version
* Fix single image raster levels
* fix compilation error
* fix a bug where multiArc might generate bugged stroke
* Remove ICONV dep (#3304)
* fix crash on saving studio palette
* Move to Paste Special Menu
* Don't Set Fixed Width if Docking a Floating Panel
* Update how_to_build_win.md
New draft of pr for requested changes to windows build instructions.
* fix geometric tool multiarc smooth option
* fix level saving failure
* fix wrong warning after saving palette
* fix a bug where moving a control point while holding alt has unintended result
* fix travis-install (#3389)
* Fix assert debug crash in flipconsole.cpp
Fix crash when using the viewer controls in the console (debug)
* Redraw Audio Waveform
Fills the waveform rather than outlines it.
* Update .gitignore
* fix undo data when drawing arc and mutliarc
* fix overwriting raster drawing palette (#3387)
* mode sensitive fx settings
* Create New Style Command Button (#3394)
* Create New Style Command Button
This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz.
Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com>
* Update paletteviewergui.cpp
Made changes to the PR per request by Shun.
* Fixed a space within the code that wasn't suppose to be there.
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
* tahoma license (#3396)
* new style button optional
* fix loading pegbars (removing updateKeyframes)
* periodic random expression
* add fx in linear color space
this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd.
in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories.
* fractal noise iwa fx
* skip unnecessary icon invalidation
* fix frame range fill with tablet
* stop function editor to open by dbl clicking key
* Expanding the radius of the rotation handle.
This just changes when the cursor transforms into the rotation tool.
(cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39)
* fix vector img patern stroke style
* Update Stylesheets
- Support the new icon sizes
- XSheet and Timeline significantly redesigned
- Lots of margin fixes and refactoring
- Remove deprecated icons, as some icons are moved into binary
- New Light theme
* New Icons
- Redesigns almost every icon as symbolic
- Adds icons for most commands
* Add Option for Icon Themes
- Adds option for icon themes
- Removes useless label from Preferences category list
* Update Icon Functions
- Adds themePath() boolean
- Adds function for recoloring black pixels in pixmaps to any color
- Rebuilds createQIcon to use fromTheme() and recolorPixmap()
- Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon
- Removes a grey horizontal line drawn above the console play bar in the viewer
* Set Default Icon Theme and Paths
- Sets search paths for icons for use with QIcon::fromTheme()
- Sets default start icon theme on first install
- Sets flag for displaying icons in menus, so we can selectively hide them
* Set Icons for Commands
- Sets icons for the commands
- Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16
- Selectively allows icons to display for Tools in menus
* Change Icon Sizes, General Fixes and Stylesheet Additions
- Change icon sizes to new size
- Remove margin around FX Editor window
- Remove white line under color sliders in Style Editor
- Make keyframe icons uniform and color stylable in the stylesheets
- Removes deprecated stylesheet strings
- Redesign GUI for palette list view
- Make tree list header sort row stylable
- Remove black lines from scrollbars in New Project window
- Remove margin around combobox in Level Strip
- Alter how some lines are drawn in the Timeline to fix some alpha issues
- Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility
- Make text always viewable in the FPS field in console bar
- Increase size of radio buttons in Cleanup Settings
- Increase size of switches in motion path nodes
- Remove unessesary "Layer" label in Timeline and other rects
- Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more
- Moves some external stylesheet icons into binary
* Make TPanelTitleBar Icon States Stylable
- Makes icon states for TPanelTitleBar buttons stylable in stylesheets
* Travis Fixes
* Swap Startup Popup Logos
They were in the wrong folders
* Revert "Swap Startup Popup Logos"
This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d.
* Fix Startup Popup Logo
It wasn't switching
* Feedback Changes
- Change render visualization to clapboard
- Fix text contrast on levels in XSheet
* Make Cell Selection More Clear
* Darken Light Theme and Tint Empty Cell Selection
* Fix missing icons
* Fix memo button
* Bring back colors
* Hide Motion Tab
* Fix Play Range Area (Light)
Make play range area more visible
* Vector Column Color
Co-authored-by: pojienie <pojienie@gmail.com>
Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp>
Co-authored-by: Rodney <rodney.baker@gmail.com>
Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com>
Co-authored-by: Kite <konero@users.noreply.github.com>
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
|
|
|
|
// Create rounded rect for key button states
|
|
|
|
|
QPainter p(this);
|
|
|
|
|
p.setRenderHint(p.Antialiasing, true);
|
2020-06-05 16:40:15 +12:00
|
|
|
|
QPainterPath path;
|
UI update and Icons from Konero (#126)
* add multi arc mockup
* implement mutli arc
* add join and smooth option
* reset multiarc and arc when deactivated
* create self loop if the last point is the same as the first
* make join option in multiarc consistent with tape tool
* fix a bug where thickness don't affect mutliarc in vector level
* remove join option in geometric tool
* stop mutliarc after closing shape
* double click can also end multi arc
* fix a bug where multiArc will produce buggy stroke
* fix a bug where geometric tools is not deactivated
* add multiArc shortcut
* rewrite multiArc
* revert changes to tvectorimage
* add undo data for multiArc
* Paste as Copy Command for XSheet
* Remove unneeded code
* Bug fix
* prevent guide lines from jumping around in MultiArc
* make stroke color consistent in MultiArc
* remove color in MultiArc's undo data
* make color consistent in MultiArc with previous version
* Fix single image raster levels
* fix compilation error
* fix a bug where multiArc might generate bugged stroke
* Remove ICONV dep (#3304)
* fix crash on saving studio palette
* Move to Paste Special Menu
* Don't Set Fixed Width if Docking a Floating Panel
* Update how_to_build_win.md
New draft of pr for requested changes to windows build instructions.
* fix geometric tool multiarc smooth option
* fix level saving failure
* fix wrong warning after saving palette
* fix a bug where moving a control point while holding alt has unintended result
* fix travis-install (#3389)
* Fix assert debug crash in flipconsole.cpp
Fix crash when using the viewer controls in the console (debug)
* Redraw Audio Waveform
Fills the waveform rather than outlines it.
* Update .gitignore
* fix undo data when drawing arc and mutliarc
* fix overwriting raster drawing palette (#3387)
* mode sensitive fx settings
* Create New Style Command Button (#3394)
* Create New Style Command Button
This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz.
Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com>
* Update paletteviewergui.cpp
Made changes to the PR per request by Shun.
* Fixed a space within the code that wasn't suppose to be there.
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
* tahoma license (#3396)
* new style button optional
* fix loading pegbars (removing updateKeyframes)
* periodic random expression
* add fx in linear color space
this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd.
in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories.
* fractal noise iwa fx
* skip unnecessary icon invalidation
* fix frame range fill with tablet
* stop function editor to open by dbl clicking key
* Expanding the radius of the rotation handle.
This just changes when the cursor transforms into the rotation tool.
(cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39)
* fix vector img patern stroke style
* Update Stylesheets
- Support the new icon sizes
- XSheet and Timeline significantly redesigned
- Lots of margin fixes and refactoring
- Remove deprecated icons, as some icons are moved into binary
- New Light theme
* New Icons
- Redesigns almost every icon as symbolic
- Adds icons for most commands
* Add Option for Icon Themes
- Adds option for icon themes
- Removes useless label from Preferences category list
* Update Icon Functions
- Adds themePath() boolean
- Adds function for recoloring black pixels in pixmaps to any color
- Rebuilds createQIcon to use fromTheme() and recolorPixmap()
- Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon
- Removes a grey horizontal line drawn above the console play bar in the viewer
* Set Default Icon Theme and Paths
- Sets search paths for icons for use with QIcon::fromTheme()
- Sets default start icon theme on first install
- Sets flag for displaying icons in menus, so we can selectively hide them
* Set Icons for Commands
- Sets icons for the commands
- Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16
- Selectively allows icons to display for Tools in menus
* Change Icon Sizes, General Fixes and Stylesheet Additions
- Change icon sizes to new size
- Remove margin around FX Editor window
- Remove white line under color sliders in Style Editor
- Make keyframe icons uniform and color stylable in the stylesheets
- Removes deprecated stylesheet strings
- Redesign GUI for palette list view
- Make tree list header sort row stylable
- Remove black lines from scrollbars in New Project window
- Remove margin around combobox in Level Strip
- Alter how some lines are drawn in the Timeline to fix some alpha issues
- Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility
- Make text always viewable in the FPS field in console bar
- Increase size of radio buttons in Cleanup Settings
- Increase size of switches in motion path nodes
- Remove unessesary "Layer" label in Timeline and other rects
- Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more
- Moves some external stylesheet icons into binary
* Make TPanelTitleBar Icon States Stylable
- Makes icon states for TPanelTitleBar buttons stylable in stylesheets
* Travis Fixes
* Swap Startup Popup Logos
They were in the wrong folders
* Revert "Swap Startup Popup Logos"
This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d.
* Fix Startup Popup Logo
It wasn't switching
* Feedback Changes
- Change render visualization to clapboard
- Fix text contrast on levels in XSheet
* Make Cell Selection More Clear
* Darken Light Theme and Tint Empty Cell Selection
* Fix missing icons
* Fix memo button
* Bring back colors
* Hide Motion Tab
* Fix Play Range Area (Light)
Make play range area more visible
* Vector Column Color
Co-authored-by: pojienie <pojienie@gmail.com>
Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp>
Co-authored-by: Rodney <rodney.baker@gmail.com>
Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com>
Co-authored-by: Kite <konero@users.noreply.github.com>
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
|
|
|
|
path.addRoundedRect(
|
|
|
|
|
QRectF(0.5, 0.5, 19, 19), radius,
|
|
|
|
|
radius); // Nudge rect by half pixel so QPen looks pixel perfect
|
|
|
|
|
QPen pen = QColor(0, 0, 0, 0);
|
2020-06-05 16:40:15 +12:00
|
|
|
|
p.setPen(pen);
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
switch (m_status) {
|
|
|
|
|
case NOT_ANIMATED:
|
UI update and Icons from Konero (#126)
* add multi arc mockup
* implement mutli arc
* add join and smooth option
* reset multiarc and arc when deactivated
* create self loop if the last point is the same as the first
* make join option in multiarc consistent with tape tool
* fix a bug where thickness don't affect mutliarc in vector level
* remove join option in geometric tool
* stop mutliarc after closing shape
* double click can also end multi arc
* fix a bug where multiArc will produce buggy stroke
* fix a bug where geometric tools is not deactivated
* add multiArc shortcut
* rewrite multiArc
* revert changes to tvectorimage
* add undo data for multiArc
* Paste as Copy Command for XSheet
* Remove unneeded code
* Bug fix
* prevent guide lines from jumping around in MultiArc
* make stroke color consistent in MultiArc
* remove color in MultiArc's undo data
* make color consistent in MultiArc with previous version
* Fix single image raster levels
* fix compilation error
* fix a bug where multiArc might generate bugged stroke
* Remove ICONV dep (#3304)
* fix crash on saving studio palette
* Move to Paste Special Menu
* Don't Set Fixed Width if Docking a Floating Panel
* Update how_to_build_win.md
New draft of pr for requested changes to windows build instructions.
* fix geometric tool multiarc smooth option
* fix level saving failure
* fix wrong warning after saving palette
* fix a bug where moving a control point while holding alt has unintended result
* fix travis-install (#3389)
* Fix assert debug crash in flipconsole.cpp
Fix crash when using the viewer controls in the console (debug)
* Redraw Audio Waveform
Fills the waveform rather than outlines it.
* Update .gitignore
* fix undo data when drawing arc and mutliarc
* fix overwriting raster drawing palette (#3387)
* mode sensitive fx settings
* Create New Style Command Button (#3394)
* Create New Style Command Button
This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz.
Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com>
* Update paletteviewergui.cpp
Made changes to the PR per request by Shun.
* Fixed a space within the code that wasn't suppose to be there.
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
* tahoma license (#3396)
* new style button optional
* fix loading pegbars (removing updateKeyframes)
* periodic random expression
* add fx in linear color space
this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd.
in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories.
* fractal noise iwa fx
* skip unnecessary icon invalidation
* fix frame range fill with tablet
* stop function editor to open by dbl clicking key
* Expanding the radius of the rotation handle.
This just changes when the cursor transforms into the rotation tool.
(cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39)
* fix vector img patern stroke style
* Update Stylesheets
- Support the new icon sizes
- XSheet and Timeline significantly redesigned
- Lots of margin fixes and refactoring
- Remove deprecated icons, as some icons are moved into binary
- New Light theme
* New Icons
- Redesigns almost every icon as symbolic
- Adds icons for most commands
* Add Option for Icon Themes
- Adds option for icon themes
- Removes useless label from Preferences category list
* Update Icon Functions
- Adds themePath() boolean
- Adds function for recoloring black pixels in pixmaps to any color
- Rebuilds createQIcon to use fromTheme() and recolorPixmap()
- Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon
- Removes a grey horizontal line drawn above the console play bar in the viewer
* Set Default Icon Theme and Paths
- Sets search paths for icons for use with QIcon::fromTheme()
- Sets default start icon theme on first install
- Sets flag for displaying icons in menus, so we can selectively hide them
* Set Icons for Commands
- Sets icons for the commands
- Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16
- Selectively allows icons to display for Tools in menus
* Change Icon Sizes, General Fixes and Stylesheet Additions
- Change icon sizes to new size
- Remove margin around FX Editor window
- Remove white line under color sliders in Style Editor
- Make keyframe icons uniform and color stylable in the stylesheets
- Removes deprecated stylesheet strings
- Redesign GUI for palette list view
- Make tree list header sort row stylable
- Remove black lines from scrollbars in New Project window
- Remove margin around combobox in Level Strip
- Alter how some lines are drawn in the Timeline to fix some alpha issues
- Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility
- Make text always viewable in the FPS field in console bar
- Increase size of radio buttons in Cleanup Settings
- Increase size of switches in motion path nodes
- Remove unessesary "Layer" label in Timeline and other rects
- Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more
- Moves some external stylesheet icons into binary
* Make TPanelTitleBar Icon States Stylable
- Makes icon states for TPanelTitleBar buttons stylable in stylesheets
* Travis Fixes
* Swap Startup Popup Logos
They were in the wrong folders
* Revert "Swap Startup Popup Logos"
This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d.
* Fix Startup Popup Logo
It wasn't switching
* Feedback Changes
- Change render visualization to clapboard
- Fix text contrast on levels in XSheet
* Make Cell Selection More Clear
* Darken Light Theme and Tint Empty Cell Selection
* Fix missing icons
* Fix memo button
* Bring back colors
* Hide Motion Tab
* Fix Play Range Area (Light)
Make play range area more visible
* Vector Column Color
Co-authored-by: pojienie <pojienie@gmail.com>
Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp>
Co-authored-by: Rodney <rodney.baker@gmail.com>
Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com>
Co-authored-by: Kite <konero@users.noreply.github.com>
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
|
|
|
|
pen = QColor(getKeyBorderOffColor());
|
|
|
|
|
p.setPen(pen);
|
2020-06-05 16:40:15 +12:00
|
|
|
|
p.fillPath(path, getKeyOffColor());
|
UI update and Icons from Konero (#126)
* add multi arc mockup
* implement mutli arc
* add join and smooth option
* reset multiarc and arc when deactivated
* create self loop if the last point is the same as the first
* make join option in multiarc consistent with tape tool
* fix a bug where thickness don't affect mutliarc in vector level
* remove join option in geometric tool
* stop mutliarc after closing shape
* double click can also end multi arc
* fix a bug where multiArc will produce buggy stroke
* fix a bug where geometric tools is not deactivated
* add multiArc shortcut
* rewrite multiArc
* revert changes to tvectorimage
* add undo data for multiArc
* Paste as Copy Command for XSheet
* Remove unneeded code
* Bug fix
* prevent guide lines from jumping around in MultiArc
* make stroke color consistent in MultiArc
* remove color in MultiArc's undo data
* make color consistent in MultiArc with previous version
* Fix single image raster levels
* fix compilation error
* fix a bug where multiArc might generate bugged stroke
* Remove ICONV dep (#3304)
* fix crash on saving studio palette
* Move to Paste Special Menu
* Don't Set Fixed Width if Docking a Floating Panel
* Update how_to_build_win.md
New draft of pr for requested changes to windows build instructions.
* fix geometric tool multiarc smooth option
* fix level saving failure
* fix wrong warning after saving palette
* fix a bug where moving a control point while holding alt has unintended result
* fix travis-install (#3389)
* Fix assert debug crash in flipconsole.cpp
Fix crash when using the viewer controls in the console (debug)
* Redraw Audio Waveform
Fills the waveform rather than outlines it.
* Update .gitignore
* fix undo data when drawing arc and mutliarc
* fix overwriting raster drawing palette (#3387)
* mode sensitive fx settings
* Create New Style Command Button (#3394)
* Create New Style Command Button
This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz.
Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com>
* Update paletteviewergui.cpp
Made changes to the PR per request by Shun.
* Fixed a space within the code that wasn't suppose to be there.
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
* tahoma license (#3396)
* new style button optional
* fix loading pegbars (removing updateKeyframes)
* periodic random expression
* add fx in linear color space
this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd.
in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories.
* fractal noise iwa fx
* skip unnecessary icon invalidation
* fix frame range fill with tablet
* stop function editor to open by dbl clicking key
* Expanding the radius of the rotation handle.
This just changes when the cursor transforms into the rotation tool.
(cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39)
* fix vector img patern stroke style
* Update Stylesheets
- Support the new icon sizes
- XSheet and Timeline significantly redesigned
- Lots of margin fixes and refactoring
- Remove deprecated icons, as some icons are moved into binary
- New Light theme
* New Icons
- Redesigns almost every icon as symbolic
- Adds icons for most commands
* Add Option for Icon Themes
- Adds option for icon themes
- Removes useless label from Preferences category list
* Update Icon Functions
- Adds themePath() boolean
- Adds function for recoloring black pixels in pixmaps to any color
- Rebuilds createQIcon to use fromTheme() and recolorPixmap()
- Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon
- Removes a grey horizontal line drawn above the console play bar in the viewer
* Set Default Icon Theme and Paths
- Sets search paths for icons for use with QIcon::fromTheme()
- Sets default start icon theme on first install
- Sets flag for displaying icons in menus, so we can selectively hide them
* Set Icons for Commands
- Sets icons for the commands
- Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16
- Selectively allows icons to display for Tools in menus
* Change Icon Sizes, General Fixes and Stylesheet Additions
- Change icon sizes to new size
- Remove margin around FX Editor window
- Remove white line under color sliders in Style Editor
- Make keyframe icons uniform and color stylable in the stylesheets
- Removes deprecated stylesheet strings
- Redesign GUI for palette list view
- Make tree list header sort row stylable
- Remove black lines from scrollbars in New Project window
- Remove margin around combobox in Level Strip
- Alter how some lines are drawn in the Timeline to fix some alpha issues
- Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility
- Make text always viewable in the FPS field in console bar
- Increase size of radio buttons in Cleanup Settings
- Increase size of switches in motion path nodes
- Remove unessesary "Layer" label in Timeline and other rects
- Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more
- Moves some external stylesheet icons into binary
* Make TPanelTitleBar Icon States Stylable
- Makes icon states for TPanelTitleBar buttons stylable in stylesheets
* Travis Fixes
* Swap Startup Popup Logos
They were in the wrong folders
* Revert "Swap Startup Popup Logos"
This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d.
* Fix Startup Popup Logo
It wasn't switching
* Feedback Changes
- Change render visualization to clapboard
- Fix text contrast on levels in XSheet
* Make Cell Selection More Clear
* Darken Light Theme and Tint Empty Cell Selection
* Fix missing icons
* Fix memo button
* Bring back colors
* Hide Motion Tab
* Fix Play Range Area (Light)
Make play range area more visible
* Vector Column Color
Co-authored-by: pojienie <pojienie@gmail.com>
Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp>
Co-authored-by: Rodney <rodney.baker@gmail.com>
Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com>
Co-authored-by: Kite <konero@users.noreply.github.com>
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
|
|
|
|
m_pixmap = QPixmap(createQIcon("key_off").pixmap(
|
|
|
|
|
iconSize, iconSize, QIcon::Normal, QIcon::Off));
|
|
|
|
|
icon.addPixmap(m_pixmap);
|
|
|
|
|
icon.paint(&p, QRect(0, 0, iconSize, iconSize));
|
2016-06-15 18:43:10 +12:00
|
|
|
|
break;
|
|
|
|
|
case KEYFRAME:
|
UI update and Icons from Konero (#126)
* add multi arc mockup
* implement mutli arc
* add join and smooth option
* reset multiarc and arc when deactivated
* create self loop if the last point is the same as the first
* make join option in multiarc consistent with tape tool
* fix a bug where thickness don't affect mutliarc in vector level
* remove join option in geometric tool
* stop mutliarc after closing shape
* double click can also end multi arc
* fix a bug where multiArc will produce buggy stroke
* fix a bug where geometric tools is not deactivated
* add multiArc shortcut
* rewrite multiArc
* revert changes to tvectorimage
* add undo data for multiArc
* Paste as Copy Command for XSheet
* Remove unneeded code
* Bug fix
* prevent guide lines from jumping around in MultiArc
* make stroke color consistent in MultiArc
* remove color in MultiArc's undo data
* make color consistent in MultiArc with previous version
* Fix single image raster levels
* fix compilation error
* fix a bug where multiArc might generate bugged stroke
* Remove ICONV dep (#3304)
* fix crash on saving studio palette
* Move to Paste Special Menu
* Don't Set Fixed Width if Docking a Floating Panel
* Update how_to_build_win.md
New draft of pr for requested changes to windows build instructions.
* fix geometric tool multiarc smooth option
* fix level saving failure
* fix wrong warning after saving palette
* fix a bug where moving a control point while holding alt has unintended result
* fix travis-install (#3389)
* Fix assert debug crash in flipconsole.cpp
Fix crash when using the viewer controls in the console (debug)
* Redraw Audio Waveform
Fills the waveform rather than outlines it.
* Update .gitignore
* fix undo data when drawing arc and mutliarc
* fix overwriting raster drawing palette (#3387)
* mode sensitive fx settings
* Create New Style Command Button (#3394)
* Create New Style Command Button
This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz.
Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com>
* Update paletteviewergui.cpp
Made changes to the PR per request by Shun.
* Fixed a space within the code that wasn't suppose to be there.
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
* tahoma license (#3396)
* new style button optional
* fix loading pegbars (removing updateKeyframes)
* periodic random expression
* add fx in linear color space
this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd.
in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories.
* fractal noise iwa fx
* skip unnecessary icon invalidation
* fix frame range fill with tablet
* stop function editor to open by dbl clicking key
* Expanding the radius of the rotation handle.
This just changes when the cursor transforms into the rotation tool.
(cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39)
* fix vector img patern stroke style
* Update Stylesheets
- Support the new icon sizes
- XSheet and Timeline significantly redesigned
- Lots of margin fixes and refactoring
- Remove deprecated icons, as some icons are moved into binary
- New Light theme
* New Icons
- Redesigns almost every icon as symbolic
- Adds icons for most commands
* Add Option for Icon Themes
- Adds option for icon themes
- Removes useless label from Preferences category list
* Update Icon Functions
- Adds themePath() boolean
- Adds function for recoloring black pixels in pixmaps to any color
- Rebuilds createQIcon to use fromTheme() and recolorPixmap()
- Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon
- Removes a grey horizontal line drawn above the console play bar in the viewer
* Set Default Icon Theme and Paths
- Sets search paths for icons for use with QIcon::fromTheme()
- Sets default start icon theme on first install
- Sets flag for displaying icons in menus, so we can selectively hide them
* Set Icons for Commands
- Sets icons for the commands
- Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16
- Selectively allows icons to display for Tools in menus
* Change Icon Sizes, General Fixes and Stylesheet Additions
- Change icon sizes to new size
- Remove margin around FX Editor window
- Remove white line under color sliders in Style Editor
- Make keyframe icons uniform and color stylable in the stylesheets
- Removes deprecated stylesheet strings
- Redesign GUI for palette list view
- Make tree list header sort row stylable
- Remove black lines from scrollbars in New Project window
- Remove margin around combobox in Level Strip
- Alter how some lines are drawn in the Timeline to fix some alpha issues
- Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility
- Make text always viewable in the FPS field in console bar
- Increase size of radio buttons in Cleanup Settings
- Increase size of switches in motion path nodes
- Remove unessesary "Layer" label in Timeline and other rects
- Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more
- Moves some external stylesheet icons into binary
* Make TPanelTitleBar Icon States Stylable
- Makes icon states for TPanelTitleBar buttons stylable in stylesheets
* Travis Fixes
* Swap Startup Popup Logos
They were in the wrong folders
* Revert "Swap Startup Popup Logos"
This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d.
* Fix Startup Popup Logo
It wasn't switching
* Feedback Changes
- Change render visualization to clapboard
- Fix text contrast on levels in XSheet
* Make Cell Selection More Clear
* Darken Light Theme and Tint Empty Cell Selection
* Fix missing icons
* Fix memo button
* Bring back colors
* Hide Motion Tab
* Fix Play Range Area (Light)
Make play range area more visible
* Vector Column Color
Co-authored-by: pojienie <pojienie@gmail.com>
Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp>
Co-authored-by: Rodney <rodney.baker@gmail.com>
Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com>
Co-authored-by: Kite <konero@users.noreply.github.com>
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
|
|
|
|
pen = QColor(getKeyBorderOnColor());
|
|
|
|
|
p.setPen(pen);
|
2020-06-05 16:40:15 +12:00
|
|
|
|
p.fillPath(path, getKeyOnColor());
|
UI update and Icons from Konero (#126)
* add multi arc mockup
* implement mutli arc
* add join and smooth option
* reset multiarc and arc when deactivated
* create self loop if the last point is the same as the first
* make join option in multiarc consistent with tape tool
* fix a bug where thickness don't affect mutliarc in vector level
* remove join option in geometric tool
* stop mutliarc after closing shape
* double click can also end multi arc
* fix a bug where multiArc will produce buggy stroke
* fix a bug where geometric tools is not deactivated
* add multiArc shortcut
* rewrite multiArc
* revert changes to tvectorimage
* add undo data for multiArc
* Paste as Copy Command for XSheet
* Remove unneeded code
* Bug fix
* prevent guide lines from jumping around in MultiArc
* make stroke color consistent in MultiArc
* remove color in MultiArc's undo data
* make color consistent in MultiArc with previous version
* Fix single image raster levels
* fix compilation error
* fix a bug where multiArc might generate bugged stroke
* Remove ICONV dep (#3304)
* fix crash on saving studio palette
* Move to Paste Special Menu
* Don't Set Fixed Width if Docking a Floating Panel
* Update how_to_build_win.md
New draft of pr for requested changes to windows build instructions.
* fix geometric tool multiarc smooth option
* fix level saving failure
* fix wrong warning after saving palette
* fix a bug where moving a control point while holding alt has unintended result
* fix travis-install (#3389)
* Fix assert debug crash in flipconsole.cpp
Fix crash when using the viewer controls in the console (debug)
* Redraw Audio Waveform
Fills the waveform rather than outlines it.
* Update .gitignore
* fix undo data when drawing arc and mutliarc
* fix overwriting raster drawing palette (#3387)
* mode sensitive fx settings
* Create New Style Command Button (#3394)
* Create New Style Command Button
This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz.
Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com>
* Update paletteviewergui.cpp
Made changes to the PR per request by Shun.
* Fixed a space within the code that wasn't suppose to be there.
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
* tahoma license (#3396)
* new style button optional
* fix loading pegbars (removing updateKeyframes)
* periodic random expression
* add fx in linear color space
this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd.
in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories.
* fractal noise iwa fx
* skip unnecessary icon invalidation
* fix frame range fill with tablet
* stop function editor to open by dbl clicking key
* Expanding the radius of the rotation handle.
This just changes when the cursor transforms into the rotation tool.
(cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39)
* fix vector img patern stroke style
* Update Stylesheets
- Support the new icon sizes
- XSheet and Timeline significantly redesigned
- Lots of margin fixes and refactoring
- Remove deprecated icons, as some icons are moved into binary
- New Light theme
* New Icons
- Redesigns almost every icon as symbolic
- Adds icons for most commands
* Add Option for Icon Themes
- Adds option for icon themes
- Removes useless label from Preferences category list
* Update Icon Functions
- Adds themePath() boolean
- Adds function for recoloring black pixels in pixmaps to any color
- Rebuilds createQIcon to use fromTheme() and recolorPixmap()
- Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon
- Removes a grey horizontal line drawn above the console play bar in the viewer
* Set Default Icon Theme and Paths
- Sets search paths for icons for use with QIcon::fromTheme()
- Sets default start icon theme on first install
- Sets flag for displaying icons in menus, so we can selectively hide them
* Set Icons for Commands
- Sets icons for the commands
- Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16
- Selectively allows icons to display for Tools in menus
* Change Icon Sizes, General Fixes and Stylesheet Additions
- Change icon sizes to new size
- Remove margin around FX Editor window
- Remove white line under color sliders in Style Editor
- Make keyframe icons uniform and color stylable in the stylesheets
- Removes deprecated stylesheet strings
- Redesign GUI for palette list view
- Make tree list header sort row stylable
- Remove black lines from scrollbars in New Project window
- Remove margin around combobox in Level Strip
- Alter how some lines are drawn in the Timeline to fix some alpha issues
- Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility
- Make text always viewable in the FPS field in console bar
- Increase size of radio buttons in Cleanup Settings
- Increase size of switches in motion path nodes
- Remove unessesary "Layer" label in Timeline and other rects
- Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more
- Moves some external stylesheet icons into binary
* Make TPanelTitleBar Icon States Stylable
- Makes icon states for TPanelTitleBar buttons stylable in stylesheets
* Travis Fixes
* Swap Startup Popup Logos
They were in the wrong folders
* Revert "Swap Startup Popup Logos"
This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d.
* Fix Startup Popup Logo
It wasn't switching
* Feedback Changes
- Change render visualization to clapboard
- Fix text contrast on levels in XSheet
* Make Cell Selection More Clear
* Darken Light Theme and Tint Empty Cell Selection
* Fix missing icons
* Fix memo button
* Bring back colors
* Hide Motion Tab
* Fix Play Range Area (Light)
Make play range area more visible
* Vector Column Color
Co-authored-by: pojienie <pojienie@gmail.com>
Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp>
Co-authored-by: Rodney <rodney.baker@gmail.com>
Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com>
Co-authored-by: Kite <konero@users.noreply.github.com>
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
|
|
|
|
m_pixmap =
|
|
|
|
|
QPixmap(createQIcon("key_on", true)
|
|
|
|
|
.pixmap(iconSize, iconSize, QIcon::Normal, QIcon::Off));
|
|
|
|
|
icon.addPixmap(m_pixmap);
|
|
|
|
|
icon.paint(&p, QRect(0, 0, iconSize, iconSize));
|
2016-06-15 18:43:10 +12:00
|
|
|
|
break;
|
|
|
|
|
case MODIFIED:
|
UI update and Icons from Konero (#126)
* add multi arc mockup
* implement mutli arc
* add join and smooth option
* reset multiarc and arc when deactivated
* create self loop if the last point is the same as the first
* make join option in multiarc consistent with tape tool
* fix a bug where thickness don't affect mutliarc in vector level
* remove join option in geometric tool
* stop mutliarc after closing shape
* double click can also end multi arc
* fix a bug where multiArc will produce buggy stroke
* fix a bug where geometric tools is not deactivated
* add multiArc shortcut
* rewrite multiArc
* revert changes to tvectorimage
* add undo data for multiArc
* Paste as Copy Command for XSheet
* Remove unneeded code
* Bug fix
* prevent guide lines from jumping around in MultiArc
* make stroke color consistent in MultiArc
* remove color in MultiArc's undo data
* make color consistent in MultiArc with previous version
* Fix single image raster levels
* fix compilation error
* fix a bug where multiArc might generate bugged stroke
* Remove ICONV dep (#3304)
* fix crash on saving studio palette
* Move to Paste Special Menu
* Don't Set Fixed Width if Docking a Floating Panel
* Update how_to_build_win.md
New draft of pr for requested changes to windows build instructions.
* fix geometric tool multiarc smooth option
* fix level saving failure
* fix wrong warning after saving palette
* fix a bug where moving a control point while holding alt has unintended result
* fix travis-install (#3389)
* Fix assert debug crash in flipconsole.cpp
Fix crash when using the viewer controls in the console (debug)
* Redraw Audio Waveform
Fills the waveform rather than outlines it.
* Update .gitignore
* fix undo data when drawing arc and mutliarc
* fix overwriting raster drawing palette (#3387)
* mode sensitive fx settings
* Create New Style Command Button (#3394)
* Create New Style Command Button
This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz.
Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com>
* Update paletteviewergui.cpp
Made changes to the PR per request by Shun.
* Fixed a space within the code that wasn't suppose to be there.
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
* tahoma license (#3396)
* new style button optional
* fix loading pegbars (removing updateKeyframes)
* periodic random expression
* add fx in linear color space
this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd.
in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories.
* fractal noise iwa fx
* skip unnecessary icon invalidation
* fix frame range fill with tablet
* stop function editor to open by dbl clicking key
* Expanding the radius of the rotation handle.
This just changes when the cursor transforms into the rotation tool.
(cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39)
* fix vector img patern stroke style
* Update Stylesheets
- Support the new icon sizes
- XSheet and Timeline significantly redesigned
- Lots of margin fixes and refactoring
- Remove deprecated icons, as some icons are moved into binary
- New Light theme
* New Icons
- Redesigns almost every icon as symbolic
- Adds icons for most commands
* Add Option for Icon Themes
- Adds option for icon themes
- Removes useless label from Preferences category list
* Update Icon Functions
- Adds themePath() boolean
- Adds function for recoloring black pixels in pixmaps to any color
- Rebuilds createQIcon to use fromTheme() and recolorPixmap()
- Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon
- Removes a grey horizontal line drawn above the console play bar in the viewer
* Set Default Icon Theme and Paths
- Sets search paths for icons for use with QIcon::fromTheme()
- Sets default start icon theme on first install
- Sets flag for displaying icons in menus, so we can selectively hide them
* Set Icons for Commands
- Sets icons for the commands
- Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16
- Selectively allows icons to display for Tools in menus
* Change Icon Sizes, General Fixes and Stylesheet Additions
- Change icon sizes to new size
- Remove margin around FX Editor window
- Remove white line under color sliders in Style Editor
- Make keyframe icons uniform and color stylable in the stylesheets
- Removes deprecated stylesheet strings
- Redesign GUI for palette list view
- Make tree list header sort row stylable
- Remove black lines from scrollbars in New Project window
- Remove margin around combobox in Level Strip
- Alter how some lines are drawn in the Timeline to fix some alpha issues
- Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility
- Make text always viewable in the FPS field in console bar
- Increase size of radio buttons in Cleanup Settings
- Increase size of switches in motion path nodes
- Remove unessesary "Layer" label in Timeline and other rects
- Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more
- Moves some external stylesheet icons into binary
* Make TPanelTitleBar Icon States Stylable
- Makes icon states for TPanelTitleBar buttons stylable in stylesheets
* Travis Fixes
* Swap Startup Popup Logos
They were in the wrong folders
* Revert "Swap Startup Popup Logos"
This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d.
* Fix Startup Popup Logo
It wasn't switching
* Feedback Changes
- Change render visualization to clapboard
- Fix text contrast on levels in XSheet
* Make Cell Selection More Clear
* Darken Light Theme and Tint Empty Cell Selection
* Fix missing icons
* Fix memo button
* Bring back colors
* Hide Motion Tab
* Fix Play Range Area (Light)
Make play range area more visible
* Vector Column Color
Co-authored-by: pojienie <pojienie@gmail.com>
Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp>
Co-authored-by: Rodney <rodney.baker@gmail.com>
Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com>
Co-authored-by: Kite <konero@users.noreply.github.com>
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
|
|
|
|
pen = QColor(getKeyBorderModifiedColor());
|
|
|
|
|
p.setPen(pen);
|
2020-06-05 16:40:15 +12:00
|
|
|
|
p.fillPath(path, getKeyModifiedColor());
|
UI update and Icons from Konero (#126)
* add multi arc mockup
* implement mutli arc
* add join and smooth option
* reset multiarc and arc when deactivated
* create self loop if the last point is the same as the first
* make join option in multiarc consistent with tape tool
* fix a bug where thickness don't affect mutliarc in vector level
* remove join option in geometric tool
* stop mutliarc after closing shape
* double click can also end multi arc
* fix a bug where multiArc will produce buggy stroke
* fix a bug where geometric tools is not deactivated
* add multiArc shortcut
* rewrite multiArc
* revert changes to tvectorimage
* add undo data for multiArc
* Paste as Copy Command for XSheet
* Remove unneeded code
* Bug fix
* prevent guide lines from jumping around in MultiArc
* make stroke color consistent in MultiArc
* remove color in MultiArc's undo data
* make color consistent in MultiArc with previous version
* Fix single image raster levels
* fix compilation error
* fix a bug where multiArc might generate bugged stroke
* Remove ICONV dep (#3304)
* fix crash on saving studio palette
* Move to Paste Special Menu
* Don't Set Fixed Width if Docking a Floating Panel
* Update how_to_build_win.md
New draft of pr for requested changes to windows build instructions.
* fix geometric tool multiarc smooth option
* fix level saving failure
* fix wrong warning after saving palette
* fix a bug where moving a control point while holding alt has unintended result
* fix travis-install (#3389)
* Fix assert debug crash in flipconsole.cpp
Fix crash when using the viewer controls in the console (debug)
* Redraw Audio Waveform
Fills the waveform rather than outlines it.
* Update .gitignore
* fix undo data when drawing arc and mutliarc
* fix overwriting raster drawing palette (#3387)
* mode sensitive fx settings
* Create New Style Command Button (#3394)
* Create New Style Command Button
This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz.
Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com>
* Update paletteviewergui.cpp
Made changes to the PR per request by Shun.
* Fixed a space within the code that wasn't suppose to be there.
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
* tahoma license (#3396)
* new style button optional
* fix loading pegbars (removing updateKeyframes)
* periodic random expression
* add fx in linear color space
this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd.
in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories.
* fractal noise iwa fx
* skip unnecessary icon invalidation
* fix frame range fill with tablet
* stop function editor to open by dbl clicking key
* Expanding the radius of the rotation handle.
This just changes when the cursor transforms into the rotation tool.
(cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39)
* fix vector img patern stroke style
* Update Stylesheets
- Support the new icon sizes
- XSheet and Timeline significantly redesigned
- Lots of margin fixes and refactoring
- Remove deprecated icons, as some icons are moved into binary
- New Light theme
* New Icons
- Redesigns almost every icon as symbolic
- Adds icons for most commands
* Add Option for Icon Themes
- Adds option for icon themes
- Removes useless label from Preferences category list
* Update Icon Functions
- Adds themePath() boolean
- Adds function for recoloring black pixels in pixmaps to any color
- Rebuilds createQIcon to use fromTheme() and recolorPixmap()
- Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon
- Removes a grey horizontal line drawn above the console play bar in the viewer
* Set Default Icon Theme and Paths
- Sets search paths for icons for use with QIcon::fromTheme()
- Sets default start icon theme on first install
- Sets flag for displaying icons in menus, so we can selectively hide them
* Set Icons for Commands
- Sets icons for the commands
- Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16
- Selectively allows icons to display for Tools in menus
* Change Icon Sizes, General Fixes and Stylesheet Additions
- Change icon sizes to new size
- Remove margin around FX Editor window
- Remove white line under color sliders in Style Editor
- Make keyframe icons uniform and color stylable in the stylesheets
- Removes deprecated stylesheet strings
- Redesign GUI for palette list view
- Make tree list header sort row stylable
- Remove black lines from scrollbars in New Project window
- Remove margin around combobox in Level Strip
- Alter how some lines are drawn in the Timeline to fix some alpha issues
- Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility
- Make text always viewable in the FPS field in console bar
- Increase size of radio buttons in Cleanup Settings
- Increase size of switches in motion path nodes
- Remove unessesary "Layer" label in Timeline and other rects
- Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more
- Moves some external stylesheet icons into binary
* Make TPanelTitleBar Icon States Stylable
- Makes icon states for TPanelTitleBar buttons stylable in stylesheets
* Travis Fixes
* Swap Startup Popup Logos
They were in the wrong folders
* Revert "Swap Startup Popup Logos"
This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d.
* Fix Startup Popup Logo
It wasn't switching
* Feedback Changes
- Change render visualization to clapboard
- Fix text contrast on levels in XSheet
* Make Cell Selection More Clear
* Darken Light Theme and Tint Empty Cell Selection
* Fix missing icons
* Fix memo button
* Bring back colors
* Hide Motion Tab
* Fix Play Range Area (Light)
Make play range area more visible
* Vector Column Color
Co-authored-by: pojienie <pojienie@gmail.com>
Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp>
Co-authored-by: Rodney <rodney.baker@gmail.com>
Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com>
Co-authored-by: Kite <konero@users.noreply.github.com>
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
|
|
|
|
m_pixmap =
|
|
|
|
|
QPixmap(createQIcon("key_modified", true)
|
|
|
|
|
.pixmap(iconSize, iconSize, QIcon::Normal, QIcon::Off));
|
|
|
|
|
icon.addPixmap(m_pixmap);
|
|
|
|
|
icon.paint(&p, QRect(0, 0, iconSize, iconSize));
|
2016-06-15 18:43:10 +12:00
|
|
|
|
break;
|
|
|
|
|
default:
|
UI update and Icons from Konero (#126)
* add multi arc mockup
* implement mutli arc
* add join and smooth option
* reset multiarc and arc when deactivated
* create self loop if the last point is the same as the first
* make join option in multiarc consistent with tape tool
* fix a bug where thickness don't affect mutliarc in vector level
* remove join option in geometric tool
* stop mutliarc after closing shape
* double click can also end multi arc
* fix a bug where multiArc will produce buggy stroke
* fix a bug where geometric tools is not deactivated
* add multiArc shortcut
* rewrite multiArc
* revert changes to tvectorimage
* add undo data for multiArc
* Paste as Copy Command for XSheet
* Remove unneeded code
* Bug fix
* prevent guide lines from jumping around in MultiArc
* make stroke color consistent in MultiArc
* remove color in MultiArc's undo data
* make color consistent in MultiArc with previous version
* Fix single image raster levels
* fix compilation error
* fix a bug where multiArc might generate bugged stroke
* Remove ICONV dep (#3304)
* fix crash on saving studio palette
* Move to Paste Special Menu
* Don't Set Fixed Width if Docking a Floating Panel
* Update how_to_build_win.md
New draft of pr for requested changes to windows build instructions.
* fix geometric tool multiarc smooth option
* fix level saving failure
* fix wrong warning after saving palette
* fix a bug where moving a control point while holding alt has unintended result
* fix travis-install (#3389)
* Fix assert debug crash in flipconsole.cpp
Fix crash when using the viewer controls in the console (debug)
* Redraw Audio Waveform
Fills the waveform rather than outlines it.
* Update .gitignore
* fix undo data when drawing arc and mutliarc
* fix overwriting raster drawing palette (#3387)
* mode sensitive fx settings
* Create New Style Command Button (#3394)
* Create New Style Command Button
This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz.
Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com>
* Update paletteviewergui.cpp
Made changes to the PR per request by Shun.
* Fixed a space within the code that wasn't suppose to be there.
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
* tahoma license (#3396)
* new style button optional
* fix loading pegbars (removing updateKeyframes)
* periodic random expression
* add fx in linear color space
this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd.
in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories.
* fractal noise iwa fx
* skip unnecessary icon invalidation
* fix frame range fill with tablet
* stop function editor to open by dbl clicking key
* Expanding the radius of the rotation handle.
This just changes when the cursor transforms into the rotation tool.
(cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39)
* fix vector img patern stroke style
* Update Stylesheets
- Support the new icon sizes
- XSheet and Timeline significantly redesigned
- Lots of margin fixes and refactoring
- Remove deprecated icons, as some icons are moved into binary
- New Light theme
* New Icons
- Redesigns almost every icon as symbolic
- Adds icons for most commands
* Add Option for Icon Themes
- Adds option for icon themes
- Removes useless label from Preferences category list
* Update Icon Functions
- Adds themePath() boolean
- Adds function for recoloring black pixels in pixmaps to any color
- Rebuilds createQIcon to use fromTheme() and recolorPixmap()
- Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon
- Removes a grey horizontal line drawn above the console play bar in the viewer
* Set Default Icon Theme and Paths
- Sets search paths for icons for use with QIcon::fromTheme()
- Sets default start icon theme on first install
- Sets flag for displaying icons in menus, so we can selectively hide them
* Set Icons for Commands
- Sets icons for the commands
- Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16
- Selectively allows icons to display for Tools in menus
* Change Icon Sizes, General Fixes and Stylesheet Additions
- Change icon sizes to new size
- Remove margin around FX Editor window
- Remove white line under color sliders in Style Editor
- Make keyframe icons uniform and color stylable in the stylesheets
- Removes deprecated stylesheet strings
- Redesign GUI for palette list view
- Make tree list header sort row stylable
- Remove black lines from scrollbars in New Project window
- Remove margin around combobox in Level Strip
- Alter how some lines are drawn in the Timeline to fix some alpha issues
- Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility
- Make text always viewable in the FPS field in console bar
- Increase size of radio buttons in Cleanup Settings
- Increase size of switches in motion path nodes
- Remove unessesary "Layer" label in Timeline and other rects
- Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more
- Moves some external stylesheet icons into binary
* Make TPanelTitleBar Icon States Stylable
- Makes icon states for TPanelTitleBar buttons stylable in stylesheets
* Travis Fixes
* Swap Startup Popup Logos
They were in the wrong folders
* Revert "Swap Startup Popup Logos"
This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d.
* Fix Startup Popup Logo
It wasn't switching
* Feedback Changes
- Change render visualization to clapboard
- Fix text contrast on levels in XSheet
* Make Cell Selection More Clear
* Darken Light Theme and Tint Empty Cell Selection
* Fix missing icons
* Fix memo button
* Bring back colors
* Hide Motion Tab
* Fix Play Range Area (Light)
Make play range area more visible
* Vector Column Color
Co-authored-by: pojienie <pojienie@gmail.com>
Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp>
Co-authored-by: Rodney <rodney.baker@gmail.com>
Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com>
Co-authored-by: Kite <konero@users.noreply.github.com>
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
|
|
|
|
pen = QColor(getKeyBorderInbetweenColor());
|
|
|
|
|
p.setPen(pen);
|
2020-06-05 16:40:15 +12:00
|
|
|
|
p.fillPath(path, getKeyInbetweenColor());
|
UI update and Icons from Konero (#126)
* add multi arc mockup
* implement mutli arc
* add join and smooth option
* reset multiarc and arc when deactivated
* create self loop if the last point is the same as the first
* make join option in multiarc consistent with tape tool
* fix a bug where thickness don't affect mutliarc in vector level
* remove join option in geometric tool
* stop mutliarc after closing shape
* double click can also end multi arc
* fix a bug where multiArc will produce buggy stroke
* fix a bug where geometric tools is not deactivated
* add multiArc shortcut
* rewrite multiArc
* revert changes to tvectorimage
* add undo data for multiArc
* Paste as Copy Command for XSheet
* Remove unneeded code
* Bug fix
* prevent guide lines from jumping around in MultiArc
* make stroke color consistent in MultiArc
* remove color in MultiArc's undo data
* make color consistent in MultiArc with previous version
* Fix single image raster levels
* fix compilation error
* fix a bug where multiArc might generate bugged stroke
* Remove ICONV dep (#3304)
* fix crash on saving studio palette
* Move to Paste Special Menu
* Don't Set Fixed Width if Docking a Floating Panel
* Update how_to_build_win.md
New draft of pr for requested changes to windows build instructions.
* fix geometric tool multiarc smooth option
* fix level saving failure
* fix wrong warning after saving palette
* fix a bug where moving a control point while holding alt has unintended result
* fix travis-install (#3389)
* Fix assert debug crash in flipconsole.cpp
Fix crash when using the viewer controls in the console (debug)
* Redraw Audio Waveform
Fills the waveform rather than outlines it.
* Update .gitignore
* fix undo data when drawing arc and mutliarc
* fix overwriting raster drawing palette (#3387)
* mode sensitive fx settings
* Create New Style Command Button (#3394)
* Create New Style Command Button
This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz.
Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com>
* Update paletteviewergui.cpp
Made changes to the PR per request by Shun.
* Fixed a space within the code that wasn't suppose to be there.
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
* tahoma license (#3396)
* new style button optional
* fix loading pegbars (removing updateKeyframes)
* periodic random expression
* add fx in linear color space
this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd.
in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories.
* fractal noise iwa fx
* skip unnecessary icon invalidation
* fix frame range fill with tablet
* stop function editor to open by dbl clicking key
* Expanding the radius of the rotation handle.
This just changes when the cursor transforms into the rotation tool.
(cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39)
* fix vector img patern stroke style
* Update Stylesheets
- Support the new icon sizes
- XSheet and Timeline significantly redesigned
- Lots of margin fixes and refactoring
- Remove deprecated icons, as some icons are moved into binary
- New Light theme
* New Icons
- Redesigns almost every icon as symbolic
- Adds icons for most commands
* Add Option for Icon Themes
- Adds option for icon themes
- Removes useless label from Preferences category list
* Update Icon Functions
- Adds themePath() boolean
- Adds function for recoloring black pixels in pixmaps to any color
- Rebuilds createQIcon to use fromTheme() and recolorPixmap()
- Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon
- Removes a grey horizontal line drawn above the console play bar in the viewer
* Set Default Icon Theme and Paths
- Sets search paths for icons for use with QIcon::fromTheme()
- Sets default start icon theme on first install
- Sets flag for displaying icons in menus, so we can selectively hide them
* Set Icons for Commands
- Sets icons for the commands
- Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16
- Selectively allows icons to display for Tools in menus
* Change Icon Sizes, General Fixes and Stylesheet Additions
- Change icon sizes to new size
- Remove margin around FX Editor window
- Remove white line under color sliders in Style Editor
- Make keyframe icons uniform and color stylable in the stylesheets
- Removes deprecated stylesheet strings
- Redesign GUI for palette list view
- Make tree list header sort row stylable
- Remove black lines from scrollbars in New Project window
- Remove margin around combobox in Level Strip
- Alter how some lines are drawn in the Timeline to fix some alpha issues
- Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility
- Make text always viewable in the FPS field in console bar
- Increase size of radio buttons in Cleanup Settings
- Increase size of switches in motion path nodes
- Remove unessesary "Layer" label in Timeline and other rects
- Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more
- Moves some external stylesheet icons into binary
* Make TPanelTitleBar Icon States Stylable
- Makes icon states for TPanelTitleBar buttons stylable in stylesheets
* Travis Fixes
* Swap Startup Popup Logos
They were in the wrong folders
* Revert "Swap Startup Popup Logos"
This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d.
* Fix Startup Popup Logo
It wasn't switching
* Feedback Changes
- Change render visualization to clapboard
- Fix text contrast on levels in XSheet
* Make Cell Selection More Clear
* Darken Light Theme and Tint Empty Cell Selection
* Fix missing icons
* Fix memo button
* Bring back colors
* Hide Motion Tab
* Fix Play Range Area (Light)
Make play range area more visible
* Vector Column Color
Co-authored-by: pojienie <pojienie@gmail.com>
Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp>
Co-authored-by: Rodney <rodney.baker@gmail.com>
Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com>
Co-authored-by: Kite <konero@users.noreply.github.com>
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
|
|
|
|
m_pixmap =
|
|
|
|
|
QPixmap(createQIcon("key_on", true)
|
|
|
|
|
.pixmap(iconSize, iconSize, QIcon::Normal, QIcon::Off));
|
|
|
|
|
icon.addPixmap(m_pixmap);
|
|
|
|
|
icon.paint(&p, QRect(0, 0, iconSize, iconSize));
|
2016-06-15 18:43:10 +12:00
|
|
|
|
break;
|
|
|
|
|
}
|
2020-06-05 16:40:15 +12:00
|
|
|
|
p.drawPath(path);
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (m_highlighted) {
|
UI update and Icons from Konero (#126)
* add multi arc mockup
* implement mutli arc
* add join and smooth option
* reset multiarc and arc when deactivated
* create self loop if the last point is the same as the first
* make join option in multiarc consistent with tape tool
* fix a bug where thickness don't affect mutliarc in vector level
* remove join option in geometric tool
* stop mutliarc after closing shape
* double click can also end multi arc
* fix a bug where multiArc will produce buggy stroke
* fix a bug where geometric tools is not deactivated
* add multiArc shortcut
* rewrite multiArc
* revert changes to tvectorimage
* add undo data for multiArc
* Paste as Copy Command for XSheet
* Remove unneeded code
* Bug fix
* prevent guide lines from jumping around in MultiArc
* make stroke color consistent in MultiArc
* remove color in MultiArc's undo data
* make color consistent in MultiArc with previous version
* Fix single image raster levels
* fix compilation error
* fix a bug where multiArc might generate bugged stroke
* Remove ICONV dep (#3304)
* fix crash on saving studio palette
* Move to Paste Special Menu
* Don't Set Fixed Width if Docking a Floating Panel
* Update how_to_build_win.md
New draft of pr for requested changes to windows build instructions.
* fix geometric tool multiarc smooth option
* fix level saving failure
* fix wrong warning after saving palette
* fix a bug where moving a control point while holding alt has unintended result
* fix travis-install (#3389)
* Fix assert debug crash in flipconsole.cpp
Fix crash when using the viewer controls in the console (debug)
* Redraw Audio Waveform
Fills the waveform rather than outlines it.
* Update .gitignore
* fix undo data when drawing arc and mutliarc
* fix overwriting raster drawing palette (#3387)
* mode sensitive fx settings
* Create New Style Command Button (#3394)
* Create New Style Command Button
This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz.
Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com>
* Update paletteviewergui.cpp
Made changes to the PR per request by Shun.
* Fixed a space within the code that wasn't suppose to be there.
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
* tahoma license (#3396)
* new style button optional
* fix loading pegbars (removing updateKeyframes)
* periodic random expression
* add fx in linear color space
this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd.
in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories.
* fractal noise iwa fx
* skip unnecessary icon invalidation
* fix frame range fill with tablet
* stop function editor to open by dbl clicking key
* Expanding the radius of the rotation handle.
This just changes when the cursor transforms into the rotation tool.
(cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39)
* fix vector img patern stroke style
* Update Stylesheets
- Support the new icon sizes
- XSheet and Timeline significantly redesigned
- Lots of margin fixes and refactoring
- Remove deprecated icons, as some icons are moved into binary
- New Light theme
* New Icons
- Redesigns almost every icon as symbolic
- Adds icons for most commands
* Add Option for Icon Themes
- Adds option for icon themes
- Removes useless label from Preferences category list
* Update Icon Functions
- Adds themePath() boolean
- Adds function for recoloring black pixels in pixmaps to any color
- Rebuilds createQIcon to use fromTheme() and recolorPixmap()
- Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon
- Removes a grey horizontal line drawn above the console play bar in the viewer
* Set Default Icon Theme and Paths
- Sets search paths for icons for use with QIcon::fromTheme()
- Sets default start icon theme on first install
- Sets flag for displaying icons in menus, so we can selectively hide them
* Set Icons for Commands
- Sets icons for the commands
- Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16
- Selectively allows icons to display for Tools in menus
* Change Icon Sizes, General Fixes and Stylesheet Additions
- Change icon sizes to new size
- Remove margin around FX Editor window
- Remove white line under color sliders in Style Editor
- Make keyframe icons uniform and color stylable in the stylesheets
- Removes deprecated stylesheet strings
- Redesign GUI for palette list view
- Make tree list header sort row stylable
- Remove black lines from scrollbars in New Project window
- Remove margin around combobox in Level Strip
- Alter how some lines are drawn in the Timeline to fix some alpha issues
- Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility
- Make text always viewable in the FPS field in console bar
- Increase size of radio buttons in Cleanup Settings
- Increase size of switches in motion path nodes
- Remove unessesary "Layer" label in Timeline and other rects
- Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more
- Moves some external stylesheet icons into binary
* Make TPanelTitleBar Icon States Stylable
- Makes icon states for TPanelTitleBar buttons stylable in stylesheets
* Travis Fixes
* Swap Startup Popup Logos
They were in the wrong folders
* Revert "Swap Startup Popup Logos"
This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d.
* Fix Startup Popup Logo
It wasn't switching
* Feedback Changes
- Change render visualization to clapboard
- Fix text contrast on levels in XSheet
* Make Cell Selection More Clear
* Darken Light Theme and Tint Empty Cell Selection
* Fix missing icons
* Fix memo button
* Bring back colors
* Hide Motion Tab
* Fix Play Range Area (Light)
Make play range area more visible
* Vector Column Color
Co-authored-by: pojienie <pojienie@gmail.com>
Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp>
Co-authored-by: Rodney <rodney.baker@gmail.com>
Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com>
Co-authored-by: Kite <konero@users.noreply.github.com>
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
|
|
|
|
pen = QColor(getKeyBorderHighlightColor());
|
|
|
|
|
p.setPen(pen);
|
2020-06-05 16:40:15 +12:00
|
|
|
|
p.fillPath(path, getKeyHighlightColor());
|
|
|
|
|
p.drawPath(path);
|
2016-06-15 18:43:10 +12:00
|
|
|
|
}
|
2020-06-05 16:40:15 +12:00
|
|
|
|
|
|
|
|
|
p.end();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void ParamFieldKeyToggle::mousePressEvent(QMouseEvent *e) { emit keyToggled(); }
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void ParamFieldKeyToggle::enterEvent(QEvent *) {
|
|
|
|
|
m_highlighted = true;
|
|
|
|
|
update();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void ParamFieldKeyToggle::leaveEvent(QEvent *) {
|
|
|
|
|
m_highlighted = false;
|
|
|
|
|
update();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
// MeasuredDoubleParamField
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
MeasuredDoubleParamField::MeasuredDoubleParamField(QWidget *parent,
|
|
|
|
|
QString name,
|
|
|
|
|
const TDoubleParamP ¶m)
|
|
|
|
|
: AnimatedParamField<double, TDoubleParamP>(parent, name, param) {
|
|
|
|
|
QString str;
|
|
|
|
|
m_paramName = str.fromStdString(param->getName());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_measuredDoubleField = new MeasuredDoubleField(this, false);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_measuredDoubleField->setSizePolicy(QSizePolicy::Expanding,
|
|
|
|
|
QSizePolicy::Minimum);
|
|
|
|
|
m_measuredDoubleField->setMeasure(param->getMeasureName());
|
|
|
|
|
m_measuredDoubleField->setValue(param->getValue(m_frame));
|
|
|
|
|
m_measuredDoubleField->setDecimals(3);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
double min = 0, max = 100, step = 1;
|
|
|
|
|
param->getValueRange(min, max, step);
|
|
|
|
|
assert(min < max);
|
|
|
|
|
m_measuredDoubleField->setRange(min, max);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
//----layout
|
|
|
|
|
m_layout->addWidget(m_keyToggle);
|
|
|
|
|
m_layout->addWidget(m_measuredDoubleField);
|
|
|
|
|
setLayout(m_layout);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
//----signal-slot connection
|
|
|
|
|
bool ret = connect(m_measuredDoubleField, SIGNAL(valueChanged(bool)),
|
|
|
|
|
SLOT(onChange(bool)));
|
|
|
|
|
ret = ret && connect(m_keyToggle, SIGNAL(keyToggled()), SLOT(onKeyToggled()));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
assert(ret);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void MeasuredDoubleParamField::updateField(double value) {
|
|
|
|
|
m_measuredDoubleField->setValue(value);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void MeasuredDoubleParamField::onChange(bool dragging) {
|
|
|
|
|
if (dragging) return;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TDoubleParamP doubleParam = m_actualParam;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TUndo *undo = 0;
|
|
|
|
|
/*-- Undoを登録する条件:
|
|
|
|
|
値が変更されていて、かつ
|
|
|
|
|
キーフレーム上か、または、まだキーフレームが無い
|
|
|
|
|
(すなわち、実際にシーンの情報を変えることになる)場合
|
|
|
|
|
--*/
|
|
|
|
|
if (doubleParam &&
|
|
|
|
|
doubleParam->getValue(m_frame) != m_measuredDoubleField->getValue() &&
|
|
|
|
|
(m_actualParam->isKeyframe(m_frame) ||
|
|
|
|
|
!m_actualParam.getPointer()->hasKeyframes()))
|
|
|
|
|
undo = new MeasuredDoubleParamFieldUndo(
|
|
|
|
|
doubleParam, m_interfaceName, m_frame, ParamField::m_fxHandleStat);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setValue(m_measuredDoubleField->getValue());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (undo) TUndoManager::manager()->add(undo);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void MeasuredDoubleParamField::onKeyToggled() { onKeyToggle(); }
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2021-04-06 15:19:44 +12:00
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
void MeasuredDoubleParamField::setPrecision(int precision) {
|
|
|
|
|
double min, max;
|
|
|
|
|
m_measuredDoubleField->getRange(min, max);
|
|
|
|
|
m_measuredDoubleField->setDecimals(precision);
|
|
|
|
|
// update slider
|
|
|
|
|
m_measuredDoubleField->setRange(min, max);
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-19 06:57:51 +13:00
|
|
|
|
//=============================================================================
|
|
|
|
|
// MeasuredRangeParamField
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
MeasuredRangeParamField::MeasuredRangeParamField(QWidget *parent, QString name,
|
|
|
|
|
const TRangeParamP ¶m)
|
|
|
|
|
: AnimatedParamField<DoublePair, TRangeParamP>(parent, name, param) {
|
|
|
|
|
QString str;
|
|
|
|
|
m_paramName = str.fromStdString(param->getName());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_valueField = new MeasuredDoublePairField(this);
|
|
|
|
|
m_valueField->setLabelsEnabled(false);
|
|
|
|
|
m_valueField->setMeasure(param->getMin()->getMeasureName());
|
|
|
|
|
m_valueField->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
|
|
|
|
|
double a, b, c, min, max;
|
|
|
|
|
param->getMin()->getValueRange(a, b, c);
|
|
|
|
|
min = a;
|
|
|
|
|
param->getMax()->getValueRange(a, b, c);
|
|
|
|
|
max = b;
|
|
|
|
|
if (min < max && max - min < 1e10) // se min=-inf e max=inf
|
|
|
|
|
m_valueField->setRange(min, max);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_layout->addWidget(m_keyToggle);
|
|
|
|
|
m_layout->addWidget(m_valueField);
|
|
|
|
|
setLayout(m_layout);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
bool ret =
|
|
|
|
|
connect(m_valueField, SIGNAL(valuesChanged(bool)), SLOT(onChange(bool)));
|
|
|
|
|
ret = ret && connect(m_keyToggle, SIGNAL(keyToggled()), SLOT(onKeyToggled()));
|
|
|
|
|
assert(ret);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void MeasuredRangeParamField::updateField(DoublePair value) {
|
|
|
|
|
m_valueField->setValues(value);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void MeasuredRangeParamField::onChange(bool dragging) {
|
|
|
|
|
if (dragging) return;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TRangeParamP rangeParam = m_actualParam;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
DoublePair value = m_valueField->getValues();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TUndo *undo = 0;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
/*-- Undoを登録する条件:
|
|
|
|
|
値が変更されていて
|
|
|
|
|
キーフレーム上か、または、まだキーフレームが無い
|
|
|
|
|
(すなわち、実際にシーンの情報を変えることになる)場合
|
|
|
|
|
--*/
|
|
|
|
|
if (rangeParam && rangeParam->getValue(m_frame) != value &&
|
|
|
|
|
(m_actualParam->isKeyframe(m_frame) ||
|
|
|
|
|
!m_actualParam.getPointer()->hasKeyframes()))
|
|
|
|
|
undo = new RangeParamFieldUndo(rangeParam, m_interfaceName, m_frame,
|
|
|
|
|
ParamField::m_fxHandleStat);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setValue(value);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (undo) TUndoManager::manager()->add(undo);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void MeasuredRangeParamField::onKeyToggled() { onKeyToggle(); }
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void MeasuredRangeParamField::setPrecision(int precision) {
|
|
|
|
|
m_valueField->setPrecision(precision);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
// PointParamField
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
PointParamField::PointParamField(QWidget *parent, QString name,
|
|
|
|
|
const TPointParamP ¶m)
|
|
|
|
|
: AnimatedParamField<TPointD, TPointParamP>(parent, name, param) {
|
|
|
|
|
QString str;
|
|
|
|
|
m_paramName = str.fromStdString(param->getName());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
QLabel *xLabel = new QLabel(tr("X:"), this);
|
|
|
|
|
m_xFld = new MeasuredDoubleField(this, false);
|
|
|
|
|
QLabel *yLabel = new QLabel(tr("Y:"), this);
|
|
|
|
|
m_yFld = new MeasuredDoubleField(this, false);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
double xmin = -(std::numeric_limits<double>::max)(),
|
|
|
|
|
xmax = (std::numeric_limits<double>::max)();
|
|
|
|
|
double ymin = -(std::numeric_limits<double>::max)(),
|
|
|
|
|
ymax = (std::numeric_limits<double>::max)();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
#if 1
|
2016-06-15 18:43:10 +12:00
|
|
|
|
/* これを有効にすれば PointParamField に範囲が設定できることが UI
|
|
|
|
|
の見た目が変わってしまう.
|
|
|
|
|
これまで誰も TPointParam に対して range
|
|
|
|
|
を設定していないなら(どうせ効いてなかったのだから)無条件に設定してもよさそうだが
|
|
|
|
|
実際は Pinned Texture などの FX
|
|
|
|
|
が設定しており(効いてないなかったが、この修正により)動作が変わってしまうので
|
|
|
|
|
plugin から要求された場合でのみ range を有効にする. */
|
|
|
|
|
if (param->isFromPlugin()) {
|
|
|
|
|
double xstep, ystep;
|
|
|
|
|
param->getX()->getValueRange(xmin, xmax, xstep);
|
|
|
|
|
param->getY()->getValueRange(ymin, ymax, ystep);
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
#endif
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_xFld->setMaximumWidth(100);
|
|
|
|
|
m_xFld->setRange(xmin, xmax);
|
|
|
|
|
m_xFld->setMeasure(param->getX()->getMeasureName());
|
|
|
|
|
m_xFld->setValue(param->getX()->getValue(m_frame));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_yFld->setMaximumWidth(100);
|
|
|
|
|
m_yFld->setRange(ymin, ymax);
|
|
|
|
|
m_yFld->setMeasure(param->getY()->getMeasureName());
|
|
|
|
|
m_yFld->setValue(param->getY()->getValue(m_frame));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
//----layout
|
|
|
|
|
m_layout->addWidget(m_keyToggle);
|
|
|
|
|
m_layout->addWidget(xLabel);
|
|
|
|
|
m_layout->addWidget(m_xFld);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_layout->addSpacing(5);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_layout->addWidget(yLabel);
|
|
|
|
|
m_layout->addWidget(m_yFld);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_layout->addStretch(1);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setLayout(m_layout);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
//----signal-slot connections
|
|
|
|
|
bool ret =
|
|
|
|
|
connect(m_xFld, SIGNAL(valueChanged(bool)), this, SLOT(onChange(bool)));
|
|
|
|
|
ret = ret &&
|
|
|
|
|
connect(m_yFld, SIGNAL(valueChanged(bool)), this, SLOT(onChange(bool)));
|
|
|
|
|
ret = ret && connect(m_keyToggle, SIGNAL(keyToggled()), SLOT(onKeyToggled()));
|
|
|
|
|
assert(ret);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void PointParamField::setPointValue(const TPointD &p) {
|
|
|
|
|
m_xFld->setValue(p.x);
|
|
|
|
|
m_yFld->setValue(p.y);
|
|
|
|
|
setValue(p);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void PointParamField::updateField(TPointD value) {
|
|
|
|
|
m_xFld->setValue(value.x);
|
|
|
|
|
m_yFld->setValue(value.y);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void PointParamField::onChange(bool dragging) {
|
|
|
|
|
if (dragging) return;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TPointParamP pointParam = m_actualParam;
|
|
|
|
|
TPointD pos(m_xFld->getValue(), m_yFld->getValue());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TUndo *undo = 0;
|
|
|
|
|
/*-- Undoを登録する条件:
|
|
|
|
|
値が変更されていて
|
|
|
|
|
キーフレーム上か、または、まだキーフレームが無い
|
|
|
|
|
(すなわち、実際にシーンの情報を変えることになる)場合
|
|
|
|
|
--*/
|
|
|
|
|
if (pointParam && pointParam->getValue(m_frame) != pos &&
|
|
|
|
|
(m_actualParam->isKeyframe(m_frame) ||
|
|
|
|
|
!m_actualParam.getPointer()->hasKeyframes()))
|
|
|
|
|
undo = new PointParamFieldUndo(pointParam, m_interfaceName, m_frame,
|
|
|
|
|
ParamField::m_fxHandleStat);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setValue(pos);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (undo) TUndoManager::manager()->add(undo);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void PointParamField::onKeyToggled() { onKeyToggle(); }
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
// PixelParamField
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
PixelParamField::PixelParamField(QWidget *parent, QString name,
|
|
|
|
|
const TPixelParamP ¶m)
|
|
|
|
|
: AnimatedParamField<TPixel32, TPixelParamP>(parent, name, param) {
|
|
|
|
|
QString str;
|
|
|
|
|
m_paramName = str.fromStdString(param->getName());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_colorField = new ColorField(this, param->isMatteEnabled());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
//----layout
|
|
|
|
|
m_layout->addWidget(m_keyToggle);
|
|
|
|
|
m_layout->addWidget(m_colorField);
|
|
|
|
|
m_layout->addStretch();
|
|
|
|
|
setLayout(m_layout);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
//----signal-slot connections
|
|
|
|
|
bool ret = connect(m_colorField, SIGNAL(colorChanged(const TPixel32 &, bool)),
|
|
|
|
|
this, SLOT(onChange(const TPixel32 &, bool)));
|
|
|
|
|
ret = ret && connect(m_keyToggle, SIGNAL(keyToggled()), SLOT(onKeyToggled()));
|
|
|
|
|
assert(ret);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void PixelParamField::updateField(TPixel32 value) {
|
|
|
|
|
m_colorField->setColor(value);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void PixelParamField::onChange(const TPixel32 &value, bool isDragging) {
|
|
|
|
|
if (isDragging) return;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TPixelParamP pixelParam = m_actualParam;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TUndo *undo = 0;
|
|
|
|
|
/*-- Undoを登録する条件:
|
|
|
|
|
値が変更されていて
|
|
|
|
|
キーフレーム上か、または、まだキーフレームが無い
|
|
|
|
|
(すなわち、実際にシーンの情報を変えることになる)場合
|
|
|
|
|
--*/
|
|
|
|
|
if (pixelParam && pixelParam->getValue(m_frame) != value &&
|
|
|
|
|
(m_actualParam->isKeyframe(m_frame) ||
|
|
|
|
|
!m_actualParam.getPointer()->hasKeyframes()))
|
|
|
|
|
undo = new PixelParamFieldUndo(pixelParam, m_interfaceName, m_frame,
|
|
|
|
|
ParamField::m_fxHandleStat);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setValue(value);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (undo) TUndoManager::manager()->add(undo);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void PixelParamField::onKeyToggled() { onKeyToggle(); }
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TPixel32 PixelParamField::getColor() { return m_colorField->getColor(); }
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void PixelParamField::setColor(TPixel32 value) {
|
|
|
|
|
m_colorField->setColor(value);
|
2019-09-19 20:19:58 +12:00
|
|
|
|
onChange(value, false);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
// RGB Link Button
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2019-09-19 20:19:58 +12:00
|
|
|
|
RgbLinkButtons::RgbLinkButtons(QString str1, QString str2, QWidget *parent,
|
|
|
|
|
PixelParamField *field1, PixelParamField *field2)
|
|
|
|
|
: QWidget(parent), m_field1(field1), m_field2(field2) {
|
|
|
|
|
QString copyButtonStr = tr("Copy RGB : %1 > %2").arg(str1).arg(str2);
|
|
|
|
|
QString swapButtonStr = tr("Swap %1 and %2").arg(str1).arg(str2);
|
|
|
|
|
QPushButton *copyButton = new QPushButton(copyButtonStr, this);
|
|
|
|
|
QPushButton *swapButton = new QPushButton(swapButtonStr, this);
|
|
|
|
|
|
|
|
|
|
copyButton->setFixedHeight(21);
|
|
|
|
|
swapButton->setFixedHeight(21);
|
|
|
|
|
|
|
|
|
|
QHBoxLayout *lay = new QHBoxLayout();
|
|
|
|
|
lay->setMargin(0);
|
|
|
|
|
lay->setSpacing(5);
|
|
|
|
|
{
|
|
|
|
|
lay->addWidget(copyButton, 0);
|
|
|
|
|
lay->addWidget(swapButton, 0);
|
|
|
|
|
lay->addStretch(1);
|
|
|
|
|
}
|
|
|
|
|
setLayout(lay);
|
|
|
|
|
|
|
|
|
|
connect(copyButton, SIGNAL(clicked()), this, SLOT(onCopyButtonClicked()));
|
|
|
|
|
connect(swapButton, SIGNAL(clicked()), this, SLOT(onSwapButtonClicked()));
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2019-09-19 20:19:58 +12:00
|
|
|
|
void RgbLinkButtons::onCopyButtonClicked() {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!m_field1 || !m_field2) return;
|
|
|
|
|
TPixel32 val1 = m_field1->getColor();
|
|
|
|
|
TPixel32 val2 = m_field2->getColor();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2019-09-19 20:19:58 +12:00
|
|
|
|
// keep alpha channel unchanged
|
2016-06-15 18:43:10 +12:00
|
|
|
|
val1.m = val2.m;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (val1 == val2) return;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_field2->setColor(val1);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2019-09-19 20:19:58 +12:00
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
void RgbLinkButtons::onSwapButtonClicked() {
|
|
|
|
|
if (!m_field1 || !m_field2) return;
|
|
|
|
|
TPixel32 val1 = m_field1->getColor();
|
|
|
|
|
TPixel32 val2 = m_field2->getColor();
|
|
|
|
|
|
|
|
|
|
if (val1 == val2) return;
|
|
|
|
|
|
|
|
|
|
TUndoManager::manager()->beginBlock();
|
|
|
|
|
m_field2->setColor(val1);
|
|
|
|
|
m_field1->setColor(val2);
|
|
|
|
|
TUndoManager::manager()->endBlock();
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-19 06:57:51 +13:00
|
|
|
|
//=============================================================================
|
|
|
|
|
// SpectrumParamField
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
SpectrumParamField::SpectrumParamField(QWidget *parent, QString name,
|
2016-06-15 18:43:10 +12:00
|
|
|
|
const TSpectrumParamP ¶m)
|
|
|
|
|
: AnimatedParamField<TSpectrum, TSpectrumParamP>(parent, name, param) {
|
|
|
|
|
QString str;
|
|
|
|
|
m_paramName = str.fromStdString(param->getName());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_spectrumField = new SpectrumField(this);
|
|
|
|
|
m_spectrumField->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
|
|
|
|
|
m_spectrumField->setCurrentKeyIndex(0);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
//--- layout
|
|
|
|
|
m_layout->addWidget(m_keyToggle);
|
|
|
|
|
m_layout->addWidget(m_spectrumField);
|
|
|
|
|
setLayout(m_layout);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
//--- signal-slot connections
|
|
|
|
|
bool ret = true;
|
|
|
|
|
ret = ret && connect(m_spectrumField, SIGNAL(keyColorChanged(bool)), this,
|
|
|
|
|
SLOT(onChange(bool)));
|
|
|
|
|
ret = ret && connect(m_spectrumField, SIGNAL(keyPositionChanged(bool)), this,
|
|
|
|
|
SLOT(onChange(bool)));
|
|
|
|
|
ret = ret && connect(m_spectrumField, SIGNAL(keyAdded(int)), this,
|
|
|
|
|
SLOT(onKeyAdded(int)));
|
|
|
|
|
ret = ret && connect(m_spectrumField, SIGNAL(keyRemoved(int)), this,
|
|
|
|
|
SLOT(onKeyRemoved(int)));
|
|
|
|
|
ret = ret && connect(m_keyToggle, SIGNAL(keyToggled()), SLOT(onKeyToggled()));
|
|
|
|
|
assert(ret);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void SpectrumParamField::updateField(TSpectrum value) {
|
|
|
|
|
if (m_spectrumField->getSpectrum() == value) return;
|
|
|
|
|
m_spectrumField->setSpectrum(value);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void SpectrumParamField::setParams() {
|
|
|
|
|
TSpectrum spectrum = m_spectrumField->getSpectrum();
|
|
|
|
|
// if(m_currentParam->getValue(0) == spectrum) return; //Rivedi quando sistemi
|
|
|
|
|
// lo SwatchViewer
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_currentParam->setValue(m_frame, spectrum);
|
|
|
|
|
if (m_actualParam->isKeyframe(m_frame)) {
|
|
|
|
|
m_actualParam->setValue(m_frame, spectrum);
|
|
|
|
|
emit actualParamChanged();
|
|
|
|
|
} else if (!m_actualParam->hasKeyframes()) {
|
|
|
|
|
m_actualParam->setDefaultValue(spectrum);
|
|
|
|
|
emit actualParamChanged();
|
|
|
|
|
}
|
|
|
|
|
updateKeyToggle();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
emit currentParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void SpectrumParamField::onKeyToggled() { onKeyToggle(); }
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void SpectrumParamField::onChange(bool isDragging) {
|
|
|
|
|
if (isDragging) return;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TSpectrumParamP spectrumParam = m_actualParam;
|
|
|
|
|
TUndo *undo = 0;
|
|
|
|
|
if (spectrumParam &&
|
|
|
|
|
spectrumParam->getValue(m_frame) != m_spectrumField->getSpectrum() &&
|
|
|
|
|
(m_actualParam->isKeyframe(m_frame) ||
|
|
|
|
|
!m_actualParam.getPointer()->hasKeyframes()))
|
|
|
|
|
undo = new SpectrumParamFieldUndo(spectrumParam, m_interfaceName, m_frame,
|
|
|
|
|
ParamField::m_fxHandleStat);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setParams();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (undo) TUndoManager::manager()->add(undo);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void SpectrumParamField::onKeyAdded(int keyIndex) {
|
|
|
|
|
TSpectrum::ColorKey key = m_spectrumField->getSpectrum().getKey(keyIndex);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TSpectrumParamP actualSpectrumParam = m_actualParam;
|
|
|
|
|
assert(actualSpectrumParam);
|
|
|
|
|
actualSpectrumParam->addKey(key.first, key.second);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TSpectrumParamP currentSpectrumParam = m_currentParam;
|
|
|
|
|
assert(currentSpectrumParam);
|
|
|
|
|
currentSpectrumParam->addKey(key.first, key.second);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TUndoManager::manager()->add(new SpectrumParamFieldAddRemoveKeyUndo(
|
|
|
|
|
actualSpectrumParam, currentSpectrumParam, key, keyIndex, true,
|
|
|
|
|
m_interfaceName, ParamField::m_fxHandleStat));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void SpectrumParamField::onKeyRemoved(int keyIndex) {
|
|
|
|
|
TUndo *undo = 0;
|
|
|
|
|
TSpectrumParamP actualSpectrumParam = m_actualParam;
|
|
|
|
|
TSpectrumParamP currentSpectrumParam = m_currentParam;
|
|
|
|
|
if (currentSpectrumParam && actualSpectrumParam) {
|
|
|
|
|
TSpectrum::ColorKey key =
|
|
|
|
|
actualSpectrumParam->getValue(m_frame).getKey(keyIndex);
|
|
|
|
|
undo = new SpectrumParamFieldAddRemoveKeyUndo(
|
|
|
|
|
actualSpectrumParam, currentSpectrumParam, key, keyIndex, false,
|
|
|
|
|
m_interfaceName, ParamField::m_fxHandleStat);
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_currentParam->removeKey(keyIndex);
|
|
|
|
|
m_actualParam->removeKey(keyIndex);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setParams();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (undo) TUndoManager::manager()->add(undo);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2020-07-28 15:16:51 +12:00
|
|
|
|
//=============================================================================
|
|
|
|
|
// Mode Sensitive Box
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
ModeSensitiveBox::ModeSensitiveBox(QWidget *parent,
|
|
|
|
|
ModeChangerParamField *modeChanger,
|
|
|
|
|
QList<int> modes)
|
|
|
|
|
: QWidget(parent), m_modes(modes) {
|
2021-06-07 15:26:20 +12:00
|
|
|
|
m_currentMode = m_modes.first();
|
2020-07-28 15:16:51 +12:00
|
|
|
|
connect(modeChanger, SIGNAL(modeChanged(int)), this,
|
|
|
|
|
SLOT(onModeChanged(int)));
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-07 15:26:20 +12:00
|
|
|
|
ModeSensitiveBox::ModeSensitiveBox(QWidget *parent, QCheckBox *checkBox)
|
|
|
|
|
: QWidget(parent) {
|
|
|
|
|
m_modes << 1;
|
|
|
|
|
connect(
|
|
|
|
|
checkBox, &QCheckBox::stateChanged, this,
|
|
|
|
|
[=]() { onModeChanged(checkBox->isChecked() ? 1 : 0); },
|
|
|
|
|
Qt::AutoConnection);
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-28 15:16:51 +12:00
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
void ModeSensitiveBox::onModeChanged(int modeValue) {
|
2021-06-07 15:26:20 +12:00
|
|
|
|
bool wasVisible = isVisible();
|
|
|
|
|
m_currentMode = modeValue;
|
|
|
|
|
if (wasVisible == m_modes.contains(modeValue)) return;
|
|
|
|
|
setVisible(!wasVisible);
|
|
|
|
|
|
|
|
|
|
ParamsPage *paramsPage = dynamic_cast<ParamsPage *>(parentWidget());
|
|
|
|
|
if (paramsPage) emit paramsPage->preferredPageSizeChanged();
|
2020-07-28 15:16:51 +12:00
|
|
|
|
}
|
|
|
|
|
|
2016-03-19 06:57:51 +13:00
|
|
|
|
//=============================================================================
|
|
|
|
|
// EnumParamField
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
EnumParamField::EnumParamField(QWidget *parent, QString name,
|
|
|
|
|
const TIntEnumParamP ¶m)
|
2020-07-28 15:16:51 +12:00
|
|
|
|
: ModeChangerParamField(parent, name, param) {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
QString str;
|
|
|
|
|
m_paramName = str.fromStdString(param->getName());
|
|
|
|
|
m_om = new QComboBox(this);
|
|
|
|
|
m_om->setFixedHeight(20);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
for (int i = 0; i < param->getItemCount(); i++) {
|
|
|
|
|
int value = 0;
|
|
|
|
|
std::string caption;
|
|
|
|
|
param->getItem(i, value, caption);
|
|
|
|
|
QString str;
|
|
|
|
|
m_om->addItem(str.fromStdString(caption));
|
|
|
|
|
}
|
|
|
|
|
connect(m_om, SIGNAL(activated(const QString &)), this,
|
|
|
|
|
SLOT(onChange(const QString &)));
|
|
|
|
|
m_layout->addWidget(m_om);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_layout->addStretch();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setLayout(m_layout);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void EnumParamField::onChange(const QString &str) {
|
|
|
|
|
TIntEnumParamP intEnumParam = m_actualParam;
|
|
|
|
|
std::string newStdStr = str.toStdString();
|
|
|
|
|
TUndo *undo = 0;
|
|
|
|
|
if (intEnumParam) {
|
|
|
|
|
/*--クリックしただけで実際のカレントアイテムが変わっていない場合はreturn--*/
|
|
|
|
|
std::string oldStr;
|
|
|
|
|
for (int i = 0; i < intEnumParam->getItemCount(); i++) {
|
|
|
|
|
int oldVal;
|
|
|
|
|
intEnumParam->getItem(i, oldVal, oldStr);
|
|
|
|
|
if (oldVal == intEnumParam->getValue()) {
|
|
|
|
|
if (oldStr == newStdStr)
|
|
|
|
|
return;
|
|
|
|
|
else
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
undo = new EnumParamFieldUndo(intEnumParam, oldStr, newStdStr,
|
|
|
|
|
m_interfaceName, ParamField::m_fxHandleStat);
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_currentParam->setValue(newStdStr);
|
|
|
|
|
m_actualParam->setValue(newStdStr);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
emit currentParamChanged();
|
|
|
|
|
emit actualParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2020-07-28 15:16:51 +12:00
|
|
|
|
emit modeChanged(m_actualParam->getValue());
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (undo) TUndoManager::manager()->add(undo);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void EnumParamField::setParam(const TParamP ¤t, const TParamP &actual,
|
|
|
|
|
int frame) {
|
|
|
|
|
m_currentParam = current;
|
|
|
|
|
m_actualParam = actual;
|
|
|
|
|
assert(m_currentParam);
|
|
|
|
|
assert(m_actualParam);
|
|
|
|
|
update(frame);
|
2020-07-28 15:16:51 +12:00
|
|
|
|
emit modeChanged(m_actualParam->getValue());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void EnumParamField::update(int frame) {
|
|
|
|
|
if (!m_actualParam || !m_currentParam) return;
|
|
|
|
|
TIntEnumParamP param = m_actualParam;
|
|
|
|
|
for (int i = 0; i < param->getItemCount(); i++) {
|
|
|
|
|
int value = 0;
|
|
|
|
|
std::string caption;
|
|
|
|
|
param->getItem(i, value, caption);
|
|
|
|
|
if (value != param->getValue()) continue;
|
|
|
|
|
if (m_om->currentIndex() == i) return;
|
|
|
|
|
m_om->setCurrentIndex(i);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
// BoolParamField
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
BoolParamField::BoolParamField(QWidget *parent, QString name,
|
|
|
|
|
const TBoolParamP ¶m)
|
2020-07-28 15:16:51 +12:00
|
|
|
|
: ModeChangerParamField(parent, name, param) {
|
2016-06-15 18:43:10 +12:00
|
|
|
|
QString str;
|
|
|
|
|
m_paramName = str.fromStdString(param->getName());
|
|
|
|
|
if (!param->hasUILabel()) m_interfaceName = name;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_checkBox = new CheckBox("", this);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
/*-- Undo時には反応しないように、toggledでなくclickedにする --*/
|
|
|
|
|
connect(m_checkBox, SIGNAL(clicked(bool)), this, SLOT(onToggled(bool)));
|
|
|
|
|
m_layout->addWidget(m_checkBox);
|
|
|
|
|
m_layout->addStretch();
|
|
|
|
|
setLayout(m_layout);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
/*-- visibleToggleインタフェースのため --*/
|
|
|
|
|
connect(m_checkBox, SIGNAL(toggled(bool)), this, SIGNAL(toggled(bool)));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void BoolParamField::onToggled(bool checked) {
|
|
|
|
|
m_actualParam->setValue(checked);
|
|
|
|
|
m_currentParam->setValue(checked);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
emit currentParamChanged();
|
|
|
|
|
emit actualParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2020-07-28 15:16:51 +12:00
|
|
|
|
emit modeChanged((checked) ? 1 : 0);
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TBoolParamP boolParam = m_actualParam;
|
|
|
|
|
if (boolParam)
|
|
|
|
|
TUndoManager::manager()->add(new BoolParamFieldUndo(
|
|
|
|
|
boolParam, m_interfaceName, ParamField::m_fxHandleStat));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void BoolParamField::setParam(const TParamP ¤t, const TParamP &actual,
|
|
|
|
|
int frame) {
|
|
|
|
|
m_currentParam = current;
|
|
|
|
|
m_actualParam = actual;
|
|
|
|
|
assert(m_currentParam);
|
|
|
|
|
assert(m_actualParam);
|
|
|
|
|
update(frame);
|
2020-07-28 15:16:51 +12:00
|
|
|
|
emit modeChanged((m_actualParam->getValue()) ? 1 : 0);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void BoolParamField::update(int frame) {
|
|
|
|
|
if (!m_actualParam || !m_currentParam) return;
|
|
|
|
|
bool value = m_actualParam->getValue();
|
|
|
|
|
if (m_checkBox->isChecked() == value) return;
|
|
|
|
|
m_checkBox->setChecked(value);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
// IntParamField
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
IntParamField::IntParamField(QWidget *parent, QString name,
|
|
|
|
|
const TIntParamP ¶m)
|
|
|
|
|
: ParamField(parent, name, param) {
|
|
|
|
|
QString str;
|
|
|
|
|
m_paramName = str.fromStdString(param->getName());
|
|
|
|
|
m_intField = new IntField(this, false);
|
|
|
|
|
m_intField->setMaximumWidth(43);
|
|
|
|
|
m_intField->enableSlider(false);
|
|
|
|
|
m_intField->enableRoller(param->isWheelEnabled());
|
|
|
|
|
int min, max;
|
|
|
|
|
param->getValueRange(min, max);
|
|
|
|
|
assert(min < max);
|
|
|
|
|
m_intField->setRange(min, max);
|
|
|
|
|
connect(m_intField, SIGNAL(valueChanged(bool)), SLOT(onChange(bool)));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_layout->addWidget(m_intField);
|
|
|
|
|
m_layout->addStretch();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setLayout(m_layout);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void IntParamField::onChange(bool isDragging) {
|
|
|
|
|
if (isDragging) return;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
int value = m_intField->getValue();
|
|
|
|
|
int min, max;
|
|
|
|
|
m_intField->getRange(min, max);
|
|
|
|
|
if (value > max)
|
|
|
|
|
value = max;
|
|
|
|
|
else if (value < min)
|
|
|
|
|
value = min;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TUndo *undo = 0;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TIntParamP intParam = m_actualParam;
|
|
|
|
|
if (intParam && intParam->getValue() != value)
|
|
|
|
|
undo = new IntParamFieldUndo(intParam, m_interfaceName,
|
|
|
|
|
ParamField::m_fxHandleStat);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_actualParam->setValue(value);
|
|
|
|
|
emit currentParamChanged();
|
|
|
|
|
m_currentParam->setValue(value);
|
|
|
|
|
emit actualParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (undo) TUndoManager::manager()->add(undo);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void IntParamField::setParam(const TParamP ¤t, const TParamP &actual,
|
|
|
|
|
int frame) {
|
|
|
|
|
m_currentParam = current;
|
|
|
|
|
m_actualParam = actual;
|
|
|
|
|
assert(m_currentParam);
|
|
|
|
|
assert(m_actualParam);
|
|
|
|
|
update(frame);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void IntParamField::update(int frame) {
|
|
|
|
|
if (!m_actualParam || !m_currentParam) return;
|
|
|
|
|
int value = m_actualParam->getValue();
|
|
|
|
|
if (m_intField->getValue() == value) return;
|
|
|
|
|
m_intField->setValue(value);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
// StringParamField
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2018-12-18 18:55:22 +13:00
|
|
|
|
namespace component {
|
|
|
|
|
|
|
|
|
|
void MyTextEdit::keyPressEvent(QKeyEvent *event) {
|
|
|
|
|
QTextEdit::keyPressEvent(event);
|
|
|
|
|
if (event->key() == Qt::Key_Return) emit edited();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MyTextEdit::focusOutEvent(QFocusEvent *event) {
|
|
|
|
|
QTextEdit::focusOutEvent(event);
|
|
|
|
|
emit edited();
|
|
|
|
|
}
|
2019-09-19 20:19:58 +12:00
|
|
|
|
}; // namespace component
|
2018-12-18 18:55:22 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
StringParamField::StringParamField(QWidget *parent, QString name,
|
|
|
|
|
const TStringParamP ¶m)
|
|
|
|
|
: ParamField(parent, name, param) {
|
|
|
|
|
QString str;
|
|
|
|
|
m_paramName = str.fromStdString(param->getName());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2018-12-18 18:55:22 +13:00
|
|
|
|
bool ret = true;
|
|
|
|
|
if (param->isMultiLineEnabled()) {
|
|
|
|
|
m_multiTextFld = new component::MyTextEdit(name, this);
|
|
|
|
|
m_multiTextFld->setFixedHeight(80);
|
|
|
|
|
m_multiTextFld->setAcceptRichText(false);
|
|
|
|
|
m_multiTextFld->setStyleSheet(
|
|
|
|
|
"background:white;\ncolor:black;\nborder:1 solid black;");
|
|
|
|
|
ret = ret &&
|
|
|
|
|
connect(m_multiTextFld, SIGNAL(edited()), this, SLOT(onChange()));
|
|
|
|
|
m_layout->addWidget(m_multiTextFld);
|
|
|
|
|
} else {
|
|
|
|
|
m_textFld = new LineEdit(name, this);
|
|
|
|
|
m_textFld->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
|
|
|
|
|
ret = ret &&
|
|
|
|
|
connect(m_textFld, SIGNAL(editingFinished()), this, SLOT(onChange()));
|
|
|
|
|
m_layout->addWidget(m_textFld);
|
|
|
|
|
}
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setLayout(m_layout);
|
|
|
|
|
assert(ret);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void StringParamField::onChange() {
|
2018-12-18 18:55:22 +13:00
|
|
|
|
std::wstring value;
|
|
|
|
|
if (m_multiTextFld)
|
|
|
|
|
value = m_multiTextFld->toPlainText().toStdWString();
|
|
|
|
|
else
|
2020-10-14 17:36:42 +13:00
|
|
|
|
value = m_textFld->text().toStdWString();
|
2018-12-18 18:55:22 +13:00
|
|
|
|
TUndo *undo = 0;
|
|
|
|
|
|
|
|
|
|
if (!m_actualParam || m_actualParam->getValue() == value) return;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2018-12-18 18:55:22 +13:00
|
|
|
|
if (m_actualParam->getValue() != value)
|
|
|
|
|
undo = new StringParamFieldUndo(m_actualParam, m_interfaceName,
|
2016-06-15 18:43:10 +12:00
|
|
|
|
ParamField::m_fxHandleStat);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_actualParam->setValue(value);
|
|
|
|
|
m_currentParam->setValue(value);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
emit currentParamChanged();
|
|
|
|
|
emit actualParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (undo) TUndoManager::manager()->add(undo);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void StringParamField::setParam(const TParamP ¤t, const TParamP &actual,
|
|
|
|
|
int frame) {
|
|
|
|
|
m_currentParam = current;
|
|
|
|
|
m_actualParam = actual;
|
|
|
|
|
assert(m_currentParam);
|
|
|
|
|
assert(m_actualParam);
|
|
|
|
|
update(frame);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void StringParamField::update(int frame) {
|
|
|
|
|
if (!m_actualParam || !m_currentParam) return;
|
|
|
|
|
QString str;
|
|
|
|
|
QString strValue = str.fromStdWString(m_actualParam->getValue());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2018-12-18 18:55:22 +13:00
|
|
|
|
if (m_textFld) {
|
|
|
|
|
if (m_textFld->text() == strValue) return;
|
|
|
|
|
m_textFld->setText(strValue);
|
|
|
|
|
|
|
|
|
|
// Faccio in modo che il cursore sia sulla prima cifra, cosi' se la stringa
|
|
|
|
|
// da visualizzare e' piu' lunga del campo le cifre che vengono troncate
|
|
|
|
|
// sono
|
|
|
|
|
// le ultime e non le prime (dovrebbero essere quelle dopo la virgola).
|
|
|
|
|
m_textFld->setCursorPosition(0);
|
|
|
|
|
} else {
|
|
|
|
|
if (m_multiTextFld->toPlainText() == strValue) return;
|
|
|
|
|
m_multiTextFld->setPlainText(strValue);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
// FontParamField
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
FontParamField::FontParamField(QWidget *parent, QString name,
|
|
|
|
|
const TFontParamP ¶m)
|
|
|
|
|
: ParamField(parent, name, param) {
|
|
|
|
|
m_paramName = QString::fromStdString(param->getName());
|
|
|
|
|
|
|
|
|
|
m_fontCombo = new QFontComboBox(this);
|
|
|
|
|
m_styleCombo = new QComboBox(this);
|
|
|
|
|
m_sizeField = new IntField(this, false);
|
|
|
|
|
|
|
|
|
|
m_sizeField->setRange(1, 500);
|
|
|
|
|
m_sizeField->enableSlider(false);
|
|
|
|
|
|
|
|
|
|
m_layout->addWidget(m_fontCombo);
|
|
|
|
|
m_layout->addSpacing(5);
|
|
|
|
|
m_layout->addWidget(new QLabel(tr("Style:"), this), 0,
|
|
|
|
|
Qt::AlignRight | Qt::AlignVCenter);
|
|
|
|
|
m_layout->addWidget(m_styleCombo);
|
|
|
|
|
m_layout->addSpacing(5);
|
|
|
|
|
m_layout->addWidget(new QLabel(tr("Size:"), this), 0,
|
|
|
|
|
Qt::AlignRight | Qt::AlignVCenter);
|
|
|
|
|
m_layout->addWidget(m_sizeField);
|
|
|
|
|
|
|
|
|
|
m_layout->addStretch();
|
|
|
|
|
|
|
|
|
|
setLayout(m_layout);
|
|
|
|
|
|
|
|
|
|
bool ret = true;
|
2020-10-14 17:36:42 +13:00
|
|
|
|
ret = ret && connect(m_fontCombo, SIGNAL(activated(const QString &)), this,
|
|
|
|
|
SLOT(onChange()));
|
2018-12-18 18:55:22 +13:00
|
|
|
|
ret = ret && connect(m_styleCombo, SIGNAL(activated(const QString &)), this,
|
|
|
|
|
SLOT(onChange()));
|
|
|
|
|
ret = ret && connect(m_sizeField, SIGNAL(valueChanged(bool)), this,
|
|
|
|
|
SLOT(onSizeChange(bool)));
|
|
|
|
|
assert(ret);
|
|
|
|
|
|
|
|
|
|
findStyles(m_fontCombo->currentFont());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
void FontParamField::findStyles(const QFont &font) {
|
|
|
|
|
QFontDatabase fontDatabase;
|
|
|
|
|
QString currentItem = m_styleCombo->currentText();
|
|
|
|
|
m_styleCombo->clear();
|
|
|
|
|
|
2019-02-20 20:31:03 +13:00
|
|
|
|
for (const QString &style : fontDatabase.styles(font.family()))
|
2018-12-18 18:55:22 +13:00
|
|
|
|
m_styleCombo->addItem(style);
|
|
|
|
|
|
|
|
|
|
int styleIndex = m_styleCombo->findText(currentItem);
|
|
|
|
|
|
|
|
|
|
if (styleIndex == -1)
|
|
|
|
|
m_styleCombo->setCurrentIndex(0);
|
|
|
|
|
else
|
|
|
|
|
m_styleCombo->setCurrentIndex(styleIndex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
void FontParamField::onSizeChange(bool isDragging) {
|
|
|
|
|
if (isDragging) return;
|
|
|
|
|
onChange();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
void FontParamField::onChange() {
|
|
|
|
|
QString family = m_fontCombo->currentFont().family();
|
|
|
|
|
|
2020-10-14 17:36:42 +13:00
|
|
|
|
TFontParamP fontParam = m_actualParam;
|
|
|
|
|
QFont currentFont;
|
|
|
|
|
currentFont.fromString(QString::fromStdWString(fontParam->getValue()));
|
|
|
|
|
if (family != currentFont.family()) {
|
|
|
|
|
findStyles(QFont(family));
|
|
|
|
|
}
|
|
|
|
|
QString style = m_styleCombo->currentText();
|
|
|
|
|
int size = m_sizeField->getValue();
|
2018-12-18 18:55:22 +13:00
|
|
|
|
int min, max;
|
|
|
|
|
m_sizeField->getRange(min, max);
|
|
|
|
|
if (size < min) size = min;
|
|
|
|
|
|
|
|
|
|
QFontDatabase fontDatabase;
|
|
|
|
|
QFont font = fontDatabase.font(family, style, 10);
|
|
|
|
|
font.setPixelSize(size);
|
|
|
|
|
|
|
|
|
|
TUndo *undo = 0;
|
|
|
|
|
|
|
|
|
|
if (fontParam && currentFont != font)
|
|
|
|
|
undo = new FontParamFieldUndo(fontParam, m_interfaceName,
|
|
|
|
|
ParamField::m_fxHandleStat);
|
|
|
|
|
|
|
|
|
|
m_actualParam->setValue(font.toString().toStdWString());
|
|
|
|
|
emit currentParamChanged();
|
|
|
|
|
m_currentParam->setValue(font.toString().toStdWString());
|
|
|
|
|
emit actualParamChanged();
|
|
|
|
|
|
|
|
|
|
if (undo) TUndoManager::manager()->add(undo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
void FontParamField::setParam(const TParamP ¤t, const TParamP &actual,
|
|
|
|
|
int frame) {
|
|
|
|
|
m_currentParam = current;
|
|
|
|
|
m_actualParam = actual;
|
|
|
|
|
assert(m_currentParam);
|
|
|
|
|
assert(m_actualParam);
|
|
|
|
|
update(frame);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
void FontParamField::update(int frame) {
|
|
|
|
|
if (!m_actualParam || !m_currentParam) return;
|
|
|
|
|
QFont font;
|
|
|
|
|
font.fromString(QString::fromStdWString(m_actualParam->getValue()));
|
2020-10-14 17:36:42 +13:00
|
|
|
|
if (m_fontCombo->currentText() != font.family()) {
|
2018-12-18 18:55:22 +13:00
|
|
|
|
m_fontCombo->setCurrentFont(font);
|
2020-10-14 17:36:42 +13:00
|
|
|
|
findStyles(font);
|
|
|
|
|
}
|
2018-12-18 18:55:22 +13:00
|
|
|
|
m_styleCombo->setCurrentText(font.styleName());
|
|
|
|
|
m_sizeField->setValue(font.pixelSize());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
// ToneCurveParamField
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
ToneCurveParamField::ToneCurveParamField(QWidget *parent, QString name,
|
|
|
|
|
const TToneCurveParamP ¶m)
|
|
|
|
|
: AnimatedParamField<const QList<TPointD>, TToneCurveParamP>(parent, name,
|
|
|
|
|
param, false) {
|
|
|
|
|
QString str;
|
|
|
|
|
m_paramName = str.fromStdString(param->getName());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
ParamsPage *paramsPage = dynamic_cast<ParamsPage *>(parent);
|
|
|
|
|
FxHistogramRender *fxHistogramRender =
|
|
|
|
|
(paramsPage) ? paramsPage->getFxHistogramRender() : 0;
|
|
|
|
|
m_toneCurveField = new ToneCurveField(this, fxHistogramRender);
|
|
|
|
|
m_toneCurveField->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
//--- layout
|
|
|
|
|
m_layout->addWidget(m_keyToggle);
|
|
|
|
|
m_layout->addWidget(m_toneCurveField);
|
|
|
|
|
m_layout->addStretch();
|
|
|
|
|
setLayout(m_layout);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
connect(m_keyToggle, SIGNAL(keyToggled()), SLOT(onKeyToggled()));
|
|
|
|
|
connect(m_toneCurveField, SIGNAL(currentChannelIndexChanged(int)),
|
|
|
|
|
SLOT(onChannelChanged(int)));
|
2020-03-16 14:37:10 +13:00
|
|
|
|
// on enlarged, make the ParamPageSet to recompute the preferred size
|
|
|
|
|
if (paramsPage)
|
|
|
|
|
connect(m_toneCurveField, SIGNAL(sizeChanged()), paramsPage,
|
|
|
|
|
SIGNAL(preferredPageSizeChanged()));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
int i;
|
|
|
|
|
for (i = 0; i < m_toneCurveField->getChannelCount(); i++) {
|
|
|
|
|
ChennelCurveEditor *c = m_toneCurveField->getChannelEditor(i);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
connect(c, SIGNAL(controlPointChanged(bool)), this, SLOT(onChange(bool)));
|
|
|
|
|
connect(c, SIGNAL(controlPointAdded(int)), this, SLOT(onPointAdded(int)));
|
|
|
|
|
connect(c, SIGNAL(controlPointRemoved(int)), this,
|
|
|
|
|
SLOT(onPointRemoved(int)));
|
|
|
|
|
}
|
|
|
|
|
connect(m_toneCurveField, SIGNAL(isLinearChanged(bool)), this,
|
|
|
|
|
SLOT(onIsLinearChanged(bool)));
|
|
|
|
|
updateField(param->getValue(0));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void ToneCurveParamField::updateField(const QList<TPointD> value) {
|
|
|
|
|
if (m_actualParam) {
|
2020-10-14 17:36:42 +13:00
|
|
|
|
assert(m_currentParam && m_currentParam->getCurrentChannel() ==
|
|
|
|
|
m_actualParam->getCurrentChannel());
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_toneCurveField->setCurrentChannel(m_actualParam->getCurrentChannel());
|
|
|
|
|
assert(m_currentParam &&
|
|
|
|
|
m_currentParam->isLinear() == m_actualParam->isLinear());
|
|
|
|
|
m_toneCurveField->setIsLinearCheckBox(m_actualParam->isLinear());
|
|
|
|
|
}
|
|
|
|
|
m_toneCurveField->getCurrentChannelEditor()->setPoints(value);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void ToneCurveParamField::setParams() {
|
|
|
|
|
QList<TPointD> value =
|
|
|
|
|
m_toneCurveField->getCurrentChannelEditor()->getPoints();
|
|
|
|
|
m_currentParam->setValue(m_frame, value);
|
|
|
|
|
if (m_actualParam->isKeyframe(m_frame)) {
|
|
|
|
|
m_actualParam->setValue(m_frame, value);
|
|
|
|
|
emit actualParamChanged();
|
|
|
|
|
} else if (!m_actualParam->hasKeyframes()) {
|
|
|
|
|
m_actualParam->setDefaultValue(value);
|
|
|
|
|
emit actualParamChanged();
|
|
|
|
|
}
|
|
|
|
|
updateKeyToggle();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
emit currentParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2021-07-09 00:01:18 +12:00
|
|
|
|
QSize ToneCurveParamField::getPreferredSize() {
|
2020-03-16 14:37:10 +13:00
|
|
|
|
if (m_toneCurveField->isEnlarged())
|
|
|
|
|
return QSize(676, 640);
|
|
|
|
|
else
|
|
|
|
|
return QSize(420, 384);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void ToneCurveParamField::onChannelChanged(int channel) {
|
|
|
|
|
if (m_actualParam->getCurrentChannel() ==
|
|
|
|
|
TToneCurveParam::ToneChannel(channel)) {
|
|
|
|
|
assert(m_currentParam->getCurrentChannel() ==
|
|
|
|
|
TToneCurveParam::ToneChannel(channel));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
m_currentParam->setCurrentChannel(TToneCurveParam::ToneChannel(channel));
|
|
|
|
|
m_actualParam->setCurrentChannel(TToneCurveParam::ToneChannel(channel));
|
|
|
|
|
updateField(m_currentParam->getValue(m_frame));
|
|
|
|
|
updateKeyToggle();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
emit currentParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void ToneCurveParamField::onChange(bool isDragging) {
|
|
|
|
|
if (isDragging) return;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TToneCurveParamP toneCurveParam = m_actualParam;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TUndo *undo = 0;
|
|
|
|
|
/*--- Undoを登録する条件:
|
|
|
|
|
値が変更されていて
|
|
|
|
|
キーフレーム上か、または、まだキーフレームが無い
|
|
|
|
|
(すなわち、実際にシーンの情報を変えることになる)場合
|
|
|
|
|
---*/
|
|
|
|
|
if (toneCurveParam &&
|
|
|
|
|
toneCurveParam->getValue(m_frame) !=
|
|
|
|
|
m_toneCurveField->getCurrentChannelEditor()->getPoints() &&
|
|
|
|
|
(m_actualParam->isKeyframe(m_frame) ||
|
|
|
|
|
!m_actualParam.getPointer()->hasKeyframes()))
|
|
|
|
|
undo = new ToneCurveParamFieldUndo(toneCurveParam, m_interfaceName, m_frame,
|
|
|
|
|
ParamField::m_fxHandleStat);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setParams();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (undo) TUndoManager::manager()->add(undo);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void ToneCurveParamField::onPointAdded(int index) {
|
|
|
|
|
QList<TPointD> value =
|
|
|
|
|
m_toneCurveField->getCurrentChannelEditor()->getPoints();
|
|
|
|
|
m_currentParam->addValue(0, value, index);
|
|
|
|
|
m_actualParam->addValue(0, value, index);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
emit actualParamChanged();
|
|
|
|
|
emit currentParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TToneCurveParamP toneCurveActualParam = m_actualParam;
|
|
|
|
|
TToneCurveParamP toneCurveCurrentParam = m_currentParam;
|
|
|
|
|
if (toneCurveActualParam && toneCurveCurrentParam)
|
|
|
|
|
TUndoManager::manager()->add(new ToneCurveParamFieldAddRemovePointUndo(
|
|
|
|
|
toneCurveActualParam, toneCurveCurrentParam, value, index, true,
|
|
|
|
|
m_interfaceName, ParamField::m_fxHandleStat));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void ToneCurveParamField::onPointRemoved(int index) {
|
|
|
|
|
TToneCurveParamP toneCurveActualParam = m_actualParam;
|
|
|
|
|
TToneCurveParamP toneCurveCurrentParam = m_currentParam;
|
|
|
|
|
if (toneCurveActualParam && toneCurveCurrentParam) {
|
|
|
|
|
QList<TPointD> value =
|
|
|
|
|
m_toneCurveField->getCurrentChannelEditor()->getPoints();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TUndoManager::manager()->add(new ToneCurveParamFieldAddRemovePointUndo(
|
|
|
|
|
toneCurveActualParam, toneCurveCurrentParam, value, index, false,
|
|
|
|
|
m_interfaceName, ParamField::m_fxHandleStat));
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_currentParam->removeValue(0, index);
|
|
|
|
|
m_actualParam->removeValue(0, index);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
emit currentParamChanged();
|
|
|
|
|
emit actualParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void ToneCurveParamField::onIsLinearChanged(bool isLinear) {
|
|
|
|
|
m_currentParam->setIsLinear(isLinear);
|
|
|
|
|
m_actualParam->setIsLinear(isLinear);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
emit actualParamChanged();
|
|
|
|
|
emit currentParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
TToneCurveParamP toneCurveActualParam = m_actualParam;
|
|
|
|
|
TToneCurveParamP toneCurveCurrentParam = m_currentParam;
|
|
|
|
|
if (toneCurveActualParam && toneCurveCurrentParam)
|
|
|
|
|
TUndoManager::manager()->add(new ToneCurveParamFieldToggleLinearUndo(
|
|
|
|
|
toneCurveActualParam, toneCurveCurrentParam, m_interfaceName,
|
|
|
|
|
ParamField::m_fxHandleStat));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void ToneCurveParamField::onKeyToggled() { onKeyToggle(); }
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
// ParamField::create()
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
ParamField *ParamField::create(QWidget *parent, QString name,
|
|
|
|
|
const TParamP ¶m) {
|
|
|
|
|
if (TDoubleParamP doubleParam = param)
|
|
|
|
|
return new MeasuredDoubleParamField(parent, name, doubleParam);
|
|
|
|
|
else if (TRangeParamP rangeParam = param)
|
|
|
|
|
return new MeasuredRangeParamField(parent, name, rangeParam);
|
|
|
|
|
else if (TPixelParamP pixelParam = param)
|
|
|
|
|
return new PixelParamField(parent, name, pixelParam);
|
|
|
|
|
else if (TPointParamP pointParam = param)
|
|
|
|
|
return new PointParamField(parent, name, pointParam);
|
|
|
|
|
else if (TIntEnumParamP enumParam = param)
|
|
|
|
|
return new EnumParamField(parent, name, enumParam);
|
|
|
|
|
else if (TIntParamP intParam = param)
|
|
|
|
|
return new IntParamField(parent, name, intParam);
|
|
|
|
|
else if (TBoolParamP boolParam = param)
|
|
|
|
|
return new BoolParamField(parent, name, boolParam);
|
|
|
|
|
else if (TSpectrumParamP spectrumParam = param)
|
|
|
|
|
return new SpectrumParamField(parent, name, spectrumParam);
|
|
|
|
|
else if (TStringParamP stringParam = param)
|
|
|
|
|
return new StringParamField(parent, name, stringParam);
|
|
|
|
|
else if (TToneCurveParamP toneCurveParam = param)
|
|
|
|
|
return new ToneCurveParamField(parent, name, toneCurveParam);
|
2018-12-18 18:55:22 +13:00
|
|
|
|
else if (TFontParamP fontParam = param)
|
|
|
|
|
return new FontParamField(parent, name, fontParam);
|
2016-06-15 18:43:10 +12:00
|
|
|
|
else
|
|
|
|
|
return 0;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
// Custom Components
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
#include <sstream>
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
namespace component {
|
2016-03-19 06:57:51 +13:00
|
|
|
|
//
|
|
|
|
|
// LineEdit_double
|
|
|
|
|
//
|
2016-06-15 18:43:10 +12:00
|
|
|
|
LineEdit_double::LineEdit_double(QWidget *parent, QString name,
|
|
|
|
|
TDoubleParamP const ¶m)
|
|
|
|
|
: ParamField(parent, name, param), frame_(0) {
|
|
|
|
|
m_paramName = QString::fromStdString(param->getName());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_ = new QLineEdit(this);
|
|
|
|
|
value_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
|
|
|
|
|
value_->setText(QString::number(param->getValue(0)));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
connect(value_, SIGNAL(textChanged(QString const &)), this,
|
|
|
|
|
SLOT(update_value(QString const &)));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_layout->addWidget(value_);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setLayout(m_layout);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void LineEdit_double::setParam(TParamP const ¤t, TParamP const &actual,
|
|
|
|
|
int frame) {
|
|
|
|
|
current_ = current;
|
|
|
|
|
actual_ = actual;
|
|
|
|
|
update(frame);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void LineEdit_double::update(int frame) {
|
|
|
|
|
frame_ = frame;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!actual_ || !current_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
const double value = actual_->getValue(frame);
|
|
|
|
|
if (value == value_->text().toDouble()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_->setText(QString::number(value));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void LineEdit_double::update_value(QString const &text) {
|
|
|
|
|
const double value = text.toDouble();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
current_->setValue(frame_, value);
|
|
|
|
|
emit currentParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
actual_->setValue(frame_, value);
|
|
|
|
|
emit actualParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Slider_double
|
|
|
|
|
//
|
2016-06-15 18:43:10 +12:00
|
|
|
|
Slider_double::Slider_double(QWidget *parent, QString name,
|
|
|
|
|
TDoubleParamP const ¶m)
|
|
|
|
|
: ParamField(parent, name, param) {
|
|
|
|
|
m_paramName = QString::fromStdString(param->getName());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_ = new QSlider(Qt::Horizontal, this);
|
|
|
|
|
value_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
|
|
|
|
|
value_->setValue(param->getValue(0));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
double minvalue;
|
|
|
|
|
double maxvalue;
|
|
|
|
|
double valuestep;
|
|
|
|
|
if (param->getValueRange(minvalue, maxvalue, valuestep)) {
|
|
|
|
|
value_->setRange(minvalue * 100, maxvalue * 100);
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
connect(value_, SIGNAL(valueChanged(int)), this, SLOT(update_value(int)));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_layout->addWidget(value_);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setLayout(m_layout);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void Slider_double::setParam(TParamP const ¤t, TParamP const &actual,
|
|
|
|
|
int frame) {
|
|
|
|
|
current_ = current;
|
|
|
|
|
actual_ = actual;
|
|
|
|
|
update(frame);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void Slider_double::update(int frame) {
|
|
|
|
|
frame_ = frame;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!actual_ || !current_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
const double value = actual_->getValue(frame);
|
|
|
|
|
if (value == value_->value() / 100.0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_->setValue(value * 100);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void Slider_double::update_value(int slider_value) {
|
|
|
|
|
const double value = slider_value / 100.0;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
current_->setValue(frame_, value);
|
|
|
|
|
emit currentParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
actual_->setValue(frame_, value);
|
|
|
|
|
emit actualParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// SpinBox_double
|
|
|
|
|
//
|
2016-06-15 18:43:10 +12:00
|
|
|
|
SpinBox_double::SpinBox_double(QWidget *parent, QString name,
|
|
|
|
|
TDoubleParamP const ¶m)
|
|
|
|
|
: ParamField(parent, name, param) {
|
|
|
|
|
m_paramName = QString::fromStdString(param->getName());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_ = new QDoubleSpinBox(this);
|
|
|
|
|
value_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
double minvalue;
|
|
|
|
|
double maxvalue;
|
|
|
|
|
double valuestep;
|
|
|
|
|
if (param->getValueRange(minvalue, maxvalue, valuestep)) {
|
|
|
|
|
value_->setRange(minvalue, maxvalue);
|
|
|
|
|
value_->setSingleStep(valuestep / 100.0);
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
connect(value_, SIGNAL(valueChanged(double)), this,
|
|
|
|
|
SLOT(update_value(double)));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_layout->addWidget(value_);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setLayout(m_layout);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void SpinBox_double::setParam(TParamP const ¤t, TParamP const &actual,
|
|
|
|
|
int frame) {
|
|
|
|
|
current_ = current;
|
|
|
|
|
actual_ = actual;
|
|
|
|
|
update(frame);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void SpinBox_double::update(int frame) {
|
|
|
|
|
frame_ = frame;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!actual_ || !current_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
const double value = actual_->getValue(frame);
|
|
|
|
|
if (value == value_->value()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_->setValue(value);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void SpinBox_double::update_value(double value) {
|
|
|
|
|
current_->setValue(frame_, value);
|
|
|
|
|
emit currentParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
actual_->setValue(frame_, value);
|
|
|
|
|
emit actualParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
2016-06-15 18:43:10 +12:00
|
|
|
|
} // end of namespace component
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
namespace component {
|
2016-03-19 06:57:51 +13:00
|
|
|
|
//
|
|
|
|
|
// LineEdit_int
|
|
|
|
|
//
|
2016-06-15 18:43:10 +12:00
|
|
|
|
LineEdit_int::LineEdit_int(QWidget *parent, QString name,
|
|
|
|
|
TIntParamP const ¶m)
|
|
|
|
|
: ParamField(parent, name, param) {
|
|
|
|
|
m_paramName = QString::fromStdString(param->getName());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_ = new QLineEdit(this);
|
|
|
|
|
value_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
|
|
|
|
|
value_->setText(QString::number(param->getValue()));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
connect(value_, SIGNAL(textChanged(QString const &)), this,
|
|
|
|
|
SLOT(update_value(QString const &)));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_layout->addWidget(value_);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setLayout(m_layout);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void LineEdit_int::setParam(TParamP const ¤t, TParamP const &actual,
|
|
|
|
|
int frame) {
|
|
|
|
|
current_ = current;
|
|
|
|
|
actual_ = actual;
|
|
|
|
|
update(frame);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void LineEdit_int::update(int frame) {
|
|
|
|
|
frame_ = frame;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!actual_ || !current_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
const int value = actual_->getValue();
|
|
|
|
|
if (value == value_->text().toInt()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_->setText(QString::number(value));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void LineEdit_int::update_value(QString const &text) {
|
|
|
|
|
const int value = text.toInt();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
current_->setValue(value);
|
|
|
|
|
emit currentParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
actual_->setValue(value);
|
|
|
|
|
emit actualParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Slider_int
|
|
|
|
|
//
|
|
|
|
|
Slider_int::Slider_int(QWidget *parent, QString name, TIntParamP const ¶m)
|
2016-06-15 18:43:10 +12:00
|
|
|
|
: ParamField(parent, name, param) {
|
|
|
|
|
m_paramName = QString::fromStdString(param->getName());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_ = new QSlider(Qt::Horizontal, this);
|
|
|
|
|
value_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
|
|
|
|
|
value_->setValue(param->getValue());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
int minvalue;
|
|
|
|
|
int maxvalue;
|
|
|
|
|
if (param->getValueRange(minvalue, maxvalue)) {
|
|
|
|
|
value_->setRange(minvalue, maxvalue);
|
|
|
|
|
} else {
|
|
|
|
|
value_->setRange(0, 100);
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
connect(value_, SIGNAL(valueChanged(int)), this, SLOT(update_value(int)));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_layout->addWidget(value_);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setLayout(m_layout);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void Slider_int::setParam(TParamP const ¤t, TParamP const &actual,
|
|
|
|
|
int frame) {
|
|
|
|
|
current_ = current;
|
|
|
|
|
actual_ = actual;
|
|
|
|
|
update(frame);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void Slider_int::update(int frame) {
|
|
|
|
|
frame_ = frame;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!actual_ || !current_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
const int value = actual_->getValue();
|
|
|
|
|
if (value == value_->value()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_->setValue(value);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void Slider_int::update_value(int value) {
|
|
|
|
|
current_->setValue(value);
|
|
|
|
|
emit currentParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
actual_->setValue(value);
|
|
|
|
|
emit actualParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// SpinBox_int
|
|
|
|
|
//
|
|
|
|
|
SpinBox_int::SpinBox_int(QWidget *parent, QString name, TIntParamP const ¶m)
|
2016-06-15 18:43:10 +12:00
|
|
|
|
: ParamField(parent, name, param) {
|
|
|
|
|
m_paramName = QString::fromStdString(param->getName());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_ = new QSpinBox(this);
|
|
|
|
|
value_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
int minvalue;
|
|
|
|
|
int maxvalue;
|
|
|
|
|
if (param->getValueRange(minvalue, maxvalue)) {
|
|
|
|
|
value_->setRange(minvalue, maxvalue);
|
|
|
|
|
} else {
|
|
|
|
|
value_->setRange(0, 100);
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
connect(value_, SIGNAL(valueChanged(int)), this, SLOT(update_value(int)));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_layout->addWidget(value_);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setLayout(m_layout);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void SpinBox_int::setParam(TParamP const ¤t, TParamP const &actual,
|
|
|
|
|
int frame) {
|
|
|
|
|
current_ = current;
|
|
|
|
|
actual_ = actual;
|
|
|
|
|
update(frame);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void SpinBox_int::update(int frame) {
|
|
|
|
|
frame_ = frame;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!actual_ || !current_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
const int value = actual_->getValue();
|
|
|
|
|
if (value == value_->value()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_->setValue(value);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void SpinBox_int::update_value(int value) {
|
|
|
|
|
current_->setValue(value);
|
|
|
|
|
emit currentParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
actual_->setValue(value);
|
|
|
|
|
emit actualParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
2016-06-15 18:43:10 +12:00
|
|
|
|
} // end of namespace component
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
namespace component {
|
2016-03-19 06:57:51 +13:00
|
|
|
|
//
|
|
|
|
|
// CheckBox_bool
|
|
|
|
|
//
|
2016-06-15 18:43:10 +12:00
|
|
|
|
CheckBox_bool::CheckBox_bool(QWidget *parent, QString name,
|
|
|
|
|
TBoolParamP const ¶m)
|
|
|
|
|
: ParamField(parent, name, param) {
|
|
|
|
|
m_paramName = QString::fromStdString(param->getName());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_ = new QCheckBox(this);
|
|
|
|
|
value_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
connect(value_, SIGNAL(stateChanged(int)), this, SLOT(update_value(int)));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_layout->addWidget(value_);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setLayout(m_layout);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void CheckBox_bool::setParam(TParamP const ¤t, TParamP const &actual,
|
|
|
|
|
int frame) {
|
|
|
|
|
current_ = current;
|
|
|
|
|
actual_ = actual;
|
|
|
|
|
update(frame);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void CheckBox_bool::update(int frame) {
|
|
|
|
|
frame_ = frame;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!actual_ || !current_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
bool const value = actual_->getValue();
|
|
|
|
|
if (value == (value_->checkState() != Qt::Unchecked)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_->setCheckState(value ? Qt::Checked : Qt::Unchecked);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void CheckBox_bool::update_value(int checkbox_value) {
|
|
|
|
|
bool const value = checkbox_value != Qt::Unchecked;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
current_->setValue(value);
|
|
|
|
|
emit currentParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
actual_->setValue(value);
|
|
|
|
|
emit actualParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
2016-06-15 18:43:10 +12:00
|
|
|
|
} // end of namespace component
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
namespace component {
|
2016-03-19 06:57:51 +13:00
|
|
|
|
//
|
|
|
|
|
// RadioButton_enum
|
|
|
|
|
//
|
2016-06-15 18:43:10 +12:00
|
|
|
|
RadioButton_enum::RadioButton_enum(QWidget *parent, QString name,
|
|
|
|
|
TIntEnumParamP const ¶m)
|
|
|
|
|
: ParamField(parent, name, param) {
|
|
|
|
|
m_paramName = QString::fromStdString(param->getName());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_ = new QButtonGroup(this);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
for (int i = 0, count = param->getItemCount(); i < count; i++) {
|
|
|
|
|
int item;
|
|
|
|
|
std::string caption;
|
|
|
|
|
param->getItem(i, item, caption);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
QRadioButton *button = new QRadioButton(caption.c_str(), this);
|
|
|
|
|
button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
|
|
|
|
|
value_->addButton(button, item);
|
|
|
|
|
m_layout->addWidget(button);
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
connect(value_, SIGNAL(buttonClicked(int)), this, SLOT(update_value(int)));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setLayout(m_layout);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void RadioButton_enum::setParam(TParamP const ¤t, TParamP const &actual,
|
|
|
|
|
int frame) {
|
|
|
|
|
current_ = current;
|
|
|
|
|
actual_ = actual;
|
|
|
|
|
update(frame);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void RadioButton_enum::update(int frame) {
|
|
|
|
|
frame_ = frame;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!actual_ || !current_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
const int value = actual_->getValue();
|
|
|
|
|
if (value == value_->checkedId()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_->button(value)->setChecked(true);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void RadioButton_enum::update_value(int value) {
|
|
|
|
|
current_->setValue(value);
|
|
|
|
|
emit currentParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
actual_->setValue(value);
|
|
|
|
|
emit actualParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// ComboBox_enum
|
|
|
|
|
//
|
2016-06-15 18:43:10 +12:00
|
|
|
|
ComboBox_enum::ComboBox_enum(QWidget *parent, QString name,
|
|
|
|
|
TIntEnumParamP const ¶m)
|
|
|
|
|
: ParamField(parent, name, param) {
|
|
|
|
|
m_paramName = QString::fromStdString(param->getName());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_ = new QComboBox(this);
|
|
|
|
|
value_->setFixedHeight(20);
|
|
|
|
|
value_->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Maximum);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
for (int i = 0, count = param->getItemCount(); i < count; i++) {
|
|
|
|
|
int item;
|
|
|
|
|
std::string caption;
|
|
|
|
|
param->getItem(i, item, caption);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_->addItem(QString::fromStdString(caption));
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
connect(value_, SIGNAL(currentIndexChanged(int)), this,
|
|
|
|
|
SLOT(update_value(int)));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setLayout(m_layout);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void ComboBox_enum::setParam(TParamP const ¤t, TParamP const &actual,
|
|
|
|
|
int frame) {
|
|
|
|
|
current_ = current;
|
|
|
|
|
actual_ = actual;
|
|
|
|
|
update(frame);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void ComboBox_enum::update(int frame) {
|
|
|
|
|
frame_ = frame;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!actual_ || !current_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
const int value = actual_->getValue();
|
|
|
|
|
if (value == value_->currentIndex()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_->setCurrentIndex(value);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void ComboBox_enum::update_value(int value) {
|
|
|
|
|
current_->setValue(value);
|
|
|
|
|
emit currentParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
actual_->setValue(value);
|
|
|
|
|
emit actualParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
2016-06-15 18:43:10 +12:00
|
|
|
|
} // end of namespace component
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
namespace component {
|
2016-03-19 06:57:51 +13:00
|
|
|
|
//
|
|
|
|
|
// LineEdit_string
|
|
|
|
|
//
|
2016-06-15 18:43:10 +12:00
|
|
|
|
LineEdit_string::LineEdit_string(QWidget *parent, QString name,
|
|
|
|
|
TStringParamP const ¶m)
|
|
|
|
|
: ParamField(parent, name, param), frame_(0) {
|
|
|
|
|
m_paramName = QString::fromStdString(param->getName());
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_ = new QLineEdit(this);
|
|
|
|
|
value_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
|
|
|
|
|
value_->setText(QString::fromStdWString(param->getValue()));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
connect(value_, SIGNAL(textChanged(QString const &)), this,
|
|
|
|
|
SLOT(update_value(QString const &)));
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
m_layout->addWidget(value_);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
setLayout(m_layout);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void LineEdit_string::setParam(TParamP const ¤t, TParamP const &actual,
|
|
|
|
|
int frame) {
|
|
|
|
|
current_ = current;
|
|
|
|
|
actual_ = actual;
|
|
|
|
|
update(frame);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void LineEdit_string::update(int frame) {
|
|
|
|
|
frame_ = frame;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
if (!actual_ || !current_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
QString const value = QString::fromStdWString(actual_->getValue());
|
|
|
|
|
if (value == value_->text()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
value_->setText(value);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
void LineEdit_string::update_value(QString const &text) {
|
|
|
|
|
std::wstring const value = text.toStdWString();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
current_->setValue(value);
|
|
|
|
|
emit currentParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
actual_->setValue(value);
|
|
|
|
|
emit actualParamChanged();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
2016-06-15 18:43:10 +12:00
|
|
|
|
} // end of namespace component
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
ParamField *make_lineedit(QWidget *parent, QString name, TParamP const ¶m) {
|
|
|
|
|
if (0)
|
|
|
|
|
;
|
|
|
|
|
else if (TDoubleParamP _ = param) {
|
|
|
|
|
return new component::LineEdit_double(parent, name, _);
|
|
|
|
|
} else if (TIntParamP _ = param) {
|
|
|
|
|
return new component::LineEdit_int(parent, name, _);
|
|
|
|
|
} else if (TStringParamP _ = param) {
|
|
|
|
|
return new component::LineEdit_string(parent, name, _);
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
return NULL;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
ParamField *make_slider(QWidget *parent, QString name, TParamP const ¶m) {
|
|
|
|
|
if (0)
|
|
|
|
|
;
|
|
|
|
|
else if (TDoubleParamP _ = param) {
|
|
|
|
|
return new component::Slider_double(parent, name, _);
|
|
|
|
|
} else if (TIntParamP _ = param) {
|
|
|
|
|
return new component::Slider_int(parent, name, _);
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
return NULL;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
ParamField *make_spinbox(QWidget *parent, QString name, TParamP const ¶m) {
|
|
|
|
|
if (0)
|
|
|
|
|
;
|
|
|
|
|
else if (TDoubleParamP _ = param) {
|
|
|
|
|
return new component::SpinBox_double(parent, name, _);
|
|
|
|
|
} else if (TIntParamP _ = param) {
|
|
|
|
|
return new component::SpinBox_int(parent, name, _);
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
return NULL;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
ParamField *make_checkbox(QWidget *parent, QString name, TParamP const ¶m) {
|
|
|
|
|
if (0)
|
|
|
|
|
;
|
|
|
|
|
else if (TBoolParamP _ = param) {
|
|
|
|
|
return new component::CheckBox_bool(parent, name, _);
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
return NULL;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
ParamField *make_radiobutton(QWidget *parent, QString name,
|
|
|
|
|
TParamP const ¶m) {
|
|
|
|
|
if (0)
|
|
|
|
|
;
|
|
|
|
|
else if (TIntEnumParamP _ = param) {
|
|
|
|
|
return new component::RadioButton_enum(parent, name, _);
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
return NULL;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
ParamField *make_combobox(QWidget *parent, QString name, TParamP const ¶m) {
|
|
|
|
|
if (0)
|
|
|
|
|
;
|
|
|
|
|
else if (TIntEnumParamP _ = param) {
|
|
|
|
|
return new component::ComboBox_enum(parent, name, _);
|
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
|
return NULL;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
}
|