tahoma2d/toonz/sources/toonzqt/flipconsole.cpp

2164 lines
71 KiB
C++
Raw Normal View History

2016-03-19 06:57:51 +13:00
#include "toonzqt/flipconsole.h"
// TnzQt includes
#include "toonzqt/menubarcommand.h"
#include "toonzqt/dvscrollwidget.h"
#include "toonzqt/gutil.h"
#include "toonzqt/flipconsoleowner.h"
#include "toonzqt/dvdialog.h"
2016-03-19 06:57:51 +13:00
// TnzLib includes
#include "toonz/preferences.h"
#include "toonz/tframehandle.h"
// TnzBase includes
#include "tenv.h"
// TnzCore includes
#include "tconvert.h"
#include "timagecache.h"
#include "trop.h"
#include "../toonz/tapp.h"
// Qt includes
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QToolBar>
#include <QLabel>
#include <QFrame>
#include <QSlider>
#include <QTimerEvent>
#include <QToolButton>
#include <QPainter>
#include <QMouseEvent>
#include <QIcon>
#include <QAction>
#include <QWidgetAction>
#include <QStyle>
#include <QStylePainter>
#include <QStyleOption>
#include <QStyleOptionFrameV3>
#include <QSettings>
#include <QPushButton>
#include <QScrollBar>
using namespace DVGui;
//==========================================================================================
// Preliminary stuff - local namespace
//==========================================================================================
TEnv::IntVar FlipBookWhiteBgToggle("FlipBookWhiteBgToggle", 1);
TEnv::IntVar FlipBookBlackBgToggle("FlipBookBlackBgToggle", 0);
TEnv::IntVar FlipBookCheckBgToggle("FlipBookCheckBgToggle", 0);
2016-06-15 18:43:10 +12:00
namespace {
// Please refer to the "qss/standard/standard.qss" file for explanations of the
// following properties.
2016-03-19 06:57:51 +13:00
int PBHeight;
QImage PBOverlay;
QImage PBMarker;
2016-06-15 18:43:10 +12:00
int PBColorMarginLeft = 0;
int PBColorMarginTop = 0;
int PBColorMarginRight = 0;
2016-03-19 06:57:51 +13:00
int PBColorMarginBottom = 0;
2016-06-15 18:43:10 +12:00
int PBMarkerMarginLeft = 0;
2016-03-19 06:57:51 +13:00
int PBMarkerMarginRight = 0;
2016-06-15 18:43:10 +12:00
QColor PBBaseColor = QColor(235, 235, 235);
2016-03-19 06:57:51 +13:00
QColor PBNotStartedColor = QColor(210, 40, 40);
2016-06-15 18:43:10 +12:00
QColor PBStartedColor = QColor(220, 160, 160);
QColor PBFinishedColor = QColor(235, 235, 235);
2019-08-26 15:47:54 +12:00
} // namespace
2016-03-19 06:57:51 +13:00
//-----------------------------------------------------------------------------
int FlipSlider::getPBHeight() const { return PBHeight; }
2016-06-15 18:43:10 +12:00
void FlipSlider::setPBHeight(int height) {
setFixedHeight(height);
PBHeight = height;
2016-03-19 06:57:51 +13:00
}
QImage FlipSlider::getPBOverlay() const { return PBOverlay; }
void FlipSlider::setPBOverlay(const QImage &img) { PBOverlay = img; }
QImage FlipSlider::getPBMarker() const { return PBMarker; }
void FlipSlider::setPBMarker(const QImage &img) { PBMarker = img; }
int FlipSlider::getPBColorMarginLeft() const { return PBColorMarginLeft; }
2016-06-15 18:43:10 +12:00
void FlipSlider::setPBColorMarginLeft(int margin) {
PBColorMarginLeft = margin;
}
2016-03-19 06:57:51 +13:00
int FlipSlider::getPBColorMarginTop() const { return PBColorMarginTop; }
void FlipSlider::setPBColorMarginTop(int margin) { PBColorMarginTop = margin; }
int FlipSlider::getPBColorMarginRight() const { return PBColorMarginRight; }
2016-06-15 18:43:10 +12:00
void FlipSlider::setPBColorMarginRight(int margin) {
PBColorMarginRight = margin;
}
2016-03-19 06:57:51 +13:00
int FlipSlider::getPBColorMarginBottom() const { return PBColorMarginBottom; }
2016-06-15 18:43:10 +12:00
void FlipSlider::setPBColorMarginBottom(int margin) {
PBColorMarginBottom = margin;
}
2016-03-19 06:57:51 +13:00
int FlipSlider::getPBMarkerMarginLeft() const { return PBMarkerMarginLeft; }
2016-06-15 18:43:10 +12:00
void FlipSlider::setPBMarkerMarginLeft(int margin) {
PBMarkerMarginLeft = margin;
}
2016-03-19 06:57:51 +13:00
int FlipSlider::getPBMarkerMarginRight() const { return PBMarkerMarginRight; }
2016-06-15 18:43:10 +12:00
void FlipSlider::setPBMarkerMarginRight(int margin) {
PBMarkerMarginRight = margin;
}
2016-03-19 06:57:51 +13:00
QColor FlipSlider::getBaseColor() const { return PBBaseColor; }
void FlipSlider::setBaseColor(const QColor &color) { PBBaseColor = color; }
QColor FlipSlider::getNotStartedColor() const { return PBNotStartedColor; }
2016-06-15 18:43:10 +12:00
void FlipSlider::setNotStartedColor(const QColor &color) {
PBNotStartedColor = color;
}
2016-03-19 06:57:51 +13:00
QColor FlipSlider::getStartedColor() const { return PBStartedColor; }
2016-06-15 18:43:10 +12:00
void FlipSlider::setStartedColor(const QColor &color) {
PBStartedColor = color;
}
2016-03-19 06:57:51 +13:00
QColor FlipSlider::getFinishedColor() const { return PBFinishedColor; }
2016-06-15 18:43:10 +12:00
void FlipSlider::setFinishedColor(const QColor &color) {
PBFinishedColor = color;
}
2016-03-19 06:57:51 +13:00
FlipConsole *FlipConsole::m_currentConsole = 0;
QList<FlipConsole *> FlipConsole::m_visibleConsoles;
bool FlipConsole::m_isLinkedPlaying = false;
2016-06-15 18:43:10 +12:00
bool FlipConsole::m_areLinked = false;
2016-03-19 06:57:51 +13:00
//==========================================================================================
2016-06-15 18:43:10 +12:00
PlaybackExecutor::PlaybackExecutor() : m_fps(25), m_abort(false) {}
2016-03-19 06:57:51 +13:00
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void PlaybackExecutor::resetFps(int fps) { m_fps = fps; }
2016-03-19 06:57:51 +13:00
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void PlaybackExecutor::run() {
// (Daniele)
// We'll build the fps considering an interval of roughly 1 second (the last
// one).
// However, the fps should be sampled at a faster rate. Each sample is taken
// at
// 1/4 second, and the last 4 samples data are stored to keep trace of the
// last
// second of playback.
TStopWatch timer;
timer.start();
TUINT32 timeResolution =
250; // Use a sufficient sampling resolution (currently 1/4 sec).
// Fps calculation is made once per sample.
int fps = m_fps, currSample = 0;
TUINT32 playedFramesCount = 0;
TUINT32 loadedInstant, nextSampleInstant = timeResolution;
TUINT32 sampleTotalLoadingTime = 0;
2020-05-25 10:00:44 +12:00
TUINT32 lastFrameCounts[4] = {0, 0, 0,
2016-06-15 18:43:10 +12:00
0}; // Keep the last 4 'played frames' counts.
TUINT32 lastSampleInstants[4] = {0, 0, 0,
0}; // Same for the last sampling instants
2020-05-25 10:00:44 +12:00
TUINT32 lastLoadingTimes[4] = {0, 0, 0,
2016-06-15 18:43:10 +12:00
0}; // Same for total sample loading times
double targetFrameTime =
1000.0 / abs(m_fps); // User-required time between frames
TUINT32 emissionInstant = 0; // Effective instant in which loading is invoked
double emissionInstantD = 0.0; // Double precision version of the above
double lastLoadingTime = 0.0; // Mean frame loading time in the last sample
while (!m_abort) {
emissionInstant = timer.getTotalTime();
// Draw the next frame
2020-05-25 10:00:44 +12:00
if (playedFramesCount) emit nextFrame(fps); // Show the next frame, telling
// currently measured fps
2016-06-15 18:43:10 +12:00
if (FlipConsole::m_areLinked) {
// In case there are linked consoles, update them too.
// Their load time must be included in the fps calculation.
int i, consolesCount = FlipConsole::m_visibleConsoles.size();
for (i = 0; i < consolesCount; ++i) {
FlipConsole *console = FlipConsole::m_visibleConsoles.at(i);
if (console->isLinkable() && console != FlipConsole::m_currentConsole)
console->playbackExecutor().emitNextFrame(m_fps < 0 ? -fps : fps);
}
}
//-------- Each nextFrame() blocks until the frame has been shown ---------
++playedFramesCount;
loadedInstant = timer.getTotalTime();
sampleTotalLoadingTime += (loadedInstant - emissionInstant);
// Recalculate data only after the specified time resolution has passed.
if (loadedInstant > nextSampleInstant) {
// Sampling instant. Perform calculations.
// Store values
TUINT32 framesCount = playedFramesCount - lastFrameCounts[currSample];
TUINT32 elapsedTime = loadedInstant - lastSampleInstants[currSample];
double loadingTime =
(sampleTotalLoadingTime - lastLoadingTimes[currSample]) /
(double)framesCount;
lastFrameCounts[currSample] = playedFramesCount;
lastSampleInstants[currSample] = loadedInstant;
lastLoadingTimes[currSample] = sampleTotalLoadingTime;
currSample = (currSample + 1) % 4;
nextSampleInstant = loadedInstant + timeResolution;
// Rebuild current fps
fps = troundp((1000 * framesCount) / (double)elapsedTime);
targetFrameTime = 1000.0 / abs(m_fps); // m_fps could have changed...
// In case the playback is too slow to keep the required pace, reset the
// emission timeline.
// Otherwise, it should be kept as the difference needs to be compensated
// to get the required fps.
if ((int)emissionInstant - (int)emissionInstantD >
20) // Reset beyond, say, 20 msecs tolerance.
emissionInstantD = (double)loadedInstant - loadingTime;
else
emissionInstantD +=
lastLoadingTime -
loadingTime; // Otherwise, just adapt to the new loading time
lastLoadingTime = loadingTime;
}
// Calculate the new emission instant
emissionInstant = std::max((int)(emissionInstantD += targetFrameTime), 0);
// Sleep until the next emission instant has been reached
while (timer.getTotalTime() < emissionInstant) msleep(1);
}
m_abort = false;
emit(playbackAborted());
2016-03-19 06:57:51 +13:00
}
//==========================================================================================
FlipSlider::FlipSlider(QWidget *parent)
2016-06-15 18:43:10 +12:00
: QAbstractSlider(parent), m_enabled(false), m_progressBarStatus(0) {
setObjectName("FlipSlider");
setOrientation(Qt::Horizontal);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipSlider::paintEvent(QPaintEvent *ev) {
QPainter p(this);
// Draw the progress status colorbar
QRect sliderRect(QPoint(), size());
QRect colorRect(sliderRect.adjusted(PBMarkerMarginLeft, PBColorMarginTop,
-PBMarkerMarginRight,
-PBColorMarginBottom));
int val, maxValuePlusStep = maximum() + singleStep();
int colorWidth = colorRect.width(), colorHeight = colorRect.height();
p.setPen(Qt::NoPen);
int currPos = PBColorMarginLeft, nextPos;
// paint the base of slider
if (m_enabled && m_progressBarStatus && !m_progressBarStatus->empty()) {
unsigned int i, pbStatusSize = m_progressBarStatus->size();
for (i = 0, val = minimum() + singleStep(); i < pbStatusSize;
++i, val += singleStep()) {
nextPos = sliderPositionFromValue(minimum(), maxValuePlusStep, val,
colorWidth) +
PBMarkerMarginLeft;
if (i == pbStatusSize - 1) nextPos += PBMarkerMarginRight;
p.fillRect(currPos, PBColorMarginTop, nextPos - currPos, colorHeight,
((*m_progressBarStatus)[i] == PBFrameStarted)
? PBStartedColor
: ((*m_progressBarStatus)[i] == PBFrameFinished)
? PBFinishedColor
: PBNotStartedColor);
currPos = nextPos;
}
// Draw frames outside the pb
if (val < maximum())
p.fillRect(currPos, PBColorMarginTop,
width() - PBColorMarginRight - currPos, colorHeight,
PBNotStartedColor);
} else
p.fillRect(PBColorMarginLeft, PBColorMarginTop,
sliderRect.width() - PBColorMarginLeft - PBColorMarginRight,
colorHeight, PBBaseColor);
// Draw the PB Overlay
int overlayInnerWidth =
PBOverlay.width() - PBColorMarginLeft - PBColorMarginRight;
int markerInnerWidth =
PBMarker.width() - PBMarkerMarginLeft - PBMarkerMarginRight;
p.drawImage(QRect(0, 0, PBColorMarginLeft, height()), PBOverlay,
QRect(0, 0, PBColorMarginLeft, PBOverlay.height()));
2020-05-25 10:00:44 +12:00
p.drawImage(QRect(PBColorMarginLeft, 0,
sliderRect.width() - PBColorMarginLeft - PBColorMarginRight,
height()),
PBOverlay, QRect(PBColorMarginLeft, 0, overlayInnerWidth,
PBOverlay.height()));
2016-06-15 18:43:10 +12:00
p.drawImage(
QRect(width() - PBColorMarginRight, 0, PBColorMarginRight, height()),
2020-05-25 10:00:44 +12:00
PBOverlay, QRect(PBOverlay.width() - PBColorMarginRight, 0,
PBColorMarginRight, PBOverlay.height()));
2016-06-15 18:43:10 +12:00
// Draw the position marker
currPos = sliderPositionFromValue(minimum(), maxValuePlusStep, value(),
colorWidth) +
PBMarkerMarginLeft;
nextPos = sliderPositionFromValue(minimum(), maxValuePlusStep,
value() + singleStep(), colorWidth) +
PBMarkerMarginLeft;
p.drawImage(
QRect(currPos - PBMarkerMarginLeft, 0, PBMarkerMarginLeft, height()),
PBMarker, QRect(0, 0, PBMarkerMarginLeft, PBMarker.height()));
p.drawImage(
QRect(currPos, 0, nextPos - currPos, height()), PBMarker,
QRect(PBMarkerMarginLeft, 0, markerInnerWidth, PBMarker.height()));
p.drawImage(QRect(nextPos, 0, PBMarkerMarginRight, height()), PBMarker,
QRect(PBMarker.width() - PBMarkerMarginRight, 0,
PBMarkerMarginRight, PBMarker.height()));
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
inline int FlipSlider::sliderPositionFromValue(int min, int max, int val,
int span) {
return tceil(span * ((val - min) / (double)(max - min)));
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
inline int FlipSlider::sliderValueFromPosition(int min, int max, int step,
int pos, int span) {
int colorBarPos = pos - PBColorMarginLeft;
int colorSpan = span - PBColorMarginLeft - PBColorMarginRight;
int tempRelativePos = (max - min + step) * (colorBarPos / (double)colorSpan);
return min + (tempRelativePos - tempRelativePos % step);
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
inline int FlipSlider::pageStepVal(int val) {
return tcrop(value() + pageStep() * tsign(val - value()), minimum(),
maximum());
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
// Mouse Press behaviour:
2016-03-19 06:57:51 +13:00
// a) If middle button, just put frame to cursor position
// b) If left button, and cursor on current frame pos, do like (a)
// c) If left button, and cursor NOT on curr.. perform a page up/down on
// the side of cursor pos
2016-06-15 18:43:10 +12:00
void FlipSlider::mousePressEvent(QMouseEvent *me) {
emit flipSliderPressed();
int cursorValue = sliderValueFromPosition(minimum(), maximum(), singleStep(),
me->pos().x(), width());
if (me->button() == Qt::MidButton)
if (cursorValue == value())
setSliderDown(true);
else {
// Move the page step
setValue(pageStepVal(cursorValue));
}
else if (me->button() == Qt::LeftButton && cursorValue != value())
setValue(cursorValue);
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipSlider::mouseMoveEvent(QMouseEvent *me) {
if (isSliderDown() || me->buttons() & Qt::LeftButton) {
int cursorValue = sliderValueFromPosition(
minimum(), maximum(), singleStep(), me->pos().x(), width());
setValue(cursorValue);
}
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipSlider::mouseReleaseEvent(QMouseEvent *me) {
setSliderDown(false);
emit flipSliderReleased();
2016-03-19 06:57:51 +13:00
}
//=============================================================================
FlipConsole::FlipConsole(QVBoxLayout *mainLayout, std::vector<int> gadgetsMask,
2016-06-15 18:43:10 +12:00
bool isLinkable, QWidget *customWidget,
const QString &customizeId,
FlipConsoleOwner *consoleOwner, bool enableBlanks)
: m_gadgetsMask(gadgetsMask)
, m_from(1)
, m_to(1)
, m_step(1)
, m_currentFrame(1)
, m_framesCount(1)
, m_settings()
, m_fps(24)
2017-07-26 17:05:17 +12:00
, m_sceneFps(24)
2016-06-15 18:43:10 +12:00
, m_isPlay(false)
, m_reverse(false)
, m_doubleRed(0)
, m_doubleGreen(0)
, m_doubleBlue(0)
, m_doubleRedAction(0)
, m_doubleGreenAction(0)
, m_doubleBlueAction(0)
, m_fpsSlider(0)
, m_markerFrom(0)
, m_markerTo(-1)
, m_playbackExecutor()
, m_drawBlanksEnabled(enableBlanks)
, m_blanksCount(0)
, m_blankColor(TPixel::Transparent)
, m_blanksToDraw(0)
, m_isLinkable(isLinkable)
, m_customAction(0)
, m_customizeMask(eShowHowMany - 1)
, m_fpsLabelAction(0)
, m_fpsSliderAction(0)
, m_fpsFieldAction(0)
, m_fpsField(0)
, m_customizeId(customizeId)
, m_histoSep(0)
, m_filledRasterSep(0)
, m_viewerSep(0)
2016-06-15 18:43:10 +12:00
, m_bgSep(0)
, m_vcrSep(0)
, m_compareSep(0)
, m_saveSep(0)
, m_colorFilterSep(0)
, m_subcamSep(0)
, m_playToolBar(0)
, m_colorFilterGroup(0)
, m_fpsLabel(0)
, m_timeLabel(0)
2016-06-15 18:43:10 +12:00
, m_consoleOwner(consoleOwner)
, m_enableBlankFrameButton(0) {
2020-05-25 10:00:44 +12:00
if (m_customizeId != "SceneViewerConsole") {
QString s = QSettings().value(m_customizeId).toString();
if (s != "") m_customizeMask = s.toUInt();
}
2016-06-15 18:43:10 +12:00
if (m_gadgetsMask.size() == 0) return;
2016-06-15 18:43:10 +12:00
// mainLayout->setMargin(1);
// mainLayout->setSpacing(0);
// create toolbars other than frame slider
if (hasButton(m_gadgetsMask, eFrames)) {
createPlayToolBar(customWidget);
2016-06-15 18:43:10 +12:00
m_playToolBarContainer = new ToolBarContainer();
QHBoxLayout *hLayout = new QHBoxLayout;
hLayout->setMargin(0);
hLayout->setSpacing(0);
hLayout->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
{
DvScrollWidget *scrollableContainer = new DvScrollWidget;
scrollableContainer->setWidget(m_playToolBar);
hLayout->addWidget(scrollableContainer);
// show fps
if (hasButton(m_gadgetsMask, eRate)) {
2016-06-15 18:43:10 +12:00
QFrame *fpsSliderFrame = createFpsSlider();
hLayout->addWidget(fpsSliderFrame, 1);
}
}
m_playToolBarContainer->setLayout(hLayout);
mainLayout->addWidget(m_playToolBarContainer);
}
// create frame slider
if (hasButton(m_gadgetsMask, eFrames)) {
2016-06-15 18:43:10 +12:00
m_frameSliderFrame = createFrameSlider();
mainLayout->addWidget(m_frameSliderFrame);
}
applyCustomizeMask();
bool ret = connect(&m_playbackExecutor, SIGNAL(nextFrame(int)), this,
SLOT(onNextFrame(int)), Qt::BlockingQueuedConnection);
ret = ret && connect(&m_playbackExecutor, SIGNAL(playbackAborted()), this,
SLOT(setFpsFieldColors()));
if (m_fpsField) {
ret = ret && connect(m_fpsField, SIGNAL(controlClickEvent()), this,
SLOT(resetToSceneFps()));
ret = ret && connect(m_fpsField, SIGNAL(controlAltClickEvent()), this,
SLOT(setSceneFpsToCurrent()));
}
2016-06-15 18:43:10 +12:00
assert(ret);
// parent->setLayout(mainLayout);
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::showHideAllParts(bool isShow) {
m_playToolBarContainer->setVisible(isShow);
m_frameSliderFrame->setVisible(isShow);
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
void FlipConsole::showHidePlaybar(bool isShow) {
m_playToolBarContainer->setVisible(isShow);
}
//-----------------------------------------------------------------------------
void FlipConsole::showHideFrameSlider(bool isShow) {
m_frameSliderFrame->setVisible(isShow);
}
//-----------------------------------------------------------------------------
2016-03-19 06:57:51 +13:00
void showEvent(QShowEvent *);
void hideEvent(QHideEvent *);
2016-06-15 18:43:10 +12:00
void FlipConsole::makeCurrent() {
if (m_currentConsole == this) return;
int i = m_visibleConsoles.indexOf(this);
if (i >= 0) m_visibleConsoles.takeAt(i);
m_visibleConsoles.append(this);
m_currentConsole = this;
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::setActive(bool active) {
if (active)
makeCurrent();
else {
pressButton(ePause);
int i = m_visibleConsoles.indexOf(this);
if (i >= 0) m_visibleConsoles.takeAt(i);
if (m_currentConsole == this) {
if (!m_visibleConsoles.empty())
m_currentConsole = m_visibleConsoles.last();
else
m_currentConsole = 0;
}
}
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
#define LX 22
#define LY 22
class DoubleButton final : public QToolButton {
2016-06-15 18:43:10 +12:00
QAction *m_firstAction, *m_secondAction;
QIcon::Mode m_firstMode, m_secondMode;
QIcon::State m_firstState, m_secondState;
bool m_enabled;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
DoubleButton(QAction *firstAction, QAction *secondAction, QWidget *parent = 0)
: QToolButton(parent)
, m_firstAction(firstAction)
, m_secondAction(secondAction)
, m_firstMode(QIcon::Normal)
, m_secondMode(QIcon::Normal)
, m_firstState(QIcon::Off)
, m_secondState(QIcon::Off)
, m_enabled(true) {
setFixedSize(LX, LY);
setMouseTracking(true);
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
setObjectName("flipDoubleButton");
2016-06-15 18:43:10 +12:00
}
void setEnabledSecondButton(bool state) {
if (!state && m_secondAction->isChecked()) m_secondAction->trigger();
m_enabled = state;
update();
}
2016-03-19 06:57:51 +13:00
protected:
2016-06-19 20:06:29 +12:00
void paintEvent(QPaintEvent *e) override {
2016-06-15 18:43:10 +12:00
QPainter p(this);
p.drawPixmap(0, 0,
m_firstAction->icon().pixmap(
QSize(LX, LY / 2),
m_firstAction->isChecked() ? QIcon::Normal : m_firstMode,
m_firstAction->isChecked() ? QIcon::On : m_firstState));
QIcon::Mode mode =
m_enabled ? (m_secondAction->isChecked() ? QIcon::Normal : m_secondMode)
: QIcon::Disabled;
QIcon::State state =
m_enabled ? (m_secondAction->isChecked() ? QIcon::On : m_secondState)
: QIcon::Off;
p.drawPixmap(0, LY / 2 + 1,
m_secondAction->icon().pixmap(QSize(LX, LY / 2), mode, state));
}
2016-06-19 20:06:29 +12:00
void mousePressEvent(QMouseEvent *e) override {
2016-06-15 18:43:10 +12:00
QRect firstActionRect(0, 0, LX, LY / 2);
QRect secondActionRect(0, LY / 2 + 1, LX, LY / 2);
QPoint pos = e->pos();
if (firstActionRect.contains(pos)) {
m_firstAction->trigger();
} else {
if (m_enabled) m_secondAction->trigger();
}
update();
}
2016-06-19 20:06:29 +12:00
void mouseMoveEvent(QMouseEvent *e) override {
2016-06-15 18:43:10 +12:00
QPoint pos = e->pos();
QRect firstActionRect(0, 0, LX, LY / 2);
QRect secondActionRect(0, LY / 2 + 1, LX, LY / 2);
m_firstState = QIcon::Off;
m_secondState = QIcon::Off;
m_firstMode = QIcon::Normal;
m_secondMode = QIcon::Normal;
if (firstActionRect.contains(pos)) {
m_firstMode = QIcon::Active;
setToolTip(m_firstAction->toolTip());
} else if (secondActionRect.contains(pos) && m_enabled) {
m_secondMode = QIcon::Active;
setToolTip(m_secondAction->toolTip());
}
update();
}
2016-06-19 20:06:29 +12:00
void leaveEvent(QEvent *e) override {
2016-06-15 18:43:10 +12:00
m_firstMode = QIcon::Normal;
m_firstState = QIcon::Off;
m_secondMode = QIcon::Normal;
m_secondState = QIcon::Off;
update();
QToolButton::leaveEvent(e);
}
2016-03-19 06:57:51 +13:00
};
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::enableButton(UINT button, bool enable, bool doShowHide) {
if (!m_playToolBar) return;
QList<QAction *> list = m_playToolBar->actions();
2020-04-12 17:19:20 +12:00
for (size_t i = 0; i < list.size(); i++)
2016-06-15 18:43:10 +12:00
if (list[i]->data().toUInt() == button) {
2020-04-12 17:19:20 +12:00
if (button == eSound) {
if (doShowHide) {
2016-06-15 18:43:10 +12:00
m_soundSep->setVisible(enable);
2020-04-12 17:19:20 +12:00
} else {
2016-06-15 18:43:10 +12:00
m_soundSep->setEnabled(enable);
}
2020-04-12 17:19:20 +12:00
}
2016-06-15 18:43:10 +12:00
if (button == eHisto) {
2020-04-12 17:19:20 +12:00
if (doShowHide) {
2016-06-15 18:43:10 +12:00
m_histoSep->setVisible(enable && m_customizeMask & eShowHisto);
2020-04-12 17:19:20 +12:00
} else {
2016-06-15 18:43:10 +12:00
m_histoSep->setEnabled(enable);
}
2016-06-15 18:43:10 +12:00
}
2020-04-12 17:19:20 +12:00
if (doShowHide) {
2016-06-15 18:43:10 +12:00
list[i]->setVisible(enable);
2020-04-12 17:19:20 +12:00
} else {
2016-06-15 18:43:10 +12:00
list[i]->setEnabled(enable);
2020-04-12 17:19:20 +12:00
}
2016-06-15 18:43:10 +12:00
if (!enable && list[i]->isChecked()) pressButton((EGadget)button);
return;
}
// double buttons are special, they are not accessible directly from the
// playtoolbar...
switch ((EGadget)button) {
case eGRed:
if (m_doubleRed) m_doubleRed->setEnabledSecondButton(enable);
break;
case eGGreen:
if (m_doubleGreen) m_doubleGreen->setEnabledSecondButton(enable);
break;
case eGBlue:
if (m_doubleBlue) m_doubleBlue->setEnabledSecondButton(enable);
break;
2020-04-12 17:19:20 +12:00
default:
break;
2016-06-15 18:43:10 +12:00
}
2016-03-19 06:57:51 +13:00
}
//----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::toggleLinked() {
m_areLinked = !m_areLinked;
int i;
FlipConsole *playingConsole = 0;
for (i = 0; i < m_visibleConsoles.size(); i++) {
playingConsole = m_visibleConsoles.at(i);
if (playingConsole->m_isLinkable &&
playingConsole->m_playbackExecutor.isRunning())
break;
}
if (i == m_visibleConsoles.size()) return;
// if we are here, flip is playing!
m_isLinkedPlaying = m_areLinked;
int button =
m_areLinked ? (playingConsole->m_isPlay ? ePlay : eLoop) : ePause;
for (i = 0; i < m_visibleConsoles.size(); i++) {
FlipConsole *console = m_visibleConsoles.at(i);
if (console->m_isLinkable && console != playingConsole) {
console->setChecked(button, true);
console->doButtonPressed(button);
}
}
2016-03-19 06:57:51 +13:00
}
//----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
bool FlipConsole::drawBlanks(int from, int to) {
if (m_blanksCount == 0 || m_isPlay || m_framesCount <= 1) return false;
// enable blanks only when the blank button is pressed
if (m_enableBlankFrameButton && !m_enableBlankFrameButton->isChecked())
return false;
if (m_blanksToDraw > 1 ||
(m_blanksToDraw == 0 &&
((m_reverse && m_currentFrame - m_step < from) ||
2020-05-25 10:00:44 +12:00
(!m_reverse &&
m_currentFrame + m_step >
to)))) // we are on the last frame of the loop
2016-06-15 18:43:10 +12:00
{
m_blanksToDraw = (m_blanksToDraw == 0 ? m_blanksCount : m_blanksToDraw - 1);
m_settings.m_blankColor = m_blankColor;
m_settings.m_drawBlankFrame = true;
m_consoleOwner->onDrawFrame(from, m_settings);
m_settings.m_drawBlankFrame = false;
return true;
}
m_blanksToDraw = 0;
return false;
2016-03-19 06:57:51 +13:00
}
//----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::onNextFrame(int fps) {
if (fps < 0) // can be negative only if is a linked console; it means that
// the master console is playing backward
{
bool reverse = m_reverse;
m_reverse = true;
fps = -fps;
playNextFrame();
m_reverse = reverse;
} else
playNextFrame();
if (fps == -1) return;
if (m_fpsLabel)
m_fpsLabel->setText(tr(" FPS ") + QString::number(fps * tsign(m_fps)) +
"/");
if (m_fpsField) {
if (fps == abs(m_fps))
m_fpsField->setLineEditBackgroundColor(Qt::green);
else
m_fpsField->setLineEditBackgroundColor(Qt::red);
}
if (m_stopAt > 0 && m_currentFrame >= m_stopAt) {
doButtonPressed(ePause);
m_stopAt = -1;
}
2016-03-19 06:57:51 +13:00
}
//----------------------------------------------------------------------------
void FlipConsole::setFpsFieldColors() {
if (m_fpsField) {
if (m_fpsField->getValue() == m_sceneFps) {
m_fpsField->setLineEditBackgroundColor(Qt::transparent);
m_fpsField->setToolTip("");
} else {
m_fpsField->setLineEditBackgroundColor(QColor(255, 69, 0));
m_fpsField->setToolTip(
tr("This value is different than the scene framerate.\n"
"Control click to reset."));
}
}
}
//----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::playNextFrame() {
int from = m_from, to = m_to;
if (m_markerFrom <= m_markerTo && m_stopAt == -1)
from = m_markerFrom, to = m_markerTo;
2016-06-15 18:43:10 +12:00
if (m_framesCount == 0 ||
(m_isPlay && m_currentFrame == (m_reverse ? from : to))) {
doButtonPressed(ePause);
setChecked(m_isPlay ? ePlay : eLoop, false);
setChecked(ePause, true);
if (Preferences::instance()->rewindAfterPlaybackEnabled())
m_currentFrame = (m_reverse ? to : from);
emit playStateChanged(false);
} else {
if (drawBlanks(from, to)) return;
if (m_reverse)
m_currentFrame =
((m_currentFrame - m_step < from) ? to : m_currentFrame - m_step);
else
m_currentFrame =
((m_currentFrame + m_step > to) ? from : m_currentFrame + m_step);
}
m_currFrameSlider->setValue(m_currentFrame);
m_editCurrFrame->setText(QString::number(m_currentFrame));
updateCurrentTime();
2016-06-15 18:43:10 +12:00
m_settings.m_blankColor = TPixel::Transparent;
m_settings.m_recomputeIfNeeded = true;
m_consoleOwner->onDrawFrame(m_currentFrame, m_settings);
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::updateCurrentFPS(int val) {
setCurrentFPS(val);
m_fpsSlider->setValue(m_fps);
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2017-07-26 17:05:17 +12:00
void FlipConsole::setFrameRate(int val, bool forceUpdate) {
if (m_sceneFps != val || forceUpdate) {
if (!m_fpsSlider) return;
m_fpsSlider->setValue(val);
setCurrentFPS(val);
}
m_sceneFps = val;
setFpsFieldColors();
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::setCurrentFPS(bool dragging) {
setCurrentFPS(m_fpsField->getValue());
m_fpsSlider->setValue(m_fps);
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
void FlipConsole::resetToSceneFps() {
setCurrentFPS(m_sceneFps);
m_fpsSlider->setValue(m_sceneFps);
}
//-----------------------------------------------------------------------------
void FlipConsole::setSceneFpsToCurrent() {
if (m_fps == abs(m_fps) && m_fps != m_sceneFps) {
emit(changeSceneFps(m_fps));
} else if (m_fps != abs(m_fps)) {
DVGui::warning(tr("Cannot set the scene fps to a negative value."));
}
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::setCurrentFPS(int val) {
if (m_fps == val) return;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
if (val == 0) val = 1;
2020-05-25 10:00:44 +12:00
m_fps = val;
2016-06-15 18:43:10 +12:00
m_fpsField->setValue(m_fps);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
if (m_playbackExecutor.isRunning() || m_isLinkedPlaying)
m_reverse = (val < 0);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
if (m_fpsLabel) m_fpsLabel->setText(tr(" FPS "));
if (m_fpsField) {
setFpsFieldColors();
}
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
m_playbackExecutor.resetFps(m_fps);
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::createButton(UINT buttonMask, const char *iconStr,
const QString &tip, bool checkable,
QActionGroup *group) {
2017-06-26 14:43:02 +12:00
QIcon icon = createQIcon(iconStr);
2016-06-15 18:43:10 +12:00
QAction *action = new QAction(icon, tip, m_playToolBar);
action->setData(QVariant(buttonMask));
action->setCheckable(checkable);
if (group) group->addAction(action);
m_actions[(EGadget)buttonMask] = action;
m_playToolBar->addAction(action);
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
QAction *FlipConsole::createCheckedButtonWithBorderImage(
UINT buttonMask, const char *iconStr, const QString &tip, bool checkable,
QActionGroup *group, const char *cmdId) {
2017-06-26 14:43:02 +12:00
QIcon icon = createQIcon(iconStr);
2016-06-15 18:43:10 +12:00
QWidgetAction *action = new QWidgetAction(m_playToolBar);
action->setIcon(icon);
action->setToolTip(tip);
action->setData(QVariant(buttonMask));
action->setCheckable(checkable);
if (group) group->addAction(action);
QToolButton *button = new QToolButton(m_playToolBar);
button->setDefaultAction(action);
m_buttons[(EGadget)buttonMask] = button;
if (cmdId) {
QAction *a = CommandManager::instance()->getAction(cmdId);
if (a) button->addAction(a);
}
action->setDefaultWidget(button);
button->setObjectName("chackableButtonWithImageBorder");
connect(button, SIGNAL(triggered(QAction *)), this,
SLOT(onButtonPressed(QAction *)));
// connect(action, SIGNAL(toggled(bool)), button, SLOT(setChecked(bool)));
m_playToolBar->addAction(action);
return action;
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
QAction *FlipConsole::createDoubleButton(
UINT buttonMask1, UINT buttonMask2, const char *iconStr1,
const char *iconStr2, const QString &tip1, const QString &tip2,
QActionGroup *group, DoubleButton *&widget) {
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
QAction *action1 =
new QAction(createQIcon(iconStr1, true), tip1, m_playToolBar);
QAction *action2 =
new QAction(createQIcon(iconStr2, true), tip2, m_playToolBar);
2016-06-15 18:43:10 +12:00
m_actions[(EGadget)buttonMask1] = action1;
m_actions[(EGadget)buttonMask2] = action2;
action1->setData(QVariant(buttonMask1));
action1->setCheckable(true);
action2->setData(QVariant(buttonMask2));
action2->setCheckable(true);
if (group) {
group->addAction(action1);
group->addAction(action2);
}
widget = new DoubleButton(action1, action2, this);
return m_playToolBar->addWidget(widget);
// m_playToolBar->addAction(action1);
// m_playToolBar->addAction(action2);
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::createOnOffButton(UINT buttonMask, const char *iconStr,
const QString &tip, QActionGroup *group) {
UI update and Icons from Konero (#126) * add multi arc mockup * implement mutli arc * add join and smooth option * reset multiarc and arc when deactivated * create self loop if the last point is the same as the first * make join option in multiarc consistent with tape tool * fix a bug where thickness don't affect mutliarc in vector level * remove join option in geometric tool * stop mutliarc after closing shape * double click can also end multi arc * fix a bug where multiArc will produce buggy stroke * fix a bug where geometric tools is not deactivated * add multiArc shortcut * rewrite multiArc * revert changes to tvectorimage * add undo data for multiArc * Paste as Copy Command for XSheet * Remove unneeded code * Bug fix * prevent guide lines from jumping around in MultiArc * make stroke color consistent in MultiArc * remove color in MultiArc's undo data * make color consistent in MultiArc with previous version * Fix single image raster levels * fix compilation error * fix a bug where multiArc might generate bugged stroke * Remove ICONV dep (#3304) * fix crash on saving studio palette * Move to Paste Special Menu * Don't Set Fixed Width if Docking a Floating Panel * Update how_to_build_win.md New draft of pr for requested changes to windows build instructions. * fix geometric tool multiarc smooth option * fix level saving failure * fix wrong warning after saving palette * fix a bug where moving a control point while holding alt has unintended result * fix travis-install (#3389) * Fix assert debug crash in flipconsole.cpp Fix crash when using the viewer controls in the console (debug) * Redraw Audio Waveform Fills the waveform rather than outlines it. * Update .gitignore * fix undo data when drawing arc and mutliarc * fix overwriting raster drawing palette (#3387) * mode sensitive fx settings * Create New Style Command Button (#3394) * Create New Style Command Button This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz. Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com> * Update paletteviewergui.cpp Made changes to the PR per request by Shun. * Fixed a space within the code that wasn't suppose to be there. Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com> * tahoma license (#3396) * new style button optional * fix loading pegbars (removing updateKeyframes) * periodic random expression * add fx in linear color space this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd. in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories. * fractal noise iwa fx * skip unnecessary icon invalidation * fix frame range fill with tablet * stop function editor to open by dbl clicking key * Expanding the radius of the rotation handle. This just changes when the cursor transforms into the rotation tool. (cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39) * fix vector img patern stroke style * Update Stylesheets - Support the new icon sizes - XSheet and Timeline significantly redesigned - Lots of margin fixes and refactoring - Remove deprecated icons, as some icons are moved into binary - New Light theme * New Icons - Redesigns almost every icon as symbolic - Adds icons for most commands * Add Option for Icon Themes - Adds option for icon themes - Removes useless label from Preferences category list * Update Icon Functions - Adds themePath() boolean - Adds function for recoloring black pixels in pixmaps to any color - Rebuilds createQIcon to use fromTheme() and recolorPixmap() - Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon - Removes a grey horizontal line drawn above the console play bar in the viewer * Set Default Icon Theme and Paths - Sets search paths for icons for use with QIcon::fromTheme() - Sets default start icon theme on first install - Sets flag for displaying icons in menus, so we can selectively hide them * Set Icons for Commands - Sets icons for the commands - Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16 - Selectively allows icons to display for Tools in menus * Change Icon Sizes, General Fixes and Stylesheet Additions - Change icon sizes to new size - Remove margin around FX Editor window - Remove white line under color sliders in Style Editor - Make keyframe icons uniform and color stylable in the stylesheets - Removes deprecated stylesheet strings - Redesign GUI for palette list view - Make tree list header sort row stylable - Remove black lines from scrollbars in New Project window - Remove margin around combobox in Level Strip - Alter how some lines are drawn in the Timeline to fix some alpha issues - Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility - Make text always viewable in the FPS field in console bar - Increase size of radio buttons in Cleanup Settings - Increase size of switches in motion path nodes - Remove unessesary "Layer" label in Timeline and other rects - Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more - Moves some external stylesheet icons into binary * Make TPanelTitleBar Icon States Stylable - Makes icon states for TPanelTitleBar buttons stylable in stylesheets * Travis Fixes * Swap Startup Popup Logos They were in the wrong folders * Revert "Swap Startup Popup Logos" This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d. * Fix Startup Popup Logo It wasn't switching * Feedback Changes - Change render visualization to clapboard - Fix text contrast on levels in XSheet * Make Cell Selection More Clear * Darken Light Theme and Tint Empty Cell Selection * Fix missing icons * Fix memo button * Bring back colors * Hide Motion Tab * Fix Play Range Area (Light) Make play range area more visible * Vector Column Color Co-authored-by: pojienie <pojienie@gmail.com> Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com> Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp> Co-authored-by: Rodney <rodney.baker@gmail.com> Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com> Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com> Co-authored-by: Kite <konero@users.noreply.github.com> Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com> Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
QIcon icon = createQIcon(iconStr);
2016-06-15 18:43:10 +12:00
QAction *action = new QAction(icon, tip, m_playToolBar);
action->setData(QVariant(buttonMask));
action->setCheckable(true);
if (group) group->addAction(action);
m_playToolBar->addAction(action);
m_actions[(EGadget)buttonMask] = action;
2016-03-19 06:57:51 +13:00
}
//----------------------------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::addMenuItem(UINT id, const QString &text, QMenu *menu) {
QAction *a = new QAction(text, menu);
a->setCheckable(true);
a->setChecked(id & m_customizeMask);
a->setData(QVariant(id));
menu->addAction(a);
2016-03-19 06:57:51 +13:00
}
//----------------------------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::onCustomizeButtonPressed(QAction *a) {
UINT id = a->data().toUInt();
if (a->isChecked())
m_customizeMask = m_customizeMask | id;
else
m_customizeMask = m_customizeMask & (~id);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
QSettings().setValue(m_customizeId, QString::number(m_customizeMask));
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
applyCustomizeMask();
2016-03-19 06:57:51 +13:00
}
//----------------------------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::applyCustomizeMask() {
enableButton(eSave, m_customizeMask & eShowSave);
// if(m_saveSep)
// m_saveSep->setVisible(m_customizeMask&eShowSave);
enableButton(eSaveImg, m_customizeMask & eShowCompare);
enableButton(eCompare, m_customizeMask & eShowCompare);
if (m_compareSep) m_compareSep->setVisible(m_customizeMask & eShowCompare);
enableButton(eDefineSubCamera, m_customizeMask & eShowDefineSubCamera);
enableButton(eDefineLoadBox, m_customizeMask & eShowDefineLoadBox);
enableButton(eUseLoadBox, m_customizeMask & eShowUseLoadBox);
if (m_subcamSep) {
int count = m_gadgetsMask.size();
bool hasDefineLoadBox =
std::find(m_gadgetsMask.begin(), m_gadgetsMask.end(), eDefineLoadBox) ==
m_gadgetsMask.end();
2020-05-25 10:00:44 +12:00
bool hasUseLoadBox = std::find(m_gadgetsMask.begin(), m_gadgetsMask.end(),
eUseLoadBox) == m_gadgetsMask.end();
bool hasDefineSubCam = std::find(m_gadgetsMask.begin(), m_gadgetsMask.end(),
eDefineSubCamera) == m_gadgetsMask.end();
m_subcamSep->setVisible(
(hasDefineSubCam && m_customizeMask & eShowDefineSubCamera) ||
(hasDefineLoadBox && m_customizeMask & eShowDefineLoadBox) ||
(hasUseLoadBox && m_customizeMask & eShowUseLoadBox));
}
2016-06-15 18:43:10 +12:00
enableButton(eWhiteBg, m_customizeMask & eShowBg);
enableButton(eBlackBg, m_customizeMask & eShowBg);
enableButton(eCheckBg, m_customizeMask & eShowBg);
if (m_bgSep) m_bgSep->setVisible(m_customizeMask & eShowBg);
if (m_fpsLabel && m_fpsSlider && m_fpsField) {
m_fpsLabel->setVisible(m_customizeMask & eShowFramerate);
m_fpsSlider->setVisible(m_customizeMask & eShowFramerate);
m_fpsField->setVisible(m_customizeMask & eShowFramerate);
}
enableButton(eFirst, m_customizeMask & eShowVcr);
enableButton(ePrev, m_customizeMask & eShowVcr);
enableButton(ePause, m_customizeMask & eShowVcr);
enableButton(ePlay, m_customizeMask & eShowVcr);
enableButton(eLoop, m_customizeMask & eShowVcr);
enableButton(eNext, m_customizeMask & eShowVcr);
enableButton(eLast, m_customizeMask & eShowVcr);
enableButton(eSound, m_customizeMask & eShowSound);
enableButton(eLocator, m_customizeMask & eShowLocator);
2016-06-15 18:43:10 +12:00
if (m_vcrSep) m_vcrSep->setVisible(m_customizeMask & eShowVcr);
enableButton(eMatte, m_customizeMask & eShowcolorFilter);
enableButton(eHisto, m_customizeMask & eShowHisto);
if (m_histoSep) m_histoSep->setVisible(m_customizeMask & eShowHisto);
if (m_doubleRedAction) {
m_doubleRedAction->setVisible(m_customizeMask & eShowcolorFilter);
m_doubleGreenAction->setVisible(m_customizeMask & eShowcolorFilter);
m_doubleBlueAction->setVisible(m_customizeMask & eShowcolorFilter);
} else {
enableButton(eRed, m_customizeMask & eShowcolorFilter);
enableButton(eGreen, m_customizeMask & eShowcolorFilter);
enableButton(eBlue, m_customizeMask & eShowcolorFilter);
}
if (m_colorFilterGroup)
m_colorFilterGroup->setVisible(m_customizeMask & eShowcolorFilter);
if (m_colorFilterSep)
m_colorFilterSep->setVisible(m_customizeMask & eShowcolorFilter);
if (m_customAction) {
bool visible = bool(m_customizeMask & eShowCustom);
m_customAction->setVisible(visible);
m_customSep->setVisible(visible);
}
enableButton(eFilledRaster, m_customizeMask & eShowFilledRaster);
if (m_filledRasterSep)
m_filledRasterSep->setVisible(m_customizeMask & eShowFilledRaster);
enableButton(eZoomIn, m_customizeMask & eShowViewerControls);
enableButton(eZoomOut, m_customizeMask & eShowViewerControls);
enableButton(eFlipHorizontal, m_customizeMask & eShowViewerControls);
enableButton(eFlipVertical, m_customizeMask & eShowViewerControls);
enableButton(eResetView, m_customizeMask & eShowViewerControls);
if (m_viewerSep)
m_viewerSep->setVisible(m_customizeMask & eShowViewerControls);
2016-06-15 18:43:10 +12:00
update();
2016-03-19 06:57:51 +13:00
}
//----------------------------------------------------------------------------------------------
2020-05-25 10:00:44 +12:00
void FlipConsole::setCustomizemask(UINT mask) {
m_customizeMask = mask;
applyCustomizeMask();
for (QAction *action : m_menu->actions()) {
UINT id = action->data().toUInt();
switch (id) {
case eShowCompare:
action->setChecked(m_customizeMask & id);
case eShowBg:
action->setChecked(m_customizeMask & id);
case eShowFramerate:
action->setChecked(m_customizeMask & id);
case eShowVcr:
action->setChecked(m_customizeMask & id);
case eShowcolorFilter:
action->setChecked(m_customizeMask & id);
case eShowCustom:
action->setChecked(m_customizeMask & id);
case eShowHisto:
action->setChecked(m_customizeMask & id);
case eShowSave:
action->setChecked(m_customizeMask & id);
case eShowDefineSubCamera:
action->setChecked(m_customizeMask & id);
case eShowFilledRaster:
action->setChecked(m_customizeMask & id);
case eShowDefineLoadBox:
action->setChecked(m_customizeMask & id);
case eShowUseLoadBox:
action->setChecked(m_customizeMask & id);
case eShowViewerControls:
action->setChecked(m_customizeMask & id);
case eShowSound:
action->setChecked(m_customizeMask & id);
case eShowLocator:
action->setChecked(m_customizeMask & id);
}
}
}
//----------------------------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::createCustomizeMenu(bool withCustomWidget) {
if (hasButton(m_gadgetsMask, eCustomize)) {
UI update and Icons from Konero (#126) * add multi arc mockup * implement mutli arc * add join and smooth option * reset multiarc and arc when deactivated * create self loop if the last point is the same as the first * make join option in multiarc consistent with tape tool * fix a bug where thickness don't affect mutliarc in vector level * remove join option in geometric tool * stop mutliarc after closing shape * double click can also end multi arc * fix a bug where multiArc will produce buggy stroke * fix a bug where geometric tools is not deactivated * add multiArc shortcut * rewrite multiArc * revert changes to tvectorimage * add undo data for multiArc * Paste as Copy Command for XSheet * Remove unneeded code * Bug fix * prevent guide lines from jumping around in MultiArc * make stroke color consistent in MultiArc * remove color in MultiArc's undo data * make color consistent in MultiArc with previous version * Fix single image raster levels * fix compilation error * fix a bug where multiArc might generate bugged stroke * Remove ICONV dep (#3304) * fix crash on saving studio palette * Move to Paste Special Menu * Don't Set Fixed Width if Docking a Floating Panel * Update how_to_build_win.md New draft of pr for requested changes to windows build instructions. * fix geometric tool multiarc smooth option * fix level saving failure * fix wrong warning after saving palette * fix a bug where moving a control point while holding alt has unintended result * fix travis-install (#3389) * Fix assert debug crash in flipconsole.cpp Fix crash when using the viewer controls in the console (debug) * Redraw Audio Waveform Fills the waveform rather than outlines it. * Update .gitignore * fix undo data when drawing arc and mutliarc * fix overwriting raster drawing palette (#3387) * mode sensitive fx settings * Create New Style Command Button (#3394) * Create New Style Command Button This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz. Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com> * Update paletteviewergui.cpp Made changes to the PR per request by Shun. * Fixed a space within the code that wasn't suppose to be there. Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com> * tahoma license (#3396) * new style button optional * fix loading pegbars (removing updateKeyframes) * periodic random expression * add fx in linear color space this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd. in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories. * fractal noise iwa fx * skip unnecessary icon invalidation * fix frame range fill with tablet * stop function editor to open by dbl clicking key * Expanding the radius of the rotation handle. This just changes when the cursor transforms into the rotation tool. (cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39) * fix vector img patern stroke style * Update Stylesheets - Support the new icon sizes - XSheet and Timeline significantly redesigned - Lots of margin fixes and refactoring - Remove deprecated icons, as some icons are moved into binary - New Light theme * New Icons - Redesigns almost every icon as symbolic - Adds icons for most commands * Add Option for Icon Themes - Adds option for icon themes - Removes useless label from Preferences category list * Update Icon Functions - Adds themePath() boolean - Adds function for recoloring black pixels in pixmaps to any color - Rebuilds createQIcon to use fromTheme() and recolorPixmap() - Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon - Removes a grey horizontal line drawn above the console play bar in the viewer * Set Default Icon Theme and Paths - Sets search paths for icons for use with QIcon::fromTheme() - Sets default start icon theme on first install - Sets flag for displaying icons in menus, so we can selectively hide them * Set Icons for Commands - Sets icons for the commands - Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16 - Selectively allows icons to display for Tools in menus * Change Icon Sizes, General Fixes and Stylesheet Additions - Change icon sizes to new size - Remove margin around FX Editor window - Remove white line under color sliders in Style Editor - Make keyframe icons uniform and color stylable in the stylesheets - Removes deprecated stylesheet strings - Redesign GUI for palette list view - Make tree list header sort row stylable - Remove black lines from scrollbars in New Project window - Remove margin around combobox in Level Strip - Alter how some lines are drawn in the Timeline to fix some alpha issues - Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility - Make text always viewable in the FPS field in console bar - Increase size of radio buttons in Cleanup Settings - Increase size of switches in motion path nodes - Remove unessesary "Layer" label in Timeline and other rects - Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more - Moves some external stylesheet icons into binary * Make TPanelTitleBar Icon States Stylable - Makes icon states for TPanelTitleBar buttons stylable in stylesheets * Travis Fixes * Swap Startup Popup Logos They were in the wrong folders * Revert "Swap Startup Popup Logos" This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d. * Fix Startup Popup Logo It wasn't switching * Feedback Changes - Change render visualization to clapboard - Fix text contrast on levels in XSheet * Make Cell Selection More Clear * Darken Light Theme and Tint Empty Cell Selection * Fix missing icons * Fix memo button * Bring back colors * Hide Motion Tab * Fix Play Range Area (Light) Make play range area more visible * Vector Column Color Co-authored-by: pojienie <pojienie@gmail.com> Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com> Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp> Co-authored-by: Rodney <rodney.baker@gmail.com> Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com> Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com> Co-authored-by: Kite <konero@users.noreply.github.com> Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com> Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
QIcon icon = createQIcon("menu");
2016-06-15 18:43:10 +12:00
QToolButton *button = new QToolButton();
button->setIcon(icon);
button->setPopupMode(QToolButton::MenuButtonPopup);
button->setObjectName("flipCustomize");
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
QMenu *menu = new QMenu();
button->setMenu(menu);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
m_playToolBar->addWidget(button);
m_playToolBar->addSeparator();
2016-03-19 06:57:51 +13:00
if (hasButton(m_gadgetsMask, eSave))
addMenuItem(eShowSave, tr("Save"), menu);
2016-03-19 06:57:51 +13:00
if (hasButton(m_gadgetsMask, eSaveImg) ||
hasButton(m_gadgetsMask, eCompare))
2016-06-15 18:43:10 +12:00
addMenuItem(eShowCompare, tr("Snapshot"), menu);
2016-03-19 06:57:51 +13:00
if (hasButton(m_gadgetsMask, eDefineSubCamera))
2016-06-15 18:43:10 +12:00
addMenuItem(eShowDefineSubCamera, tr("Define Sub-camera"), menu);
if (hasButton(m_gadgetsMask, eDefineLoadBox))
2016-06-15 18:43:10 +12:00
addMenuItem(eShowDefineLoadBox, tr("Define Loading Box"), menu);
if (hasButton(m_gadgetsMask, eUseLoadBox))
2016-06-15 18:43:10 +12:00
addMenuItem(eShowUseLoadBox, tr("Use Loading Box"), menu);
2016-03-19 06:57:51 +13:00
if (hasButton(m_gadgetsMask, eWhiteBg) ||
hasButton(m_gadgetsMask, eBlackBg) ||
hasButton(m_gadgetsMask, eCheckBg))
2016-06-15 18:43:10 +12:00
addMenuItem(eShowBg, tr("Background Colors"), menu);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
addMenuItem(eShowVcr, tr("Playback Controls"), menu);
2016-03-19 06:57:51 +13:00
if (hasButton(m_gadgetsMask, eRed) || hasButton(m_gadgetsMask, eGreen) ||
hasButton(m_gadgetsMask, eBlue) || hasButton(m_gadgetsMask, eMatte))
2016-06-15 18:43:10 +12:00
addMenuItem(eShowcolorFilter, tr("Color Channels"), menu);
2016-03-19 06:57:51 +13:00
if (hasButton(m_gadgetsMask, eSound))
addMenuItem(eShowSound, tr("Sound"), menu);
2016-03-19 06:57:51 +13:00
if (hasButton(m_gadgetsMask, eHisto))
addMenuItem(eShowHisto, tr("Histogram"), menu);
2016-03-19 06:57:51 +13:00
if (hasButton(m_gadgetsMask, eLocator))
addMenuItem(eShowLocator, tr("Locator"), menu);
if (withCustomWidget) addMenuItem(eShowCustom, tr("Set Key"), menu);
if (hasButton(m_gadgetsMask, eFilledRaster))
2016-06-15 18:43:10 +12:00
addMenuItem(eFilledRaster, tr("Display Areas as Filled"), menu);
2016-03-19 06:57:51 +13:00
if (hasButton(m_gadgetsMask, eZoomIn) ||
hasButton(m_gadgetsMask, eZoomOut) ||
hasButton(m_gadgetsMask, eFlipHorizontal) ||
hasButton(m_gadgetsMask, eFlipVertical) ||
hasButton(m_gadgetsMask, eResetView))
addMenuItem(eShowViewerControls, tr("Viewer Controls"), menu);
if (hasButton(m_gadgetsMask, eRate))
addMenuItem(eShowFramerate, tr("Framerate"), menu);
2016-06-15 18:43:10 +12:00
bool ret = connect(menu, SIGNAL(triggered(QAction *)), this,
SLOT(onCustomizeButtonPressed(QAction *)));
assert(ret);
2020-05-25 10:00:44 +12:00
m_menu = menu;
2016-06-15 18:43:10 +12:00
}
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
void FlipConsole::createPlayToolBar(QWidget *customWidget) {
bool ret = true;
bool withCustomWidget = customWidget != 0;
2016-06-15 18:43:10 +12:00
m_playToolBar = new QToolBar(this);
m_playToolBar->setMovable(false);
m_playToolBar->setObjectName("FlipConsolePlayToolBar");
UI update and Icons from Konero (#126) * add multi arc mockup * implement mutli arc * add join and smooth option * reset multiarc and arc when deactivated * create self loop if the last point is the same as the first * make join option in multiarc consistent with tape tool * fix a bug where thickness don't affect mutliarc in vector level * remove join option in geometric tool * stop mutliarc after closing shape * double click can also end multi arc * fix a bug where multiArc will produce buggy stroke * fix a bug where geometric tools is not deactivated * add multiArc shortcut * rewrite multiArc * revert changes to tvectorimage * add undo data for multiArc * Paste as Copy Command for XSheet * Remove unneeded code * Bug fix * prevent guide lines from jumping around in MultiArc * make stroke color consistent in MultiArc * remove color in MultiArc's undo data * make color consistent in MultiArc with previous version * Fix single image raster levels * fix compilation error * fix a bug where multiArc might generate bugged stroke * Remove ICONV dep (#3304) * fix crash on saving studio palette * Move to Paste Special Menu * Don't Set Fixed Width if Docking a Floating Panel * Update how_to_build_win.md New draft of pr for requested changes to windows build instructions. * fix geometric tool multiarc smooth option * fix level saving failure * fix wrong warning after saving palette * fix a bug where moving a control point while holding alt has unintended result * fix travis-install (#3389) * Fix assert debug crash in flipconsole.cpp Fix crash when using the viewer controls in the console (debug) * Redraw Audio Waveform Fills the waveform rather than outlines it. * Update .gitignore * fix undo data when drawing arc and mutliarc * fix overwriting raster drawing palette (#3387) * mode sensitive fx settings * Create New Style Command Button (#3394) * Create New Style Command Button This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz. Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com> * Update paletteviewergui.cpp Made changes to the PR per request by Shun. * Fixed a space within the code that wasn't suppose to be there. Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com> * tahoma license (#3396) * new style button optional * fix loading pegbars (removing updateKeyframes) * periodic random expression * add fx in linear color space this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd. in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories. * fractal noise iwa fx * skip unnecessary icon invalidation * fix frame range fill with tablet * stop function editor to open by dbl clicking key * Expanding the radius of the rotation handle. This just changes when the cursor transforms into the rotation tool. (cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39) * fix vector img patern stroke style * Update Stylesheets - Support the new icon sizes - XSheet and Timeline significantly redesigned - Lots of margin fixes and refactoring - Remove deprecated icons, as some icons are moved into binary - New Light theme * New Icons - Redesigns almost every icon as symbolic - Adds icons for most commands * Add Option for Icon Themes - Adds option for icon themes - Removes useless label from Preferences category list * Update Icon Functions - Adds themePath() boolean - Adds function for recoloring black pixels in pixmaps to any color - Rebuilds createQIcon to use fromTheme() and recolorPixmap() - Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon - Removes a grey horizontal line drawn above the console play bar in the viewer * Set Default Icon Theme and Paths - Sets search paths for icons for use with QIcon::fromTheme() - Sets default start icon theme on first install - Sets flag for displaying icons in menus, so we can selectively hide them * Set Icons for Commands - Sets icons for the commands - Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16 - Selectively allows icons to display for Tools in menus * Change Icon Sizes, General Fixes and Stylesheet Additions - Change icon sizes to new size - Remove margin around FX Editor window - Remove white line under color sliders in Style Editor - Make keyframe icons uniform and color stylable in the stylesheets - Removes deprecated stylesheet strings - Redesign GUI for palette list view - Make tree list header sort row stylable - Remove black lines from scrollbars in New Project window - Remove margin around combobox in Level Strip - Alter how some lines are drawn in the Timeline to fix some alpha issues - Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility - Make text always viewable in the FPS field in console bar - Increase size of radio buttons in Cleanup Settings - Increase size of switches in motion path nodes - Remove unessesary "Layer" label in Timeline and other rects - Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more - Moves some external stylesheet icons into binary * Make TPanelTitleBar Icon States Stylable - Makes icon states for TPanelTitleBar buttons stylable in stylesheets * Travis Fixes * Swap Startup Popup Logos They were in the wrong folders * Revert "Swap Startup Popup Logos" This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d. * Fix Startup Popup Logo It wasn't switching * Feedback Changes - Change render visualization to clapboard - Fix text contrast on levels in XSheet * Make Cell Selection More Clear * Darken Light Theme and Tint Empty Cell Selection * Fix missing icons * Fix memo button * Bring back colors * Hide Motion Tab * Fix Play Range Area (Light) Make play range area more visible * Vector Column Color Co-authored-by: pojienie <pojienie@gmail.com> Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com> Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp> Co-authored-by: Rodney <rodney.baker@gmail.com> Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com> Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com> Co-authored-by: Kite <konero@users.noreply.github.com> Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com> Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
m_playToolBar->setIconSize(QSize(20, 20));
2016-06-15 18:43:10 +12:00
// m_playToolBar->setObjectName("chackableButtonToolBar");
// m_playToolBar->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
createCustomizeMenu(withCustomWidget);
if (hasButton(m_gadgetsMask, eSave)) {
2017-06-26 14:43:02 +12:00
createButton(eSave, "save", tr("&Save Images"), false);
2016-06-15 18:43:10 +12:00
// m_saveSep = m_playToolBar->addSeparator();
}
// snapshot
bool separator = false;
if (hasButton(m_gadgetsMask, eSaveImg)) {
2016-06-15 18:43:10 +12:00
createButton(eSaveImg, "snapshot", tr("&Snapshot"), false);
separator = true;
}
if (hasButton(m_gadgetsMask, eCompare)) {
2016-06-15 18:43:10 +12:00
createButton(eCompare, "compare", tr("&Compare to Snapshot"), true);
separator = true;
}
if (separator) m_compareSep = m_playToolBar->addSeparator();
// sub camera
separator = false;
if (hasButton(m_gadgetsMask, eDefineSubCamera)) {
2016-06-15 18:43:10 +12:00
createButton(eDefineSubCamera, "define_subcamera_preview",
tr("&Define Sub-camera"), true);
separator = true;
}
if (hasButton(m_gadgetsMask, eDefineLoadBox)) {
2016-06-15 18:43:10 +12:00
createButton(eDefineLoadBox, "define_subcamera_preview",
tr("&Define Loading Box"), true);
separator = true;
}
if (hasButton(m_gadgetsMask, eUseLoadBox)) {
2016-06-15 18:43:10 +12:00
createButton(eUseLoadBox, "use_subcamera_preview", tr("&Use Loading Box"),
true);
separator = true;
}
if (separator) m_subcamSep = m_playToolBar->addSeparator();
// preview BGs
QActionGroup *group = new QActionGroup(m_playToolBar);
if (hasButton(m_gadgetsMask, eWhiteBg))
2016-06-15 18:43:10 +12:00
createOnOffButton(eWhiteBg, "preview_white", tr("&White Background"),
group);
if (hasButton(m_gadgetsMask, eBlackBg))
2016-06-15 18:43:10 +12:00
createOnOffButton(eBlackBg, "preview_black", tr("&Black Background"),
group);
if (hasButton(m_gadgetsMask, eCheckBg))
2016-06-15 18:43:10 +12:00
createOnOffButton(eCheckBg, "preview_checkboard",
tr("&Checkered Background"), group);
if (hasButton(m_gadgetsMask, eWhiteBg))
m_bgSep = m_playToolBar->addSeparator();
2016-06-15 18:43:10 +12:00
// VCR buttons
QActionGroup *playGroup = new QActionGroup(m_playToolBar);
if (hasButton(m_gadgetsMask, eFirst))
2016-06-15 18:43:10 +12:00
createButton(eFirst, "framefirst", tr("&First Frame"), false);
if (hasButton(m_gadgetsMask, ePrev))
2016-06-15 18:43:10 +12:00
createButton(ePrev, "frameprev", tr("&Previous Frame"), false);
if (hasButton(m_gadgetsMask, ePause))
2016-06-15 18:43:10 +12:00
createCheckedButtonWithBorderImage(ePause, "pause", tr("Pause"), true,
playGroup, "A_Flip_Pause");
if (hasButton(m_gadgetsMask, ePlay))
2016-06-15 18:43:10 +12:00
createCheckedButtonWithBorderImage(ePlay, "play", tr("Play"), true,
playGroup, "A_Flip_Play");
if (hasButton(m_gadgetsMask, eLoop))
2016-06-15 18:43:10 +12:00
createCheckedButtonWithBorderImage(eLoop, "loop", tr("Loop"), true,
playGroup, "A_Flip_Loop");
if (hasButton(m_gadgetsMask, eNext))
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
createButton(eNext, "framenext", tr("&Next Frame"), false);
if (hasButton(m_gadgetsMask, eLast))
2016-06-15 18:43:10 +12:00
createButton(eLast, "framelast", tr("&Last Frame"), false);
// separator
if (hasButton(m_gadgetsMask, ePlay)) m_vcrSep = m_playToolBar->addSeparator();
2016-06-15 18:43:10 +12:00
// Channel Selector
m_colorFilterGroup = new QActionGroup(m_playToolBar);
m_colorFilterGroup->setExclusive(false);
if (hasButton(m_gadgetsMask, eRed) && !hasButton(m_gadgetsMask, eGRed))
2016-06-15 18:43:10 +12:00
createButton(eRed, "channelred", tr("Red Channel"), true);
else if (hasButton(m_gadgetsMask, eRed) && hasButton(m_gadgetsMask, eGRed))
2016-06-15 18:43:10 +12:00
m_doubleRedAction = createDoubleButton(
eRed, eGRed, "half_R", "half_bw", tr("Red Channel"),
tr("Red Channel in Grayscale"), m_colorFilterGroup, m_doubleRed);
if (hasButton(m_gadgetsMask, eGreen) && !hasButton(m_gadgetsMask, eGGreen))
2016-06-15 18:43:10 +12:00
createButton(eGreen, "channelgreen", tr("Green Channel"), true);
else if (hasButton(m_gadgetsMask, eGreen) &&
hasButton(m_gadgetsMask, eGGreen))
2016-06-15 18:43:10 +12:00
m_doubleGreenAction = createDoubleButton(
eGreen, eGGreen, "half_G", "half_bw", tr("Green Channel"),
tr("Green Channel in Grayscale"), m_colorFilterGroup, m_doubleGreen);
if (hasButton(m_gadgetsMask, eBlue) && !hasButton(m_gadgetsMask, eGBlue))
2016-06-15 18:43:10 +12:00
createButton(eBlue, "channelblue", tr("Blue Channel"), true);
else if (hasButton(m_gadgetsMask, eBlue) && hasButton(m_gadgetsMask, eGBlue))
2016-06-15 18:43:10 +12:00
m_doubleBlueAction = createDoubleButton(
eBlue, eGBlue, "half_B", "half_bw", tr("Blue Channel"),
tr("Blue Channel in Grayscale"), m_colorFilterGroup, m_doubleBlue);
ret = ret && connect(m_colorFilterGroup, SIGNAL(triggered(QAction *)), this,
SLOT(onButtonPressed(QAction *)));
if (hasButton(m_gadgetsMask, eMatte))
2016-06-15 18:43:10 +12:00
createButton(eMatte, "channelmatte", tr("Alpha Channel"), true);
// separator
if (hasButton(m_gadgetsMask, eRed) || hasButton(m_gadgetsMask, eGRed))
2016-06-15 18:43:10 +12:00
m_colorFilterSep = m_playToolBar->addSeparator();
2016-10-13 22:55:22 +13:00
// Sound & Histogram & Locator
if (hasButton(m_gadgetsMask, eSound) || hasButton(m_gadgetsMask, eHisto) ||
hasButton(m_gadgetsMask, eLocator)) {
if (hasButton(m_gadgetsMask, eSound)) {
2016-06-15 18:43:10 +12:00
createButton(eSound, "sound", tr("&Soundtrack "), true);
m_soundSep = m_playToolBar->addSeparator();
}
if (hasButton(m_gadgetsMask, eHisto))
2016-06-15 18:43:10 +12:00
createButton(eHisto, "histograms", tr("&Histogram"), false);
if (hasButton(m_gadgetsMask, eLocator))
2016-10-13 22:55:22 +13:00
createButton(eLocator, "locator", tr("&Locator"), false);
if (hasButton(m_gadgetsMask, eHisto) || hasButton(m_gadgetsMask, eLocator))
2016-06-15 18:43:10 +12:00
m_histoSep = m_playToolBar->addSeparator();
}
if (hasButton(m_gadgetsMask, eFilledRaster)) {
2016-06-15 18:43:10 +12:00
createOnOffButton(eFilledRaster, "preview_white",
tr("&Display Areas as Filled"), 0);
m_filledRasterSep = m_playToolBar->addSeparator();
}
if (withCustomWidget) {
m_customAction = m_playToolBar->addWidget(customWidget);
m_customSep = m_playToolBar->addSeparator();
}
if (hasButton(m_gadgetsMask, eZoomIn) || hasButton(m_gadgetsMask, eZoomOut) ||
hasButton(m_gadgetsMask, eFlipHorizontal) ||
hasButton(m_gadgetsMask, eFlipVertical) ||
hasButton(m_gadgetsMask, eResetView)) {
if (hasButton(m_gadgetsMask, eZoomIn))
createButton(eZoomIn, "zoomin", tr("&Zoom In"), false);
if (hasButton(m_gadgetsMask, eZoomOut))
createButton(eZoomOut, "zoomout", tr("&Zoom Out"), false);
if (hasButton(m_gadgetsMask, eFlipHorizontal))
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
createButton(eFlipHorizontal, "fliphoriz", tr("&Flip Horizontally"), 0);
if (hasButton(m_gadgetsMask, eFlipVertical))
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
createButton(eFlipVertical, "flipvert", tr("&Flip Vertically"), 0);
if (hasButton(m_gadgetsMask, eResetView))
createButton(eResetView, "reset", tr("&Reset View"), false);
m_viewerSep = m_playToolBar->addSeparator();
}
2016-06-15 18:43:10 +12:00
// for all actions in this toolbar
ret = ret && connect(m_playToolBar, SIGNAL(actionTriggered(QAction *)), this,
SLOT(onButtonPressed(QAction *)));
setChecked(ePause, true);
setChecked(eWhiteBg, FlipBookWhiteBgToggle);
setChecked(eBlackBg, FlipBookBlackBgToggle);
setChecked(eCheckBg, FlipBookCheckBgToggle);
assert(ret);
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::enableBlanks(bool state) {
m_drawBlanksEnabled = state;
m_blankColor = TPixel::Transparent;
if (m_drawBlanksEnabled)
Preferences::instance()->getBlankValues(m_blanksCount, m_blankColor);
else {
m_blanksCount = 0;
m_blankColor = TPixel::Transparent;
}
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
/*! call consoleOwner->onDrawFrame() intead of emitting drawFrame signal
2019-08-26 15:47:54 +12:00
*/
2016-06-15 18:43:10 +12:00
void FlipConsole::showCurrentFrame() {
m_consoleOwner->onDrawFrame(m_currentFrame, m_settings);
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::setChecked(UINT button, bool state) {
int i;
if (m_playToolBar) {
QObjectList objectList = m_playToolBar->children();
for (i = 0; i < (int)objectList.size(); i++) {
QAction *action = dynamic_cast<QAction *>(objectList[i]);
if (!action) {
QToolButton *toolButton = dynamic_cast<QToolButton *>(objectList[i]);
if (!toolButton) continue;
action = toolButton->defaultAction();
}
if (action && action->data().toUInt() == button) {
action->setChecked(state);
return;
}
}
}
if (m_colorFilterGroup) {
QList<QAction *> list = m_colorFilterGroup->actions();
for (i = 0; i < (int)list.size(); i++)
if (list[i]->data().toUInt() == button) {
list[i]->setChecked(state);
return;
}
}
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
bool FlipConsole::isChecked(UINT button) const {
QList<QAction *> list;
int i;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
if (m_playToolBar) {
list = m_playToolBar->actions();
for (i = 0; i < (int)list.size(); i++)
if (list[i]->data().toUInt() == button) return list[i]->isChecked();
}
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
if (m_colorFilterGroup) {
list = m_colorFilterGroup->actions();
for (i = 0; i < (int)list.size(); i++)
if (list[i]->data().toUInt() == button) return list[i]->isChecked();
}
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
return false;
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::pressLinkedConsoleButton(UINT button, FlipConsole *parent) {
int i;
assert(parent);
for (i = 0; i < m_visibleConsoles.size(); i++) {
FlipConsole *console = m_visibleConsoles.at(i);
if (console->m_isLinkable && console != parent) {
console->setChecked(button, parent ? parent->isChecked(button) : true);
console->doButtonPressed(button);
}
}
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::onButtonPressed(int button) {
makeCurrent();
2017-05-09 16:45:52 +12:00
if (m_playbackExecutor.isRunning() &&
(button == FlipConsole::ePlay || button == FlipConsole::eLoop)) {
pressButton(ePause);
} else {
2020-05-20 19:53:18 +12:00
// Sync playback state among all viewers & combo viewers.
// Note that the property "m_isLinkable" is used for distinguishing the
// owner between (viewer / combo viewer) and (flipbook / color model).
if (!m_isLinkable &&
(button == FlipConsole::ePlay || button == FlipConsole::eLoop)) {
bool stoppedOther = false;
2020-05-20 19:53:18 +12:00
for (auto playingConsole : m_visibleConsoles) {
if (playingConsole == this || playingConsole->isLinkable()) continue;
if (playingConsole->m_playbackExecutor.isRunning()) {
playingConsole->doButtonPressed(ePause);
playingConsole->setChecked(ePlay, false);
playingConsole->setChecked(eLoop, false);
playingConsole->setChecked(ePause, true);
stoppedOther = true;
m_stopAt = -1;
}
}
if (stoppedOther) {
setChecked(ePlay, false);
setChecked(eLoop, false);
setChecked(ePause, true);
m_stopAt = -1;
return;
}
}
2017-05-09 16:45:52 +12:00
doButtonPressed(button);
}
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
if (m_areLinked) pressLinkedConsoleButton(button, this);
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::pressButton(EGadget buttonId) {
2019-08-26 15:47:54 +12:00
FlipConsole *console = this;
2017-05-09 16:45:52 +12:00
if (m_visibleConsoles.indexOf(this) < 0 && m_visibleConsoles.size() > 0) {
2019-08-26 15:47:54 +12:00
console = m_visibleConsoles.at(0);
2017-05-09 16:45:52 +12:00
console->makeCurrent();
}
2019-08-26 15:47:54 +12:00
if (console->m_buttons.contains(buttonId) &&
console->m_buttons[buttonId]->isEnabled())
console->m_buttons[buttonId]->click();
else if (console->m_actions.contains(buttonId) &&
console->m_actions[buttonId]->isEnabled())
console->m_actions[buttonId]->trigger();
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::onLoadBox(bool isDefine) {
int shrink, dummy;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
Preferences::instance()->getViewValues(shrink, dummy);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
if (shrink != 1) {
2016-04-15 17:11:23 +12:00
#ifdef _WIN32
2016-06-15 18:43:10 +12:00
MessageBox(0, "Cannot use loading box with a shrink factor! ", "Warning",
MB_OK);
2016-03-19 06:57:51 +13:00
#endif
2016-06-15 18:43:10 +12:00
setChecked(eUseLoadBox, false);
setChecked(eDefineLoadBox, false);
m_settings.m_useLoadbox = m_settings.m_defineLoadbox = false;
return;
}
if (isDefine)
m_settings.m_defineLoadbox = !m_settings.m_defineLoadbox;
else
m_settings.m_useLoadbox = !m_settings.m_useLoadbox;
if (m_settings.m_defineLoadbox && m_settings.m_useLoadbox) {
setChecked(isDefine ? eUseLoadBox : eDefineLoadBox, false);
if (isDefine)
m_settings.m_useLoadbox = false;
else
m_settings.m_defineLoadbox = false;
}
m_consoleOwner->onDrawFrame(m_currentFrame, m_settings);
return;
2016-03-19 06:57:51 +13:00
}
//-----------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::doButtonPressed(UINT button) {
emit buttonPressed((FlipConsole::EGadget)button);
int from = m_from, to = m_to;
// When the level editing mode, ignore the preview frame range marker
if ((m_markerFrom <= m_markerTo && m_frameHandle &&
m_frameHandle->isEditingScene()) &&
m_stopAt == -1) {
from = m_markerFrom;
to = m_markerTo;
}
2016-06-15 18:43:10 +12:00
bool linked = m_areLinked && m_isLinkable;
switch (button) {
case eFirst:
m_currentFrame = from;
break;
case ePrev:
m_currentFrame =
(m_currentFrame - m_step < from) ? from : m_currentFrame - m_step;
break;
case eNext:
m_currentFrame =
(m_currentFrame + m_step > to) ? to : m_currentFrame + m_step;
break;
case eLast:
m_currentFrame = to;
break;
case ePlay:
case eLoop:
// if ( isChecked(ePlay, false);
// setChecked(eLoop, false);
m_editCurrFrame->disconnect();
m_currFrameSlider->disconnect();
m_isPlay = (button == ePlay);
if (linked && m_isLinkedPlaying) return;
if ((m_fps == 0 || m_framesCount == 0) && m_playbackExecutor.isRunning()) {
doButtonPressed(ePause);
if (m_fpsLabel) m_fpsLabel->setText(tr(" FPS ") + QString::number(m_fps));
if (m_fpsField) {
setFpsFieldColors();
}
2016-06-15 18:43:10 +12:00
return;
}
if (m_fpsLabel) m_fpsLabel->setText(tr(" FPS ") + "/");
if (m_fpsField) m_fpsField->setLineEditBackgroundColor(Qt::red);
m_playbackExecutor.resetFps(m_fps);
if (!m_playbackExecutor.isRunning()) m_playbackExecutor.start();
m_isLinkedPlaying = linked;
m_reverse = (m_fps < 0);
if (!linked) {
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
// if the play button pressed at the end frame, then go back to the
// start frame and play
2016-06-15 18:43:10 +12:00
if (m_currentFrame <= from ||
m_currentFrame >=
to) // the first frame of the playback is drawn right now
2020-05-25 10:00:44 +12:00
m_currentFrame = m_reverse ? to : from;
2016-06-15 18:43:10 +12:00
m_settings.m_recomputeIfNeeded = true;
m_consoleOwner->onDrawFrame(m_currentFrame, m_settings);
}
emit playStateChanged(true);
return;
case ePause:
if (!m_playbackExecutor.isRunning() && !m_isLinkedPlaying) {
2020-05-20 19:53:18 +12:00
// Sync playback state among all viewers & combo viewers.
// Note that the property "m_isLinkable" is used for distinguishing the
// owner between (viewer / combo viewer) and (flipbook / color model).
if (!m_isLinkable) {
for (auto playingConsole : m_visibleConsoles) {
if (playingConsole->isLinkable()) continue;
if (playingConsole->m_playbackExecutor.isRunning())
playingConsole->doButtonPressed(button);
playingConsole->setChecked(ePlay, false);
playingConsole->setChecked(eLoop, false);
playingConsole->setChecked(ePause, true);
}
}
m_stopAt = -1;
return;
}
2016-06-15 18:43:10 +12:00
m_isLinkedPlaying = false;
if (m_playbackExecutor.isRunning()) m_playbackExecutor.abort();
m_stopAt = -1;
2016-06-15 18:43:10 +12:00
m_isPlay = false;
m_blanksToDraw = 0;
m_consoleOwner->swapBuffers();
m_consoleOwner->changeSwapBehavior(true);
if (m_settings.m_blankColor != TPixel::Transparent) {
m_settings.m_blankColor = TPixel::Transparent;
m_settings.m_recomputeIfNeeded = true;
m_consoleOwner->onDrawFrame(m_currentFrame, m_settings);
}
if (m_fpsLabel) m_fpsLabel->setText(tr(" FPS "));
if (m_fpsField) {
setFpsFieldColors();
}
2016-06-15 18:43:10 +12:00
// setChecked(ePlay, false);
// setChecked(eLoop, false);
connect(m_editCurrFrame, SIGNAL(editingFinished()), this,
SLOT(OnSetCurrentFrame()));
connect(m_currFrameSlider, SIGNAL(flipSliderReleased()), this,
SLOT(OnFrameSliderRelease()));
connect(m_currFrameSlider, SIGNAL(flipSliderPressed()), this,
SLOT(OnFrameSliderPress()));
connect(m_currFrameSlider, SIGNAL(valueChanged(int)), this,
SLOT(OnSetCurrentFrame(int)));
connect(m_currFrameSlider, SIGNAL(flipSliderReleased()), this,
SLOT(onSliderRelease()));
emit playStateChanged(false);
return;
case eGRed:
case eGGreen:
case eGBlue:
case eRed:
case eGreen:
case eBlue:
case eMatte: {
if (button != eGRed) setChecked(eGRed, false);
if (button != eGGreen) setChecked(eGGreen, false);
if (button != eGBlue) setChecked(eGBlue, false);
if (button == eGRed || button == eGGreen || button == eGBlue) {
m_settings.m_greytones = isChecked(button);
setChecked(eRed, false);
setChecked(eGreen, false);
setChecked(eBlue, false);
setChecked(eMatte, false);
} else
m_settings.m_greytones = false;
if (m_doubleRed) {
m_doubleRed->update();
m_doubleGreen->update();
m_doubleBlue->update();
}
int colorMask = 0;
if (isChecked(eRed) || isChecked(eGRed))
colorMask = colorMask | TRop::RChan;
if (isChecked(eGreen) || isChecked(eGGreen))
colorMask = colorMask | TRop::GChan;
if (isChecked(eBlue) || isChecked(eGBlue))
2020-05-25 10:00:44 +12:00
colorMask = colorMask | TRop::BChan;
2016-06-15 18:43:10 +12:00
if (isChecked(eMatte)) colorMask = colorMask | TRop::MChan;
if (colorMask == (TRop::RChan | TRop::GChan | TRop::BChan) ||
colorMask == (TRop::RChan | TRop::GChan | TRop::BChan | TRop::MChan))
m_settings.m_colorMask = 0;
else
m_settings.m_colorMask = colorMask;
break;
}
case eSound:
// emit soundEnabled(isChecked(eSound));
break;
case eWhiteBg:
case eBlackBg:
case eCheckBg:
m_settings.m_bg = (EGadget)button;
FlipBookWhiteBgToggle = isChecked(eWhiteBg);
FlipBookBlackBgToggle = isChecked(eBlackBg);
FlipBookCheckBgToggle = isChecked(eCheckBg);
break;
case FlipConsole::eCompare:
m_settings.m_doCompare = !m_settings.m_doCompare;
break;
case eHisto:
case eSaveImg:
case eSave:
2016-10-13 22:55:22 +13:00
case eLocator:
2016-06-15 18:43:10 +12:00
// nothing to do
return;
case eDefineSubCamera:
// nothing to do
return;
case eDefineLoadBox:
onLoadBox(true);
break;
case eUseLoadBox:
onLoadBox(false);
break;
case eFilledRaster:
return;
2020-04-28 17:02:21 +12:00
case eFlipHorizontal:
case eFlipVertical:
case eZoomIn:
case eZoomOut:
case eResetView:
return;
2016-06-15 18:43:10 +12:00
default:
assert(false);
break;
}
m_currFrameSlider->setValue(m_currentFrame);
m_editCurrFrame->setText(QString::number(m_currentFrame));
updateCurrentTime();
2016-06-15 18:43:10 +12:00
m_consoleOwner->onDrawFrame(m_currentFrame, m_settings);
2016-03-19 06:57:51 +13:00
}
//--------------------------------------------------------------------
void FlipConsole::setStopAt(int frame) { m_stopAt = frame; }
//--------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
QFrame *FlipConsole::createFrameSlider() {
QFrame *frameSliderFrame = new QFrame(this);
m_editCurrFrame = new DVGui::IntLineEdit(frameSliderFrame, m_currentFrame);
m_editCurrFrame->setToolTip(tr("Set the current frame"));
m_editCurrFrame->setFixedWidth(40);
m_currFrameSlider = new FlipSlider(frameSliderFrame);
m_currFrameSlider->setToolTip(tr("Drag to play the animation"));
m_currFrameSlider->setRange(0, 0);
m_currFrameSlider->setValue(0);
m_timeLabel = new QLabel(QString("00:00:00"), frameSliderFrame);
2020-07-04 11:45:44 +12:00
m_timeLabel->setFixedWidth(m_timeLabel->fontMetrics().width("00:00:00") + 10);
m_timeLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
m_timeLabel->setStyleSheet("padding: 0px; margin: 0px;");
2016-06-15 18:43:10 +12:00
if (m_drawBlanksEnabled) {
m_enableBlankFrameButton = new QPushButton(this);
m_enableBlankFrameButton->setCheckable(true);
m_enableBlankFrameButton->setChecked(true);
m_enableBlankFrameButton->setFixedHeight(24);
m_enableBlankFrameButton->setFixedWidth(66);
m_enableBlankFrameButton->setObjectName("enableBlankFrameButton");
}
// layout
QHBoxLayout *frameSliderLayout = new QHBoxLayout();
frameSliderLayout->setSpacing(5);
frameSliderLayout->setMargin(2);
{
frameSliderLayout->addWidget(m_timeLabel, 0);
2016-06-15 18:43:10 +12:00
frameSliderLayout->addWidget(m_editCurrFrame, 0);
frameSliderLayout->addWidget(m_currFrameSlider, 1);
if (m_drawBlanksEnabled)
frameSliderLayout->addWidget(m_enableBlankFrameButton, 0);
}
frameSliderFrame->setLayout(frameSliderLayout);
connect(m_editCurrFrame, SIGNAL(editingFinished()), this,
SLOT(OnSetCurrentFrame()));
connect(m_currFrameSlider, SIGNAL(valueChanged(int)), this,
SLOT(OnSetCurrentFrame(int)));
connect(m_currFrameSlider, SIGNAL(flipSliderReleased()), this,
SLOT(OnFrameSliderRelease()));
if (!m_fpsField) m_timeLabel->hide();
2016-06-15 18:43:10 +12:00
return frameSliderFrame;
2016-03-19 06:57:51 +13:00
}
//--------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
QFrame *FlipConsole::createFpsSlider() {
QFrame *fpsSliderFrame = new QFrame(this);
// frame per second
m_fpsLabel = new QLabel(QString(" FPS -- /"), fpsSliderFrame);
m_fpsSlider = new QScrollBar(Qt::Horizontal, fpsSliderFrame);
m_fpsField = new DVGui::IntLineEdit(fpsSliderFrame, m_fps, -60, 60);
m_fpsField->setFixedWidth(40);
m_fpsLabel->setMinimumWidth(m_fpsLabel->fontMetrics().width("_FPS_24___"));
m_fpsLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
m_fpsSlider->setObjectName("ViewerFpsSlider");
m_fpsSlider->setRange(-60, 60);
m_fpsSlider->setValue(m_fps);
m_fpsSlider->setToolTip(tr("Set the playback frame rate"));
m_fpsSlider->setContextMenuPolicy(Qt::NoContextMenu);
QHBoxLayout *hLay = new QHBoxLayout();
hLay->setSpacing(0);
hLay->setMargin(0);
{
hLay->addWidget(m_fpsLabel, 0);
hLay->addWidget(m_fpsField, 0);
hLay->addWidget(m_fpsSlider, 1);
}
fpsSliderFrame->setLayout(hLay);
connect(m_fpsSlider, SIGNAL(valueChanged(int)), this,
SLOT(setCurrentFPS(int)));
connect(m_fpsField, SIGNAL(editingFinished()), this, SLOT(onFPSEdited()));
return fpsSliderFrame;
2016-03-19 06:57:51 +13:00
}
//--------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::onFPSEdited(void) {
// this will emit fpsSlider->ValueChanged as well
m_fpsSlider->setValue(m_fpsField->getValue());
2016-03-19 06:57:51 +13:00
}
//--------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::setFrameRange(int from, int to, int step, int current) {
if (from != m_from || to != m_to || step != m_step) {
m_from = from;
m_to = to;
m_step = step;
m_to -= (m_to - m_from) % m_step;
m_framesCount = (m_to - m_from) / m_step + 1;
m_currFrameSlider->blockSignals(true);
// m_currFrameSlider->setRange(0, m_framesCount-1);
m_currFrameSlider->setRange(m_from, m_to);
m_currFrameSlider->setSingleStep(m_step);
m_currFrameSlider->blockSignals(false);
}
if (m_playbackExecutor.isRunning() ||
UI update and Icons from Konero (#126) * add multi arc mockup * implement mutli arc * add join and smooth option * reset multiarc and arc when deactivated * create self loop if the last point is the same as the first * make join option in multiarc consistent with tape tool * fix a bug where thickness don't affect mutliarc in vector level * remove join option in geometric tool * stop mutliarc after closing shape * double click can also end multi arc * fix a bug where multiArc will produce buggy stroke * fix a bug where geometric tools is not deactivated * add multiArc shortcut * rewrite multiArc * revert changes to tvectorimage * add undo data for multiArc * Paste as Copy Command for XSheet * Remove unneeded code * Bug fix * prevent guide lines from jumping around in MultiArc * make stroke color consistent in MultiArc * remove color in MultiArc's undo data * make color consistent in MultiArc with previous version * Fix single image raster levels * fix compilation error * fix a bug where multiArc might generate bugged stroke * Remove ICONV dep (#3304) * fix crash on saving studio palette * Move to Paste Special Menu * Don't Set Fixed Width if Docking a Floating Panel * Update how_to_build_win.md New draft of pr for requested changes to windows build instructions. * fix geometric tool multiarc smooth option * fix level saving failure * fix wrong warning after saving palette * fix a bug where moving a control point while holding alt has unintended result * fix travis-install (#3389) * Fix assert debug crash in flipconsole.cpp Fix crash when using the viewer controls in the console (debug) * Redraw Audio Waveform Fills the waveform rather than outlines it. * Update .gitignore * fix undo data when drawing arc and mutliarc * fix overwriting raster drawing palette (#3387) * mode sensitive fx settings * Create New Style Command Button (#3394) * Create New Style Command Button This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz. Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com> * Update paletteviewergui.cpp Made changes to the PR per request by Shun. * Fixed a space within the code that wasn't suppose to be there. Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com> * tahoma license (#3396) * new style button optional * fix loading pegbars (removing updateKeyframes) * periodic random expression * add fx in linear color space this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd. in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories. * fractal noise iwa fx * skip unnecessary icon invalidation * fix frame range fill with tablet * stop function editor to open by dbl clicking key * Expanding the radius of the rotation handle. This just changes when the cursor transforms into the rotation tool. (cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39) * fix vector img patern stroke style * Update Stylesheets - Support the new icon sizes - XSheet and Timeline significantly redesigned - Lots of margin fixes and refactoring - Remove deprecated icons, as some icons are moved into binary - New Light theme * New Icons - Redesigns almost every icon as symbolic - Adds icons for most commands * Add Option for Icon Themes - Adds option for icon themes - Removes useless label from Preferences category list * Update Icon Functions - Adds themePath() boolean - Adds function for recoloring black pixels in pixmaps to any color - Rebuilds createQIcon to use fromTheme() and recolorPixmap() - Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon - Removes a grey horizontal line drawn above the console play bar in the viewer * Set Default Icon Theme and Paths - Sets search paths for icons for use with QIcon::fromTheme() - Sets default start icon theme on first install - Sets flag for displaying icons in menus, so we can selectively hide them * Set Icons for Commands - Sets icons for the commands - Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16 - Selectively allows icons to display for Tools in menus * Change Icon Sizes, General Fixes and Stylesheet Additions - Change icon sizes to new size - Remove margin around FX Editor window - Remove white line under color sliders in Style Editor - Make keyframe icons uniform and color stylable in the stylesheets - Removes deprecated stylesheet strings - Redesign GUI for palette list view - Make tree list header sort row stylable - Remove black lines from scrollbars in New Project window - Remove margin around combobox in Level Strip - Alter how some lines are drawn in the Timeline to fix some alpha issues - Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility - Make text always viewable in the FPS field in console bar - Increase size of radio buttons in Cleanup Settings - Increase size of switches in motion path nodes - Remove unessesary "Layer" label in Timeline and other rects - Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more - Moves some external stylesheet icons into binary * Make TPanelTitleBar Icon States Stylable - Makes icon states for TPanelTitleBar buttons stylable in stylesheets * Travis Fixes * Swap Startup Popup Logos They were in the wrong folders * Revert "Swap Startup Popup Logos" This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d. * Fix Startup Popup Logo It wasn't switching * Feedback Changes - Change render visualization to clapboard - Fix text contrast on levels in XSheet * Make Cell Selection More Clear * Darken Light Theme and Tint Empty Cell Selection * Fix missing icons * Fix memo button * Bring back colors * Hide Motion Tab * Fix Play Range Area (Light) Make play range area more visible * Vector Column Color Co-authored-by: pojienie <pojienie@gmail.com> Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com> Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp> Co-authored-by: Rodney <rodney.baker@gmail.com> Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com> Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com> Co-authored-by: Kite <konero@users.noreply.github.com> Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com> Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
m_isLinkedPlaying) // if in playing mode, the slider and the frame
// field are already set in the timer!
2016-06-15 18:43:10 +12:00
return;
// limit the current frame in the range from-to
if (current < from)
current = from;
else if (current > to)
current = to;
m_currFrameSlider->blockSignals(true);
setCurrentFrame(current);
m_currFrameSlider->blockSignals(false);
2016-03-19 06:57:51 +13:00
}
//--------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::incrementCurrentFrame(int delta) {
m_currentFrame = m_currentFrame + delta;
if (m_currentFrame < m_from)
m_currentFrame += m_to - m_from + 1;
else if (m_currentFrame > m_to)
m_currentFrame -= m_to - m_from + 1;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
m_editCurrFrame->setText(QString::number(m_currentFrame));
m_currFrameSlider->setValue(m_currentFrame);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
m_consoleOwner->onDrawFrame(m_currentFrame, m_settings);
2016-03-19 06:57:51 +13:00
}
//--------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::OnSetCurrentFrame() {
int newFrame = m_editCurrFrame->text().toInt();
if (m_step > 1) {
newFrame -= ((newFrame - m_from) % m_step);
m_editCurrFrame->setText(QString::number(newFrame));
updateCurrentTime();
2016-06-15 18:43:10 +12:00
}
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
int i, deltaFrame = newFrame - m_currentFrame;
2016-03-19 06:57:51 +13:00
if (m_framesCount == 0) {
m_editCurrFrame->setText(QString::number(1));
updateCurrentTime();
}
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
if (m_framesCount == 0 || newFrame == m_currentFrame || newFrame == 0) return;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
if (newFrame > m_to) {
m_editCurrFrame->setText(QString::number(m_currentFrame));
updateCurrentTime();
2016-06-15 18:43:10 +12:00
return;
}
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
m_currentFrame = newFrame;
m_currFrameSlider->setValue(m_currentFrame);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
m_consoleOwner->onDrawFrame(m_currentFrame, m_settings);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
if (m_areLinked)
for (i = 0; i < m_visibleConsoles.size(); i++) {
FlipConsole *console = m_visibleConsoles.at(i);
if (console->m_isLinkable && console != this)
console->incrementCurrentFrame(deltaFrame);
}
2016-03-19 06:57:51 +13:00
}
//--------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::onSliderRelease() { emit sliderReleased(); }
2016-03-19 06:57:51 +13:00
//--------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::OnFrameSliderRelease() {
m_settings.m_recomputeIfNeeded = true;
m_currentFrame = -1;
OnSetCurrentFrame();
2016-03-19 06:57:51 +13:00
}
2016-06-15 18:43:10 +12:00
void FlipConsole::OnFrameSliderPress() {
m_settings.m_recomputeIfNeeded = false;
2016-03-19 06:57:51 +13:00
}
//---------------------
//----------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::OnSetCurrentFrame(int index) {
if (m_framesCount == 0) return;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
if (index == m_currentFrame) return;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
int deltaFrame = index - m_currentFrame;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
m_currentFrame = index;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
assert(m_currentFrame <= m_to);
m_editCurrFrame->setText(QString::number(m_currentFrame));
updateCurrentTime();
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
m_consoleOwner->onDrawFrame(m_currentFrame, m_settings);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
if (m_areLinked)
for (int i = 0; i < m_visibleConsoles.size(); i++) {
FlipConsole *console = m_visibleConsoles.at(i);
if (console->m_isLinkable && console != this)
console->incrementCurrentFrame(deltaFrame);
}
2016-03-19 06:57:51 +13:00
}
//--------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::setCurrentFrame(int frame, bool forceResetting) {
m_currentFrame = (frame == -1) ? m_from : frame;
if ((m_playbackExecutor.isRunning() || m_isLinkedPlaying) &&
!forceResetting) // if in playing mode, the slider and the frame field
// are already set in the timer!
return;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
m_editCurrFrame->setValue(m_currentFrame);
m_currFrameSlider->setValue(m_currentFrame);
updateCurrentTime();
}
//--------------------------------------------------------------------
void FlipConsole::updateCurrentTime() {
int seconds = (int)((double)(m_currentFrame) / m_sceneFps);
int frames = (m_currentFrame) % (int)m_sceneFps;
int minutes = seconds / 60;
int realSeconds = seconds - (minutes * 60);
QString strMinutes = QString("%1").arg(minutes, 2, 10, QChar('0'));
QString strSeconds = QString("%1").arg(realSeconds, 2, 10, QChar('0'));
QString strFrames = QString("%1").arg(frames, 2, 10, QChar('0'));
QString time = strMinutes + ":" + strSeconds + ":" + strFrames;
m_timeLabel->setText(time);
2016-03-19 06:57:51 +13:00
}
//--------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::enableProgressBar(bool enable) {
m_currFrameSlider->setProgressBarEnabled(enable);
2016-03-19 06:57:51 +13:00
}
//--------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void FlipConsole::setProgressBarStatus(const std::vector<UCHAR> *pbStatus) {
m_currFrameSlider->setProgressBarStatus(pbStatus);
2016-03-19 06:57:51 +13:00
}
//--------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
const std::vector<UCHAR> *FlipConsole::getProgressBarStatus() const {
return m_currFrameSlider->getProgressBarStatus();
2016-03-19 06:57:51 +13:00
}
//--------------------------------------------------------------------
2017-02-28 17:56:07 +13:00
void FlipConsole::onPreferenceChanged(const QString &prefName) {
// react only when related properties are changed
if (prefName != "BlankCount" && prefName != "BlankColor" &&
!prefName.isEmpty())
return;
2016-06-15 18:43:10 +12:00
if (m_drawBlanksEnabled) {
Preferences::instance()->getBlankValues(m_blanksCount, m_blankColor);
if (m_blanksCount == 0) {
if (m_enableBlankFrameButton->isVisible())
m_enableBlankFrameButton->hide();
} else {
if (m_enableBlankFrameButton->isHidden())
m_enableBlankFrameButton->show();
QString buttonText = QString("+%1 Blank").arg(m_blanksCount);
if (m_blanksCount > 1) buttonText += "s";
m_enableBlankFrameButton->setText(buttonText);
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
// Set text color based on luminescence of blankColor color
2016-06-15 18:43:10 +12:00
QString textColor;
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
double luminescence =
((0.299 * (int)m_blankColor.r) + (0.587 * (int)m_blankColor.g) +
(0.114 * (int)m_blankColor.b)) /
255;
if (luminescence > 0.5)
textColor = QString("black");
else
textColor = QString("white");
2016-06-15 18:43:10 +12:00
m_enableBlankFrameButton->setStyleSheet(
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
QString("#enableBlankFrameButton:checked { \
2016-06-19 20:06:29 +12:00
background-color: rgb(%1,%2,%3); \
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
color: %4;}")
2016-06-15 18:43:10 +12:00
.arg(m_blankColor.r)
.arg(m_blankColor.g)
.arg(m_blankColor.b)
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
.arg(textColor));
2016-06-15 18:43:10 +12:00
m_enableBlankFrameButton->update();
}
}
2016-03-19 06:57:51 +13:00
}
//====================================================================
2016-06-15 18:43:10 +12:00
class FlipConsoleActionsCreator : AuxActionsCreator {
void createToggleAction(QObject *parent, const char *cmdId, const char *name,
int buttonId) {
QAction *action = new QAction(name, parent);
action->setData(QVariant(buttonId));
CommandManager::instance()->define(cmdId, MiscCommandType, "", action);
}
2016-03-19 06:57:51 +13:00
public:
2016-06-19 20:06:29 +12:00
void createActions(QObject *parent) override {
2016-06-15 18:43:10 +12:00
/*createToggleAction(parent, "A_Flip_Play", "Play", FlipConsole::ePlay);
createToggleAction(parent, "A_Flip_Pause", "Pause", FlipConsole::ePause);
createToggleAction(parent, "A_Flip_Loop", "Loop", FlipConsole::eLoop);*/
}
2016-03-19 06:57:51 +13:00
} flipConsoleActionsCreator;
//--------------------------------------------------------------------