af90cdedbe
* 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>
787 lines
21 KiB
C++
787 lines
21 KiB
C++
#pragma once
|
|
|
|
#ifndef TOOLOPTIONS_H
|
|
#define TOOLOPTIONS_H
|
|
|
|
// TnzQt includes
|
|
#include "toonzqt/checkbox.h"
|
|
|
|
// TnzLib includes
|
|
#include "toonz/tstageobject.h"
|
|
|
|
// TnzCore includes
|
|
#include "tcommon.h"
|
|
#include "tproperty.h"
|
|
|
|
// Qt includes
|
|
#include <QFrame>
|
|
#include <QAction>
|
|
#include <QList>
|
|
#include <QToolBar>
|
|
#include <QMap>
|
|
#include <QLabel>
|
|
#include <QRadioButton>
|
|
|
|
// STD includes
|
|
#include <map>
|
|
|
|
#undef DVAPI
|
|
#undef DVVAR
|
|
#ifdef TNZTOOLS_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 TTool;
|
|
class ToolOptionToolBar;
|
|
class TPropertyGroup;
|
|
class TPaletteHandle;
|
|
class TFrameHandle;
|
|
class TObjectHandle;
|
|
class TXsheetHandle;
|
|
class ToolHandle;
|
|
class SelectionScaleField;
|
|
class SelectionRotationField;
|
|
class SelectionMoveField;
|
|
class ToolOptionSlider;
|
|
class ToolOptionIntSlider;
|
|
class ThickChangeField;
|
|
class ToolOptionCombo;
|
|
class ToolOptionCheckbox;
|
|
class PegbarChannelField;
|
|
class ToolOptionPairSlider;
|
|
class ToolOptionControl;
|
|
class ToolOptionPopupButton;
|
|
class TXshLevelHandle;
|
|
class NoScaleField;
|
|
class PegbarCenterField;
|
|
class RGBLabel;
|
|
class MeasuredValueField;
|
|
class PaletteController;
|
|
class ClickableLabel;
|
|
|
|
class QLabel;
|
|
class QPushButton;
|
|
class QPropertyAnimation;
|
|
class QFrame;
|
|
class QHBoxLayout;
|
|
class QComboBox;
|
|
class QStackedWidget;
|
|
|
|
//=============================================================================
|
|
|
|
// Preprocessor definitions
|
|
|
|
#define TOOL_OPTIONS_LEFT_MARGIN 5
|
|
|
|
//=============================================================================
|
|
|
|
//***********************************************************************************************
|
|
// ToolOptionToolBar declaration
|
|
//***********************************************************************************************
|
|
|
|
class ToolOptionToolBar final : public QToolBar {
|
|
public:
|
|
ToolOptionToolBar(QWidget *parent = 0);
|
|
|
|
void addSpacing(int width);
|
|
};
|
|
|
|
//***********************************************************************************************
|
|
// ToolOptionsBox declaration
|
|
//***********************************************************************************************
|
|
|
|
class ToolOptionsBox : public QFrame {
|
|
Q_OBJECT
|
|
|
|
protected:
|
|
QMap<std::string, ToolOptionControl *>
|
|
m_controls; //!< property name -> ToolOptionControl
|
|
QMap<std::string, QLabel *> m_labels;
|
|
|
|
QHBoxLayout *m_layout;
|
|
|
|
public:
|
|
ToolOptionsBox(QWidget *parent, bool isScrollable = true);
|
|
~ToolOptionsBox();
|
|
|
|
virtual void
|
|
updateStatus(); //!< Invokes updateStatus() on all registered controls
|
|
virtual void onStageObjectChange() {}
|
|
|
|
QHBoxLayout *hLayout() { return m_layout; }
|
|
void addControl(ToolOptionControl *control);
|
|
|
|
ToolOptionControl *control(const std::string &controlName) const;
|
|
|
|
QLabel *addLabel(QString name);
|
|
void addLabel(std::string propName, QLabel *label);
|
|
void addSeparator();
|
|
};
|
|
|
|
//***********************************************************************************************
|
|
// ToolOptionControlBuilder declaration
|
|
//***********************************************************************************************
|
|
|
|
class ToolOptionControlBuilder final : public TProperty::Visitor {
|
|
ToolOptionsBox *m_panel;
|
|
TTool *m_tool;
|
|
TPaletteHandle *m_pltHandle;
|
|
ToolHandle *m_toolHandle;
|
|
|
|
int m_singleValueWidgetType;
|
|
int m_enumWidgetType;
|
|
|
|
public:
|
|
ToolOptionControlBuilder(ToolOptionsBox *panel, TTool *tool,
|
|
TPaletteHandle *pltHandle,
|
|
ToolHandle *toolHandle = 0);
|
|
|
|
enum SingleValueWidgetType { SLIDER = 0, FIELD };
|
|
void setSingleValueWidgetType(int type) { m_singleValueWidgetType = type; }
|
|
|
|
enum EnumWidgetType { COMBOBOX = 0, POPUPBUTTON, FONTCOMBOBOX };
|
|
void setEnumWidgetType(int type) { m_enumWidgetType = type; }
|
|
|
|
private:
|
|
QHBoxLayout *hLayout() { return m_panel->hLayout(); }
|
|
QLabel *addLabel(TProperty *p);
|
|
|
|
void visit(TDoubleProperty *p);
|
|
void visit(TDoublePairProperty *p);
|
|
void visit(TIntPairProperty *p);
|
|
void visit(TIntProperty *p);
|
|
void visit(TBoolProperty *p);
|
|
void visit(TStringProperty *p);
|
|
void visit(TEnumProperty *p);
|
|
void visit(TStyleIndexProperty *p);
|
|
void visit(TPointerProperty *p);
|
|
};
|
|
|
|
//***********************************************************************************************
|
|
// GenericToolOptionsBox declaration
|
|
//***********************************************************************************************
|
|
|
|
class GenericToolOptionsBox : public ToolOptionsBox {
|
|
public:
|
|
GenericToolOptionsBox(QWidget *parent, TTool *tool, TPaletteHandle *pltHandle,
|
|
int propertyGroupIdx = 0, ToolHandle *toolHandle = 0,
|
|
bool scrollable = true);
|
|
};
|
|
|
|
//=============================================================================
|
|
//
|
|
// ArrowToolOptionsBox
|
|
//
|
|
//=============================================================================
|
|
|
|
class ArrowToolOptionsBox final : public ToolOptionsBox {
|
|
Q_OBJECT
|
|
|
|
enum AXIS { Position = 0, Rotation, Scale, Shear, CenterPosition, AllAxis };
|
|
|
|
TPropertyGroup *m_pg;
|
|
bool m_splined;
|
|
TTool *m_tool;
|
|
TFrameHandle *m_frameHandle;
|
|
TObjectHandle *m_objHandle;
|
|
TXsheetHandle *m_xshHandle;
|
|
|
|
QWidget **m_axisOptionWidgets;
|
|
QWidget *m_pickWidget;
|
|
|
|
// General
|
|
ToolOptionCombo *m_chooseActiveAxisCombo;
|
|
ToolOptionCombo *m_pickCombo;
|
|
// enable to choose the target pegbar from the combobox
|
|
QComboBox *m_currentStageObjectCombo;
|
|
|
|
// Position
|
|
PegbarChannelField *m_motionPathPosField;
|
|
PegbarChannelField *m_ewPosField;
|
|
PegbarChannelField *m_nsPosField;
|
|
PegbarChannelField *m_zField;
|
|
NoScaleField *m_noScaleZField;
|
|
ClickableLabel *m_motionPathPosLabel;
|
|
ClickableLabel *m_ewPosLabel;
|
|
ClickableLabel *m_nsPosLabel;
|
|
ClickableLabel *m_zLabel;
|
|
|
|
ToolOptionCheckbox *m_lockEWPosCheckbox;
|
|
ToolOptionCheckbox *m_lockNSPosCheckbox;
|
|
|
|
// SO = Stacked Order
|
|
ClickableLabel *m_soLabel;
|
|
PegbarChannelField *m_soField;
|
|
|
|
// Rotation
|
|
ClickableLabel *m_rotationLabel;
|
|
PegbarChannelField *m_rotationField;
|
|
|
|
// Scale
|
|
ClickableLabel *m_globalScaleLabel;
|
|
ClickableLabel *m_scaleHLabel;
|
|
ClickableLabel *m_scaleVLabel;
|
|
PegbarChannelField *m_globalScaleField;
|
|
PegbarChannelField *m_scaleHField;
|
|
PegbarChannelField *m_scaleVField;
|
|
ToolOptionCheckbox *m_lockScaleHCheckbox;
|
|
ToolOptionCheckbox *m_lockScaleVCheckbox;
|
|
ToolOptionCombo *m_maintainCombo;
|
|
|
|
// Shear
|
|
ClickableLabel *m_shearHLabel;
|
|
ClickableLabel *m_shearVLabel;
|
|
PegbarChannelField *m_shearHField;
|
|
PegbarChannelField *m_shearVField;
|
|
ToolOptionCheckbox *m_lockShearHCheckbox;
|
|
ToolOptionCheckbox *m_lockShearVCheckbox;
|
|
|
|
// Center Position
|
|
ClickableLabel *m_ewCenterLabel;
|
|
ClickableLabel *m_nsCenterLabel;
|
|
PegbarCenterField *m_ewCenterField;
|
|
PegbarCenterField *m_nsCenterField;
|
|
ToolOptionCheckbox *m_lockEWCenterCheckbox;
|
|
ToolOptionCheckbox *m_lockNSCenterCheckbox;
|
|
|
|
ToolOptionCheckbox *m_globalKey;
|
|
|
|
// enables adjusting value by dragging on the label
|
|
void connectLabelAndField(ClickableLabel *label, MeasuredValueField *field);
|
|
|
|
public:
|
|
ArrowToolOptionsBox(QWidget *parent, TTool *tool, TPropertyGroup *pg,
|
|
TFrameHandle *frameHandle, TObjectHandle *objHandle,
|
|
TXsheetHandle *xshHandle, ToolHandle *toolHandle);
|
|
|
|
void updateStatus();
|
|
void onStageObjectChange();
|
|
|
|
protected:
|
|
void showEvent(QShowEvent *);
|
|
void hideEvent(QShowEvent *);
|
|
|
|
void setSplined(bool on);
|
|
bool isCurrentObjectSplined() const;
|
|
|
|
protected slots:
|
|
void onFrameSwitched() { updateStatus(); }
|
|
// update the object list in combobox
|
|
void updateStageObjectComboItems();
|
|
// syncronize the current item in the combobox to the selected stage object
|
|
void syncCurrentStageObjectComboItem();
|
|
// change the current stage object when user changes it via combobox by hand
|
|
void onCurrentStageObjectComboActivated(int index);
|
|
|
|
void onCurrentAxisChanged(int);
|
|
};
|
|
|
|
//=============================================================================
|
|
//
|
|
// SelectionToolOptionsBox
|
|
//
|
|
//=============================================================================
|
|
|
|
class DraggableIconView : public QWidget {
|
|
Q_OBJECT
|
|
public:
|
|
DraggableIconView(QWidget *parent = 0) : QWidget(parent){};
|
|
|
|
protected:
|
|
// these are used for dragging on the icon to
|
|
// change the value of the field
|
|
void mousePressEvent(QMouseEvent *) override;
|
|
void mouseMoveEvent(QMouseEvent *) override;
|
|
void mouseReleaseEvent(QMouseEvent *) override;
|
|
|
|
signals:
|
|
void onMousePress(QMouseEvent *event);
|
|
void onMouseMove(QMouseEvent *event);
|
|
void onMouseRelease(QMouseEvent *event);
|
|
};
|
|
|
|
class IconViewField final : public DraggableIconView {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
enum IconType {
|
|
Icon_ScalePeg = 0,
|
|
Icon_Rotation,
|
|
Icon_Position,
|
|
Icon_Thickness,
|
|
Icon_Amount
|
|
};
|
|
|
|
private:
|
|
IconType m_iconType;
|
|
|
|
protected:
|
|
QPixmap m_pm[Icon_Amount];
|
|
Q_PROPERTY(
|
|
QPixmap ScalePegPixmap READ getScalePegPixmap WRITE setScalePegPixmap);
|
|
Q_PROPERTY(
|
|
QPixmap RotationPixmap READ getRotationPixmap WRITE setRotationPixmap);
|
|
Q_PROPERTY(
|
|
QPixmap PositionPixmap READ getPositionPixmap WRITE setPositionPixmap);
|
|
|
|
public:
|
|
IconViewField(QWidget *parent = 0, IconType iconType = Icon_ScalePeg);
|
|
|
|
QPixmap getScalePegPixmap() const { return m_pm[Icon_ScalePeg]; }
|
|
void setScalePegPixmap(const QPixmap &pixmap) {
|
|
m_pm[Icon_ScalePeg] = pixmap;
|
|
}
|
|
QPixmap getRotationPixmap() const { return m_pm[Icon_Rotation]; }
|
|
void setRotationPixmap(const QPixmap &pixmap) {
|
|
m_pm[Icon_Rotation] = pixmap;
|
|
}
|
|
QPixmap getPositionPixmap() const { return m_pm[Icon_Position]; }
|
|
void setPositionPixmap(const QPixmap &pixmap) {
|
|
m_pm[Icon_Position] = pixmap;
|
|
}
|
|
|
|
protected:
|
|
void paintEvent(QPaintEvent *e);
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
class SelectionToolOptionsBox final : public ToolOptionsBox,
|
|
public TProperty::Listener {
|
|
Q_OBJECT
|
|
|
|
TTool *m_tool;
|
|
|
|
ToolOptionCheckbox *m_setSaveboxCheckbox;
|
|
bool m_isVectorSelction;
|
|
QLabel *m_scaleXLabel;
|
|
SelectionScaleField *m_scaleXField;
|
|
QLabel *m_scaleYLabel;
|
|
SelectionScaleField *m_scaleYField;
|
|
DVGui::CheckBox *m_scaleLink;
|
|
SelectionRotationField *m_rotationField;
|
|
QLabel *m_moveXLabel;
|
|
SelectionMoveField *m_moveXField;
|
|
QLabel *m_moveYLabel;
|
|
SelectionMoveField *m_moveYField;
|
|
ThickChangeField *m_thickChangeField;
|
|
|
|
ToolOptionPopupButton *m_capStyle;
|
|
ToolOptionPopupButton *m_joinStyle;
|
|
ToolOptionIntSlider *m_miterField;
|
|
|
|
public:
|
|
SelectionToolOptionsBox(QWidget *parent, TTool *tool,
|
|
TPaletteHandle *pltHandle, ToolHandle *toolHandle);
|
|
|
|
void updateStatus();
|
|
void onPropertyChanged();
|
|
|
|
protected slots:
|
|
// addToUndo is only set to false when dragging with the mouse
|
|
// to set the value. It is set to true on mouse release.
|
|
void onScaleXValueChanged(bool addToUndo = true);
|
|
void onScaleYValueChanged(bool addToUndo = true);
|
|
void onSetSaveboxCheckboxChanged(bool);
|
|
};
|
|
|
|
//=============================================================================
|
|
//
|
|
// GeometricToolOptionsBox
|
|
//
|
|
//=============================================================================
|
|
|
|
class GeometricToolOptionsBox final : public ToolOptionsBox {
|
|
Q_OBJECT
|
|
|
|
int m_targetType;
|
|
|
|
QLabel *m_poligonSideLabel, *m_hardnessLabel;
|
|
ToolOptionSlider *m_hardnessField;
|
|
ToolOptionIntSlider *m_poligonSideField;
|
|
ToolOptionCombo *m_shapeField;
|
|
ToolOptionCheckbox *m_pencilMode;
|
|
ToolOptionIntSlider *m_miterField;
|
|
ToolOptionCheckbox *m_snapCheckbox, *m_smoothCheckbox;
|
|
ToolOptionCombo *m_snapSensitivityCombo;
|
|
TTool *m_tool;
|
|
|
|
public:
|
|
GeometricToolOptionsBox(QWidget *parent, TTool *tool,
|
|
TPaletteHandle *pltHandle, ToolHandle *toolHandle);
|
|
|
|
void updateStatus();
|
|
|
|
protected slots:
|
|
void onShapeValueChanged(int);
|
|
void onPencilModeToggled(bool);
|
|
void onJoinStyleChanged(int);
|
|
};
|
|
|
|
//=============================================================================
|
|
//
|
|
// TypeToolOptionsBox
|
|
//
|
|
//=============================================================================
|
|
|
|
class TypeToolOptionsBox final : public ToolOptionsBox {
|
|
Q_OBJECT
|
|
|
|
TTool *m_tool;
|
|
|
|
public:
|
|
TypeToolOptionsBox(QWidget *parent, TTool *tool, TPaletteHandle *pltHandle,
|
|
ToolHandle *toolHandle);
|
|
|
|
void updateStatus();
|
|
|
|
protected slots:
|
|
void onFieldChanged();
|
|
};
|
|
|
|
//=============================================================================
|
|
//
|
|
// PaintbrushToolOptionsBox
|
|
//
|
|
//=============================================================================
|
|
|
|
class PaintbrushToolOptionsBox final : public ToolOptionsBox {
|
|
Q_OBJECT
|
|
|
|
ToolOptionCombo *m_colorMode;
|
|
ToolOptionCheckbox *m_selectiveMode;
|
|
|
|
public:
|
|
PaintbrushToolOptionsBox(QWidget *parent, TTool *tool,
|
|
TPaletteHandle *pltHandle, ToolHandle *toolHandle);
|
|
|
|
void updateStatus();
|
|
|
|
protected slots:
|
|
void onColorModeChanged(int);
|
|
};
|
|
|
|
//=============================================================================
|
|
//
|
|
// FullColorFillToolOptionsBox
|
|
//
|
|
//=============================================================================
|
|
|
|
class FullColorFillToolOptionsBox final : public ToolOptionsBox {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
FullColorFillToolOptionsBox(QWidget *parent, TTool *tool,
|
|
TPaletteHandle *pltHandle,
|
|
ToolHandle *toolHandle);
|
|
};
|
|
|
|
//=============================================================================
|
|
//
|
|
// FillToolOptionsBox
|
|
//
|
|
//=============================================================================
|
|
|
|
class FillToolOptionsBox final : public ToolOptionsBox {
|
|
Q_OBJECT
|
|
|
|
int m_targetType;
|
|
QLabel *m_fillDepthLabel;
|
|
ToolOptionCombo *m_colorMode, *m_toolType;
|
|
ToolOptionCheckbox *m_selectiveMode, *m_segmentMode, *m_onionMode,
|
|
*m_multiFrameMode, *m_autopaintMode;
|
|
ToolOptionPairSlider *m_fillDepthField;
|
|
|
|
public:
|
|
FillToolOptionsBox(QWidget *parent, TTool *tool, TPaletteHandle *pltHandle,
|
|
ToolHandle *toolHandle);
|
|
|
|
void updateStatus();
|
|
|
|
protected slots:
|
|
void onColorModeChanged(int);
|
|
void onToolTypeChanged(int);
|
|
void onOnionModeToggled(bool);
|
|
void onMultiFrameModeToggled(bool);
|
|
};
|
|
|
|
//=============================================================================
|
|
//
|
|
// BrushToolOptionsBox
|
|
//
|
|
//=============================================================================
|
|
|
|
class BrushToolOptionsBox final : public ToolOptionsBox {
|
|
Q_OBJECT
|
|
|
|
TTool *m_tool;
|
|
|
|
ToolOptionCheckbox *m_pencilMode;
|
|
QLabel *m_hardnessLabel;
|
|
ToolOptionSlider *m_hardnessField;
|
|
ToolOptionPopupButton *m_joinStyleCombo;
|
|
ToolOptionIntSlider *m_miterField;
|
|
ToolOptionCombo *m_presetCombo;
|
|
ToolOptionCheckbox *m_snapCheckbox;
|
|
ToolOptionCombo *m_snapSensitivityCombo;
|
|
QPushButton *m_addPresetButton;
|
|
QPushButton *m_removePresetButton;
|
|
|
|
private:
|
|
class PresetNamePopup;
|
|
PresetNamePopup *m_presetNamePopup;
|
|
void filterControls();
|
|
|
|
public:
|
|
BrushToolOptionsBox(QWidget *parent, TTool *tool, TPaletteHandle *pltHandle,
|
|
ToolHandle *toolHandle);
|
|
|
|
void updateStatus();
|
|
|
|
protected slots:
|
|
|
|
void onPencilModeToggled(bool);
|
|
void onAddPreset();
|
|
void onRemovePreset();
|
|
};
|
|
|
|
//=============================================================================
|
|
//
|
|
// EraserToolOptionsBox
|
|
//
|
|
//=============================================================================
|
|
|
|
class EraserToolOptionsBox final : public ToolOptionsBox {
|
|
Q_OBJECT
|
|
|
|
ToolOptionCheckbox *m_pencilMode, *m_invertMode, *m_multiFrameMode;
|
|
ToolOptionCombo *m_toolType, *m_colorMode;
|
|
QLabel *m_hardnessLabel;
|
|
ToolOptionSlider *m_hardnessField;
|
|
|
|
public:
|
|
EraserToolOptionsBox(QWidget *parent, TTool *tool, TPaletteHandle *pltHandle,
|
|
ToolHandle *toolHandle);
|
|
|
|
void updateStatus();
|
|
|
|
protected slots:
|
|
void onPencilModeToggled(bool);
|
|
void onToolTypeChanged(int);
|
|
void onColorModeChanged(int);
|
|
};
|
|
|
|
//=============================================================================
|
|
//
|
|
// RulerToolOptionsBox
|
|
//
|
|
//=============================================================================
|
|
|
|
class RulerToolOptionsBox final : public ToolOptionsBox {
|
|
Q_OBJECT
|
|
|
|
MeasuredValueField *m_Xfld;
|
|
MeasuredValueField *m_Yfld;
|
|
MeasuredValueField *m_Wfld;
|
|
MeasuredValueField *m_Hfld;
|
|
MeasuredValueField *m_Afld;
|
|
MeasuredValueField *m_Lfld;
|
|
|
|
QLabel *m_XpixelFld;
|
|
QLabel *m_YpixelFld;
|
|
QLabel *m_WpixelFld;
|
|
QLabel *m_HpixelFld;
|
|
|
|
TTool *m_tool;
|
|
|
|
public:
|
|
RulerToolOptionsBox(QWidget *parent, TTool *tool);
|
|
|
|
void updateValues(bool isRasterLevelEditing, double X, double Y, double W,
|
|
double H, double A, double L, int Xpix = 0, int Ypix = 0,
|
|
int Wpix = 0, int Hpix = 0);
|
|
|
|
void resetValues();
|
|
};
|
|
|
|
//=============================================================================
|
|
//
|
|
// TapeToolOptionsBox
|
|
//
|
|
//=============================================================================
|
|
|
|
class TapeToolOptionsBox final : public ToolOptionsBox {
|
|
Q_OBJECT
|
|
|
|
ToolOptionCheckbox *m_smoothMode, *m_joinStrokesMode;
|
|
ToolOptionCombo *m_toolMode, *m_typeMode;
|
|
QLabel *m_autocloseLabel;
|
|
ToolOptionSlider *m_autocloseField;
|
|
|
|
public:
|
|
TapeToolOptionsBox(QWidget *parent, TTool *tool, TPaletteHandle *pltHandle,
|
|
ToolHandle *toolHandle);
|
|
|
|
void updateStatus();
|
|
|
|
protected slots:
|
|
void onToolTypeChanged(int);
|
|
void onToolModeChanged(int);
|
|
void onJoinStrokesModeChanged();
|
|
};
|
|
|
|
//=============================================================================
|
|
//
|
|
// RGBPickerToolOptionsBox
|
|
//
|
|
//=============================================================================
|
|
|
|
class RGBPickerToolOptionsBox final : public ToolOptionsBox {
|
|
Q_OBJECT
|
|
ToolOptionCheckbox *m_realTimePickMode;
|
|
// label with background color
|
|
RGBLabel *m_currentRGBLabel;
|
|
|
|
public:
|
|
RGBPickerToolOptionsBox(QWidget *parent, TTool *tool,
|
|
TPaletteHandle *pltHandle, ToolHandle *toolHandle,
|
|
PaletteController *paletteController);
|
|
void updateStatus();
|
|
protected slots:
|
|
void updateRealTimePickLabel(const QColor &);
|
|
};
|
|
|
|
//=============================================================================
|
|
//
|
|
// StylePickerToolOptionsBox
|
|
//
|
|
//=============================================================================
|
|
|
|
class StylePickerToolOptionsBox final : public ToolOptionsBox {
|
|
Q_OBJECT
|
|
ToolOptionCheckbox *m_realTimePickMode;
|
|
|
|
QLabel *m_currentStyleLabel;
|
|
|
|
public:
|
|
StylePickerToolOptionsBox(QWidget *parent, TTool *tool,
|
|
TPaletteHandle *pltHandle, ToolHandle *toolHandle,
|
|
PaletteController *paletteController);
|
|
void updateStatus();
|
|
protected slots:
|
|
void updateRealTimePickLabel(const int, const int, const int);
|
|
};
|
|
|
|
//=============================================================================
|
|
//
|
|
// ShiftTraceToolOptionBox
|
|
// shown only when "Edit Shift" mode is active
|
|
//
|
|
//=============================================================================
|
|
|
|
class ShiftTraceToolOptionBox final : public ToolOptionsBox {
|
|
Q_OBJECT
|
|
QFrame *m_prevFrame, *m_afterFrame;
|
|
QRadioButton *m_prevRadioBtn, *m_afterRadioBtn;
|
|
QPushButton *m_resetPrevGhostBtn, *m_resetAfterGhostBtn;
|
|
TTool *m_tool;
|
|
void resetGhost(int index);
|
|
|
|
protected:
|
|
void showEvent(QShowEvent *);
|
|
void hideEvent(QShowEvent *);
|
|
|
|
public:
|
|
ShiftTraceToolOptionBox(QWidget *parent = 0, TTool *tool = 0);
|
|
void updateStatus() override;
|
|
protected slots:
|
|
void onResetPrevGhostBtnPressed();
|
|
void onResetAfterGhostBtnPressed();
|
|
void onPrevRadioBtnClicked();
|
|
void onAfterRadioBtnClicked();
|
|
void updateColors();
|
|
};
|
|
|
|
//=============================================================================
|
|
//
|
|
// ZoomToolOptionsBox
|
|
//
|
|
//=============================================================================
|
|
|
|
class ZoomToolOptionsBox final : public ToolOptionsBox {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
ZoomToolOptionsBox(QWidget *parent, TTool *tool, TPaletteHandle *pltHandle,
|
|
ToolHandle *toolHandle);
|
|
};
|
|
|
|
//=============================================================================
|
|
//
|
|
// RotateToolOptionsBox
|
|
//
|
|
//=============================================================================
|
|
|
|
class RotateToolOptionsBox final : public ToolOptionsBox {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
RotateToolOptionsBox(QWidget *parent, TTool *tool, TPaletteHandle *pltHandle,
|
|
ToolHandle *toolHandle);
|
|
};
|
|
|
|
//=============================================================================
|
|
//
|
|
// HandToolOptionsBox
|
|
//
|
|
//=============================================================================
|
|
|
|
class HandToolOptionsBox final : public ToolOptionsBox {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
HandToolOptionsBox(QWidget *parent, TTool *tool, TPaletteHandle *pltHandle,
|
|
ToolHandle *toolHandle);
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
class DVAPI ToolOptions final : public QFrame {
|
|
Q_OBJECT
|
|
|
|
int m_width, m_height;
|
|
std::map<TTool *, ToolOptionsBox *> m_panels;
|
|
QWidget *m_panel;
|
|
|
|
public:
|
|
ToolOptions();
|
|
~ToolOptions();
|
|
|
|
QWidget *getPanel() const { return m_panel; }
|
|
|
|
protected:
|
|
void showEvent(QShowEvent *);
|
|
void hideEvent(QShowEvent *);
|
|
|
|
public slots:
|
|
|
|
void onToolSwitched();
|
|
void onToolChanged();
|
|
void onStageObjectChange();
|
|
|
|
signals:
|
|
// used in ComboViewer to handle Tab focus
|
|
void newPanelCreated();
|
|
|
|
// void toolOptionChange();
|
|
};
|
|
|
|
#endif // PANE_H
|