Rename level types (#46)

This commit is contained in:
Jeremy Bullock 2020-06-06 18:49:41 -06:00 committed by GitHub
parent 8044d337b2
commit 8d19877058
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 73 additions and 80 deletions

View file

@ -1975,7 +1975,7 @@ XsheetViewer {
qproperty-VerticalLineHeadColor: #0f0f0f;
qproperty-PreviewFrameTextColor: #9fdaff;
qproperty-CurrentRowBgColor: rgba(83, 133, 166, 0.7);
qproperty-OnionSkinAreaBgColor: #262626;
qproperty-OnionSkinAreaBgColor: #2b2b2b;
qproperty-CellFocusColor: #000;
qproperty-EmptyColumnHeadColor: #444444;
qproperty-EmptyCellColor: #303030;

View file

@ -1975,7 +1975,7 @@ XsheetViewer {
qproperty-VerticalLineHeadColor: #272727;
qproperty-PreviewFrameTextColor: #9fdaff;
qproperty-CurrentRowBgColor: rgba(83, 133, 166, 0.7);
qproperty-OnionSkinAreaBgColor: #393939;
qproperty-OnionSkinAreaBgColor: #404040;
qproperty-CellFocusColor: #000;
qproperty-EmptyColumnHeadColor: #484848;
qproperty-EmptyCellColor: #393939;

View file

@ -377,7 +377,7 @@
@xsheet-VerticalLineHead-color: darken(@bg, 13); // function editior header
@xsheet-PreviewFrameText-color: @label-title;
@xsheet-CurrentRowBG-color: fade(@hl-bg-color, 70);
@xsheet-OnionSkinAreaBG-color: darken(@title-bg-color, 0);
@xsheet-OnionSkinAreaBG-color: @xsheet-bg-color;
@xsheet-CellArea-bg-color-focus: rgba(0, 0, 0, 0.65);
@xsheet-CellFocus-color: #000;

View file

@ -78,7 +78,7 @@
// -----------------------------------------------------------------------------
@xsheet-bg-color: darken(@bg, 2);
@xsheet-OnionSkinAreaBG-color: darken(@bg, 4);
@xsheet-OnionSkinAreaBG-color: darken(@bg, 2);
@xsheet-EmptyColumnHead-color: lighten(@bg, 8);
@xsheet-EmptyCell-color: @bg;
@xsheet-NotEmptyColumn-color: lighten(@bg, 3);

View file

@ -148,11 +148,8 @@ void CleanupPaletteViewer::buildGUI() {
if (m_greyMode) {
m_scrollArea->setMinimumSize(0, 60);
m_scrollArea->setStyleSheet("QScrollArea { border: none; }");
} else {
m_scrollArea->setMinimumSize(0, 120);
m_scrollArea->setStyleSheet(
"QScrollArea { border: 1px solid rgb(190, 190, 190); }");
}
m_add->setVisible(!m_greyMode);

View file

@ -184,8 +184,8 @@ LevelCreatePopup::LevelCreatePopup()
QRegExp rx("[^\\\\/:?*.\"<>|]+");
m_nameFld->setValidator(new QRegExpValidator(rx, this));
m_levelTypeOm->addItem(tr("Toonz Vector Level"), (int)PLI_XSHLEVEL);
m_levelTypeOm->addItem(tr("Toonz Raster Level"), (int)TZP_XSHLEVEL);
m_levelTypeOm->addItem(tr("Vector Level"), (int)PLI_XSHLEVEL);
m_levelTypeOm->addItem(tr("Smart Raster Level"), (int)TZP_XSHLEVEL);
m_levelTypeOm->addItem(tr("Raster Level"), (int)OVL_XSHLEVEL);
m_levelTypeOm->addItem(tr("Scan Level"), (int)TZI_XSHLEVEL);

View file

@ -454,7 +454,7 @@ LevelSettingsPopup::LevelSettingsPopup()
if (Preferences::instance()->getUnits() == "pixel")
dpiBox = new QGroupBox(tr("Resolution"), this);
else
dpiBox = new QGroupBox(tr("DPI && Resolution"), this);
dpiBox = new QGroupBox(tr("DPI && Resolution"), this);
QGridLayout *dpiLayout = new QGridLayout();
dpiLayout->setMargin(5);
dpiLayout->setSpacing(5);
@ -679,7 +679,7 @@ LevelSettingsValues LevelSettingsPopup::getValues(TXshLevelP level) {
// leveltype
switch (levelType) {
case ToonzRaster:
values.typeStr = tr("Toonz Raster level");
values.typeStr = tr("Smart Raster level");
break;
case Raster:
values.typeStr = tr("Raster level");
@ -688,7 +688,7 @@ LevelSettingsValues LevelSettingsPopup::getValues(TXshLevelP level) {
values.typeStr = tr("Mesh level");
break;
case ToonzVector:
values.typeStr = tr("Toonz Vector level");
values.typeStr = tr("Vector level");
break;
case Palette:
values.typeStr = tr("Palette level");
@ -1321,7 +1321,7 @@ void LevelSettingsPopup::onWidthFieldChanged() {
if (dpi.x <= 0) continue;
TDimension res = sl->getResolution();
if (res.lx <= 0) continue;
dpi.x = res.lx / lx;
dpi.x = res.lx / lx;
if (m_squarePixCB->isChecked()) dpi.y = dpi.x;
LevelProperties::DpiPolicy oldPolicy = sl->getProperties()->getDpiPolicy();
@ -1361,7 +1361,7 @@ void LevelSettingsPopup::onHeightFieldChanged() {
if (dpi.y <= 0) continue;
TDimension res = sl->getResolution();
if (res.ly <= 0) continue;
dpi.y = res.ly / ly;
dpi.y = res.ly / ly;
if (m_squarePixCB->isChecked()) dpi.x = dpi.y;
LevelProperties::DpiPolicy oldPolicy = sl->getProperties()->getDpiPolicy();

View file

@ -1643,8 +1643,8 @@ void MainWindow::defineActions() {
newVectorLevelAction->setIconText(tr("New Vector Level"));
newVectorLevelAction->setIcon(QIcon(":Resources/new_vector_level.svg"));
QAction *newToonzRasterLevelAction = createMenuLevelAction(
MI_NewToonzRasterLevel, tr("&New Toonz Raster Level"), "");
newToonzRasterLevelAction->setIconText(tr("New Toonz Raster Level"));
MI_NewToonzRasterLevel, tr("&New Smart Raster Level"), "");
newToonzRasterLevelAction->setIconText(tr("New Smart Raster Level"));
newToonzRasterLevelAction->setIcon(
QIcon(":Resources/new_toonz_raster_level.svg"));
QAction *newRasterLevelAction =
@ -2118,10 +2118,9 @@ void MainWindow::defineActions() {
// createRightClickMenuAction(MI_PremultiplyFile, tr("Premultiply"),
// "");
createMenuLevelAction(MI_ConvertToVectors, tr("Convert to Vectors..."), "");
createMenuLevelAction(MI_ConvertToToonzRaster, tr("Vectors to Toonz Raster"),
createMenuLevelAction(MI_ConvertToToonzRaster, tr("Vectors to Smart Raster"),
"");
createMenuLevelAction(MI_ConvertVectorToVector,
tr("Replace Vectors with Simplified Vectors"), "");
createMenuLevelAction(MI_ConvertVectorToVector, tr("Simplify Vectors"), "");
createMenuLevelAction(MI_Tracking, tr("Tracking..."), "");
createRightClickMenuAction(MI_RemoveLevel, tr("Remove Level"), "");
createRightClickMenuAction(MI_AddToBatchRenderList, tr("Add As Render Task"),
@ -2213,7 +2212,8 @@ void MainWindow::defineActions() {
createToolAction(T_Geometric, "geometric", tr("Geometric Tool"), "G");
createToolAction(T_Type, "type", tr("Type Tool"), "Y");
createToolAction(T_Fill, "fill", tr("Fill Tool"), "F");
createToolAction(T_PaintBrush, "paintbrush", tr("Paint Brush Tool"), "");
createToolAction(T_PaintBrush, "paintbrush", tr("Smart Raster Paint Tool"),
"");
createToolAction(T_Eraser, "eraser", tr("Eraser Tool"), "E");
createToolAction(T_Tape, "tape", tr("Tape Tool"), "T");
createToolAction(T_StylePicker, "stylepicker", tr("Style Picker Tool"), "K");

View file

@ -533,7 +533,7 @@ public:
m_indexes(indexes) {
int i;
for (i = 0; i < fids.size(); i++) {
QString id = "DeleteMatchlineUndo" + QString::number((uintptr_t)this) +
QString id = "DeleteMatchlineUndo" + QString::number((uintptr_t) this) +
"-" + QString::number(i);
TToonzImageP image = sl->getFrame(fids[i], false);
assert(image);
@ -545,7 +545,7 @@ public:
int i;
for (i = 0; i < m_fids.size(); i++) {
QString id = "DeleteMatchlineUndo" + QString::number((uintptr_t)this) +
QString id = "DeleteMatchlineUndo" + QString::number((uintptr_t) this) +
"-" + QString::number(i);
TImageP img = TImageCache::instance()->get(id, false)->cloneImage();
@ -576,7 +576,7 @@ public:
int i;
for (i = 0; i < m_fids.size(); i++)
TImageCache::instance()->remove("DeleteMatchlineUndo" +
QString::number((uintptr_t)this) + "-" +
QString::number((uintptr_t) this) + "-" +
QString::number(i));
}
@ -778,7 +778,7 @@ void doMatchlines(int column, int mColumn, int index, int inkPrevalence,
if (!timg || !tmatch) {
getImageProgressBar->close();
DVGui::warning(QObject::tr(
"Match lines can be applied to Toonz raster levels only."));
"Match lines can be applied to Smart Raster levels only."));
/*-- 前に遡ってキャッシュを消去 --*/
i--;
for (; i >= 0; i--) {
@ -810,7 +810,7 @@ void doMatchlines(int column, int mColumn, int index, int inkPrevalence,
if (matchingLevels.empty()) {
DVGui::warning(
QObject::tr("Match lines can be applied to Toonz raster levels only."));
QObject::tr("Match lines can be applied to Smart Raster levels only."));
return;
}

View file

@ -215,7 +215,7 @@ bool checkColumnValidity(int column) {
if (cell[i].getSimpleLevel()->getType() != TZP_XSHLEVEL) {
DVGui::warning(QObject::tr(
"Match lines can be applied to Toonz raster levels only."));
"Match lines can be applied to Smart Raster levels only."));
return false;
}
if (level != cell[i].getSimpleLevel()) {
@ -288,8 +288,9 @@ public:
}
int getSize() const override {
return sizeof *this + (sizeof(TXshLevelP) + sizeof(TXshSimpleLevel *)) *
m_createdLevels.size();
return sizeof *this +
(sizeof(TXshLevelP) + sizeof(TXshSimpleLevel *)) *
m_createdLevels.size();
}
};
@ -585,7 +586,7 @@ void doDeleteCommand(bool isMatchline) {
}
if (cell.m_level->getType() != TZP_XSHLEVEL) {
DVGui::warning(QObject::tr(
"Match lines can be deleted from Toonz raster levels only"));
"Match lines can be deleted from Smart Raster levels only"));
return;
}
}

View file

@ -1138,8 +1138,8 @@ QList<ComboBoxItem> PreferencesPopup::getComboItemList(
{tr("On Demand"), Preferences::LoadOnDemand}}},
{scanLevelType, {{"tif", "tif"}, {"png", "png"}}},
{DefLevelType,
{{tr("Toonz Vector Level"), PLI_XSHLEVEL},
{tr("Toonz Raster Level"), TZP_XSHLEVEL},
{{tr("Vector Level"), PLI_XSHLEVEL},
{tr("Smart Raster Level"), TZP_XSHLEVEL},
{tr("Raster Level"), OVL_XSHLEVEL}}},
{NumberingSystem,
{{tr("Incremental"), 0}, {tr("Use Xsheet as Animation Sheet"), 1}}},
@ -1238,11 +1238,7 @@ PreferencesPopup::PreferencesPopup()
QVBoxLayout* categoryLayout = new QVBoxLayout();
categoryLayout->setMargin(5);
categoryLayout->setSpacing(10);
{
categoryLayout->addWidget(new QLabel(tr("Category"), this), 0,
Qt::AlignLeft | Qt::AlignVCenter);
categoryLayout->addWidget(categoryList, 1);
}
{ categoryLayout->addWidget(categoryList, 1); }
mainLayout->addLayout(categoryLayout, 0);
mainLayout->addWidget(stackedWidget, 1);
}

View file

@ -29,7 +29,7 @@
#include <QVBoxLayout>
#include <QObject>
TEnv::IntVar ShowAllToolsToggle("ShowAllToolsToggle", 0);
TEnv::IntVar ShowAllToolsToggle("ShowAllToolsToggle", 1);
namespace {
struct {
@ -41,7 +41,7 @@ struct {
{T_Geometric, false, 0}, {T_Type, true, 0},
{T_Fill, false, 0}, {T_PaintBrush, false, 0},
{"Separator_2", false, 0}, {T_Eraser, false, 0},
{T_Tape, false, 0}, {T_Finger, false, 0},
{T_Tape, false, 0}, //{T_Finger, false, 0},
{"Separator_3", false, 0}, {T_StylePicker, false, 0},
{T_RGBPicker, false, 0}, {T_Ruler, false, 0},
{"Separator_4", false, 0}, {T_ControlPointEditor, false, 0},
@ -77,7 +77,7 @@ Toolbar::Toolbar(QWidget *parent, bool isVertical)
m_expandButton->setCheckable(true);
m_expandButton->setChecked(m_isExpanded);
m_expandButton->setArrowType((isVertical) ? Qt::DownArrow : Qt::RightArrow);
m_expandButton->hide();
m_expandAction = addWidget(m_expandButton);
connect(m_expandButton, SIGNAL(toggled(bool)), this,

View file

@ -2669,21 +2669,22 @@ void ColumnArea::contextMenuEvent(QContextMenuEvent *event) {
menu.addAction(cmdManager->getAction(MI_ReplaceLevel));
menu.addAction(cmdManager->getAction(MI_ReplaceParentDirectory));
if (containsVectorLevel(col)) {
menu.addSeparator();
QAction *setMask =
new QAction(tr("Temporary Mask (Not in final render)"), this);
setMask->setCheckable(true);
setMask->setChecked(xsh->getColumn(col)->isMask());
setMask->setToolTip(
tr("Only Toonz Vector levels can be used as masks. \n Masks don't "
"show up in final renders."));
bool ret = true;
ret = ret &&
connect(setMask, &QAction::toggled, [=]() { onSetMask(col); });
assert(ret);
menu.addAction(setMask);
}
// if (containsVectorLevel(col)) {
// menu.addSeparator();
// QAction *setMask =
// new QAction(tr("Temporary Mask (Not in final render)"), this);
// setMask->setCheckable(true);
// setMask->setChecked(xsh->getColumn(col)->isMask());
// setMask->setToolTip(
// tr("Only Toonz Vector levels can be used as masks. \n Masks don't
// "
// "show up in final renders."));
// bool ret = true;
// ret = ret &&
// connect(setMask, &QAction::toggled, [=]() { onSetMask(col); });
// assert(ret);
// menu.addAction(setMask);
//}
}
}

View file

@ -127,7 +127,7 @@ void Separator::paintEvent(QPaintEvent *) {
p.drawText(contents.left(), 10, m_name);
// make the line semi-transparent
QColor lineColor = palette().alternateBase().color();
QColor lineColor = Qt::black;
lineColor.setAlpha(128);
p.setPen(lineColor);

View file

@ -618,7 +618,7 @@ void updateMaximumPageSize(QGridLayout *layout, int &maxLabelWidth,
QLayoutItem *item = layout->itemAtPosition(r, 1);
if (!item) continue;
QSize itemSize = getItemSize(item);
QSize itemSize = getItemSize(item);
if (maxWidgetWidth < itemSize.width()) maxWidgetWidth = itemSize.width();
fieldsHeight += itemSize.height();
}
@ -657,9 +657,7 @@ ParamsPageSet::ParamsPageSet(QWidget *parent, Qt::WFlags flags)
// TabBar
m_tabBar = new TabBar(this);
// This widget is used to set the background color of the tabBar
// using the styleSheet.
// It is also used to take 6px on the left before the tabBar
// and to draw the two lines on the bottom size
// using the styleSheet and to draw the two lines on the bottom size.
m_tabBarContainer = new TabBarContainter(this);
m_pagesList = new QStackedWidget(this);
@ -675,12 +673,12 @@ ParamsPageSet::ParamsPageSet(QWidget *parent, Qt::WFlags flags)
//----layout
QVBoxLayout *mainLayout = new QVBoxLayout();
mainLayout->setMargin(1);
mainLayout->setMargin(0);
mainLayout->setSpacing(0);
{
QHBoxLayout *hLayout = new QHBoxLayout();
hLayout->setMargin(0);
hLayout->addSpacing(6);
hLayout->addSpacing(-1);
{
hLayout->addWidget(m_tabBar);
hLayout->addStretch(1);
@ -871,7 +869,7 @@ void ParamsPageSet::createPage(TIStream &is, const TFxP &fx, int index) {
std::string tagName;
if (!is.matchTag(tagName) || tagName != "page")
throw TException("expected <page>");
std::string pageName = is.getTagAttribute("name");
std::string pageName = is.getTagAttribute("name");
if (pageName == "") pageName = "page";
ParamsPage *paramsPage = new ParamsPage(this, m_parent);
@ -978,7 +976,7 @@ ParamViewer::ParamViewer(QWidget *parent, Qt::WFlags flags)
showSwatchButton->setFocusPolicy(Qt::NoFocus);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setMargin(1);
mainLayout->setMargin(0);
mainLayout->setSpacing(0);
{
mainLayout->addWidget(m_tablePageSet, 1);
@ -1148,7 +1146,7 @@ FxSettings::FxSettings(QWidget *parent, const TPixel32 &checkCol1,
bool ret = true;
ret = ret && connect(m_paramViewer, SIGNAL(currentFxParamChanged()),
SLOT(updateViewer()));
ret = ret &&
ret = ret &&
connect(m_viewer, SIGNAL(pointPositionChanged(int, const TPointD &)),
SLOT(onPointChanged(int, const TPointD &)));
ret = ret && connect(m_paramViewer, SIGNAL(preferredSizeChanged(QSize)), this,
@ -1297,10 +1295,10 @@ void FxSettings::setFx(const TFxP &currentFx, const TFxP &actualFx) {
TFxUtil::setKeyframe(currentFxWithoutCamera, m_frameHandle->getFrameIndex(),
actualFx, m_frameHandle->getFrameIndex());
ToonzScene *scene = 0;
ToonzScene *scene = 0;
if (m_sceneHandle) scene = m_sceneHandle->getScene();
int frameIndex = 0;
int frameIndex = 0;
if (m_frameHandle) frameIndex = m_frameHandle->getFrameIndex();
m_paramViewer->setFx(currentFxWithoutCamera, actualFx, frameIndex, scene);
@ -1360,7 +1358,7 @@ void FxSettings::setCurrentFx() {
if (TZeraryColumnFx *zfx = dynamic_cast<TZeraryColumnFx *>(fx.getPointer()))
fx = zfx->getZeraryFx();
else
hasEmptyInput = hasEmptyInputPort(fx);
hasEmptyInput = hasEmptyInputPort(fx);
int frame = m_frameHandle->getFrame();
ToonzScene *scene = m_sceneHandle->getScene();
actualFx = fx;

View file

@ -264,25 +264,25 @@ QString InfoViewerImp::getTypeString() {
QString ext = QString::fromStdString(m_path.getType());
if (ext == "tlv" || ext == "tzp" || ext == "tzu")
return "Toonz Cmapped Raster Level";
return "Smart Raster Level";
else if (ext == "pli" || ext == "svg")
return "Toonz Vector Level";
return "Vector Level";
else if (ext == "mov" || ext == "avi" || ext == "3gp")
return "Movie File";
else if (ext == "tnz")
return "Toonz Scene";
return "Tahoma Scene";
else if (ext == "tab")
return "Tab Scene";
else if (ext == "plt")
return "Toonz Palette";
return "Tahoma Palette";
else if (ext == "wav" || ext == "aiff" || ext == "mp3")
return "Audio File";
else if (ext == "mesh")
return "Toonz Mesh Level";
return "Mesh Level";
else if (ext == "pic")
return "Pic File";
else if (Tiio::makeReader(ext.toStdString()))
return (m_fids.size() == 1) ? "Single Raster Image" : "Raster Image Level";
return (m_fids.size() == 1) ? "Single Raster Image" : "Raster Level";
else if (ext == "psd")
return "Photoshop Image";
else
@ -349,7 +349,7 @@ void InfoViewerImp::setImageInfo() {
setVal(eBitsSample, QString::number(ii->m_bitsPerSample));
if (ii->m_samplePerPixel > 0)
setVal(eSamplePixel, QString::number(ii->m_samplePerPixel));
//if (ii->m_dpix > 0 || ii->m_dpiy > 0)
// if (ii->m_dpix > 0 || ii->m_dpiy > 0)
// setVal(eDpi, "(" + QString::number(ii->m_dpix) + ", " +
// QString::number(ii->m_dpiy) + ")");
TPropertyGroup *pg = ii->m_properties;
@ -370,7 +370,7 @@ void InfoViewerImp::setImageInfo() {
m_separator1.hide();
const TContentHistory *ch = 0;
if (lr) ch = lr->getContentHistory();
if (lr) ch = lr->getContentHistory();
if (ch) {
QString str = ch->serialize();
@ -394,12 +394,12 @@ void InfoViewerImp::setImageInfo() {
QString::number(r.x1) + ", " + QString::number(r.y1) + ")");
}
//double dpix, dpiy;
// double dpix, dpiy;
if (timg) {
// setVal(eHPos, QString::number(timg->gethPos()));
//timg->getDpi(dpix, dpiy);
//setVal(eDpi,
// timg->getDpi(dpix, dpiy);
// setVal(eDpi,
// "(" + QString::number(dpix) + ", " + QString::number(dpiy) + ")");
TDimension dim = timg->getRaster()->getSize();
setVal(eImageSize,
@ -493,7 +493,7 @@ void InfoViewerImp::setToonzSceneInfo() {
setVal(eCamera, QString::number(cam->getRes().lx) + " X " +
QString::number(cam->getRes().ly));
//setVal(eCameraDpi, QString::number(cam->getDpi().x) + ", " +
// setVal(eCameraDpi, QString::number(cam->getDpi().x) + ", " +
// QString::number(cam->getDpi().y));
setVal(eFrameCount, QString::number(scene.getFrameCount()));
if (set) setVal(eLevelCount, QString::number(set->getLevelCount()));

View file

@ -3021,7 +3021,7 @@ StyleEditor::StyleEditor(PaletteController *paletteController, QWidget *parent)
QHBoxLayout *hLayout = new QHBoxLayout;
hLayout->setMargin(0);
{
hLayout->addSpacing(0);
hLayout->addSpacing(-1);
hLayout->addWidget(m_styleBar);
hLayout->addStretch();
}