Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Beautification

manongjohn7d6ab3e8ea61
diff --git a/toonz/sources/toonz/columncommand.cpp b/toonz/sources/toonz/columncommand.cpp
index 77c4f7a8d..744e88351 100644
--- a/toonz/sources/toonz/columncommand.cpp
+++ b/toonz/sources/toonz/columncommand.cpp
@@ -1223,9 +1223,9 @@ public:
void execute() override {
TColumnSelection *selection = dynamic_cast<TColumnSelection *>(
TApp::instance()->getCurrentSelection()->getSelection());
- TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
- int cc = TApp::instance()->getCurrentColumn()->getColumnIndex();
- bool sound_changed = false;
+ TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
+ int cc = TApp::instance()->getCurrentColumn()->getColumnIndex();
+ bool sound_changed = false;
for (int i = 0; i < xsh->getColumnCount(); i++) {
/*- 空のカラムの場合は飛ばす -*/
if (xsh->isColumnEmpty(i)) continue;
@@ -1272,7 +1272,7 @@ public:
column->setCamstandVisible(negate);
else
column->setCamstandVisible(!column->isCamstandVisible());
- if (column->getSoundColumn()) sound_changed = true;
+ if (column->getSoundColumn()) sound_changed = true;
}
/*TAB
if(cmd & (CMD_ENABLE_PREVIEW|CMD_DISABLE_PREVIEW|CMD_TOGGLE_PREVIEW))
@@ -1295,7 +1295,8 @@ column->setCamstandVisible(!column->isCamstandVisible());
}
*/
}
- if (sound_changed) TApp::instance()->getCurrentXsheet()->notifyXsheetSoundChanged();
+ if (sound_changed)
+ TApp::instance()->getCurrentXsheet()->notifyXsheetSoundChanged();
TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
TApp::instance()->getCurrentScene()->setDirtyFlag(true);
}
diff --git a/toonz/sources/toonz/mainwindow.cpp b/toonz/sources/toonz/mainwindow.cpp
index 43e41fbf2..59d68e8ce 100644
--- a/toonz/sources/toonz/mainwindow.cpp
+++ b/toonz/sources/toonz/mainwindow.cpp
@@ -2287,9 +2287,9 @@ RecentFiles::~RecentFiles() {}
void RecentFiles::addFilePath(QString path, FileType fileType) {
QList<QString> files =
- (fileType == Scene)
- ? m_recentScenes
- : (fileType == Level) ? m_recentLevels : m_recentFlipbookImages;
+ (fileType == Scene) ? m_recentScenes : (fileType == Level)
+ ? m_recentLevels
+ : m_recentFlipbookImages;
int i;
for (i = 0; i < files.size(); i++)
if (files.at(i) == path) files.removeAt(i);
@@ -2414,9 +2414,9 @@ void RecentFiles::saveRecentFiles() {
QList<QString> RecentFiles::getFilesNameList(FileType fileType) {
QList<QString> files =
- (fileType == Scene)
- ? m_recentScenes
- : (fileType == Level) ? m_recentLevels : m_recentFlipbookImages;
+ (fileType == Scene) ? m_recentScenes : (fileType == Level)
+ ? m_recentLevels
+ : m_recentFlipbookImages;
QList<QString> names;
int i;
for (i = 0; i < files.size(); i++) {
@@ -2443,9 +2443,9 @@ void RecentFiles::refreshRecentFilesMenu(FileType fileType) {
menu->setEnabled(false);
else {
CommandId clearActionId =
- (fileType == Scene)
- ? MI_ClearRecentScene
- : (fileType == Level) ? MI_ClearRecentLevel : MI_ClearRecentImage;
+ (fileType == Scene) ? MI_ClearRecentScene : (fileType == Level)
+ ? MI_ClearRecentLevel
+ : MI_ClearRecentImage;
menu->setActions(names);
menu->addSeparator();
QAction *clearAction = CommandManager::instance()->getAction(clearActionId);
diff --git a/toonz/sources/toonz/xshcellviewer.cpp b/toonz/sources/toonz/xshcellviewer.cpp
index 5ce8a2a48..645c03904 100644
--- a/toonz/sources/toonz/xshcellviewer.cpp
+++ b/toonz/sources/toonz/xshcellviewer.cpp
@@ -730,28 +730,33 @@ void RenameCellField::focusOutEvent(QFocusEvent *e) {
// Override shortcut keys for cell selection commands
bool RenameCellField::eventFilter(QObject *obj, QEvent *e) {
- // We really shouldn't allow OT defined shortcuts to be checked and used while renaming a cell
- // but if we must, we should only return true or false if we're executing our OT action;
+ // We really shouldn't allow OT defined shortcuts to be checked and used while
+ // renaming a cell
+ // but if we must, we should only return true or false if we're executing our
+ // OT action;
// otherwise pass event forward in case another object is interested in it.
- if (e->type() != QEvent::ShortcutOverride) return QObject::eventFilter(obj, e); //return false;
+ if (e->type() != QEvent::ShortcutOverride)
+ return QObject::eventFilter(obj, e); // return false;
TCellSelection *cellSelection = dynamic_cast<TCellSelection *>(
TApp::instance()->getCurrentSelection()->getSelection());
- if (!cellSelection) return QObject::eventFilter(obj, e); //return false;
+ if (!cellSelection) return QObject::eventFilter(obj, e); // return false;
QKeyEvent *ke = (QKeyEvent *)e;
std::string keyStr =
QKeySequence(ke->key() + ke->modifiers()).toString().toStdString();
QAction *action = CommandManager::instance()->getActionFromShortcut(keyStr);
- if (!action) return QObject::eventFilter(obj, e); //return false;
+ if (!action) return QObject::eventFilter(obj, e); // return false;
std::string actionId = CommandManager::instance()->getIdFromAction(action);
// These are usally standard ctrl/command strokes for text editing.
- // Default to standard behavior and don't execute OT's action while renaming cell.
- if (actionId == "MI_Undo" || actionId == "MI_Redo"
- || actionId == "MI_Clear" || actionId == "MI_Copy" || actionId == "MI_Paste" || actionId == "MI_Cut"
- ) return QObject::eventFilter(obj, e); //return true;
+ // Default to standard behavior and don't execute OT's action while renaming
+ // cell.
+ if (actionId == "MI_Undo" || actionId == "MI_Redo" ||
+ actionId == "MI_Clear" || actionId == "MI_Copy" ||
+ actionId == "MI_Paste" || actionId == "MI_Cut")
+ return QObject::eventFilter(obj, e); // return true;
return TCellSelection::isEnabledCommand(actionId);
}
@@ -1418,8 +1423,8 @@ void CellArea::drawLevelCell(QPainter &p, int row, int col, bool isReference) {
// convert the last one digit of the frame number to alphabet
// Ex. 12 -> 1B 21 -> 2A 30 -> 3
- if (Preferences::instance()->isShowFrameNumberWithLettersEnabled())
- fnum = m_viewer->getFrameNumberWithLetters(fid.getNumber());
+ if (Preferences::instance()->isShowFrameNumberWithLettersEnabled())
+ fnum = m_viewer->getFrameNumberWithLetters(fid.getNumber());
else {
std::string frameNumber("");
// set number
@@ -1429,8 +1434,8 @@ void CellArea::drawLevelCell(QPainter &p, int row, int col, bool isReference) {
fnum = QString::fromStdString(frameNumber);
}
- p.drawText(nameRect, Qt::AlignRight | Qt::AlignBottom, fnum);
-}
+ p.drawText(nameRect, Qt::AlignRight | Qt::AlignBottom, fnum);
+ }
// draw level name
if (!sameLevel ||
@@ -1438,12 +1443,14 @@ void CellArea::drawLevelCell(QPainter &p, int row, int col, bool isReference) {
Preferences::instance()->isLevelNameOnEachMarkerEnabled())) {
std::wstring levelName = cell.m_level->getName();
QString text = QString::fromStdWString(levelName);
- QFontMetrics fm(font);
+ QFontMetrics fm(font);
#if QT_VERSION >= 0x050500
-// QFontMetrics fm(font);
- QString elidaName = elideText(text, fm, nameRect.width() - fm.width(fnum), QString("~"));
+ // QFontMetrics fm(font);
+ QString elidaName =
+ elideText(text, fm, nameRect.width() - fm.width(fnum), QString("~"));
#else
- QString elidaName = elideText(text, font, nameRect.width() - fm.width(fnum));
+ QString elidaName =
+ elideText(text, font, nameRect.width() - fm.width(fnum));
#endif
p.drawText(nameRect, Qt::AlignLeft | Qt::AlignBottom, elidaName);
}
diff --git a/toonz/sources/toonz/xsheetcmd.cpp b/toonz/sources/toonz/xsheetcmd.cpp
index 1f36899ed..6e1cb0c05 100644
--- a/toonz/sources/toonz/xsheetcmd.cpp
+++ b/toonz/sources/toonz/xsheetcmd.cpp
@@ -829,8 +829,8 @@ public:
TApp *app = TApp::instance();
TKeyframeSelection *selection = dynamic_cast<TKeyframeSelection *>(
app->getCurrentSelection()->getSelection());
- if (!selection) return;
- int row = app->getCurrentFrame()->getFrame();
+ if (!selection) return;
+ int row = app->getCurrentFrame()->getFrame();
selection->selectNone();
ToonzScene *scene = app->getCurrentScene()->getScene();
@@ -863,7 +863,7 @@ public:
TApp *app = TApp::instance();
TKeyframeSelection *selection = dynamic_cast<TKeyframeSelection *>(
app->getCurrentSelection()->getSelection());
- if (!selection) return;
+ if (!selection) return;
int col = app->getCurrentColumn()->getColumnIndex();
TStageObjectId objectId = app->getCurrentObject()->getObjectId();
if (app->getCurrentObject()->getObjectId() == TStageObjectId::CameraId(0)) {
diff --git a/toonz/sources/toonz/xshnoteviewer.cpp b/toonz/sources/toonz/xshnoteviewer.cpp
index 3a742b2f9..eb2a342e0 100644
--- a/toonz/sources/toonz/xshnoteviewer.cpp
+++ b/toonz/sources/toonz/xshnoteviewer.cpp
@@ -554,10 +554,10 @@ void NoteArea::createLayout() {
setFixedSize(rect.size());
- if(o->isVerticalTimeline())
- m_noteButton->setFixedSize(44, 26);
+ if (o->isVerticalTimeline())
+ m_noteButton->setFixedSize(44, 26);
else
- m_noteButton->setFixedSize(44, 22);
+ m_noteButton->setFixedSize(44, 22);
// has two elements: main layout and header panel
QVBoxLayout *panelLayout = new QVBoxLayout();
diff --git a/toonz/sources/toonz/xshrowviewer.cpp b/toonz/sources/toonz/xshrowviewer.cpp
index 3b826ae70..ebf691723 100644
--- a/toonz/sources/toonz/xshrowviewer.cpp
+++ b/toonz/sources/toonz/xshrowviewer.cpp
@@ -520,9 +520,9 @@ void RowArea::paintEvent(QPaintEvent *event) {
p.setPen(m_viewer->getVerticalLineColor());
p.setBrush(Qt::NoBrush);
if (m_viewer->orientation()->isVerticalTimeline())
- p.drawRect(toBeUpdated.adjusted(0, -1, -1, 0));
+ p.drawRect(toBeUpdated.adjusted(0, -1, -1, 0));
else
- p.drawRect(toBeUpdated.adjusted(-1, 0, 0, -1));
+ p.drawRect(toBeUpdated.adjusted(-1, 0, 0, -1));
}
//-----------------------------------------------------------------------------