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

641 lines
19 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 SCHEMATICVIEWER_H
#define SCHEMATICVIEWER_H
// TnzLib includes
#include "toonz/tstageobjectid.h"
2021-03-04 20:57:24 +13:00
#include "toonz/txshcolumn.h"
2016-03-19 06:57:51 +13:00
// TnzBase includes
#include "tfx.h"
// Qt includes
#include <QGraphicsScene>
#include <QGraphicsView>
2018-07-20 22:15:22 +12:00
#include <QTouchDevice>
2016-03-19 06:57:51 +13:00
#include <QIcon>
2016-03-19 06:57:51 +13:00
// STD includes
#include <set>
#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 declarations
class SchematicNode;
class SchematicPort;
class SchematicLink;
class ToonzScene;
class StageSchematicScene;
class FxSchematicScene;
class TXsheetHandle;
class TObjectHandle;
class TColumnHandle;
class TFxHandle;
class TSceneHandle;
class TFrameHandle;
class TFx;
class TLevel;
class TSelection;
class TApplication;
class QToolBar;
class QToolButton;
class QAction;
2018-07-20 22:15:22 +12:00
class QTouchEvent;
class QGestureEvent;
2020-04-17 19:02:53 +12:00
class FxSelection;
class StageObjectSelection;
class SnapTargetItem;
2016-03-19 06:57:51 +13:00
//====================================================
2018-07-20 22:15:22 +12:00
namespace {
enum CursorMode { Select, Zoom, Hand };
}
2016-03-19 06:57:51 +13:00
//==================================================================
//
// SchematicScene
//
//==================================================================
2016-06-15 18:43:10 +12:00
class DVAPI SchematicScene : public QGraphicsScene {
Q_OBJECT
2016-03-19 06:57:51 +13:00
QPointF m_mousePos, m_clickedPos;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
SchematicScene(QWidget *parent);
~SchematicScene();
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void clearAllItems();
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
virtual QGraphicsItem *getCurrentNode() { return 0; }
virtual void reorderScene() = 0;
virtual void updateScene() = 0;
2016-03-19 06:57:51 +13:00
QPointF mousePos() { return m_mousePos; }
void setMousePos(QPointF pos) { m_mousePos = pos; }
virtual void updateSnapTarget(QGraphicsItem *item){};
QPointF clickedPos() { return m_clickedPos; }
void setClickedPos(QPointF pos) { m_clickedPos = pos; }
void computeSnap(SchematicNode *node, QPointF &delta, bool enable);
2016-03-19 06:57:51 +13:00
protected:
2016-06-15 18:43:10 +12:00
QList<SchematicLink *> m_highlightedLinks;
enum GridDimension { eLarge, eSmall };
QList<SnapTargetItem *> m_snapTargets;
static int snapVInterval;
static int snapHSpacing;
2016-03-19 06:57:51 +13:00
protected:
2016-06-15 18:43:10 +12:00
//! Returns \b true if no nodes intersects \b rect.
bool isAnEmptyZone(const QRectF &rect);
//! Returns a vector containing all nodes which had their bounding rects
//! contained in \b node bounding
2016-06-15 18:43:10 +12:00
//! rect enlarged of 10.
QVector<SchematicNode *> getPlacedNode(SchematicNode *node);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void showEvent(QShowEvent *se);
void hideEvent(QHideEvent *se);
2016-03-19 06:57:51 +13:00
void addSnapTarget(const QPointF &pos, const QRectF &rect,
const QPointF &theOtherEndPos, const QPointF &endPos);
void clearSnapTargets();
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
virtual void onSelectionSwitched(TSelection *, TSelection *) {}
2016-03-19 06:57:51 +13:00
};
//==================================================================
//
// SchematicSceneViewer
//
//==================================================================
class DVAPI SchematicSceneViewer final : public QGraphicsView {
2016-06-15 18:43:10 +12:00
Q_OBJECT
2016-03-19 06:57:51 +13:00
2018-07-20 22:15:22 +12:00
bool m_tabletEvent, m_tabletMove;
enum TabletState {
None = 0,
Touched,
StartStroke, // this state is to detect the first call
// of TabletMove just after TabletPress
OnStroke,
Released
} m_tabletState = None;
bool m_touchActive = false;
bool m_gestureActive = false;
QTouchDevice::DeviceType m_touchDevice = QTouchDevice::TouchScreen;
bool m_zooming = false;
bool m_panning = false;
bool m_panningArmed = false;
2018-07-20 22:15:22 +12:00
double m_scaleFactor; // used for zoom gesture
bool m_stylusUsed = false;
2018-07-20 22:15:22 +12:00
CursorMode m_cursorMode;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
SchematicSceneViewer(QWidget *parent);
~SchematicSceneViewer();
2016-03-19 06:57:51 +13:00
2019-08-05 20:37:40 +12:00
void zoomQt(bool zoomin, bool resetView);
2018-07-31 01:43:18 +12:00
void panQt(const QPointF &delta);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
QPointF getOldScenePos() { return m_oldScenePos; }
2016-03-19 06:57:51 +13:00
2018-07-20 22:15:22 +12:00
void setCursorMode(CursorMode mode);
2016-03-19 06:57:51 +13:00
protected:
2016-06-19 20:06:29 +12:00
void mousePressEvent(QMouseEvent *me) override;
void mouseMoveEvent(QMouseEvent *me) override;
void mouseReleaseEvent(QMouseEvent *me) override;
void keyPressEvent(QKeyEvent *ke) override;
void keyReleaseEvent(QKeyEvent *ke) override;
2016-06-19 20:06:29 +12:00
void wheelEvent(QWheelEvent *me) override;
void showEvent(QShowEvent *se) override;
void enterEvent(QEvent *e) override;
void leaveEvent(QEvent *e) override;
void mouseDoubleClickEvent(QMouseEvent *event) override;
2018-07-20 22:15:22 +12:00
void tabletEvent(QTabletEvent *e) override;
2018-07-20 22:15:22 +12:00
void touchEvent(QTouchEvent *e, int type);
void gestureEvent(QGestureEvent *e);
bool event(QEvent *event) override;
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void centerOnCurrent();
void reorderScene();
2019-08-05 20:37:40 +12:00
public slots:
2016-06-15 18:43:10 +12:00
void normalizeScene();
2019-08-05 20:37:40 +12:00
void fitScene();
2016-03-19 06:57:51 +13:00
private:
2016-06-15 18:43:10 +12:00
Qt::MouseButton m_buttonState;
QPoint m_oldWinPos;
QPointF m_oldScenePos;
2019-01-18 12:20:19 +13:00
QPointF m_firstPanPoint, m_mousePanPoint;
2018-07-31 01:43:18 +12:00
QPoint m_zoomPoint;
2016-06-15 18:43:10 +12:00
bool m_firstShowing;
2016-03-19 06:57:51 +13:00
private:
2016-06-15 18:43:10 +12:00
void changeScale(const QPoint &winPos, qreal scaleFactor);
2016-03-19 06:57:51 +13:00
};
//==================================================================
//
// SchematicViewer
//
//==================================================================
class DVAPI SchematicViewer final : public QWidget {
2016-06-15 18:43:10 +12:00
Q_OBJECT
2016-03-19 06:57:51 +13:00
QColor m_textColor; // text color (black)
Q_PROPERTY(QColor TextColor READ getTextColor WRITE setTextColor)
QColor m_verticalLineColor;
Q_PROPERTY(QColor VerticalLineColor READ getVerticalLineColor WRITE
setVerticalLineColor)
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_linkColor; // link color
Q_PROPERTY(QColor LinkColor READ getLinkColor WRITE setLinkColor)
QColor m_selectedLinkColor; // selected link color
Q_PROPERTY(QColor SelectedLinkColor READ getSelectedLinkColor WRITE
setSelectedLinkColor)
// Selected Node Border Color
QColor m_selectedBorderColor;
Q_PROPERTY(QColor SelectedBorderColor READ getSelectedBorderColor WRITE
setSelectedBorderColor)
// Motion Path Link Color
QColor m_motionPathLinkColor;
Q_PROPERTY(QColor MotionPathLinkColor READ getMotionPathLinkColor WRITE
setMotionPathLinkColor)
// Motion Path Selected Link Color
QColor m_motionPathSelectedLinkColor;
Q_PROPERTY(
QColor MotionPathSelectedLinkColor READ getMotionPathSelectedLinkColor
WRITE setMotionPathSelectedLinkColor)
// TZP column
QColor m_levelColumnColor; //(127,219,127)
Q_PROPERTY(QColor LevelColumnColor READ getLevelColumnColor WRITE
setLevelColumnColor)
// PLI column
QColor m_vectorColumnColor; //(212,212,133)
Q_PROPERTY(QColor VectorColumnColor READ getVectorColumnColor WRITE
setVectorColumnColor)
// subXsheet column
QColor m_childColumnColor; //(214,154,219)
Q_PROPERTY(QColor ChildColumnColor READ getChildColumnColor WRITE
setChildColumnColor)
// Raster image column
QColor m_fullcolorColumnColor; //(154,214,219)
Q_PROPERTY(QColor FullcolorColumnColor READ getFullcolorColumnColor WRITE
setFullcolorColumnColor)
// Fx column
QColor m_fxColumnColor; //(130,129,93)
Q_PROPERTY(QColor FxColumnColor READ getFxColumnColor WRITE setFxColumnColor)
// Palette column
QColor m_paletteColumnColor; //(42,171,154)
Q_PROPERTY(QColor PaletteColumnColor READ getPaletteColumnColor WRITE
setPaletteColumnColor)
// Mesh column
QColor m_meshColumnColor;
Q_PROPERTY(
QColor MeshColumnColor READ getMeshColumnColor WRITE setMeshColumnColor)
2018-09-11 17:43:04 +12:00
// Reference column
QColor m_referenceColumnColor;
Q_PROPERTY(QColor ReferenceColumnColor MEMBER m_referenceColumnColor)
// Table node
QColor m_tableColor;
Q_PROPERTY(QColor TableColor READ getTableColor WRITE setTableColor)
// Camera nodes
QColor m_activeCameraColor, m_otherCameraColor;
Q_PROPERTY(QColor ActiveCameraColor READ getActiveCameraColor WRITE
setActiveCameraColor)
Q_PROPERTY(QColor OtherCameraColor READ getOtherCameraColor WRITE
setOtherCameraColor)
// Group node
QColor m_groupColor;
Q_PROPERTY(QColor GroupColor READ getGroupColor WRITE setGroupColor)
// Peg node
QColor m_pegColor;
Q_PROPERTY(QColor PegColor READ getPegColor WRITE setPegColor)
// Path node
QColor m_splineColor;
Q_PROPERTY(QColor SplineColor READ getSplineColor WRITE setSplineColor)
// Output nodes
QColor m_activeOutputColor, m_otherOutputColor;
Q_PROPERTY(QColor ActiveOutputColor READ getActiveOutputColor WRITE
setActiveOutputColor)
Q_PROPERTY(QColor OtherOutputColor READ getOtherOutputColor WRITE
setOtherOutputColor)
// Xsheet node
QColor m_xsheetColor;
Q_PROPERTY(QColor XsheetColor READ getXsheetColor WRITE setXsheetColor)
2021-08-04 21:28:09 +12:00
// Pass Through node
QColor m_passThroughColor;
Q_PROPERTY(QColor PassThroughColor READ getPassThroughColor WRITE
setPassThroughColor)
// Fx nodes
QColor m_normalFx;
Q_PROPERTY(QColor NormalFxColor READ getNormalFxColor WRITE setNormalFxColor)
QColor m_macroFx;
Q_PROPERTY(QColor MacroFxColor READ getMacroFxColor WRITE setMacroFxColor)
QColor m_imageAdjustFx;
Q_PROPERTY(QColor ImageAdjustFxColor READ getImageAdjustFxColor WRITE
setImageAdjustFxColor)
QColor m_layerBlendingFx;
Q_PROPERTY(QColor LayerBlendingFxColor READ getLayerBlendingFxColor WRITE
setLayerBlendingFxColor)
QColor m_matteFx;
Q_PROPERTY(QColor MatteFxColor READ getMatteFxColor WRITE setMatteFxColor)
// Schematic Preview Button
QColor m_schematicPreviewButtonBgOnColor;
QIcon m_schematicPreviewButtonOnImage;
QColor m_schematicPreviewButtonBgOffColor;
QIcon m_schematicPreviewButtonOffImage;
Q_PROPERTY(QColor SchematicPreviewButtonBgOnColor READ
getSchematicPreviewButtonBgOnColor WRITE
setSchematicPreviewButtonBgOnColor)
Q_PROPERTY(
QIcon SchematicPreviewButtonOnImage READ getSchematicPreviewButtonOnImage
WRITE setSchematicPreviewButtonOnImage)
Q_PROPERTY(QColor SchematicPreviewButtonBgOffColor READ
getSchematicPreviewButtonBgOffColor WRITE
setSchematicPreviewButtonBgOffColor)
Q_PROPERTY(QIcon SchematicPreviewButtonOffImage READ
getSchematicPreviewButtonOffImage WRITE
setSchematicPreviewButtonOffImage)
// Schematic Camstand Button
QColor m_schematicCamstandButtonBgOnColor;
QIcon m_schematicCamstandButtonOnImage;
QIcon m_schematicCamstandButtonTranspImage;
QColor m_schematicCamstandButtonBgOffColor;
QIcon m_schematicCamstandButtonOffImage;
Q_PROPERTY(QColor SchematicCamstandButtonBgOnColor READ
getSchematicCamstandButtonBgOnColor WRITE
setSchematicCamstandButtonBgOnColor)
Q_PROPERTY(QIcon SchematicCamstandButtonOnImage READ
getSchematicCamstandButtonOnImage WRITE
setSchematicCamstandButtonOnImage)
Q_PROPERTY(QIcon SchematicCamstandButtonTranspImage READ
getSchematicCamstandButtonTranspImage WRITE
setSchematicCamstandButtonTranspImage)
Q_PROPERTY(QColor SchematicCamstandButtonBgOffColor READ
getSchematicCamstandButtonBgOffColor WRITE
setSchematicCamstandButtonBgOffColor)
Q_PROPERTY(QIcon SchematicCamstandButtonOffImage READ
getSchematicCamstandButtonOffImage WRITE
setSchematicCamstandButtonOffImage)
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
SchematicViewer(QWidget *parent);
~SchematicViewer();
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void setSchematicScene(SchematicScene *scene);
void setApplication(TApplication *app);
bool isStageSchematicViewed();
void setStageSchematicViewed(bool isStageSchematic);
2016-03-19 06:57:51 +13:00
void setTextColor(const QColor &color) { m_textColor = color; }
QColor getTextColor() const { return m_textColor; }
void setVerticalLineColor(const QColor &color) {
m_verticalLineColor = color;
}
QColor getVerticalLineColor() const { return m_verticalLineColor; }
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
// Link Color
void setLinkColor(const QColor &color) { m_linkColor = color; }
QColor getLinkColor() const { return m_linkColor; }
// Selected Link Color
void setSelectedLinkColor(const QColor &color) {
m_selectedLinkColor = color;
}
QColor getSelectedLinkColor() const { return m_selectedLinkColor; }
// Selected Node Border Color
void setSelectedBorderColor(const QColor &color) {
m_selectedBorderColor = color;
}
QColor getSelectedBorderColor() const { return m_selectedBorderColor; }
// Motion Path Link Color
void setMotionPathLinkColor(const QColor &color) {
m_motionPathLinkColor = color;
}
QColor getMotionPathLinkColor() const { return m_motionPathLinkColor; }
// Motion Path Selected Link Color
void setMotionPathSelectedLinkColor(const QColor &color) {
m_motionPathSelectedLinkColor = color;
}
QColor getMotionPathSelectedLinkColor() const {
return m_motionPathSelectedLinkColor;
}
// TZP column
void setLevelColumnColor(const QColor &color) { m_levelColumnColor = color; }
QColor getLevelColumnColor() const { return m_levelColumnColor; }
// PLI column
void setVectorColumnColor(const QColor &color) {
m_vectorColumnColor = color;
}
QColor getVectorColumnColor() const { return m_vectorColumnColor; }
// subXsheet column
void setChildColumnColor(const QColor &color) { m_childColumnColor = color; }
QColor getChildColumnColor() const { return m_childColumnColor; }
// Raster image column
void setFullcolorColumnColor(const QColor &color) {
m_fullcolorColumnColor = color;
}
QColor getFullcolorColumnColor() const { return m_fullcolorColumnColor; }
// Fx column
void setFxColumnColor(const QColor &color) { m_fxColumnColor = color; }
QColor getFxColumnColor() const { return m_fxColumnColor; }
// Palette column
void setPaletteColumnColor(const QColor &color) {
m_paletteColumnColor = color;
}
QColor getPaletteColumnColor() const { return m_paletteColumnColor; }
// Mesh column
void setMeshColumnColor(const QColor &color) { m_meshColumnColor = color; }
QColor getMeshColumnColor() const { return m_meshColumnColor; }
2018-09-11 17:43:04 +12:00
// Reference column
QColor getReferenceColumnColor() const { return m_referenceColumnColor; }
// Table node
void setTableColor(const QColor &color) { m_tableColor = color; }
QColor getTableColor() const { return m_tableColor; }
// Camera nodes
void setActiveCameraColor(const QColor &color) {
m_activeCameraColor = color;
}
void setOtherCameraColor(const QColor &color) { m_otherCameraColor = color; }
QColor getActiveCameraColor() const { return m_activeCameraColor; }
QColor getOtherCameraColor() const { return m_otherCameraColor; }
// Group node
void setGroupColor(const QColor &color) { m_groupColor = color; }
QColor getGroupColor() const { return m_groupColor; }
// Peg node
void setPegColor(const QColor &color) { m_pegColor = color; }
QColor getPegColor() const { return m_pegColor; }
// Path node
void setSplineColor(const QColor &color) { m_splineColor = color; }
QColor getSplineColor() const { return m_splineColor; }
// Output nodes
void setActiveOutputColor(const QColor &color) {
m_activeOutputColor = color;
}
void setOtherOutputColor(const QColor &color) { m_otherOutputColor = color; }
QColor getActiveOutputColor() const { return m_activeOutputColor; }
QColor getOtherOutputColor() const { return m_otherOutputColor; }
// Xsheet node
void setXsheetColor(const QColor &color) { m_xsheetColor = color; }
QColor getXsheetColor() const { return m_xsheetColor; }
2021-08-04 21:28:09 +12:00
// Pass Through node
void setPassThroughColor(const QColor &color) { m_passThroughColor = color; }
QColor getPassThroughColor() const { return m_passThroughColor; }
// Fx nodes
QColor getNormalFxColor() const { return m_normalFx; }
void setNormalFxColor(const QColor &color) { m_normalFx = color; }
QColor getMacroFxColor() const { return m_macroFx; }
void setMacroFxColor(const QColor &color) { m_macroFx = color; }
QColor getImageAdjustFxColor() const { return m_imageAdjustFx; }
void setImageAdjustFxColor(const QColor &color) { m_imageAdjustFx = color; }
QColor getLayerBlendingFxColor() const { return m_layerBlendingFx; }
void setLayerBlendingFxColor(const QColor &color) {
m_layerBlendingFx = color;
}
QColor getMatteFxColor() const { return m_matteFx; }
void setMatteFxColor(const QColor &color) { m_matteFx = color; }
// Schematic Preview Button
void setSchematicPreviewButtonBgOnColor(const QColor &color) {
m_schematicPreviewButtonBgOnColor = color;
}
void setSchematicPreviewButtonOnImage(const QIcon &image) {
m_schematicPreviewButtonOnImage = image;
}
void setSchematicPreviewButtonBgOffColor(const QColor &color) {
m_schematicPreviewButtonBgOffColor = color;
}
void setSchematicPreviewButtonOffImage(const QIcon &image) {
m_schematicPreviewButtonOffImage = image;
}
QColor getSchematicPreviewButtonBgOnColor() const {
return m_schematicPreviewButtonBgOnColor;
}
QIcon getSchematicPreviewButtonOnImage() const {
return m_schematicPreviewButtonOnImage;
}
QColor getSchematicPreviewButtonBgOffColor() const {
return m_schematicPreviewButtonBgOffColor;
}
QIcon getSchematicPreviewButtonOffImage() const {
return m_schematicPreviewButtonOffImage;
}
// Schematic Camstand Button
void setSchematicCamstandButtonBgOnColor(const QColor &color) {
m_schematicCamstandButtonBgOnColor = color;
}
void setSchematicCamstandButtonOnImage(const QIcon &image) {
m_schematicCamstandButtonOnImage = image;
}
void setSchematicCamstandButtonTranspImage(const QIcon &image) {
m_schematicCamstandButtonTranspImage = image;
}
void setSchematicCamstandButtonBgOffColor(const QColor &color) {
m_schematicCamstandButtonBgOffColor = color;
}
void setSchematicCamstandButtonOffImage(const QIcon &image) {
m_schematicCamstandButtonOffImage = image;
}
QColor getSchematicCamstandButtonBgOnColor() const {
return m_schematicCamstandButtonBgOnColor;
}
QIcon getSchematicCamstandButtonOnImage() const {
return m_schematicCamstandButtonOnImage;
}
QIcon getSchematicCamstandButtonTranspImage() const {
return m_schematicCamstandButtonTranspImage;
}
QColor getSchematicCamstandButtonBgOffColor() const {
return m_schematicCamstandButtonBgOffColor;
}
QIcon getSchematicCamstandButtonOffImage() const {
return m_schematicCamstandButtonOffImage;
}
void getNodeColor(int ltype, QColor &nodeColor);
QColor getSelectedNodeTextColor();
2018-07-20 22:15:22 +12:00
void setCursorMode(CursorMode mode);
2016-03-19 06:57:51 +13:00
public slots:
2016-06-15 18:43:10 +12:00
void updateSchematic();
2016-03-19 06:57:51 +13:00
signals:
2016-06-15 18:43:10 +12:00
void showPreview(TFxP);
void doCollapse(const QList<TFxP> &);
void doCollapse(QList<TStageObjectId>);
void doExplodeChild(const QList<TFxP> &);
void doExplodeChild(QList<TStageObjectId>);
void editObject();
2016-03-19 06:57:51 +13:00
2020-04-17 19:02:53 +12:00
void doDeleteFxs(const FxSelection *);
void doDeleteStageObjects(const StageObjectSelection *);
2021-03-04 20:57:24 +13:00
void columnPasted(const QList<TXshColumnP> &);
2016-03-19 06:57:51 +13:00
protected slots:
2016-06-15 18:43:10 +12:00
void onSceneChanged();
void onSceneSwitched();
void updateScenes();
void changeNodeSize();
2016-03-19 06:57:51 +13:00
2018-07-20 22:15:22 +12:00
void selectModeEnabled();
void zoomModeEnabled();
void handModeEnabled();
2020-04-17 19:02:53 +12:00
void deleteFxs();
void deleteStageObjects();
2016-03-19 06:57:51 +13:00
private:
2016-06-15 18:43:10 +12:00
SchematicSceneViewer *m_viewer;
StageSchematicScene *m_stageScene;
FxSchematicScene *m_fxScene;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
TSceneHandle *m_sceneHandle;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
QToolBar *m_stageToolbar, *m_commonToolbar, *m_fxToolbar, *m_swapToolbar;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
QAction *m_fitSchematic, *m_centerOn, *m_reorder, *m_normalize, *m_nodeSize,
2018-07-20 22:15:22 +12:00
*m_changeScene, *m_selectMode, *m_zoomMode, *m_handMode;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
bool m_fullSchematic, m_maximizedNode;
2016-03-19 06:57:51 +13:00
2018-07-21 00:14:21 +12:00
CursorMode m_cursorMode;
2018-07-20 22:15:22 +12:00
2016-03-19 06:57:51 +13:00
private:
2016-06-15 18:43:10 +12:00
void createToolbars();
void createActions();
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void setStageSchematic();
void setFxSchematic();
2016-03-19 06:57:51 +13:00
};
2016-06-15 18:43:10 +12:00
#endif // SCHEMATICVIEWER_H