From f5da61aa1b8b13353b05f1bea75c59509f0b9811 Mon Sep 17 00:00:00 2001 From: Jeremy Bullock Date: Sat, 25 Jul 2020 22:23:46 -0700 Subject: [PATCH] OT changes as of 7/22 (#94) --- stuff/doc/LICENSE/LICENSE_tahoma.txt | 36 +++++++++++++++++++ toonz/sources/include/toonzqt/paletteviewer.h | 1 + toonz/sources/toonzlib/tstageobject.cpp | 6 +++- toonz/sources/toonzqt/paletteviewer.cpp | 16 +++++++++ toonz/sources/toonzqt/paletteviewergui.cpp | 7 ++-- 5 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 stuff/doc/LICENSE/LICENSE_tahoma.txt diff --git a/stuff/doc/LICENSE/LICENSE_tahoma.txt b/stuff/doc/LICENSE/LICENSE_tahoma.txt new file mode 100644 index 00000000..1afdb03f --- /dev/null +++ b/stuff/doc/LICENSE/LICENSE_tahoma.txt @@ -0,0 +1,36 @@ +License Agreement For Tahoma +[https://github.com/turtletooth/tahoma] + +- - - - - - - - - - - - - - - - + +Tahoma + +All contributions by Jeremy Bullock: +Copyright (c) 2016 - 2020, Jeremy Bullock +All rights reserved. + +All contributions by DWANGO: +Copyright (c) 2016 - 2020, DWANGO Co., Ltd. +All rights reserved. + +All other contributions: +Copyright (c) 2016 - 2020, the respective contributors. +All rights reserved. + +Each contributor holds copyright over their respective contributions. +The project versioning (Git) records all such contribution source information. + + +LICENSE + +BSD 3-Clause "New" or "Revised" License + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/toonz/sources/include/toonzqt/paletteviewer.h b/toonz/sources/include/toonzqt/paletteviewer.h index b45011c0..7c4e6e90 100644 --- a/toonz/sources/include/toonzqt/paletteviewer.h +++ b/toonz/sources/include/toonzqt/paletteviewer.h @@ -169,6 +169,7 @@ protected slots: void setIsLocked(bool lock); void onSwitchToPage(int pageIndex); + void onShowNewStyleButtonToggled(); private: void setSaveDefaultText(QAction *action, int levelType); diff --git a/toonz/sources/toonzlib/tstageobject.cpp b/toonz/sources/toonzlib/tstageobject.cpp index ebb5f6d9..2de30b13 100644 --- a/toonz/sources/toonzlib/tstageobject.cpp +++ b/toonz/sources/toonzlib/tstageobject.cpp @@ -1815,7 +1815,11 @@ void TStageObject::loadData(TIStream &is) { for (; itKfInd != keyframeIndexSet.end(); itKfInd++) setkey(m_scale, *itKfInd); } - updateKeyframes(); + // Calling updateKeyframes() here may cause failure to load expressions + // especially if it refers to a curve which is to be loaded AFTER this + // function while loading scene process. So I will skip it assuming that + // updateKeyframes() will be called when it is actually needed. + // updateKeyframes(); if (m_spline != 0 && isUppkEnabled()) m_spline->addParam(m_posPath.getPointer()); invalidate(); diff --git a/toonz/sources/toonzqt/paletteviewer.cpp b/toonz/sources/toonzqt/paletteviewer.cpp index 195ad4f4..a0bd3e0a 100644 --- a/toonz/sources/toonzqt/paletteviewer.cpp +++ b/toonz/sources/toonzqt/paletteviewer.cpp @@ -27,6 +27,7 @@ // TnzCore includes #include "tconvert.h" #include "tsystem.h" +#include "tenv.h" // Qt includes #include @@ -40,6 +41,7 @@ #include #include +TEnv::IntVar ShowNewStyleButton("ShowNewStyleButton", 1); using namespace PaletteViewerGUI; //============================================================================= @@ -1296,3 +1298,17 @@ void PaletteViewer::setIsLocked(bool lock) { void PaletteViewer::onSwitchToPage(int pageIndex) { m_pagesBar->setCurrentIndex(pageIndex); } + +//----------------------------------------------------------------------------- + +void PaletteViewer::onShowNewStyleButtonToggled() { + ShowNewStyleButton = (ShowNewStyleButton == 1) ? 0 : 1; + QAction *act = dynamic_cast(sender()); + if (act) { + QString str = (ShowNewStyleButton) ? tr("Hide New Style Button") + : tr("Show New Style Button"); + act->setText(str); + } + m_pageViewer->computeSize(); + m_pageViewer->update(); +} \ No newline at end of file diff --git a/toonz/sources/toonzqt/paletteviewergui.cpp b/toonz/sources/toonzqt/paletteviewergui.cpp index 3934b47a..2502a84b 100644 --- a/toonz/sources/toonzqt/paletteviewergui.cpp +++ b/toonz/sources/toonzqt/paletteviewergui.cpp @@ -40,6 +40,7 @@ // enable to set font size for style name separately from other texts TEnv::IntVar EnvSoftwareCurrentFontSize_StyleName( "SoftwareCurrentFontSize_StyleName", 11); +extern TEnv::IntVar ShowNewStyleButton; TEnv::IntVar ShowStyleIndex("ShowStyleIndex", 0); @@ -573,9 +574,9 @@ void PageViewer::drawToggleLink(QPainter &p, QRect &chipRect, //----------------------------------------------------------------------------- /*! Draw the chip name \b name inside rectangle \b chipRect using painter \b p. -* If the name is too wide to fit on the chip, use left align - to show the -* start of the name. Otherwise, use center align. -*/ + * If the name is too wide to fit on the chip, use left align - to show the + * start of the name. Otherwise, use center align. + */ static void drawChipName(QPainter &p, const QRect &chipRect, const std::wstring &name) { const QString nameQString = QString::fromStdWString(name);