tahoma2d/toonz/sources/include/toonzqt/paramfield.h

944 lines
26 KiB
C
Raw Normal View History

2016-05-17 03:04:11 +12:00
#pragma once
2016-03-19 06:57:51 +13:00
#ifndef PARAMFIELD_H
#define PARAMFIELD_H
#ifdef _MSC_VER
2016-03-19 06:57:51 +13:00
#pragma warning(disable : 4251)
#endif
#include "tcommon.h"
#include <QWidget>
#include <QSpinBox>
#include <QSlider>
#include <QCheckBox>
#include <QButtonGroup>
#include <QRadioButton>
#include <QPushButton>
#include <QTextEdit>
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
#include <QPainterPath>
2016-03-19 06:57:51 +13:00
#include "tgeometry.h"
#include "tparam.h"
#include "tnotanimatableparam.h"
#include "tspectrumparam.h"
#include "ttonecurveparam.h"
#include "tdoubleparam.h"
#include "toonz/tfxhandle.h"
#include "historytypes.h"
#undef DVAPI
#undef DVVAR
#ifdef TOONZQT_EXPORTS
#define DVAPI DV_EXPORT_API
#define DVVAR DV_EXPORT_VAR
#else
#define DVAPI DV_IMPORT_API
#define DVVAR DV_IMPORT_VAR
#endif
// forward declaration
class QString;
class QComboBox;
class QHBoxLayout;
class TFxHandle;
class QFontComboBox;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
namespace DVGui {
2016-03-19 06:57:51 +13:00
class LineEdit;
class IntField;
class DoubleField;
class MeasuredDoubleField;
class MeasuredDoublePairField;
class ColorField;
class SpectrumField;
class ToneCurveField;
class CheckBox;
2019-09-19 20:19:58 +12:00
} // namespace DVGui
2016-03-19 06:57:51 +13:00
//=============================================================================
/*! \brief ParamField.
2016-06-15 18:43:10 +12:00
Inherits \b QWidget.
2016-03-19 06:57:51 +13:00
*/
2016-06-15 18:43:10 +12:00
class DVAPI ParamField : public QWidget {
Q_OBJECT
2016-03-19 06:57:51 +13:00
protected:
2016-06-15 18:43:10 +12:00
QHBoxLayout *m_layout;
QString m_paramName;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
static TFxHandle *m_fxHandleStat;
QString m_interfaceName;
QString m_description;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
ParamField(QWidget *parent, QString paramName, const TParamP &param,
bool addEmptyLabel = true);
~ParamField();
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
QString getParamName() const { return m_paramName; }
QString getUIName() const { return m_interfaceName; }
QString getDescription() const { return m_description; }
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
virtual void setParam(const TParamP &current, const TParamP &actual,
int frame) = 0;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
virtual void update(int frame) = 0;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
static ParamField *create(QWidget *parent, QString name,
const TParamP &param);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
virtual void setPointValue(const TPointD &p){};
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
virtual QSize getPreferedSize() { return QSize(200, 28); }
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
static void setFxHandle(TFxHandle *fxHandle);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
virtual void setPrecision(int precision) {}
2016-03-19 06:57:51 +13:00
signals:
2016-06-15 18:43:10 +12:00
void currentParamChanged();
void actualParamChanged();
void paramKeyToggle();
2016-03-19 06:57:51 +13:00
};
//=============================================================================
// ParamFieldKeyToggle
//-----------------------------------------------------------------------------
class DVAPI ParamFieldKeyToggle final : public QWidget {
2016-06-15 18:43:10 +12:00
Q_OBJECT
2016-03-19 06:57:51 +13:00
public:
2020-06-05 16:40:15 +12:00
QPixmap m_pixmap;
// keyframe colors
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
QColor m_keyBorderOffColor;
QColor m_keyBorderOnColor;
QColor m_keyBorderModifiedColor;
QColor m_keyBorderInbetweenColor;
QColor m_keyBorderHighlightColor;
2020-06-05 16:40:15 +12:00
QColor m_keyOffColor;
QColor m_keyOnColor;
QColor m_keyModifiedColor;
QColor m_keyHighlightColor;
QColor m_keyInbetweenColor;
// keyframe colors
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
Q_PROPERTY(QColor KeyBorderOffColor READ getKeyBorderOffColor WRITE
setKeyBorderOffColor)
Q_PROPERTY(QColor KeyBorderOnColor READ getKeyBorderOnColor WRITE
setKeyBorderOnColor)
Q_PROPERTY(QColor KeyBorderModifiedColor READ getKeyBorderModifiedColor WRITE
setKeyBorderModifiedColor)
Q_PROPERTY(QColor KeyBorderInbetweenColor READ getKeyBorderInbetweenColor
WRITE setKeyBorderInbetweenColor)
Q_PROPERTY(QColor KeyBorderHighlightColor READ getKeyBorderHighlightColor
WRITE setKeyBorderHighlightColor)
2020-06-05 16:40:15 +12:00
Q_PROPERTY(QColor KeyOffColor READ getKeyOffColor WRITE setKeyOffColor)
Q_PROPERTY(QColor KeyOnColor READ getKeyOnColor WRITE setKeyOnColor)
Q_PROPERTY(QColor KeyModifiedColor READ getKeyModifiedColor WRITE
setKeyModifiedColor)
Q_PROPERTY(QColor KeyInbetweenColor READ getKeyInbetweenColor WRITE
setKeyInbetweenColor)
Q_PROPERTY(QColor KeyHighlightColor READ getKeyHighlightColor WRITE
setKeyHighlightColor)
2016-03-19 06:57:51 +13: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
enum Status { NOT_ANIMATED, NOT_KEYFRAME, MODIFIED, KEYFRAME };
//QPixmap m_pixmap;
QIcon m_icon;
//// keyframe colors
//QColor m_keyOffColor;
//QColor m_keyOnColor;
//QColor m_keyModifiedColor;
//QColor m_keyHighlightColor;
//QColor m_keyInbetweenColor;
//// keyframe colors
//Q_PROPERTY(QColor KeyOffColor READ getKeyOffColor WRITE setKeyOffColor)
//Q_PROPERTY(QColor KeyOnColor READ getKeyOnColor WRITE setKeyOnColor)
//Q_PROPERTY(QColor KeyModifiedColor READ getKeyModifiedColor WRITE
// setKeyModifiedColor)
//Q_PROPERTY(QColor KeyInbetweenColor READ getKeyInbetweenColor WRITE
// setKeyInbetweenColor)
//Q_PROPERTY(QColor KeyHighlightColor READ getKeyHighlightColor WRITE
// setKeyHighlightColor)
2016-03-19 06:57:51 +13:00
private:
2016-06-15 18:43:10 +12:00
Status m_status;
bool m_highlighted;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
ParamFieldKeyToggle(QWidget *parent,
std::string name = "ParamFieldKeyToggle");
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void setStatus(Status status);
Status getStatus() const;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void setStatus(bool hasKeyframe, bool isKeyframe, bool hasBeenChanged);
2016-03-19 06:57:51 +13:00
protected:
2016-06-19 20:06:29 +12:00
void paintEvent(QPaintEvent *) override;
void mousePressEvent(QMouseEvent *) override;
void enterEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
2016-03-19 06:57:51 +13:00
2020-06-05 16:40:15 +12:00
// keyframe colors
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
void setKeyBorderOffColor(const QColor &color) {
m_keyBorderOffColor = color;
}
QColor getKeyBorderOffColor() const { return m_keyBorderOffColor; }
void setKeyBorderOnColor(const QColor &color) { m_keyBorderOnColor = color; }
QColor getKeyBorderOnColor() const { return m_keyBorderOnColor; }
void setKeyBorderModifiedColor(const QColor &color) {
m_keyBorderModifiedColor = color;
}
QColor getKeyBorderModifiedColor() const { return m_keyBorderModifiedColor; }
void setKeyBorderInbetweenColor(const QColor &color) {
m_keyBorderInbetweenColor = color;
}
QColor getKeyBorderInbetweenColor() const {
return m_keyBorderInbetweenColor;
}
void setKeyBorderHighlightColor(const QColor &color) {
m_keyBorderHighlightColor = color;
}
QColor getKeyBorderHighlightColor() const {
return m_keyBorderHighlightColor;
}
2020-06-05 16:40:15 +12:00
void setKeyOffColor(const QColor &color) { m_keyOffColor = color; }
QColor getKeyOffColor() const { return m_keyOffColor; }
void setKeyOnColor(const QColor &color) { m_keyOnColor = color; }
QColor getKeyOnColor() const { return m_keyOnColor; }
void setKeyModifiedColor(const QColor &color) { m_keyModifiedColor = color; }
QColor getKeyModifiedColor() const { return m_keyModifiedColor; }
void setKeyHighlightColor(const QColor &color) {
m_keyHighlightColor = color;
}
QColor getKeyHighlightColor() const { return m_keyHighlightColor; }
void setKeyInbetweenColor(const QColor &color) {
m_keyInbetweenColor = color;
}
QColor getKeyInbetweenColor() const { return m_keyInbetweenColor; }
2016-03-19 06:57:51 +13:00
signals:
2016-06-15 18:43:10 +12:00
void keyToggled();
2016-03-19 06:57:51 +13:00
};
//=============================================================================
// FxSettingsKeyToggleUndo
//=============================================================================
template <class T, class ParamP>
class FxSettingsKeyToggleUndo final : public TUndo {
2016-06-15 18:43:10 +12:00
TFxHandle *m_fxHandle;
QString m_name;
bool m_wasKeyframe;
int m_frame;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
ParamP m_param;
T m_currentValue;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
FxSettingsKeyToggleUndo(ParamP param, T currentValue, bool wasKeyFrame,
QString name, int frame, TFxHandle *fxHandle)
: m_param(param)
, m_currentValue(currentValue)
, m_wasKeyframe(wasKeyFrame)
, m_name(name)
, m_frame(frame)
, m_fxHandle(fxHandle) {}
// void notify();
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->setValue(m_frame, m_currentValue);
else
m_param->deleteKeyframe(m_frame);
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->deleteKeyframe(m_frame);
else
m_param->setValue(m_frame, m_currentValue);
if (m_fxHandle) m_fxHandle->notifyFxChanged();
}
2016-06-19 20:06:29 +12:00
int getSize() const override { return sizeof(*this); }
int getHistoryType() override { return HistoryType::Fx; }
QString getHistoryString() override {
2016-06-15 18:43:10 +12:00
QString str =
QObject::tr("Modify Fx Param : %1 Key : %2 Frame %3")
.arg((m_wasKeyframe) ? QObject::tr("Delete") : QObject::tr("Set"))
.arg(m_name)
.arg(QString::number(m_frame + 1));
return str;
}
2016-03-19 06:57:51 +13:00
};
//=============================================================================
// AnimatedParamField
//-----------------------------------------------------------------------------
template <class T, class ParamP>
2016-06-15 18:43:10 +12:00
class DVAPI AnimatedParamField : public ParamField {
2016-03-19 06:57:51 +13:00
protected:
2016-06-15 18:43:10 +12:00
ParamP m_currentParam, m_actualParam;
int m_frame;
ParamFieldKeyToggle *m_keyToggle;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
AnimatedParamField(QWidget *parent, QString name, const ParamP &param,
bool addEmptyLabel = true)
: ParamField(parent, name, param, addEmptyLabel), m_frame(0) {
m_keyToggle = new ParamFieldKeyToggle(this);
}
virtual void updateField(T value) = 0;
2016-06-20 14:23:05 +12:00
void setParam(const TParamP &current, const TParamP &actual,
int frame) override {
2016-06-15 18:43:10 +12:00
m_currentParam = current;
m_actualParam = actual;
assert(m_currentParam);
assert(m_actualParam);
update(frame);
}
2016-06-19 20:06:29 +12:00
void update(int frame) override {
2016-06-15 18:43:10 +12:00
m_frame = frame;
if (!m_actualParam || !m_currentParam) return;
T value = m_actualParam->getValue(m_frame);
if (m_actualParam->isKeyframe(m_frame))
m_currentParam->setValue(m_frame, value);
else if (!m_actualParam.getPointer()->hasKeyframes())
m_currentParam->setDefaultValue(value);
updateField(value);
updateKeyToggle();
}
void updateKeyToggle() {
T stroke = m_actualParam->getValue(m_frame);
T stroke2 = m_currentParam->getValue(m_frame);
m_keyToggle->setStatus(
m_actualParam->hasKeyframes(), m_actualParam->isKeyframe(m_frame),
m_actualParam->getValue(m_frame) != m_currentParam->getValue(m_frame));
}
/*--
* SwatchViewerでドラッグして編集するときに呼ばれる
* ---*/
void setValue(T value) {
if (m_currentParam->getValue(m_frame) == value) return;
m_currentParam->setValue(m_frame, value);
/*-- キーフレーム上で操作した場合 --*/
if (m_actualParam->isKeyframe(m_frame)) {
m_actualParam->setValue(m_frame, value);
emit actualParamChanged();
}
/*-- キーフレーム無い場合 --*/
else if (!m_actualParam.getPointer()->hasKeyframes()) {
m_actualParam->setDefaultValue(value);
emit actualParamChanged();
}
/*-- 他にキーフレームがあって、キーフレーム以外のフレームで操作した場合 --*/
emit currentParamChanged();
updateKeyToggle();
}
void onKeyToggle() {
T currentVal = m_currentParam->getValue(m_frame);
bool wasKeyFrame;
if (m_keyToggle->getStatus() == ParamFieldKeyToggle::KEYFRAME) {
m_actualParam->deleteKeyframe(m_frame);
update(m_frame);
wasKeyFrame = true;
} else {
m_actualParam->setValue(m_frame, m_currentParam->getValue(m_frame));
updateKeyToggle();
wasKeyFrame = false;
}
emit actualParamChanged();
emit paramKeyToggle();
TUndoManager::manager()->add(new FxSettingsKeyToggleUndo<T, ParamP>(
m_actualParam, currentVal, wasKeyFrame, m_interfaceName, m_frame,
ParamField::m_fxHandleStat));
}
2016-03-19 06:57:51 +13:00
};
//=============================================================================
// MeasuredDoubleParamField
//-----------------------------------------------------------------------------
class DVAPI MeasuredDoubleParamField final
2016-06-15 18:43:10 +12:00
: public AnimatedParamField<double, TDoubleParamP> {
Q_OBJECT
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
DVGui::MeasuredDoubleField *m_measuredDoubleField;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
MeasuredDoubleParamField(QWidget *parent, QString name,
const TDoubleParamP &param);
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
void updateField(double value) override;
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
QSize getPreferedSize() override { return QSize(260, 28); }
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void onChange(bool);
void onKeyToggled();
2016-03-19 06:57:51 +13:00
};
//=============================================================================
// RangeParamField
//-----------------------------------------------------------------------------
class DVAPI MeasuredRangeParamField final
2016-06-15 18:43:10 +12:00
: public AnimatedParamField<DoublePair, TRangeParamP> {
Q_OBJECT
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
DVGui::MeasuredDoublePairField *m_valueField;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
MeasuredRangeParamField(QWidget *parent, QString name,
const TRangeParamP &param);
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
void updateField(DoublePair value) override;
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
QSize getPreferedSize() override { return QSize(300, 20); }
void setPrecision(int precision) override;
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void onChange(bool);
void onKeyToggled();
2016-03-19 06:57:51 +13:00
};
//=============================================================================
// PointParamField
//-----------------------------------------------------------------------------
class DVAPI PointParamField final
: public AnimatedParamField<TPointD, TPointParamP> {
2016-06-15 18:43:10 +12:00
Q_OBJECT
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
DVGui::MeasuredDoubleField *m_xFld, *m_yFld;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
PointParamField(QWidget *parent, QString name, const TPointParamP &param);
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
void setPointValue(const TPointD &p) override;
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
void updateField(TPointD value) override;
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
QSize getPreferedSize() override { return QSize(270, 28); }
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void onChange(bool);
void onKeyToggled();
2016-03-19 06:57:51 +13:00
};
//=============================================================================
// PixelParamField
//-----------------------------------------------------------------------------
class DVAPI PixelParamField final
2016-06-15 18:43:10 +12:00
: public AnimatedParamField<TPixel32, TPixelParamP> {
Q_OBJECT
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
DVGui::ColorField *m_colorField;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
PixelParamField(QWidget *parent, QString name, const TPixelParamP &param);
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
void updateField(TPixel32 value) override;
2016-03-19 06:57:51 +13:00
2017-09-29 22:55:10 +13:00
QSize getPreferedSize() override { return QSize(480, 40); }
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
/*-- RgbLinkButtonの実行のため --*/
TPixel32 getColor();
void setColor(TPixel32 value);
2016-03-19 06:57:51 +13:00
protected:
2016-06-15 18:43:10 +12:00
void setParams();
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void onChange(const TPixel32 &value, bool isDragging);
void onKeyToggled();
2016-03-19 06:57:51 +13:00
};
//=============================================================================
// RGB Link Button
//-----------------------------------------------------------------------------
2019-09-19 20:19:58 +12:00
class DVAPI RgbLinkButtons final : public QWidget {
2016-06-15 18:43:10 +12:00
Q_OBJECT
PixelParamField *m_field1, *m_field2;
2016-03-19 06:57:51 +13:00
public:
2019-09-19 20:19:58 +12:00
RgbLinkButtons(QString str1, QString str2, QWidget *parent,
PixelParamField *field1, PixelParamField *field2);
2016-03-19 06:57:51 +13:00
protected slots:
2019-09-19 20:19:58 +12:00
void onCopyButtonClicked();
void onSwapButtonClicked();
2016-03-19 06:57:51 +13:00
};
//=============================================================================
// SpectrumParamField
//-----------------------------------------------------------------------------
class DVAPI SpectrumParamField final
2016-06-15 18:43:10 +12:00
: public AnimatedParamField<TSpectrum, TSpectrumParamP> {
Q_OBJECT
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
DVGui::SpectrumField *m_spectrumField;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
SpectrumParamField(QWidget *parent, QString name,
const TSpectrumParamP &param);
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
void updateField(TSpectrum value) override;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void setParams();
2016-03-19 06:57:51 +13:00
2017-09-29 22:55:10 +13:00
QSize getPreferedSize() override { return QSize(477, 60); }
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void onKeyToggled();
void onChange(bool isDragging);
void onKeyAdded(int keyIndex);
void onKeyRemoved(int keyIndex);
2016-03-19 06:57:51 +13:00
};
2020-07-28 15:16:51 +12:00
//=============================================================================
// Mode Sensitive Box
//-----------------------------------------------------------------------------
class ModeChangerParamField : public ParamField {
Q_OBJECT
public:
ModeChangerParamField(QWidget *parent, QString paramName,
const TParamP &param, bool addEmptyLabel = true)
: ParamField(parent, paramName, param, addEmptyLabel) {}
signals:
void modeChanged(int);
};
class DVAPI ModeSensitiveBox final : public QWidget {
Q_OBJECT
QList<int> m_modes;
public:
ModeSensitiveBox(QWidget *parent, ModeChangerParamField *modeChanger,
QList<int> modes);
QList<int> modes() { return m_modes; }
protected slots:
void onModeChanged(int mode);
};
2016-03-19 06:57:51 +13:00
//=============================================================================
// EnumParamField
//-----------------------------------------------------------------------------
2020-07-28 15:16:51 +12:00
class EnumParamField final : public ModeChangerParamField {
2016-06-15 18:43:10 +12:00
Q_OBJECT
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
TIntEnumParamP m_currentParam, m_actualParam;
QComboBox *m_om;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
EnumParamField(QWidget *parent, QString name, const TIntEnumParamP &param);
2016-03-19 06:57:51 +13:00
2016-06-20 14:23:05 +12:00
void setParam(const TParamP &current, const TParamP &actual,
int frame) override;
2016-06-19 20:06:29 +12:00
void update(int frame) override;
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
QSize getPreferedSize() override { return QSize(150, 20); }
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void onChange(const QString &str);
2016-03-19 06:57:51 +13:00
};
//=============================================================================
// BoolParamField
//-----------------------------------------------------------------------------
2020-07-28 15:16:51 +12:00
class DVAPI BoolParamField final : public ModeChangerParamField {
2016-06-15 18:43:10 +12:00
Q_OBJECT
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
TBoolParamP m_currentParam, m_actualParam;
DVGui::CheckBox *m_checkBox;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
BoolParamField(QWidget *parent, QString name, const TBoolParamP &param);
2016-03-19 06:57:51 +13:00
2016-06-20 14:23:05 +12:00
void setParam(const TParamP &current, const TParamP &actual,
int frame) override;
2016-06-19 20:06:29 +12:00
void update(int frame) override;
2016-03-19 06:57:51 +13:00
2017-09-29 22:55:10 +13:00
QSize getPreferedSize() override { return QSize(20, 15); }
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void onToggled(bool checked);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
/*-- visibleToggle UIで使用する --*/
2016-03-19 06:57:51 +13:00
signals:
2016-06-15 18:43:10 +12:00
void toggled(bool);
2016-03-19 06:57:51 +13:00
};
//=============================================================================
// IntParamField
//-----------------------------------------------------------------------------
class DVAPI IntParamField final : public ParamField {
2016-06-15 18:43:10 +12:00
Q_OBJECT
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
TIntParamP m_currentParam, m_actualParam;
DVGui::IntField *m_intField;
typedef IntParamField This;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
IntParamField(QWidget *parent = 0, QString name = 0,
const TIntParamP &param = 0);
2016-03-19 06:57:51 +13:00
2016-06-20 14:23:05 +12:00
void setParam(const TParamP &current, const TParamP &actual,
int frame) override;
2016-06-19 20:06:29 +12:00
void update(int frame) override;
2016-03-19 06:57:51 +13:00
2017-09-29 22:55:10 +13:00
QSize getPreferedSize() override { return QSize(50, 20); }
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void onChange(bool isDragging = false);
2016-03-19 06:57:51 +13:00
};
//=============================================================================
// StringParamField
//-----------------------------------------------------------------------------
namespace component {
class MyTextEdit : public QTextEdit {
Q_OBJECT
public:
MyTextEdit(const QString &text, QWidget *parent = Q_NULLPTR)
: QTextEdit(text, parent) {}
protected:
void keyPressEvent(QKeyEvent *event) override;
void focusOutEvent(QFocusEvent *e) override;
signals:
void edited();
};
2019-09-19 20:19:58 +12:00
}; // namespace component
class DVAPI StringParamField final : public ParamField {
2016-06-15 18:43:10 +12:00
Q_OBJECT
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
TStringParamP m_currentParam, m_actualParam;
DVGui::LineEdit *m_textFld = nullptr;
component::MyTextEdit *m_multiTextFld = nullptr;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
StringParamField(QWidget *parent, QString name, const TStringParamP &param);
2016-03-19 06:57:51 +13:00
2016-06-20 14:23:05 +12:00
void setParam(const TParamP &current, const TParamP &actual,
int frame) override;
2016-06-19 20:06:29 +12:00
void update(int frame) override;
2016-03-19 06:57:51 +13:00
QSize getPreferedSize() override {
if (m_textFld)
return QSize(100, 20);
else
return QSize(100, 80);
}
protected slots:
void onChange();
};
//=============================================================================
// FontParamField
//-----------------------------------------------------------------------------
class FontParamField final : public ParamField {
Q_OBJECT
TFontParamP m_currentParam, m_actualParam;
QFontComboBox *m_fontCombo;
QComboBox *m_styleCombo;
DVGui::IntField *m_sizeField;
public:
FontParamField(QWidget *parent, QString name, const TFontParamP &param);
void setParam(const TParamP &current, const TParamP &actual,
int frame) override;
void update(int frame) override;
QSize getPreferedSize() override { return QSize(150, 20); }
2016-03-19 06:57:51 +13:00
protected slots:
void findStyles(const QFont &font);
void onSizeChange(bool);
2016-06-15 18:43:10 +12:00
void onChange();
2016-03-19 06:57:51 +13:00
};
//=============================================================================
// ToneCurveParamField
//-----------------------------------------------------------------------------
class DVAPI ToneCurveParamField final
2016-06-15 18:43:10 +12:00
: public AnimatedParamField<const QList<TPointD>, TToneCurveParamP> {
Q_OBJECT
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
DVGui::ToneCurveField *m_toneCurveField;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
ToneCurveParamField(QWidget *parent, QString name,
const TToneCurveParamP &param);
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
void updateField(const QList<TPointD> value) override;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void setParams();
2016-03-19 06:57:51 +13:00
2020-03-16 14:37:10 +13:00
QSize getPreferedSize() override;
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void onChannelChanged(int);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void onChange(bool isDragging);
void onPointAdded(int index);
void onPointRemoved(int index);
void onIsLinearChanged(bool);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void onKeyToggled();
2016-03-19 06:57:51 +13:00
};
2016-06-15 18:43:10 +12:00
namespace component {
class DVAPI LineEdit_double final : public ParamField {
2016-06-15 18:43:10 +12:00
Q_OBJECT; // could not use templates for Q_OBJECT
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
int frame_;
TDoubleParamP current_;
TDoubleParamP actual_;
QLineEdit *value_;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
LineEdit_double(QWidget *parent, QString name, TDoubleParamP const &param);
2016-03-19 06:57:51 +13:00
2016-06-20 14:23:05 +12:00
void setParam(TParamP const &current, TParamP const &actual,
int frame) override;
2016-06-19 20:06:29 +12:00
void update(int frame) override;
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void update_value(QString const &text); // could not use MACROs for slots
2016-03-19 06:57:51 +13:00
};
class DVAPI Slider_double final : public ParamField {
2016-06-15 18:43:10 +12:00
Q_OBJECT;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
int frame_;
TDoubleParamP current_;
TDoubleParamP actual_;
QSlider *value_;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
Slider_double(QWidget *parent, QString name, TDoubleParamP const &param);
2016-03-19 06:57:51 +13:00
2016-06-20 14:23:05 +12:00
void setParam(TParamP const &current, TParamP const &actual,
int frame) override;
2016-06-19 20:06:29 +12:00
void update(int frame) override;
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void update_value(int);
2016-03-19 06:57:51 +13:00
};
class DVAPI SpinBox_double final : public ParamField {
2016-06-15 18:43:10 +12:00
Q_OBJECT;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
int frame_;
TDoubleParamP current_;
TDoubleParamP actual_;
QDoubleSpinBox *value_;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
SpinBox_double(QWidget *parent, QString name, TDoubleParamP const &param);
2016-03-19 06:57:51 +13:00
2016-06-20 14:23:05 +12:00
void setParam(TParamP const &current, TParamP const &actual,
int frame) override;
2016-06-19 20:06:29 +12:00
void update(int frame) override;
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void update_value(double);
2016-03-19 06:57:51 +13:00
};
2019-09-19 20:19:58 +12:00
} // namespace component
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
namespace component {
class DVAPI LineEdit_int final : public ParamField {
2016-06-15 18:43:10 +12:00
Q_OBJECT;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
int frame_;
TIntParamP current_;
TIntParamP actual_;
QLineEdit *value_;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
LineEdit_int(QWidget *parent, QString name, TIntParamP const &param);
2016-03-19 06:57:51 +13:00
2016-06-20 14:23:05 +12:00
void setParam(TParamP const &current, TParamP const &actual,
int frame) override;
2016-06-19 20:06:29 +12:00
void update(int frame) override;
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void update_value(QString const &text);
2016-03-19 06:57:51 +13:00
};
class DVAPI Slider_int final : public ParamField {
2016-06-15 18:43:10 +12:00
Q_OBJECT;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
int frame_;
TIntParamP current_;
TIntParamP actual_;
QSlider *value_;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
Slider_int(QWidget *parent, QString name, TIntParamP const &param);
2016-03-19 06:57:51 +13:00
2016-06-20 14:23:05 +12:00
void setParam(TParamP const &current, TParamP const &actual,
int frame) override;
2016-06-19 20:06:29 +12:00
void update(int frame) override;
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void update_value(int);
2016-03-19 06:57:51 +13:00
};
class DVAPI SpinBox_int final : public ParamField {
2016-06-15 18:43:10 +12:00
Q_OBJECT;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
int frame_;
TIntParamP current_;
TIntParamP actual_;
QSpinBox *value_;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
SpinBox_int(QWidget *parent, QString name, TIntParamP const &param);
2016-03-19 06:57:51 +13:00
2016-06-20 14:23:05 +12:00
void setParam(TParamP const &current, TParamP const &actual,
int frame) override;
2016-06-19 20:06:29 +12:00
void update(int frame) override;
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void update_value(int);
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 {
class DVAPI CheckBox_bool final : public ParamField {
2016-06-15 18:43:10 +12:00
Q_OBJECT;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
int frame_;
TBoolParamP current_;
TBoolParamP actual_;
QCheckBox *value_;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
CheckBox_bool(QWidget *parent, QString name, TBoolParamP const &param);
2016-03-19 06:57:51 +13:00
2016-06-20 14:23:05 +12:00
void setParam(TParamP const &current, TParamP const &actual,
int frame) override;
2016-06-19 20:06:29 +12:00
void update(int frame) override;
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void update_value(int);
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 {
class DVAPI RadioButton_enum final : public ParamField {
2016-06-15 18:43:10 +12:00
Q_OBJECT;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
int frame_;
TIntEnumParamP current_;
TIntEnumParamP actual_;
QButtonGroup *value_;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
RadioButton_enum(QWidget *parent, QString name, TIntEnumParamP const &param);
2016-03-19 06:57:51 +13:00
2016-06-20 14:23:05 +12:00
void setParam(TParamP const &current, TParamP const &actual,
int frame) override;
2016-06-19 20:06:29 +12:00
void update(int frame) override;
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void update_value(int);
2016-03-19 06:57:51 +13:00
};
class DVAPI ComboBox_enum final : public ParamField {
2016-06-15 18:43:10 +12:00
Q_OBJECT;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
int frame_;
TIntEnumParamP current_;
TIntEnumParamP actual_;
QComboBox *value_;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
ComboBox_enum(QWidget *parent, QString name, TIntEnumParamP const &param);
2016-03-19 06:57:51 +13:00
2016-06-20 14:23:05 +12:00
void setParam(TParamP const &current, TParamP const &actual,
int frame) override;
2016-06-19 20:06:29 +12:00
void update(int frame) override;
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void update_value(int);
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 {
class DVAPI LineEdit_string final : public ParamField {
2016-06-15 18:43:10 +12:00
Q_OBJECT;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
int frame_;
TStringParamP current_;
TStringParamP actual_;
QLineEdit *value_;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
LineEdit_string(QWidget *parent, QString name, TStringParamP const &param);
2016-03-19 06:57:51 +13:00
2016-06-20 14:23:05 +12:00
void setParam(TParamP const &current, TParamP const &actual,
int frame) override;
2016-06-19 20:06:29 +12:00
void update(int frame) override;
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void update_value(QString const &);
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
#ifdef __cplusplus
extern "C" {
#endif
2016-06-15 18:43:10 +12:00
#define TOONZ_DECLARE_MAKE_WIDGET(NAME) \
ParamField *NAME(QWidget *parent, QString name, TParamP const &param)
2016-03-19 06:57:51 +13:00
TOONZ_DECLARE_MAKE_WIDGET(make_lineedit);
TOONZ_DECLARE_MAKE_WIDGET(make_slider);
TOONZ_DECLARE_MAKE_WIDGET(make_spinbox);
TOONZ_DECLARE_MAKE_WIDGET(make_checkbox);
TOONZ_DECLARE_MAKE_WIDGET(make_radiobutton);
TOONZ_DECLARE_MAKE_WIDGET(make_combobox);
#ifdef __cplusplus
}
#endif
2016-06-15 18:43:10 +12:00
#endif // PARAMFIELD_H