Skip to content

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

C

refactor with qiconengine

koneroe321bafdd745
diff --git a/toonz/sources/include/toonz/preferences.h b/toonz/sources/include/toonz/preferences.h
index 847cf9649..2b599348f 100644
--- a/toonz/sources/include/toonz/preferences.h
+++ b/toonz/sources/include/toonz/preferences.h
@@ -192,7 +192,6 @@ public:
// Interface tab
QStringList getStyleSheetList() const { return m_styleSheetList; }
- bool getIconTheme() const { return getBoolValue(iconTheme); }
void storeOldUnits();
void resetOldUnits();
QStringList getLanguageList() const { return m_languageList; }
diff --git a/toonz/sources/include/toonzqt/gutil.h b/toonz/sources/include/toonzqt/gutil.h
index aedf649da..2daefa238 100644
--- a/toonz/sources/include/toonzqt/gutil.h
+++ b/toonz/sources/include/toonzqt/gutil.h
@@ -6,6 +6,7 @@
#include "tcommon.h"
#include <QImage>
#include <QFrame>
+#include <QIconEngine>
#include <QColor>
#include "traster.h"
#include "toonz/preferences.h"
@@ -54,10 +55,6 @@ class TStroke;
//-----------------------------------------------------------------------------
-QString DVAPI getIconThemePath(const QString &filePath);
-
-//-----------------------------------------------------------------------------
-
QString DVAPI fileSizeString(qint64 size, int precision = 2);
//-----------------------------------------------------------------------------
@@ -126,56 +123,25 @@ int DVAPI getDevicePixelRatio(const QWidget *widget = nullptr);
//-----------------------------------------------------------------------------
-QImage DVAPI adjustImageOpacity(const QImage &input, qreal opacity = 1.0);
-
-//-----------------------------------------------------------------------------
-
-QImage DVAPI compositeImage(const QImage &input, QSize newSize = QSize(),
- bool scaleInput = false,
- QColor bgColor = Qt::transparent);
-
-//-----------------------------------------------------------------------------
-
-QPixmap DVAPI convertImageToPixmap(const QImage &image);
-
-//-----------------------------------------------------------------------------
-
-QImage DVAPI
-generateIconImage(const QString &iconSVGName, qreal opacity = qreal(1.0),
- QSize newSize = QSize(),
- Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio);
+QImage DVAPI colorizeBlackPixels(const QImage &input,
+ const QColor color = QColor());
//-----------------------------------------------------------------------------
-QPixmap DVAPI
-generateIconPixmap(const QString &iconSVGName, qreal opacity = qreal(1.0),
- QSize newSize = QSize(),
- Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio);
+QPixmap DVAPI expandPixmap(const QPixmap &pixmap,
+ const QSize &expandSize = QSize(),
+ const QColor bgColor = Qt::transparent);
//-----------------------------------------------------------------------------
-void DVAPI addImagesToIcon(QIcon &icon, const QImage &baseImg,
- const QImage &overImg = QImage(),
- const QImage &onImg = QImage(),
- bool useFullOpacity = false);
-
-//-----------------------------------------------------------------------------
-
-void DVAPI addSpecifiedSizedImageToIcon(QIcon &icon, const char *iconSVGName,
- QSize newSize = QSize());
-
-//-----------------------------------------------------------------------------
-
-void DVAPI addPixmapToAllModesAndStates(QIcon &icon, const QPixmap &pixmap);
-
-//-----------------------------------------------------------------------------
-
-QIcon DVAPI createQIcon(const QString &iconSVGName, bool useFullOpacity = false,
- bool isForMenuItem = false, QSize newSize = QSize());
+QIcon DVAPI createQIcon(const QString &iconName, bool isForMenuItem = false,
+ qreal dpr = 0.0, QSize newSize = QSize());
QIcon DVAPI createQIconPNG(const char *iconPNGName);
QIcon DVAPI createQIconOnOffPNG(const char *iconPNGName, bool withOver = true);
QIcon DVAPI createTemporaryIconFromName(const char *commandName);
+QImage DVAPI adjustImageOpacity(const QImage &input, qreal opacity = 1.0);
+
inline QSize dimension2QSize(const TDimension &sz) {
return QSize(sz.lx, sz.ly);
}
@@ -241,20 +207,14 @@ public:
TabBarContainter(QWidget *parent = 0);
protected:
- QColor m_bottomBelowLineColor, m_bottomAboveLineColor;
+ QColor m_bottomBelowLineColor;
Q_PROPERTY(QColor BottomBelowLineColor READ getBottomBelowLineColor WRITE
setBottomBelowLineColor);
- Q_PROPERTY(QColor BottomAboveLineColor READ getBottomAboveLineColor WRITE
- setBottomAboveLineColor);
void paintEvent(QPaintEvent *event) override;
void setBottomBelowLineColor(const QColor &color) {
m_bottomBelowLineColor = color;
}
QColor getBottomBelowLineColor() const { return m_bottomBelowLineColor; }
- void setBottomAboveLineColor(const QColor &color) {
- m_bottomAboveLineColor = color;
- }
- QColor getBottomAboveLineColor() const { return m_bottomAboveLineColor; }
};
//-----------------------------------------------------------------------------
@@ -272,38 +232,158 @@ protected:
QString DVAPI operator+(const QString &a, const TFilePath &fp);
//-----------------------------------------------------------------------------
-// Theme Manager
-// For managing icon themes
+// QPixmapCache
+
+void DVAPI addToPixmapCache(const QString &key, const QPixmap &pixmap);
+QPixmap DVAPI getFromPixmapCache(const QString &key);
+void DVAPI clearQPixmapCache();
+
+//-----------------------------------------------------------------------------
+// ThemeManager
-class DVAPI ThemeManager { // singleton
+class DVAPI ThemeManager {
public:
+ // Singleton Instance
static ThemeManager &getInstance();
-
- void buildIconPathsMap(const QString &path);
+ void initialize();
+
+ // Icon Management
+ void preloadIconMetadata(const QString &path);
+ void updateThemeColor();
+ QString getIconPath(const QString &iconName, QIcon::Mode mode = QIcon::Normal,
+ QIcon::State state = QIcon::Off) const;
+ QSize getIconSize(const QString &iconName) const;
bool hasIcon(const QString &iconName) const;
- QString getIconPath(const QString &iconName) const;
+ bool isMenuIcon(const QString &iconName) const;
+ bool isColoredIcon(const QString &iconName) const;
+
+ // Icon Color Management
+ void setIconBaseColor(const QColor &color) { m_iconBaseColor = color; }
+ QColor getIconBaseColor() const { return m_iconBaseColor; }
- qreal getOnOpacity() const;
- qreal getOffOpacity() const;
- qreal getDisabledOpacity() const;
+ void setIconActiveColor(const QColor &color) { m_iconActiveColor = color; }
+ QColor getIconActiveColor() const { return m_iconActiveColor; }
- QImage recolorBlackPixels(const QImage &image, QColor color = QColor());
- QPixmap recolorBlackPixels(const QPixmap &input, QColor color = QColor());
+ void setIconOnColor(const QColor &color) { m_iconOnColor = color; }
+ QColor getIconOnColor() const { return m_iconOnColor; }
- // Debug
- void printiconPathsMap();
+ void setIconSelectedColor(const QColor &color) {
+ m_iconSelectedColor = color;
+ }
+ QColor getIconSelectedColor() const { return m_iconSelectedColor; }
- ThemeManager(ThemeManager const &) = delete;
- void operator=(ThemeManager const &) = delete;
- ~ThemeManager();
+ void setIconCloseColor(const QColor &color) { m_iconCloseColor = color; }
+ QColor getIconCloseColor() const { return m_iconCloseColor; }
+
+ void setIconPreviewColor(const QColor &color) { m_iconPreviewColor = color; }
+ QColor getIconPreviewColor() const { return m_iconPreviewColor; }
+
+ void setIconVCheckColor(const QColor &color) { m_iconVCheckColor = color; }
+ QColor getIconVCheckColor() const { return m_iconVCheckColor; }
+
+ void setIconLockColor(const QColor &color) { m_iconLockColor = color; }
+ QColor getIconLockColor() const { return m_iconLockColor; }
+
+ void setIconKeyframeColor(const QColor &color) {
+ m_iconKeyframeColor = color;
+ }
+ QColor getIconKeyframeColor() const { return m_iconKeyframeColor; }
+
+ void setIconKeyframeModifiedColor(const QColor &color) {
+ m_iconKeyframeModifiedColor = color;
+ }
+ QColor getIconKeyframeModifiedColor() const {
+ return m_iconKeyframeModifiedColor;
+ }
+
+ // Stylesheet Parsing
+ void parseCustomPropertiesFromStylesheet(const QString &styleSheet);
+ void setCustomProperty(const QString &name, const QString &value);
+ QString getCustomProperty(const QString &name) const;
private:
+ // Constructor & Restriction
ThemeManager();
+ Q_DISABLE_COPY_MOVE(ThemeManager)
+
+ // Icon Metadata Parsing
+ QSize parseIconSize(const QString &iconPath) const;
+ bool parseIsColored(const QString &iconPath) const;
+
+ // Icon Data
+ QHash<QString, QString> m_iconPaths;
+ QHash<QString, QSize> m_iconSizes;
+ QHash<QString, bool> m_coloredIcons;
+ QHash<QString, bool> m_menuIcons;
+ QHash<QString, QString> m_customProperties;
+
+ // Theme Colors
+ QColor m_iconBaseColor;
+ QColor m_iconActiveColor;
+ QColor m_iconOnColor;
+ QColor m_iconSelectedColor;
+ QColor m_iconCloseColor;
+ QColor m_iconPreviewColor;
+ QColor m_iconVCheckColor;
+ QColor m_iconLockColor;
+ QColor m_iconKeyframeColor;
+ QColor m_iconKeyframeModifiedColor;
+};
+
+QString DVAPI getIconPath(const QString &iconSVGName);
+
+//-----------------------------------------------------------------------------
+// SVGIconEngine
+
+// Cache Key Generator
+QString DVAPI generateCacheKey(const QString &keyName, const QSize &size,
+ QIcon::Mode mode, QIcon::State state);
+
+class DVAPI SvgIconEngine : public QIconEngine {
+public:
+ // Constructors
+ SvgIconEngine(const QString &iconName, bool isForMenuItem = false,
+ qreal dpr = 0.0, QSize newSize = QSize());
+ SvgIconEngine(const QString &commandName, const QImage image);
+
+ // Cloning
+ QIconEngine *clone() const override;
+
+ // Core Functionality
+ void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode,
+ QIcon::State state) override;
+ QPixmap pixmap(const QSize &size, QIcon::Mode mode,
+ QIcon::State state) override;
+ QColor getThemeColor(const QString &iconName, QIcon::Mode mode,
+ QIcon::State state);
- class ThemeManagerImpl; // forward declaration
- std::unique_ptr<ThemeManagerImpl> impl; // opaque pointer
+private:
+ // Icon Properties
+ QString m_iconName; // Icon base name
+ QSize m_iconSize; // Requested icon size
+ qreal m_dpr; // Device pixel ratio
+
+ // Icon Type Flags
+ bool m_isForMenuItem; // If intended for menus
+ bool m_isMenuIcon; // If sized for menus
+ bool m_isColored; // If full-color image
+
+ // Icon Color & Image
+ QColor m_color; // Theme color of the icon
+ QImage m_image; // For storing temporary command icon image
+ bool m_isTemporaryCommandIcon;
+
+ // Helper Methods
+ qreal getOpacityForModeState(QIcon::Mode mode, QIcon::State state);
+ QColor getUniqueIconColor(const QString &iconName, QIcon::Mode mode,
+ QIcon::State state);
+ QPixmap loadPixmap(const QString &iconName, QIcon::Mode mode = QIcon::Normal,
+ QIcon::State state = QIcon::Off,
+ QSize physicalSize = QSize(), QColor color = QColor());
+ bool shouldHideIcon(bool isForMenuItem);
+ QSize getBestToolbarSizeByDpr(const QSize &requestedSize);
};
-QString DVAPI getIconPath(const QString &path);
+//-----------------------------------------------------------------------------
#endif // GUTIL_H
diff --git a/toonz/sources/toonz/castselection.cpp b/toonz/sources/toonz/castselection.cpp
index e3079d700..08e10d3d1 100644
--- a/toonz/sources/toonz/castselection.cpp
+++ b/toonz/sources/toonz/castselection.cpp
@@ -138,8 +138,9 @@ int SoundCastItem::getFrameCount() const {
//-----------------------------------------------------------------------------
QPixmap SoundCastItem::getPixmap(bool isSelected) const {
- static QPixmap loudspeaker(generateIconPixmap(
- "audio_icon", qreal(1.0), m_itemPixmapSize, Qt::KeepAspectRatio));
+ static QPixmap loudspeaker =
+ createQIcon("audio_icon")
+ .pixmap(QSize(64, 64), QIcon::Normal, QIcon::Off);
return loudspeaker;
}
diff --git a/toonz/sources/toonz/colormodelbehaviorpopup.cpp b/toonz/sources/toonz/colormodelbehaviorpopup.cpp
index 6d9075cc1..7fe2aa377 100644
--- a/toonz/sources/toonz/colormodelbehaviorpopup.cpp
+++ b/toonz/sources/toonz/colormodelbehaviorpopup.cpp
@@ -95,11 +95,11 @@ ColorModelBehaviorPopup::ColorModelBehaviorPopup(
m_colorChipOrder = new QButtonGroup(this);
QPushButton* upperLeftOrderBtn =
- new QPushButton(createQIcon("colorchiporder_upleft", true), "", this);
+ new QPushButton(createQIcon("colorchiporder_upleft"), "", this);
QPushButton* lowerLeftOrderBtn =
- new QPushButton(createQIcon("colorchiporder_lowleft", true), "", this);
+ new QPushButton(createQIcon("colorchiporder_lowleft"), "", this);
QPushButton* leftUpperOrderBtn =
- new QPushButton(createQIcon("colorchiporder_leftup", true), "", this);
+ new QPushButton(createQIcon("colorchiporder_leftup"), "", this);
QStringList paletteTypes;
paletteTypes << tr("Pick Every Colors as Different Styles")
diff --git a/toonz/sources/toonz/commandbarpopup.cpp b/toonz/sources/toonz/commandbarpopup.cpp
index 043bf7e01..01b5cc1bb 100644
--- a/toonz/sources/toonz/commandbarpopup.cpp
+++ b/toonz/sources/toonz/commandbarpopup.cpp
@@ -76,7 +76,7 @@ CommandListTree::CommandListTree(const QString& dropTargetString,
setIconSize(QSize(21, 18));
header()->close();
- QIcon menuFolderIcon(createQIcon("folder_project", true));
+ QIcon menuFolderIcon(createQIcon("folder_project"));
invisibleRootItem()->setIcon(0, menuFolderIcon);
QTreeWidgetItem* menuCommandFolder = new QTreeWidgetItem(this);
diff --git a/toonz/sources/toonz/dvitemview.cpp b/toonz/sources/toonz/dvitemview.cpp
index d56986c91..21a5880d2 100644
--- a/toonz/sources/toonz/dvitemview.cpp
+++ b/toonz/sources/toonz/dvitemview.cpp
@@ -1032,7 +1032,7 @@ void DvItemViewerPanel::paintThumbnailItem(QPainter &p, int index) {
if (!thumbnail.isNull()) p.drawPixmap(iconRect.topLeft(), thumbnail);
//}
else {
- static QPixmap missingPixmap = generateIconPixmap("missing_icon");
+ static QPixmap missingPixmap(getIconPath("missing_icon"));
QRect pixmapRect(rect.left() + (rect.width() - missingPixmap.width()) / 2,
rect.top(), missingPixmap.width(), missingPixmap.height());
p.drawPixmap(pixmapRect.topLeft(), missingPixmap);
diff --git a/toonz/sources/toonz/exportscenepopup.cpp b/toonz/sources/toonz/exportscenepopup.cpp
index 47c67621c..0d6e2790e 100644
--- a/toonz/sources/toonz/exportscenepopup.cpp
+++ b/toonz/sources/toonz/exportscenepopup.cpp
@@ -122,8 +122,13 @@ ExportSceneDvDirModelFileFolderNode::createExposeSceneNode(
// ExportSceneDvDirModelProjectNode
QPixmap ExportSceneDvDirModelProjectNode::getPixmap(bool isOpen) const {
- static QPixmap openProjectPixmap(generateIconPixmap("folder_project_on"));
- static QPixmap closeProjectPixmap(generateIconPixmap("folder_project"));
+ QPixmap openProjectPixmap =
+ createQIcon("folder_project")
+ .pixmap(QSize(18, 18), QIcon::Normal, QIcon::On);
+ QPixmap closeProjectPixmap =
+ createQIcon("folder_project")
+ .pixmap(QSize(18, 18), QIcon::Normal, QIcon::Off);
+
return isOpen ? openProjectPixmap : closeProjectPixmap;
}
@@ -192,7 +197,8 @@ void ExportSceneDvDirModelRootNode::refreshChildren() {
new ExportSceneDvDirModelSpecialFileFolderNode(
this, L"Project root (" + rootDir + L")", projectRoot);
projectRootNode->setPixmap(
- QPixmap(generateIconPixmap("folder_project_root")));
+ createQIcon("folder_project_root")
+ .pixmap(QSize(18, 18), QIcon::Normal, QIcon::Off));
m_projectRootNodes.push_back(projectRootNode);
addChild(projectRootNode);
}
@@ -410,7 +416,7 @@ void ExportSceneTreeViewDelegate::paint(QPainter *painter,
QPixmap px = node->getPixmap(m_treeView->isExpanded(index));
if (!px.isNull()) {
int x = rect.left();
- int y = rect.top() + (rect.height() - px.height()) / 2;
+ int y = rect.center().y() - ((rect.height() / 2) - 2);
painter->drawPixmap(QPoint(x, y), px);
}
rect.adjust(pnode ? 31 : 22, 0, 0, 0);
@@ -531,7 +537,6 @@ ExportScenePopup::ExportScenePopup(std::vector<TFilePath> scenes)
chooseProjectLayout->addWidget(m_chooseProjectButton);
m_projectTreeView = new ExportSceneTreeView(chooseProjectWidget);
- m_projectTreeView->setMinimumWidth(200);
m_projectTreeView->setMinimumWidth(400);
ret = ret && connect(m_projectTreeView, SIGNAL(focusIn()), this,
SLOT(onProjectTreeViweFocusIn()));
@@ -569,7 +574,7 @@ ExportScenePopup::ExportScenePopup(std::vector<TFilePath> scenes)
Qt::AlignRight | Qt::AlignVCenter);
newProjectLayout->addWidget(m_projectLocationFld, 2, 1);
- newProjectWidget->setLayout(chooseProjectLayout);
+ newProjectWidget->setLayout(newProjectLayout);
layout->addWidget(newProjectWidget);
ret = ret &&
diff --git a/toonz/sources/toonz/filebrowser.cpp b/toonz/sources/toonz/filebrowser.cpp
index 54edc4542..c1122a299 100644
--- a/toonz/sources/toonz/filebrowser.cpp
+++ b/toonz/sources/toonz/filebrowser.cpp
@@ -432,9 +432,10 @@ void FileBrowser::sortByDataModel(DataType dataType, bool isDiscendent) {
boost::make_counting_iterator(0),
boost::make_counting_iterator(int(m_items.size())));
- std::stable_sort(
- new2OldIdx.begin(), new2OldIdx.end(),
- [this, dataType](int x, int y) { return locals::itemLess(x, y, *this, dataType); });
+ std::stable_sort(new2OldIdx.begin(), new2OldIdx.end(),
+ [this, dataType](int x, int y) {
+ return locals::itemLess(x, y, *this, dataType);
+ });
// Use the renumbering table to permutate elements
std::vector<Item>(
@@ -452,13 +453,17 @@ void FileBrowser::sortByDataModel(DataType dataType, bool isDiscendent) {
boost::make_counting_iterator(int(m_items.size())));
std::sort(old2NewIdx.begin(), old2NewIdx.end(),
- [&new2OldIdx](int aIdx, int bIdx){ return locals::indexLess(aIdx, bIdx, new2OldIdx); });
+ [&new2OldIdx](int aIdx, int bIdx) {
+ return locals::indexLess(aIdx, bIdx, new2OldIdx);
+ });
std::vector<int> newSelectedIndices;
- tcg::substitute(
- newSelectedIndices,
- tcg::permuted_range(old2NewIdx, fs->getSelectedIndices() |
- ba::filtered([&old2NewIdx](int x){ return x < old2NewIdx.size(); })));
+ tcg::substitute(newSelectedIndices,
+ tcg::permuted_range(
+ old2NewIdx, fs->getSelectedIndices() |
+ ba::filtered([&old2NewIdx](int x) {
+ return x < old2NewIdx.size();
+ })));
fs->select(!newSelectedIndices.empty() ? &newSelectedIndices.front() : 0,
int(newSelectedIndices.size()));
@@ -480,11 +485,12 @@ void FileBrowser::sortByDataModel(DataType dataType, bool isDiscendent) {
int iCount = int(m_items.size()), lastIdx = iCount - 1;
std::vector<int> newSelectedIndices;
- tcg::substitute(
- newSelectedIndices,
- fs->getSelectedIndices() |
- ba::filtered([iCount](int x){ return x < iCount; }) |
- ba::transformed([lastIdx](int x){ return locals::complement(x, lastIdx); }));
+ tcg::substitute(newSelectedIndices,
+ fs->getSelectedIndices() | ba::filtered([iCount](int x) {
+ return x < iCount;
+ }) | ba::transformed([lastIdx](int x) {
+ return locals::complement(x, lastIdx);
+ }));
fs->select(!newSelectedIndices.empty() ? &newSelectedIndices.front() : 0,
int(newSelectedIndices.size()));
@@ -894,19 +900,16 @@ QVariant FileBrowser::getItemData(int index, DataType dataType,
QSize iconSize = m_itemViewer->getPanel()->getIconSize();
// parent folder icons
if (item.m_path == m_folder.getParentDir()) {
- static QPixmap folderUpPixmap(generateIconPixmap(
- "folder_browser_up", qreal(1.0), iconSize, Qt::KeepAspectRatio));
+ static QPixmap folderUpPixmap(getIconPath("folder_browser_up"));
return folderUpPixmap;
}
// folder icons
else if (item.m_isFolder) {
if (item.m_isLink) {
- static QPixmap folderLinkPixmap(generateIconPixmap(
- "folder_browser_link", qreal(1.0), iconSize, Qt::KeepAspectRatio));
+ static QPixmap folderLinkPixmap(getIconPath("folder_browser_link"));
return folderLinkPixmap;
} else {
- static QPixmap folderPixmap(generateIconPixmap(
- "folder_browser", qreal(1.0), iconSize, Qt::KeepAspectRatio));
+ static QPixmap folderPixmap(getIconPath("folder_browser"));
return folderPixmap;
}
}
diff --git a/toonz/sources/toonz/filebrowsermodel.cpp b/toonz/sources/toonz/filebrowsermodel.cpp
index 8df018d92..0b957d7c4 100644
--- a/toonz/sources/toonz/filebrowsermodel.cpp
+++ b/toonz/sources/toonz/filebrowsermodel.cpp
@@ -271,51 +271,39 @@ void DvDirModelFileFolderNode::refreshChildren() {
std::vector<std::wstring> names;
getChildrenNames(names);
- std::vector<DvDirModelNode *> oldChildren = m_children;
+ std::vector<DvDirModelNode *> oldChildren;
+ oldChildren.swap(m_children);
- // synchronize nodes for each items in the current folder
- QModelIndex index = DvDirModel::instance()->getIndexByNode(this);
- int i, j;
+ std::vector<DvDirModelNode *>::iterator j;
+ int i;
for (i = 0; i < (int)names.size(); i++) {
std::wstring name = names[i];
-
- // check if the item is already in the children nodes
- for (j = i; j < m_children.size() && m_children[j]->getName() != name;
- j++) {
- }
- // if the child is already registered
- if (j < m_children.size()) {
- if (i != j) {
- // swap node order
- DvDirModel::instance()->notifyBeginMoveRows(index, j, j, index, i);
- std::swap(m_children[i], m_children[j]);
- DvDirModel::instance()->notifyEndMoveRows();
- }
+ for (j = oldChildren.begin();
+ j != oldChildren.end() && (*j)->getName() != name; ++j) {
}
- // if not, create a new child and insert
- else {
- DvDirModelNode *child = makeChild(name);
+ DvDirModelNode *child = 0;
+ if (j != oldChildren.end()) {
+ child = *j;
+ oldChildren.erase(j);
+ } else {
+ child = makeChild(name);
if (DvDirModelFileFolderNode *folderNode =
dynamic_cast<DvDirModelFileFolderNode *>(child))
folderNode->setPeeking(m_peeks);
- assert(child);
- DvDirModel::instance()->notifyBeginInsertRows(index, i, i);
- addChild(child);
- DvDirModel::instance()->notifyEndInsertRows();
}
- }
- // delete rest of the children nodes
- for (j = m_children.size() - 1; j >= i; j--) {
- DvDirModelNode *child = m_children[j];
- DvDirModel::instance()->notifyBeginRemoveRows(index, j, j);
- m_children.erase(m_children.begin() + j);
- DvDirModel::instance()->notifyEndRemoveRows();
+ if (!child) continue;
+
+ addChild(child);
+ }
+ for (j = oldChildren.begin(); j != oldChildren.end(); ++j) {
+ DvDirModelNode *child = *j;
if (!!child && child->hasChildren())
child->removeChildren(0, child->getChildCount());
- delete child;
+ delete *j;
}
+
m_hasChildren = (m_children.size() > 0);
}
@@ -365,9 +353,8 @@ DvDirModelNode *DvDirModelFileFolderNode::getNodeByPath(const TFilePath &path) {
//-----------------------------------------------------------------------------
QPixmap DvDirModelFileFolderNode::getPixmap(bool isOpen) const {
- static QPixmap openFolderPixmap = generateIconPixmap("folder_on");
- static QPixmap closeFolderPixmap = generateIconPixmap("folder");
- return isOpen ? openFolderPixmap : closeFolderPixmap;
+ return createQIcon("folder").pixmap({18, 18}, QIcon::Normal,
+ isOpen ? QIcon::On : QIcon::Off);
}
//=============================================================================
@@ -378,18 +365,18 @@ QPixmap DvDirModelFileFolderNode::getPixmap(bool isOpen) const {
DvDirModelSpecialFileFolderNode::DvDirModelSpecialFileFolderNode(
DvDirModelNode *parent, std::wstring name, const TFilePath &path)
- : DvDirModelFileFolderNode(parent, name, path) {}
+ : DvDirModelFileFolderNode(parent, name, path)
+ , m_iconName()
+ , m_iconSize(16, 16) {}
//-----------------------------------------------------------------------------
QPixmap DvDirModelSpecialFileFolderNode::getPixmap(bool isOpen) const {
- return m_pixmap;
-}
-
-//-----------------------------------------------------------------------------
-
-void DvDirModelSpecialFileFolderNode::setPixmap(const QPixmap &pixmap) {
- m_pixmap = pixmap;
+ if (!m_iconName.isEmpty()) {
+ QIcon icon = createQIcon(m_iconName);
+ return icon.pixmap(m_iconSize);
+ }
+ return DvDirModelFileFolderNode::getPixmap(isOpen);
}
//=============================================================================
@@ -516,24 +503,19 @@ DvDirModelNode *DvDirVersionControlNode::makeChild(std::wstring name) {
//-----------------------------------------------------------------------------
QPixmap DvDirVersionControlNode::getPixmap(bool isOpen) const {
- static QPixmap openFolderPixmap(generateIconPixmap("folder_on"));
- static QPixmap closeFolderPixmap(generateIconPixmap("folder"));
- static QPixmap openMissingPixmap(
- svgToPixmap(":Resources/vcfolder_mis_open.svg"));
- static QPixmap closeMissingPixmap(
- svgToPixmap(":Resources/vcfolder_mis_close.svg"));
- static QPixmap openSceneFolderPixmap(
- svgToPixmap(":Resources/browser_scene_open.svg"));
- static QPixmap closeSceneFolderPixmap(
- svgToPixmap(":Resources/browser_scene_close.svg"));
-
- if (TFileStatus(getPath()).doesExist()) {
- if (getPath().getType() == "tnz")
- return isOpen ? openSceneFolderPixmap : closeSceneFolderPixmap;
- else
- return isOpen ? openFolderPixmap : closeFolderPixmap;
- } else
- return isOpen ? openMissingPixmap : closeMissingPixmap;
+ static const QSize iconSize(18, 18);
+
+ static const QIcon folderIcon = createQIcon("folder");
+ static const QIcon missingIcon = createQIcon("vcfolder_mis");
+ static const QIcon sceneFolderIcon = createQIcon("browser_scene");
+
+ const TFilePath path = getPath();
+ const bool exists = TFileStatus(path).doesExist();
+ const QIcon &icon =
+ exists ? (path.getType() == "tnz" ? sceneFolderIcon : folderIcon)
+ : missingIcon;
+
+ return icon.pixmap(iconSize, QIcon::Normal, isOpen ? QIcon::On : QIcon::Off);
}
//-----------------------------------------------------------------------------
@@ -788,9 +770,9 @@ void DvDirModelProjectNode::makeCurrent() {
//-----------------------------------------------------------------------------
QPixmap DvDirModelProjectNode::getPixmap(bool isOpen) const {
- static QPixmap openProjectPixmap = generateIconPixmap("folder_project_on");
- static QPixmap closeProjectPixmap = generateIconPixmap("folder_project");
- return isOpen ? openProjectPixmap : closeProjectPixmap;
+ static const QIcon projectIcon = createQIcon("folder_project");
+ return projectIcon.pixmap({18, 18}, QIcon::Normal,
+ isOpen ? QIcon::On : QIcon::Off);
}
//-----------------------------------------------------------------------------
@@ -867,9 +849,9 @@ void DvDirModelDayNode::visualizeContent(FileBrowser *browser) {
//-----------------------------------------------------------------------------
QPixmap DvDirModelDayNode::getPixmap(bool isOpen) const {
- static QPixmap openFolderPixmap = generateIconPixmap("folder_on");
- static QPixmap closeFolderPixmap = generateIconPixmap("folder");
- return isOpen ? openFolderPixmap : closeFolderPixmap;
+ static const QIcon folderIcon = createQIcon("folder");
+ return folderIcon.pixmap({18, 18}, QIcon::Normal,
+ isOpen ? QIcon::On : QIcon::Off);
}
//=============================================================================
@@ -886,35 +868,21 @@ DvDirModelHistoryNode::DvDirModelHistoryNode(DvDirModelNode *parent)
//-----------------------------------------------------------------------------
void DvDirModelHistoryNode::refreshChildren() {
- QModelIndex index = DvDirModel::instance()->getIndexByNode(this);
- m_childrenValid = true;
- if (!m_children.empty()) {
- DvDirModel::instance()->notifyBeginRemoveRows(index, 0,
- m_children.size() - 1);
- clearPointerContainer(m_children);
- DvDirModel::instance()->notifyEndRemoveRows();
- }
-
- History *h = History::instance();
- int dayCount = h->getDayCount();
- if (dayCount > 0) {
- DvDirModel::instance()->notifyBeginInsertRows(index, 0, dayCount);
- for (int i = 0; i < dayCount; i++) {
- const History::Day *day = h->getDay(i);
- DvDirModelNode *child =
- new DvDirModelDayNode(this, ::to_wstring(day->getDate()));
- addChild(child);
- }
- DvDirModel::instance()->notifyEndInsertRows();
+ m_children.clear();
+ m_childrenValid = true;
+ History *h = History::instance();
+ for (int i = 0; i < h->getDayCount(); i++) {
+ const History::Day *day = h->getDay(i);
+ DvDirModelNode *child =
+ new DvDirModelDayNode(this, ::to_wstring(day->getDate()));
+ addChild(child);
}
}
//-----------------------------------------------------------------------------
QPixmap DvDirModelHistoryNode::getPixmap(bool isOpen) const {
- QIcon icon = createQIcon("history");
- static QPixmap pixmap = icon.pixmap(16);
- return pixmap;
+ return createQIcon("history").pixmap(QSize(16, 16));
}
//=============================================================================
@@ -932,15 +900,8 @@ DvDirModelMyComputerNode::DvDirModelMyComputerNode(DvDirModelNode *parent)
//-----------------------------------------------------------------------------
void DvDirModelMyComputerNode::refreshChildren() {
- QModelIndex index = DvDirModel::instance()->getIndexByNode(this);
- m_childrenValid = true;
-
- if (!m_children.empty()) {
- DvDirModel::instance()->notifyBeginRemoveRows(index, 0,
- m_children.size() - 1);
- clearPointerContainer(m_children);
- DvDirModel::instance()->notifyEndRemoveRows();
- }
+ m_childrenValid = true;
+ if (!m_children.empty()) clearPointerContainer(m_children);
TFilePathSet fps = TSystem::getDisks();
@@ -948,22 +909,18 @@ void DvDirModelMyComputerNode::refreshChildren() {
fps.push_back(TFilePath("/Volumes/"));
#endif
- DvDirModel::instance()->notifyBeginInsertRows(index, 0, fps.size() - 1);
TFilePathSet::iterator it;
for (it = fps.begin(); it != fps.end(); ++it) {
DvDirModelNode *child =
new DvDirModelFileFolderNode(this, it->getWideString(), *it);
addChild(child);
}
- DvDirModel::instance()->notifyEndInsertRows();
}
//-----------------------------------------------------------------------------
QPixmap DvDirModelMyComputerNode::getPixmap(bool isOpen) const {
- QIcon icon = createQIcon("my_computer");
- static QPixmap pixmap = icon.pixmap(16);
- return pixmap;
+ return createQIcon("my_computer").pixmap(QSize(16, 16));
}
//=============================================================================
@@ -980,15 +937,9 @@ DvDirModelNetworkNode::DvDirModelNetworkNode(DvDirModelNode *parent)
//-----------------------------------------------------------------------------
void DvDirModelNetworkNode::refreshChildren() {
- QModelIndex index = DvDirModel::instance()->getIndexByNode(this);
- m_childrenValid = true;
+ m_childrenValid = true;
- if (!m_children.empty()) {
- DvDirModel::instance()->notifyBeginRemoveRows(index, 0,
- m_children.size() - 1);
- clearPointerContainer(m_children);
- DvDirModel::instance()->notifyEndRemoveRows();
- }
+ if (!m_children.empty()) clearPointerContainer(m_children);
#ifdef _WIN32
@@ -1021,10 +972,7 @@ void DvDirModelNetworkNode::refreshChildren() {
new DvDirModelFileFolderNode(this, wstr, TFilePath(wstr));
child->setPeeking(false);
- DvDirModel::instance()->notifyBeginInsertRows(
- index, m_children.size(), m_children.size());
addChild(child);
- DvDirModel::instance()->notifyEndInsertRows();
}
}
} else if (err != ERROR_NO_MORE_ITEMS)
@@ -1043,9 +991,7 @@ void DvDirModelNetworkNode::refreshChildren() {
//-----------------------------------------------------------------------------
QPixmap DvDirModelNetworkNode::getPixmap(bool isOpen) const {
- QIcon icon = createQIcon("network");
- static QPixmap pixmap = icon.pixmap(16);
- return pixmap;
+ return createQIcon("network").pixmap(QSize(16, 16));
}
//-----------------------------------------------------------------------------
@@ -1101,19 +1047,19 @@ void DvDirModelRootNode::refreshChildren() {
DvDirModelSpecialFileFolderNode *child;
child = new DvDirModelSpecialFileFolderNode(this, L"My Documents",
getMyDocumentsPath());
- child->setPixmap(generateIconPixmap("my_documents"));
+ child->setIconName("my_documents");
m_specialNodes.push_back(child);
addChild(child);
child =
new DvDirModelSpecialFileFolderNode(this, L"Desktop", getDesktopPath());
- child->setPixmap(generateIconPixmap("desktop"));
+ child->setIconName("desktop");
m_specialNodes.push_back(child);
addChild(child);
child = new DvDirModelSpecialFileFolderNode(
this, L"Library", ToonzFolder::getLibraryFolder());
- child->setPixmap(generateIconPixmap("library"));
+ child->setIconName("library");
m_specialNodes.push_back(child);
addChild(child);
@@ -1133,8 +1079,8 @@ void DvDirModelRootNode::refreshChildren() {
L"*" + projectRoot.withoutParentDir().getWideString() + L" (" +
rootDir + L")",
projectRoot);
- projectRootNode->setPixmap(
- QPixmap(generateIconPixmap("folder_project_root")));
+ projectRootNode->setIconName("folder_project_root");
+ projectRootNode->setIconSize(QSize(18, 18));
m_projectRootNodes.push_back(projectRootNode);
addChild(projectRootNode);
}
@@ -1163,7 +1109,8 @@ void DvDirModelRootNode::refreshChildren() {
// scenefolder node (access to the parent folder of the current scene file)
m_sceneFolderNode =
new DvDirModelSceneFolderNode(this, L"Scene Folder", TFilePath());
- m_sceneFolderNode->setPixmap(QPixmap(":Resources/clapboard.png"));
+ m_sceneFolderNode->setIconName("clapboard");
+ m_sceneFolderNode->setIconSize(QSize(16, 16));
}
}
@@ -1338,6 +1285,34 @@ void DvDirModel::onFolderChanged(const TFilePath &path) { refreshFolder(path); }
//-----------------------------------------------------------------------------
+// void DvDirModel::refresh(const QModelIndex &index) {
+// if (!index.isValid()) return;
+// DvDirModelNode *node = getNode(index);
+// if (!node) return;
+//
+// emit layoutAboutToBeChanged();
+//
+// int oldChildren = node->getChildCount();
+// if (oldChildren > 0) {
+// emit beginRemoveRows(index, 0, oldChildren - 1);
+// node->refreshChildren();
+// emit endRemoveRows();
+// } else if (oldChildren == 0) {
+// node->refreshChildren();
+// } else {
+// emit layoutChanged();
+// return;
+// }
+//
+// int newChildren = node->getChildCount();
+// if (newChildren > 0) {
+// emit beginInsertRows(index, 0, newChildren - 1);
+// emit endInsertRows();
+// }
+//
+// emit layoutChanged();
+// }
+
void DvDirModel::refresh(const QModelIndex &index) {
if (!index.isValid()) return;
DvDirModelNode *node = getNode(index);
diff --git a/toonz/sources/toonz/filebrowsermodel.h b/toonz/sources/toonz/filebrowsermodel.h
index cf363a265..7e51c235c 100644
--- a/toonz/sources/toonz/filebrowsermodel.h
+++ b/toonz/sources/toonz/filebrowsermodel.h
@@ -126,13 +126,16 @@ public:
//-----------------------------------------------------------------------------
class DvDirModelSpecialFileFolderNode : public DvDirModelFileFolderNode {
- QPixmap m_pixmap;
+private:
+ QString m_iconName;
+ QSize m_iconSize;
public:
DvDirModelSpecialFileFolderNode(DvDirModelNode *parent, std::wstring name,
const TFilePath &localPath);
QPixmap getPixmap(bool isOpen) const override;
- void setPixmap(const QPixmap &pixmap);
+ void setIconName(const QString &iconName) { m_iconName = iconName; }
+ void setIconSize(const QSize &size) { m_iconSize = size; }
};
//-----------------------------------------------------------------------------
diff --git a/toonz/sources/toonz/flipbook.cpp b/toonz/sources/toonz/flipbook.cpp
index f62187eee..322cc5749 100644
--- a/toonz/sources/toonz/flipbook.cpp
+++ b/toonz/sources/toonz/flipbook.cpp
@@ -264,7 +264,7 @@ void FlipBook::addFreezeButtonToTitleBar() {
if (panel) {
TPanelTitleBar *titleBar = panel->getTitleBar();
m_freezeButton =
- new TPanelTitleBarButton(titleBar, getIconPath("pane_freeze"));
+ new TPanelTitleBarButton(titleBar, "freeze");
m_freezeButton->setToolTip("Freeze");
titleBar->add(QPoint(-64, 0), m_freezeButton);
connect(m_freezeButton, SIGNAL(toggled(bool)), this, SLOT(freeze(bool)));
diff --git a/toonz/sources/toonz/insertfxpopup.cpp b/toonz/sources/toonz/insertfxpopup.cpp
index 655c104c3..dc419cccb 100644
--- a/toonz/sources/toonz/insertfxpopup.cpp
+++ b/toonz/sources/toonz/insertfxpopup.cpp
@@ -232,7 +232,7 @@ InsertFxPopup::InsertFxPopup()
SLOT(onSearchTextChanged(const QString &)));
m_fxTree = new FxTree();
- m_fxTree->setIconSize(QSize(21, 18));
+ m_fxTree->setIconSize(QSize(18, 18));
m_fxTree->setColumnCount(1);
m_fxTree->header()->close();
diff --git a/toonz/sources/toonz/layerfooterpanel.cpp b/toonz/sources/toonz/layerfooterpanel.cpp
index e424e196b..5d07f9ecc 100644
--- a/toonz/sources/toonz/layerfooterpanel.cpp
+++ b/toonz/sources/toonz/layerfooterpanel.cpp
@@ -1,38 +1,30 @@
#include "layerfooterpanel.h"
#include <QPainter>
-#include <QToolTip>
-#include <QScrollBar>
-
+#include <QMenu>
#include "xsheetviewer.h"
#include "xshcolumnviewer.h"
-
-#include "tapp.h"
-#include "toonz/tscenehandle.h"
-#include "toonz/txsheethandle.h"
-#include "toonz/tobjecthandle.h"
-
-#include "toonz/preferences.h"
-
#include "toonzqt/gutil.h"
-using XsheetGUI::ColumnArea;
+//-----------------------------------------------------------------------------
-LayerFooterPanel::LayerFooterPanel(XsheetViewer *viewer, QWidget *parent,
+LayerFooterPanel::LayerFooterPanel(XsheetViewer* viewer, QWidget* parent,
Qt::WindowFlags flags)
- : QWidget(parent, flags), m_viewer(viewer) {
- const Orientation *o = viewer->orientation();
-
+ : QWidget(parent, flags)
+ , m_viewer(viewer)
+ , m_frameZoomSlider(nullptr)
+ , m_zoomInButton(nullptr)
+ , m_zoomOutButton(nullptr)
+ , isCtrlPressed(false) {
setObjectName("layerFooterPanel");
- setMouseTracking(true);
+ const Orientation* o = viewer->orientation();
- Qt::Orientation ori =
- (o->isVerticalTimeline()) ? Qt::Vertical : Qt::Horizontal;
- bool invDirection = o->isVerticalTimeline();
- QString tooltipStr = (o->isVerticalTimeline())
- ? tr("Zoom in/out of xsheet")
- : tr("Zoom in/out of timeline");
+ // Create and configure the zoom slider
+ Qt::Orientation ori = o->isVerticalTimeline() ? Qt::Vertical : Qt::Horizontal;
+ bool invDirection = o->isVerticalTimeline();
+ QString tooltipStr = o->isVerticalTimeline() ? tr("Zoom in/out of xsheet")
+ : tr("Zoom in/out of timeline");
m_frameZoomSlider = new QSlider(ori, this);
m_frameZoomSlider->setMinimum(20);
@@ -42,170 +34,135 @@ LayerFooterPanel::LayerFooterPanel(XsheetViewer *viewer, QWidget *parent,
m_frameZoomSlider->setInvertedAppearance(invDirection);
m_frameZoomSlider->setInvertedControls(invDirection);
- // for minimal layout, hide the slider
- if (o->rect(PredefinedRect::ZOOM_SLIDER).isEmpty()) m_frameZoomSlider->hide();
-
+ // Create and configure zoom buttons
+ m_zoomInButton = new QToolButton(this);
+ m_zoomInButton->setIcon(createQIcon("zoom_in"));
+ m_zoomInButton->setToolTip(tr("Zoom in (Ctrl-click to zoom in all the way)"));
+ m_zoomInButton->setAutoRaise(true);
+ m_zoomInButton->setFocusPolicy(Qt::NoFocus);
+
+ // Remove padding by making icon size match button size
+ QSize buttonSize = o->rect(PredefinedRect::ZOOM_IN).size();
+ m_zoomInButton->setIconSize(buttonSize);
+ m_zoomInButton->setFixedSize(buttonSize);
+
+ m_zoomOutButton = new QToolButton(this);
+ m_zoomOutButton->setIcon(createQIcon("zoom_out"));
+ m_zoomOutButton->setToolTip(
+ tr("Zoom out (Ctrl-click to zoom out all the way)"));
+ m_zoomOutButton->setAutoRaise(true);
+ m_zoomOutButton->setFocusPolicy(Qt::NoFocus);
+
+ // Apply same sizing to zoom out button
+ m_zoomOutButton->setIconSize(buttonSize);
+ m_zoomOutButton->setFixedSize(buttonSize);
+
+ // Connect signals
connect(m_frameZoomSlider, SIGNAL(valueChanged(int)), this,
SLOT(onFrameZoomSliderValueChanged(int)));
-}
-
-LayerFooterPanel::~LayerFooterPanel() {}
-
-namespace {
+ connect(m_zoomInButton, SIGNAL(clicked()), this, SLOT(onZoomInClicked()));
+ connect(m_zoomOutButton, SIGNAL(clicked()), this, SLOT(onZoomOutClicked()));
-QColor mix(const QColor &a, const QColor &b, double w) {
- return QColor(a.red() * w + b.red() * (1 - w),
- a.green() * w + b.green() * (1 - w),
- a.blue() * w + b.blue() * (1 - w));
-}
+ // Hide slider if needed based on orientation settings
+ if (o->rect(PredefinedRect::ZOOM_SLIDER).isEmpty()) {
+ m_frameZoomSlider->hide();
+ }
-QColor withAlpha(const QColor &color, double alpha) {
- QColor result(color);
- result.setAlpha(alpha * 255);
- return result;
+ // Initial layout setup
+ showOrHide(o);
}
-QRect shorter(const QRect original) { return original.adjusted(0, 2, 0, -2); }
-
-QLine leftSide(const QRect &r) { return QLine(r.topLeft(), r.bottomLeft()); }
-
-QLine rightSide(const QRect &r) { return QLine(r.topRight(), r.bottomRight()); }
-} // namespace
-
-void LayerFooterPanel::paintEvent(QPaintEvent *event) {
- QPainter p(this);
- p.setRenderHint(QPainter::SmoothPixmapTransform, true);
-
- const Orientation *o = m_viewer->orientation();
-
- QRect zoomSliderRect = o->rect(PredefinedRect::ZOOM_SLIDER_AREA);
- p.fillRect(zoomSliderRect, Qt::NoBrush);
-
- QRect sliderObjRect = o->rect(PredefinedRect::ZOOM_SLIDER);
- m_frameZoomSlider->setGeometry(sliderObjRect);
-
- static QPixmap zoomIn = generateIconPixmap("zoom_in");
- static QPixmap zoomInRollover = generateIconPixmap("zoom_in_rollover");
- const QRect zoomInImgRect = o->rect(PredefinedRect::ZOOM_IN);
-
- static QPixmap zoomOut = generateIconPixmap("zoom_out");
- static QPixmap zoomOutRollover = generateIconPixmap("zoom_out_rollover");
- const QRect zoomOutImgRect = o->rect(PredefinedRect::ZOOM_OUT);
-
- p.setRenderHint(QPainter::SmoothPixmapTransform, true);
- if (m_zoomInHighlighted)
- p.drawPixmap(zoomInImgRect, zoomInRollover);
- else
- p.drawPixmap(zoomInImgRect, zoomIn);
+//-----------------------------------------------------------------------------
- if (m_zoomOutHighlighted)
- p.drawPixmap(zoomOutImgRect, zoomOutRollover);
- else
- p.drawPixmap(zoomOutImgRect, zoomOut);
+LayerFooterPanel::~LayerFooterPanel() {}
- if (!o->isVerticalTimeline()) {
- p.setPen(m_viewer->getVerticalLineColor());
- QLine line = {leftSide(shorter(zoomOutImgRect)).translated(-2, 0)};
- p.drawLine(line);
- }
-}
+//-----------------------------------------------------------------------------
-void LayerFooterPanel::showOrHide(const Orientation *o) {
+void LayerFooterPanel::showOrHide(const Orientation* o) {
QRect rect = o->rect(PredefinedRect::LAYER_FOOTER_PANEL);
setFixedSize(rect.size());
- Qt::Orientation ori =
- (o->isVerticalTimeline()) ? Qt::Vertical : Qt::Horizontal;
- bool invDirection = o->isVerticalTimeline();
- QString tooltipStr = (o->isVerticalTimeline())
- ? tr("Zoom in/out of xsheet")
- : tr("Zoom in/out of timeline");
+
+ // Update slider configuration
+ Qt::Orientation ori = o->isVerticalTimeline() ? Qt::Vertical : Qt::Horizontal;
+ bool invDirection = o->isVerticalTimeline();
+ QString tooltipStr = o->isVerticalTimeline() ? tr("Zoom in/out of xsheet")
+ : tr("Zoom in/out of timeline");
m_frameZoomSlider->setOrientation(ori);
m_frameZoomSlider->setToolTip(tooltipStr);
m_frameZoomSlider->setInvertedAppearance(invDirection);
m_frameZoomSlider->setInvertedControls(invDirection);
- // for minimal layout, hide the slider
- if (o->rect(PredefinedRect::ZOOM_SLIDER).isEmpty())
+ // Position widgets according to orientation
+ QRect sliderRect = o->rect(PredefinedRect::ZOOM_SLIDER);
+ m_frameZoomSlider->setGeometry(sliderRect);
+
+ m_zoomInButton->setGeometry(o->rect(PredefinedRect::ZOOM_IN));
+ m_zoomOutButton->setGeometry(o->rect(PredefinedRect::ZOOM_OUT));
+
+ // Handle slider visibility
+ if (o->rect(PredefinedRect::ZOOM_SLIDER).isEmpty()) {
m_frameZoomSlider->hide();
- else
+ } else {
m_frameZoomSlider->show();
+ }
show();
}
//-----------------------------------------------------------------------------
-void LayerFooterPanel::enterEvent(QEvent *) {
- m_zoomInHighlighted = false;
- m_zoomOutHighlighted = false;
-
- update();
-}
-void LayerFooterPanel::leaveEvent(QEvent *) {
- m_zoomInHighlighted = false;
- m_zoomOutHighlighted = false;
+void LayerFooterPanel::setZoomSliderValue(int val) {
+ val = qBound(m_frameZoomSlider->minimum(), val, m_frameZoomSlider->maximum());
- update();
+ m_frameZoomSlider->blockSignals(true);
+ m_frameZoomSlider->setValue(val);
+ m_frameZoomSlider->blockSignals(false);
}
-void LayerFooterPanel::mousePressEvent(QMouseEvent *event) {
- const Orientation *o = m_viewer->orientation();
-
- if (event->button() == Qt::LeftButton) {
- // get mouse position
- QPoint pos = event->pos();
- if (o->rect(PredefinedRect::ZOOM_IN_AREA).contains(pos)) {
- int newFactor = isCtrlPressed ? m_frameZoomSlider->maximum()
- : m_frameZoomSlider->value() + 10;
- m_frameZoomSlider->setValue(newFactor);
- } else if (o->rect(PredefinedRect::ZOOM_OUT_AREA).contains(pos)) {
- int newFactor = isCtrlPressed ? m_frameZoomSlider->minimum()
- : m_frameZoomSlider->value() - 10;
- m_frameZoomSlider->setValue(newFactor);
- }
- }
+//-----------------------------------------------------------------------------
- update();
+void LayerFooterPanel::onFrameZoomSliderValueChanged(int val) {
+ m_viewer->zoomOnFrame(m_viewer->getCurrentRow(), val);
}
-void LayerFooterPanel::mouseMoveEvent(QMouseEvent *event) {
- const Orientation *o = m_viewer->orientation();
-
- QPoint pos = event->pos();
+//-----------------------------------------------------------------------------
- m_zoomInHighlighted = false;
- m_zoomOutHighlighted = false;
- if (o->rect(PredefinedRect::ZOOM_IN_AREA).contains(pos)) {
- m_zoomInHighlighted = true;
- m_tooltip = tr("Zoom in (Ctrl-click to zoom in all the way)");
- } else if (o->rect(PredefinedRect::ZOOM_OUT_AREA).contains(pos)) {
- m_zoomOutHighlighted = true;
- m_tooltip = tr("Zoom out (Ctrl-click to zoom out all the way)");
- } else {
- m_tooltip = tr("");
- }
+void LayerFooterPanel::onZoomInClicked() {
+ int newFactor = isCtrlPressed ? m_frameZoomSlider->maximum()
+ : m_frameZoomSlider->value() + 10;
+ m_frameZoomSlider->setValue(newFactor);
+}
- m_pos = pos;
+//-----------------------------------------------------------------------------
- update();
+void LayerFooterPanel::onZoomOutClicked() {
+ int newFactor = isCtrlPressed ? m_frameZoomSlider->minimum()
+ : m_frameZoomSlider->value() - 10;
+ m_frameZoomSlider->setValue(newFactor);
}
//-----------------------------------------------------------------------------
-bool LayerFooterPanel::event(QEvent *event) {
- if (event->type() == QEvent::ToolTip) {
- if (!m_tooltip.isEmpty())
- QToolTip::showText(mapToGlobal(m_pos), m_tooltip);
- else
- QToolTip::hideText();
+void LayerFooterPanel::paintEvent(QPaintEvent* event) {
+ // Only needed for drawing the separator line in horizontal mode
+ if (!m_viewer->orientation()->isVerticalTimeline()) {
+ QPainter p(this);
+ p.setPen(m_viewer->getVerticalLineColor());
+
+ // Draw separator line
+ QRect zoomOutRect = m_viewer->orientation()->rect(PredefinedRect::ZOOM_OUT);
+ QLine line = QLine(zoomOutRect.topLeft(), zoomOutRect.bottomLeft())
+ .translated(-2, 0);
+ p.drawLine(line);
}
- return QWidget::event(event);
+
+ QWidget::paintEvent(event);
}
//-----------------------------------------------------------------------------
-void LayerFooterPanel::contextMenuEvent(QContextMenuEvent *event) {
+void LayerFooterPanel::contextMenuEvent(QContextMenuEvent* event) {
if (!m_viewer->orientation()->isVerticalTimeline()) {
event->ignore();
return;
@@ -216,9 +173,9 @@ void LayerFooterPanel::contextMenuEvent(QContextMenuEvent *event) {
return;
}
- QMenu *menu = new QMenu(this);
+ QMenu* menu = new QMenu(this);
for (auto frame : frames) {
- QAction *action = menu->addAction(tr("%1 frames per page").arg(frame));
+ QAction* action = menu->addAction(tr("%1 frames per page").arg(frame));
action->setData(frame);
connect(action, SIGNAL(triggered()), this, SLOT(onFramesPerPageSelected()));
}
@@ -227,38 +184,20 @@ void LayerFooterPanel::contextMenuEvent(QContextMenuEvent *event) {
//-----------------------------------------------------------------------------
-void LayerFooterPanel::setZoomSliderValue(int val) {
- if (val > m_frameZoomSlider->maximum())
- val = m_frameZoomSlider->maximum();
- else if (val < m_frameZoomSlider->minimum())
- val = m_frameZoomSlider->minimum();
-
- m_frameZoomSlider->blockSignals(true);
- m_frameZoomSlider->setValue(val);
- m_frameZoomSlider->blockSignals(false);
-}
-
-//-----------------------------------------------------------------------------
-
-void LayerFooterPanel::onFrameZoomSliderValueChanged(int val) {
- m_viewer->zoomOnFrame(m_viewer->getCurrentRow(), val);
-}
-
-//-----------------------------------------------------------------------------
-
void LayerFooterPanel::onFramesPerPageSelected() {
- QAction *action = (QAction *)QObject::sender();
- int frame = action->data().toInt();
- m_viewer->zoomToFramesPerPage(frame);
+ QAction* action = qobject_cast<QAction*>(sender());
+ if (action) {
+ int frame = action->data().toInt();
+ m_viewer->zoomToFramesPerPage(frame);
+ }
}
//-----------------------------------------------------------------------------
void LayerFooterPanel::onControlPressed(bool pressed) {
isCtrlPressed = pressed;
- update();
}
//-----------------------------------------------------------------------------
-const bool LayerFooterPanel::isControlPressed() { return isCtrlPressed; }
+bool LayerFooterPanel::isControlPressed() const { return isCtrlPressed; }
diff --git a/toonz/sources/toonz/layerfooterpanel.h b/toonz/sources/toonz/layerfooterpanel.h
index 326892720..532a28380 100644
--- a/toonz/sources/toonz/layerfooterpanel.h
+++ b/toonz/sources/toonz/layerfooterpanel.h
@@ -5,59 +5,43 @@
#include <QWidget>
#include <QSlider>
+#include <QToolButton>
#include <QKeyEvent>
-#include <boost/optional.hpp>
-
#include "orientation.h"
-using boost::optional;
-
class XsheetViewer;
-// Panel showing column footers for layers in timeline mode
class LayerFooterPanel final : public QWidget {
Q_OBJECT
- QString m_tooltip;
- QPoint m_pos;
-
- QSlider *m_frameZoomSlider;
-
- bool isCtrlPressed = false;
- bool m_zoomInHighlighted = false;
- bool m_zoomOutHighlighted = false;
-
private:
- XsheetViewer *m_viewer;
+ XsheetViewer* m_viewer;
+ QSlider* m_frameZoomSlider;
+ QToolButton* m_zoomInButton;
+ QToolButton* m_zoomOutButton;
+ bool isCtrlPressed;
public:
- LayerFooterPanel(XsheetViewer *viewer, QWidget *parent = 0,
+ LayerFooterPanel(XsheetViewer* viewer, QWidget* parent = nullptr,
Qt::WindowFlags flags = Qt::WindowFlags());
~LayerFooterPanel();
- void showOrHide(const Orientation *o);
-
+ void showOrHide(const Orientation* o);
void setZoomSliderValue(int val);
-
void onControlPressed(bool pressed);
- const bool isControlPressed();
+ bool isControlPressed() const;
protected:
- void paintEvent(QPaintEvent *event) override;
-
- void enterEvent(QEvent *) override;
- void leaveEvent(QEvent *) override;
- void mousePressEvent(QMouseEvent *event) override;
- void mouseMoveEvent(QMouseEvent *event) override;
- bool event(QEvent *event) override;
- void contextMenuEvent(QContextMenuEvent *) override;
-
- void keyPressEvent(QKeyEvent *event) override { event->ignore(); }
- void wheelEvent(QWheelEvent *event) override { event->ignore(); }
+ void paintEvent(QPaintEvent* event) override;
+ void contextMenuEvent(QContextMenuEvent*) override;
+ void keyPressEvent(QKeyEvent* event) override { event->ignore(); }
+ void wheelEvent(QWheelEvent* event) override { event->ignore(); }
-public slots:
+private slots:
void onFrameZoomSliderValueChanged(int val);
void onFramesPerPageSelected();
+ void onZoomInClicked();
+ void onZoomOutClicked();
};
+
#endif
-#pragma once
diff --git a/toonz/sources/toonz/main.cpp b/toonz/sources/toonz/main.cpp
index 988d48004..3a1dd0ccb 100644
--- a/toonz/sources/toonz/main.cpp
+++ b/toonz/sources/toonz/main.cpp
@@ -256,9 +256,6 @@ int main(int argc, char *argv[]) {
}
#endif
- // Build icon map
- ThemeManager::getInstance().buildIconPathsMap(":/icons");
-
// Install signal handlers to catch crashes
CrashHandler::install();
@@ -635,6 +632,10 @@ int main(int argc, char *argv[]) {
Qt::white);
a.processEvents();
+ // Initialize ThemeManager before TApp
+ auto &themeManager = ThemeManager::getInstance();
+ themeManager.initialize();
+
TTool::setApplication(TApp::instance());
TApp::instance()->init();
@@ -665,7 +666,7 @@ int main(int argc, char *argv[]) {
if (TFileStatus(loadFilePath).doesExist()) {
// find project for this script file
TProjectManager *pm = TProjectManager::instance();
- auto sceneProject = pm->loadSceneProject(loadFilePath);
+ auto sceneProject = pm->loadSceneProject(loadFilePath);
TFilePath oldProjectPath;
if (!sceneProject) {
std::cerr << QObject::tr(
@@ -727,6 +728,9 @@ int main(int argc, char *argv[]) {
QString currentStyle = Preferences::instance()->getCurrentStyleSheet();
a.setStyleSheet(currentStyle);
+ // Parse inital stylesheet in ThemeManager
+ themeManager.parseCustomPropertiesFromStylesheet(currentStyle);
+
w.setWindowTitle(QString::fromStdString(TEnv::getApplicationFullName()));
if (TEnv::getIsPortable()) {
splash.showMessage(offsetStr + "Starting OpenToonz Portable ...",
diff --git a/toonz/sources/toonz/mainwindow.cpp b/toonz/sources/toonz/mainwindow.cpp
index 94bd7bdf1..a5ac58245 100644
--- a/toonz/sources/toonz/mainwindow.cpp
+++ b/toonz/sources/toonz/mainwindow.cpp
@@ -1441,7 +1441,7 @@ QAction *MainWindow::createAction(const char *id, const char *name,
#endif
// do nothing for other platforms
} else
- action->setIcon(createQIcon(iconSVGName, false, true));
+ action->setIcon(createQIcon(iconSVGName, true));
addAction(action);
#ifdef MACOSX
// To prevent the wrong menu items (due to MacOS menu naming conventions),
@@ -1633,7 +1633,7 @@ QAction *MainWindow::createToolOptionsAction(const char *id, const char *name,
const char *iconSVGName) {
QAction *action = new DVAction(tr(name), this);
if (iconSVGName && *iconSVGName)
- action->setIcon(createQIcon(iconSVGName, false, true));
+ action->setIcon(createQIcon(iconSVGName, true));
addAction(action);
CommandManager::instance()->define(id, ToolModifierCommandType,
defaultShortcut.toStdString(), action,
@@ -2125,10 +2125,10 @@ void MainWindow::defineActions() {
QT_TR_NOOP("&Save Previewed Frames"), "",
"save_previewed_frames");
createToggle(MI_ToggleViewerPreview, QT_TR_NOOP("Toggle Viewer Preview"), "",
- false, MenuRenderCommandType, "pane_preview");
+ false, MenuRenderCommandType, "preview");
createToggle(MI_ToggleViewerSubCameraPreview,
QT_TR_NOOP("Toggle Viewer Sub-camera Preview"), "", false,
- MenuRenderCommandType, "pane_subpreview");
+ MenuRenderCommandType, "subpreview");
createRightClickMenuAction(MI_OpenPltGizmo, QT_TR_NOOP("&Palette Gizmo"), "",
"palettegizmo");
@@ -2208,7 +2208,7 @@ void MainWindow::defineActions() {
createMenuWindowsAction(MI_OpenFileBrowser, QT_TR_NOOP("&File Browser"), "",
"filebrowser");
createMenuWindowsAction(MI_OpenPreproductionBoard,
- QT_TR_NOOP("&Preproduction Board"), "", "");
+ QT_TR_NOOP("&Preproduction Board"), "", "preproductionboard");
createMenuWindowsAction(MI_OpenFileViewer, QT_TR_NOOP("&Flipbook"), "",
"flipbook");
createMenuWindowsAction(MI_OpenFunctionEditor, QT_TR_NOOP("&Function Editor"),
@@ -2343,7 +2343,7 @@ void MainWindow::defineActions() {
createRightClickMenuAction(MI_ToggleXsheetCameraColumn,
QT_TR_NOOP("Show/Hide Xsheet Camera Column"), "");
createRightClickMenuAction(MI_SetKeyframes, QT_TR_NOOP("&Set Key"), "F6",
- "set_key");
+ "set_keyframe");
createRightClickMenuAction(MI_ShiftKeyframesDown,
QT_TR_NOOP("&Shift Keys Down"), "",
"shift_keys_down");
diff --git a/toonz/sources/toonz/pane.cpp b/toonz/sources/toonz/pane.cpp
index 5bb76e593..15f1d61ef 100644
--- a/toonz/sources/toonz/pane.cpp
+++ b/toonz/sources/toonz/pane.cpp
@@ -36,6 +36,7 @@
#include <QLineEdit>
#include <QTextEdit>
#include <QScreen>
+#include <QDebug>
extern TEnv::StringVar EnvSafeAreaName;
extern TEnv::IntVar EnvViewerPreviewBehavior;
@@ -244,23 +245,16 @@ TPanelTitleBarButton::TPanelTitleBarButton(QWidget *parent,
, m_pressed(false)
, m_buttonSet(0)
, m_id(0) {
- updatePixmaps();
- setFixedSize(m_onPixmap.size() / m_onPixmap.devicePixelRatio());
-}
+ setMouseTracking(true);
-//-----------------------------------------------------------------------------
+ // Determine button size
+ m_baseSize = QSize(20, 18);
+ if (m_standardPixmapName.contains("preview", Qt::CaseInsensitive)) {
+ m_baseSize = QSize(30, 18);
+ }
-TPanelTitleBarButton::TPanelTitleBarButton(QWidget *parent,
- const QPixmap &standardPixmap)
- : QWidget(parent)
- , m_onPixmap(standardPixmap)
- , m_offPixmap(standardPixmap)
- , m_overPixmap(standardPixmap)
- , m_rollover(false)
- , m_pressed(false)
- , m_buttonSet(0)
- , m_id(0) {
- setFixedSize(m_onPixmap.size() / m_onPixmap.devicePixelRatio());
+ // Set initial size
+ setFixedSize(m_baseSize);
}
//-----------------------------------------------------------------------------
@@ -283,10 +277,19 @@ void TPanelTitleBarButton::setPressed(bool pressed) {
//-----------------------------------------------------------------------------
+void TPanelTitleBarButton::setOffColor(const QColor &color) {
+ if (m_offColor != color) {
+ m_offColor = color;
+ }
+}
+
+QColor TPanelTitleBarButton::getOffColor() const { return m_offColor; }
+
+//-----------------------------------------------------------------------------
+
void TPanelTitleBarButton::setOverColor(const QColor &color) {
if (m_overColor != color) {
m_overColor = color;
- updatePixmaps();
}
}
@@ -297,7 +300,6 @@ QColor TPanelTitleBarButton::getOverColor() const { return m_overColor; }
void TPanelTitleBarButton::setPressedColor(const QColor &color) {
if (m_pressedColor != color) {
m_pressedColor = color;
- updatePixmaps();
}
}
@@ -308,7 +310,6 @@ QColor TPanelTitleBarButton::getPressedColor() const { return m_pressedColor; }
void TPanelTitleBarButton::setFreezeColor(const QColor &color) {
if (m_freezeColor != color) {
m_freezeColor = color;
- updatePixmaps();
}
}
@@ -319,7 +320,6 @@ QColor TPanelTitleBarButton::getFreezeColor() const { return m_freezeColor; }
void TPanelTitleBarButton::setPreviewColor(const QColor &color) {
if (m_previewColor != color) {
m_previewColor = color;
- updatePixmaps();
}
}
@@ -327,41 +327,59 @@ QColor TPanelTitleBarButton::getPreviewColor() const { return m_previewColor; }
//-----------------------------------------------------------------------------
-void TPanelTitleBarButton::updatePixmaps() {
- // Get background color used by some icons and states
- QColor bgColor;
- if (m_standardPixmapName.contains("freeze", Qt::CaseInsensitive)) {
- bgColor = getFreezeColor();
- } else if (m_standardPixmapName.contains("preview", Qt::CaseInsensitive)) {
- bgColor = getPreviewColor();
- } else {
- bgColor = getPressedColor();
+void TPanelTitleBarButton::paintEvent(QPaintEvent *event) {
+ if (m_standardPixmapName.isEmpty()) return;
+
+ QPainter p(this);
+
+ // Determine icon state
+ QIcon::Mode mode = m_rollover ? QIcon::Active : QIcon::Normal;
+ QIcon::State state = m_pressed ? QIcon::On : QIcon::Off;
+
+ // Get DPR and sizes
+ qreal dpr = getDevicePixelRatio(this);
+ auto &tm = ThemeManager::getInstance();
+ QSize iconSz = tm.getIconSize(m_standardPixmapName);
+ QSize physSz = iconSz * dpr;
+ QSize btnSz = size() * dpr;
+
+ // Cache key with DPR
+ QString cacheKey =
+ generateCacheKey(m_standardPixmapName, btnSz, mode, state) +
+ QString::number(dpr);
+
+ // Try cache first
+ QPixmap finalPm = getFromPixmapCache(cacheKey);
+ if (finalPm.isNull()) {
+ QPixmap pm = SvgIconEngine(m_standardPixmapName, false, dpr, iconSz)
+ .pixmap(iconSz, mode, state);
+ pm.scaled(iconSz, Qt::KeepAspectRatio);
+
+ if (!pm.isNull()) {
+ QColor bgColor = getOffColor();
+ if (m_pressed) {
+ if (m_standardPixmapName.contains("freeze")) {
+ bgColor = getFreezeColor();
+ } else if (m_standardPixmapName.contains("preview")) {
+ bgColor = getPreviewColor();
+ } else {
+ bgColor = getPressedColor();
+ }
+ } else if (m_rollover) {
+ bgColor = getOverColor();
+ }
+
+ pm.setDevicePixelRatio(dpr);
+ finalPm = expandPixmap(pm, btnSz, bgColor);
+ finalPm.setDevicePixelRatio(dpr);
+
+ addToPixmapCache(cacheKey, finalPm);
+ } else
+ return;
}
- ThemeManager &themeManager = ThemeManager::getInstance();
- const qreal offOpacity = themeManager.getOffOpacity();
-
- // Compute icon
- QImage baseImg = svgToImage(m_standardPixmapName);
- baseImg = themeManager.recolorBlackPixels(baseImg);
- QImage onImg = compositeImage(baseImg, QSize(), false, bgColor);
- QImage offImg = adjustImageOpacity(baseImg, offOpacity);
- QImage overImg = compositeImage(baseImg, QSize(), false, getOverColor());
-
- // Store in member variables
- m_onPixmap = convertImageToPixmap(onImg);
- m_offPixmap = convertImageToPixmap(offImg);
- m_overPixmap = convertImageToPixmap(overImg);
-}
-
-//-----------------------------------------------------------------------------
-
-void TPanelTitleBarButton::paintEvent(QPaintEvent *event) {
- QPainter painter(this);
- painter.drawPixmap(0, 0,
- m_pressed ? m_onPixmap
- : m_rollover ? m_overPixmap
- : m_offPixmap);
+ p.setRenderHint(QPainter::SmoothPixmapTransform);
+ p.drawPixmap(0, 0, finalPm);
}
//-----------------------------------------------------------------------------
@@ -554,7 +572,6 @@ TPanelTitleBar::TPanelTitleBar(QWidget *parent,
: QFrame(parent), m_closeButtonHighlighted(false) {
setMouseTracking(true);
setFocusPolicy(Qt::NoFocus);
- generateCloseButtonPixmaps();
}
//-----------------------------------------------------------------------------
@@ -563,42 +580,17 @@ QSize TPanelTitleBar::minimumSizeHint() const { return QSize(20, 18); }
//-----------------------------------------------------------------------------
-void TPanelTitleBar::generateCloseButtonPixmaps() {
- // Icon theme vars
- ThemeManager &themeManager = ThemeManager::getInstance();
- const qreal offOpacity = themeManager.getOffOpacity();
-
- // Use overColor from stylesheet for bgColor of rollover
- QColor overColor = getOverColor();
-
- // Generate base icon image
- QImage baseImg = generateIconImage("pane_close");
- baseImg = compositeImage(baseImg, QSize(20, 18));
-
- // Off icon image
- QImage offImg = adjustImageOpacity(baseImg, offOpacity);
-
- // Over icon image
- QImage overImg = compositeImage(baseImg, QSize(), false, overColor);
-
- m_closeButtonPixmap = convertImageToPixmap(offImg);
- m_closeButtonOverPixmap = convertImageToPixmap(overImg);
-}
-
-//-----------------------------------------------------------------------------
-
void TPanelTitleBar::paintEvent(QPaintEvent *) {
QPainter painter(this);
QRect rect = this->rect();
bool isPanelActive;
-
TPanel *dw = qobject_cast<TPanel *>(parentWidget());
Q_ASSERT(dw != 0);
if (!dw->isFloating()) { // docked panel
isPanelActive = dw->widgetInThisPanelIsFocused();
- } else { // floating panel
+ } else { // floating panel
isPanelActive = isActiveWindow();
}
@@ -612,25 +604,52 @@ void TPanelTitleBar::paintEvent(QPaintEvent *) {
}
if (dw->isFloating()) {
- QPoint closeButtonPos(rect.right() - 19, rect.top());
+ QPoint btnPos(rect.right() - 19, rect.top());
+ qreal dpr = getDevicePixelRatio(this);
+ QSize btnSz = minimumSizeHint() * dpr;
+ QSize iconSz = QSize(16, 16);
+
+ // Icon mode and background color
+ bool highlighted = m_closeButtonHighlighted;
+ QIcon::Mode mode = highlighted ? QIcon::Active : QIcon::Normal;
+ QColor bgColor = highlighted ? getCloseOverColor() : Qt::transparent;
+
+ // Cache key
+ QString cacheKey =
+ generateCacheKey("closewindow", btnSz, mode, QIcon::Off) +
+ QString::number(dpr);
+
+ // Check cache first
+ QPixmap finalPm = getFromPixmapCache(cacheKey);
+ if (!finalPm.isNull()) {
+ painter.drawPixmap(btnPos, finalPm);
+ return;
+ }
- if (m_closeButtonHighlighted)
- painter.drawPixmap(closeButtonPos, m_closeButtonOverPixmap);
- else
- painter.drawPixmap(closeButtonPos, m_closeButtonPixmap);
+ // Load icon at logical size
+ QPixmap pm = SvgIconEngine("closewindow", false, dpr, iconSz)
+ .pixmap(iconSz, mode, QIcon::Off);
+ if (pm.isNull()) return;
+
+ pm.setDevicePixelRatio(dpr);
+ finalPm = expandPixmap(pm, btnSz, bgColor);
+ finalPm.setDevicePixelRatio(dpr);
+
+ // Cache and draw
+ addToPixmapCache(cacheKey, finalPm);
+ painter.drawPixmap(btnPos, finalPm);
}
}
//-----------------------------------------------------------------------------
-void TPanelTitleBar::setOverColor(const QColor &color) {
- if (m_overColor != color) {
- m_overColor = color;
- generateCloseButtonPixmaps();
+void TPanelTitleBar::setCloseOverColor(const QColor &color) {
+ if (m_closeOverColor != color) {
+ m_closeOverColor = color;
}
}
-QColor TPanelTitleBar::getOverColor() const { return m_overColor; }
+QColor TPanelTitleBar::getCloseOverColor() const { return m_closeOverColor; }
//-----------------------------------------------------------------------------
diff --git a/toonz/sources/toonz/pane.h b/toonz/sources/toonz/pane.h
index 3f000bd57..4dda80d1a 100644
--- a/toonz/sources/toonz/pane.h
+++ b/toonz/sources/toonz/pane.h
@@ -18,22 +18,21 @@ class TPanelTitleBarButton : public QWidget {
// Filepath
QString m_standardPixmapName;
- // Pixmaps
- QPixmap m_standardPixmap;
- QPixmap m_onPixmap;
- QPixmap m_offPixmap;
- QPixmap m_overPixmap;
-
// Colors
+ QColor m_offColor;
QColor m_overColor;
QColor m_pressedColor;
QColor m_freezeColor;
QColor m_previewColor;
+ QSize m_baseSize;
+ QColor m_bgColor;
+
// Methods
void updatePixmaps();
// Stylesheet
+ Q_PROPERTY(QColor OffColor READ getOffColor WRITE setOffColor);
Q_PROPERTY(QColor OverColor READ getOverColor WRITE setOverColor);
Q_PROPERTY(QColor PressedColor READ getPressedColor WRITE setPressedColor);
Q_PROPERTY(QColor FreezeColor READ getFreezeColor WRITE setFreezeColor);
@@ -48,13 +47,15 @@ protected:
public:
TPanelTitleBarButton(QWidget *parent, const QString &standardPixmapName);
- TPanelTitleBarButton(QWidget *parent, const QPixmap &standardPixmap);
//! call this method to make a radio button. id is the button identifier
void setButtonSet(TPanelTitleBarButtonSet *buttonSet, int id);
int getId() const { return m_id; }
// Stylesheet
+ void setOffColor(const QColor &color);
+ QColor getOffColor() const;
+
void setOverColor(const QColor &color);
QColor getOverColor() const;
@@ -152,8 +153,7 @@ class TPanelTitleBar final : public QFrame {
bool m_closeButtonHighlighted;
std::vector<std::pair<QPoint, QWidget *>> m_buttons;
- QColor m_titleColor, m_activeTitleColor, m_overColor;
- QPixmap m_closeButtonPixmap, m_closeButtonOverPixmap;
+ QColor m_titleColor, m_activeTitleColor, m_closeOverColor;
public:
TPanelTitleBar(QWidget *parent = 0,
@@ -162,18 +162,16 @@ public:
QSize sizeHint() const override { return minimumSizeHint(); }
QSize minimumSizeHint() const override;
- void generateCloseButtonPixmaps();
-
// pos = widget position. n.b. if pos.x()<0 then origin is topright corner
void add(const QPoint &pos, QWidget *widget);
-
+
QColor getTitleColor() const { return m_titleColor; }
void setTitleColor(const QColor &color) { m_titleColor = color; }
QColor getActiveTitleColor() const { return m_activeTitleColor; }
void setActiveTitleColor(const QColor &color) { m_activeTitleColor = color; }
- QColor getOverColor() const;
- void setOverColor(const QColor &color);
+ QColor getCloseOverColor() const;
+ void setCloseOverColor(const QColor &color);
protected:
void resizeEvent(QResizeEvent *e) override;
@@ -190,7 +188,8 @@ protected:
Q_PROPERTY(QColor TitleColor READ getTitleColor WRITE setTitleColor);
Q_PROPERTY(QColor ActiveTitleColor READ getActiveTitleColor WRITE
setActiveTitleColor);
- Q_PROPERTY(QColor OverColor READ getOverColor WRITE setOverColor);
+ Q_PROPERTY(
+ QColor CloseOverColor READ getCloseOverColor WRITE setCloseOverColor);
signals:
@@ -249,10 +248,10 @@ public:
TPanelTitleBar *getTitleBar() const { return m_panelTitleBar; }
- virtual void reset(){};
+ virtual void reset() {};
virtual int getViewType() { return -1; };
- virtual void setViewType(int viewType){};
+ virtual void setViewType(int viewType) {};
virtual bool widgetInThisPanelIsFocused() {
// by default, check if the panel content itself has focus
diff --git a/toonz/sources/toonz/preferencespopup.cpp b/toonz/sources/toonz/preferencespopup.cpp
index 08cea4f72..8e507ad14 100644
--- a/toonz/sources/toonz/preferencespopup.cpp
+++ b/toonz/sources/toonz/preferencespopup.cpp
@@ -530,11 +530,18 @@ void PreferencesPopup::onStyleSheetTypeChanged() {
QString currentStyle = m_pref->getCurrentStyleSheet();
qApp->setStyleSheet(currentStyle);
QApplication::restoreOverrideCursor();
-}
-//-----------------------------------------------------------------------------
+ // Update icons
+ ThemeManager& tm = ThemeManager::getInstance();
+ tm.parseCustomPropertiesFromStylesheet(currentStyle);
-void PreferencesPopup::onIconThemeChanged() {}
+ // Try request a full UI repaint to update icons
+ // TODO: Can be better, may not refresh all widgets like popups...
+ QMainWindow* mainwindow = TApp::instance()->getMainWindow();
+ if (mainwindow) {
+ mainwindow->update();
+ }
+}
//-----------------------------------------------------------------------------
@@ -1210,7 +1217,6 @@ QString PreferencesPopup::getUIString(PreferencesItemId id) {
// Interface
{CurrentStyleSheetName, tr("Theme:")},
- {iconTheme, tr("Switch to dark icons")},
{pixelsOnly, tr("All imported images will use the same DPI")},
//{ oldUnits, tr("") },
//{ oldCameraUnits, tr("") },
@@ -1300,7 +1306,8 @@ QString PreferencesPopup::getUIString(PreferencesItemId id) {
tr("Use higher DPI for calculations - Slower but more accurate")},
// Tools
- // {dropdownShortcutsCycleOptions, tr("Dropdown Shortcuts:")}, // removed
+ // {dropdownShortcutsCycleOptions, tr("Dropdown Shortcuts:")}, //
+ // removed
{FillOnlysavebox, tr("Use the TLV Savebox to Limit Filling Operations")},
{multiLayerStylePickerEnabled,
tr("Multi Layer Style Picker: Switch Levels by Picking")},
@@ -1343,7 +1350,8 @@ QString PreferencesPopup::getUIString(PreferencesItemId id) {
tr("Sync Level Strip Drawing Number Changes with the Xsheet")},
{currentTimelineEnabled, tr("Show Current Time Indicator")},
{currentColumnColor, tr("Current Column Color:")},
- //{ levelNameOnEachMarkerEnabled, tr("Display Level Name on Each Marker")
+ //{ levelNameOnEachMarkerEnabled, tr("Display Level Name on Each
+ // Marker")
//},
{levelNameDisplayType, tr("Level Name Display:")},
{showFrameNumberWithLetters,
@@ -1354,8 +1362,8 @@ QString PreferencesPopup::getUIString(PreferencesItemId id) {
{keyframeType, tr("Default Interpolation:")},
{animationStep, tr("Animation Step:")},
{modifyExpressionOnMovingReferences,
- tr("[Experimental Feature] ") +
- tr("Automatically Modify Expression On Moving Referenced Objects")},
+ tr("[Experimental Feature] ") + tr("Automatically Modify Expression "
+ "On Moving Referenced Objects")},
// Preview
{blanksCount, tr("Blank Frames:")},
@@ -1395,11 +1403,13 @@ QString PreferencesPopup::getUIString(PreferencesItemId id) {
tr("Check for the Latest Version of OpenToonz on Launch")},
// Touch / Tablet Settings
- // TounchGestureControl // Touch Gesture is a checkable command and not in
+ // TounchGestureControl // Touch Gesture is a checkable command and not
+ // in
// preferences.ini
{winInkEnabled, tr("Enable Windows Ink Support* (EXPERIMENTAL)")},
{useQtNativeWinInk,
- tr("Use Qt's Native Windows Ink Support*\n(CAUTION: This options is for "
+ tr("Use Qt's Native Windows Ink Support*\n(CAUTION: This options is "
+ "for "
"maintenance purpose. \n Do not activate this option or the tablet "
"won't work properly.)")}};
@@ -1716,10 +1726,6 @@ QWidget* PreferencesPopup::createInterfacePage() {
int row = lay->rowCount();
lay->addWidget(additionalStyleSheetBtn, row - 1, 2, Qt::AlignRight);
- lay->addWidget(new QLabel(tr("Icon Theme*:"), this), 2, 0,
- Qt::AlignRight | Qt::AlignVCenter);
- lay->addWidget(createUI(iconTheme), 2, 1);
-
insertUI(linearUnits, lay, getComboItemList(linearUnits));
insertUI(cameraUnits, lay,
getComboItemList(linearUnits)); // share items with linearUnits
@@ -1771,7 +1777,6 @@ QWidget* PreferencesPopup::createInterfacePage() {
m_onEditedFuncMap.insert(CurrentStyleSheetName,
&PreferencesPopup::onStyleSheetTypeChanged);
- m_onEditedFuncMap.insert(iconTheme, &PreferencesPopup::onIconThemeChanged);
m_onEditedFuncMap.insert(pixelsOnly, &PreferencesPopup::onPixelsOnlyChanged);
m_preEditedFuncMap.insert(linearUnits, &PreferencesPopup::beforeUnitChanged);
m_onEditedFuncMap.insert(linearUnits, &PreferencesPopup::onUnitChanged);
diff --git a/toonz/sources/toonz/preferencespopup.h b/toonz/sources/toonz/preferencespopup.h
index 350a8aed1..5390e198d 100644
--- a/toonz/sources/toonz/preferencespopup.h
+++ b/toonz/sources/toonz/preferencespopup.h
@@ -127,7 +127,6 @@ private:
void onPathAliasPriorityChanged();
// Interface
void onStyleSheetTypeChanged();
- void onIconThemeChanged();
void onPixelsOnlyChanged();
void beforeUnitChanged();
void onUnitChanged();
diff --git a/toonz/sources/toonz/projectpopup.cpp b/toonz/sources/toonz/projectpopup.cpp
index a6d9c826d..1390e4bd0 100644
--- a/toonz/sources/toonz/projectpopup.cpp
+++ b/toonz/sources/toonz/projectpopup.cpp
@@ -50,8 +50,12 @@ enum { Rule_Standard = 0, Rule_Custom };
//-----------------------------------------------------------------------------
QPixmap ProjectDvDirModelProjectNode::getPixmap(bool isOpen) const {
- static QPixmap openProjectPixmap(generateIconPixmap("folder_project_on"));
- static QPixmap closeProjectPixmap(generateIconPixmap("folder_project"));
+ static QPixmap openProjectPixmap =
+ createQIcon("folder_project")
+ .pixmap(QSize(18, 18), QIcon::Normal, QIcon::On);
+ static QPixmap closeProjectPixmap =
+ createQIcon("folder_project")
+ .pixmap(QSize(18, 18), QIcon::Normal, QIcon::Off);
return isOpen ? openProjectPixmap : closeProjectPixmap;
}
@@ -104,7 +108,9 @@ void ProjectDvDirModelRootNode::refreshChildren() {
ProjectDvDirModelSpecialFileFolderNode *projectRootNode =
new ProjectDvDirModelSpecialFileFolderNode(
this, L"Project root (" + rootDir + L")", projectRoot);
- projectRootNode->setPixmap(generateIconPixmap("folder_project_root"));
+ projectRootNode->setPixmap(
+ createQIcon("folder_project_root")
+ .pixmap(QSize(18, 18), QIcon::Normal, QIcon::Off));
addChild(projectRootNode);
}
@@ -452,7 +458,7 @@ void ProjectPopup::updateChooseProjectCombo() {
}
}
// Add in project of current project if outside known Project root folders
- auto currentProject = pm->getCurrentProject();
+ auto currentProject = pm->getCurrentProject();
TFilePath currentProjectFP = currentProject->getProjectPath();
if (m_projectPaths.indexOf(currentProjectFP) == -1) {
m_projectPaths.push_back(currentProjectFP);
diff --git a/toonz/sources/toonz/startuppopup.cpp b/toonz/sources/toonz/startuppopup.cpp
index cdf1f49d5..0b8ffd98d 100644
--- a/toonz/sources/toonz/startuppopup.cpp
+++ b/toonz/sources/toonz/startuppopup.cpp
@@ -169,7 +169,8 @@ StartupPopup::StartupPopup()
m_removePresetBtn->setStyleSheet(
"QPushButton { padding-left: 4px; padding-right: 4px;}");
QLabel *label = new QLabel();
- label->setPixmap(QPixmap(generateIconPixmap("opentoonz_logo")));
+ label->setPixmap(createQIcon("opentoonz_logo")
+ .pixmap(QSize(315, 77), QIcon::Normal, QIcon::Off));
m_projectBox->setObjectName("SolidLineFrame");
m_scenesTab->setObjectName("SolidLineFrame");
m_recentBox->setObjectName("SolidLineFrame");
@@ -629,7 +630,7 @@ void StartupPopup::updateProjectCB() {
}
}
// Add in project of current project if outside known Project root folders
- auto currentProject = pm->getCurrentProject();
+ auto currentProject = pm->getCurrentProject();
TFilePath currentProjectFP = currentProject->getProjectPath();
if (m_projectPaths.indexOf(currentProjectFP) == -1) {
m_projectPaths.push_back(currentProjectFP);
@@ -1234,8 +1235,8 @@ void StartupScenesList::clearScenes() { clear(); }
void StartupScenesList::addScene(const QString &name, const QString &path) {
QPixmap pixmap;
if (path == ":")
- pixmap = generateIconPixmap("new_scene", qreal(1.0), m_iconSize,
- Qt::KeepAspectRatio);
+ pixmap = createQIcon("new_scene", false)
+ .pixmap(m_iconSize, QIcon::Normal, QIcon::Off);
else
pixmap = createScenePreview(name, TFilePath(path));
QIcon icon(pixmap);
diff --git a/toonz/sources/toonz/toonz.qrc b/toonz/sources/toonz/toonz.qrc
index c865eb72c..03c97f8cc 100644
--- a/toonz/sources/toonz/toonz.qrc
+++ b/toonz/sources/toonz/toonz.qrc
@@ -1,600 +1,602 @@
<RCC>
<qresource prefix="/">
+ <!-- Note: paths with /colored/ bypass iconEngine's recolor/opacity handling, use for full-color icons -->
+
<!-- Tools -->
- <file>icons/dark/tools/20/animate.svg</file>
- <file>icons/dark/tools/20/brush.svg</file>
- <file>icons/dark/tools/20/paintbrush.svg</file>
- <file>icons/dark/tools/20/eraser.svg</file>
- <file>icons/dark/tools/20/geometric.svg</file>
- <file>icons/dark/tools/20/fill.svg</file>
- <file>icons/dark/tools/20/controlpointeditor.svg</file>
- <file>icons/dark/tools/20/cutter.svg</file>
- <file>icons/dark/tools/20/finger.svg</file>
- <file>icons/dark/tools/20/hook.svg</file>
- <file>icons/dark/tools/20/iron.svg</file>
- <file>icons/dark/tools/20/magnet.svg</file>
- <file>icons/dark/tools/20/stylepicker.svg</file>
- <file>icons/dark/tools/20/rgbpicker.svg</file>
- <file>icons/dark/tools/20/rgbpicker_over.svg</file>
- <file>icons/dark/tools/20/rgbpicker_on.svg</file>
- <file>icons/dark/tools/20/pinch.svg</file>
- <file>icons/dark/tools/20/bender.svg</file>
- <file>icons/dark/tools/20/plastic.svg</file>
- <file>icons/dark/tools/20/pump.svg</file>
- <file>icons/dark/tools/20/ruler.svg</file>
- <file>icons/dark/tools/20/selection.svg</file>
- <file>icons/dark/tools/20/skeleton.svg</file>
- <file>icons/dark/tools/20/type.svg</file>
- <file>icons/dark/tools/20/tracker.svg</file>
- <file>icons/dark/tools/20/radar.svg</file>
- <file>icons/dark/tools/20/tape.svg</file>
- <file>icons/dark/tools/20/hand.svg</file>
- <file>icons/dark/tools/20/rotate.svg</file>
- <file>icons/dark/tools/20/zoom.svg</file>
- <file>icons/dark/tools/20/assistant.svg</file>
-
- <file>icons/dark/tools/18/edit_center.svg</file>
- <file>icons/dark/tools/18/edit_all.svg</file>
- <file>icons/dark/tools/18/edit_position.svg</file>
- <file>icons/dark/tools/18/edit_rotation.svg</file>
- <file>icons/dark/tools/18/edit_scale.svg</file>
- <file>icons/dark/tools/18/edit_shear.svg</file>
-
- <file>icons/dark/actions/16/round_join.svg</file>
- <file>icons/dark/actions/16/projecting_cap.svg</file>
- <file>icons/dark/actions/16/round_cap.svg</file>
- <file>icons/dark/actions/16/bevel_join.svg</file>
- <file>icons/dark/actions/16/butt_cap.svg</file>
- <file>icons/dark/actions/16/miter_join.svg</file>
-
- <file>icons/dark/actions/16/rotateleft.svg</file>
- <file>icons/dark/actions/16/rotateright.svg</file>
-
- <!-- File / Common -->
- <file>icons/dark/actions/16/menu.svg</file>
- <file>icons/dark/actions/16/export.svg</file>
- <file>icons/dark/actions/16/import.svg</file>
- <file>icons/dark/actions/16/load.svg</file>
- <file>icons/dark/actions/16/lock.svg</file>
- <file>icons/dark/actions/16/lock_on.svg</file>
- <file>icons/dark/actions/16/file_copy.svg</file>
- <file>icons/dark/actions/16/content_copy.svg</file>
- <file>icons/dark/actions/16/cut.svg</file>
- <file>icons/dark/actions/16/paste.svg</file>
- <file>icons/dark/actions/16/paste_into.svg</file>
- <file>icons/dark/actions/16/paste_above_after.svg</file>
- <file>icons/dark/actions/16/paste_duplicate.svg</file>
- <file>icons/dark/actions/16/paste_numbers.svg</file>
- <file>icons/dark/actions/16/insert.svg</file>
- <file>icons/dark/actions/16/insert_above_after.svg</file>
- <file>icons/dark/actions/16/select_all.svg</file>
- <file>icons/dark/actions/16/invert_selection.svg</file>
- <file>icons/dark/actions/16/save.svg</file>
- <file>icons/dark/actions/16/saveas.svg</file>
- <file>icons/dark/actions/16/saveall.svg</file>
- <file>icons/dark/actions/16/gear.svg</file>
- <file>icons/dark/actions/16/gear_check.svg</file>
- <file>icons/dark/actions/16/settings_reset.svg</file>
- <file>icons/dark/actions/16/clear.svg</file>
- <file>icons/dark/actions/16/undo.svg</file>
- <file>icons/dark/actions/16/redo.svg</file>
- <file>icons/dark/actions/16/delete.svg</file>
- <file>icons/dark/actions/16/new_scene.svg</file>
- <file>icons/dark/actions/16/revert_scene.svg</file>
- <file>icons/dark/actions/16/save_scene.svg</file>
- <file>icons/dark/actions/16/save_scene_as.svg</file>
- <file>icons/dark/actions/16/load_scene.svg</file>
- <file>icons/dark/actions/16/convert.svg</file>
- <file>icons/dark/actions/16/orientation_h.svg</file>
- <file>icons/dark/actions/16/orientation_v.svg</file>
- <file>icons/dark/actions/16/load_as_sub_xsheet.svg</file>
- <file>icons/dark/actions/16/export_scene.svg</file>
+ <file>icons/dark/tools/20x20/animate.svg</file>
+ <file>icons/dark/tools/20x20/brush.svg</file>
+ <file>icons/dark/tools/20x20/paintbrush.svg</file>
+ <file>icons/dark/tools/20x20/eraser.svg</file>
+ <file>icons/dark/tools/20x20/geometric.svg</file>
+ <file>icons/dark/tools/20x20/fill.svg</file>
+ <file>icons/dark/tools/20x20/controlpointeditor.svg</file>
+ <file>icons/dark/tools/20x20/cutter.svg</file>
+ <file>icons/dark/tools/20x20/finger.svg</file>
+ <file>icons/dark/tools/20x20/hook.svg</file>
+ <file>icons/dark/tools/20x20/iron.svg</file>
+ <file>icons/dark/tools/20x20/magnet.svg</file>
+ <file>icons/dark/tools/20x20/stylepicker.svg</file>
+ <file>icons/dark/tools/20x20/rgbpicker.svg</file>
+ <file>icons/dark/tools/20x20/rgbpicker_over.svg</file>
+ <file>icons/dark/tools/20x20/rgbpicker_on.svg</file>
+ <file>icons/dark/tools/20x20/pinch.svg</file>
+ <file>icons/dark/tools/20x20/bender.svg</file>
+ <file>icons/dark/tools/20x20/plastic.svg</file>
+ <file>icons/dark/tools/20x20/pump.svg</file>
+ <file>icons/dark/tools/20x20/ruler.svg</file>
+ <file>icons/dark/tools/20x20/selection.svg</file>
+ <file>icons/dark/tools/20x20/skeleton.svg</file>
+ <file>icons/dark/tools/20x20/type.svg</file>
+ <file>icons/dark/tools/20x20/tracker.svg</file>
+ <file>icons/dark/tools/20x20/radar.svg</file>
+ <file>icons/dark/tools/20x20/tape.svg</file>
+ <file>icons/dark/tools/20x20/hand.svg</file>
+ <file>icons/dark/tools/20x20/rotate.svg</file>
+ <file>icons/dark/tools/20x20/zoom.svg</file>
+ <file>icons/dark/tools/20x20/assistant.svg</file>
+
+ <file>icons/dark/tools/18x18/edit_center.svg</file>
+ <file>icons/dark/tools/18x18/edit_all.svg</file>
+ <file>icons/dark/tools/18x18/edit_position.svg</file>
+ <file>icons/dark/tools/18x18/edit_rotation.svg</file>
+ <file>icons/dark/tools/18x18/edit_scale.svg</file>
+ <file>icons/dark/tools/18x18/edit_shear.svg</file>
+
+ <!-- Vector -->
+ <file>icons/dark/actions/16x16/round_join.svg</file>
+ <file>icons/dark/actions/16x16/projecting_cap.svg</file>
+ <file>icons/dark/actions/16x16/round_cap.svg</file>
+ <file>icons/dark/actions/16x16/bevel_join.svg</file>
+ <file>icons/dark/actions/16x16/butt_cap.svg</file>
+ <file>icons/dark/actions/16x16/miter_join.svg</file>
+
+ <file>icons/dark/actions/16x16/rotateleft.svg</file>
+ <file>icons/dark/actions/16x16/rotateright.svg</file>
+
+ <!-- File / Common -->
+ <file>icons/dark/actions/16x16/menu.svg</file>
+ <file>icons/dark/actions/16x16/export.svg</file>
+ <file>icons/dark/actions/16x16/import.svg</file>
+ <file>icons/dark/actions/16x16/load.svg</file>
+ <file>icons/dark/actions/16x16/lock.svg</file>
+ <file>icons/dark/actions/16x16/lock_on.svg</file>
+ <file>icons/dark/actions/16x16/file_copy.svg</file>
+ <file>icons/dark/actions/16x16/content_copy.svg</file>
+ <file>icons/dark/actions/16x16/cut.svg</file>
+ <file>icons/dark/actions/16x16/paste.svg</file>
+ <file>icons/dark/actions/16x16/paste_into.svg</file>
+ <file>icons/dark/actions/16x16/paste_above_after.svg</file>
+ <file>icons/dark/actions/16x16/paste_duplicate.svg</file>
+ <file>icons/dark/actions/16x16/paste_numbers.svg</file>
+ <file>icons/dark/actions/16x16/insert.svg</file>
+ <file>icons/dark/actions/16x16/insert_above_after.svg</file>
+ <file>icons/dark/actions/16x16/select_all.svg</file>
+ <file>icons/dark/actions/16x16/invert_selection.svg</file>
+ <file>icons/dark/actions/16x16/save.svg</file>
+ <file>icons/dark/actions/16x16/saveas.svg</file>
+ <file>icons/dark/actions/16x16/saveall.svg</file>
+ <file>icons/dark/actions/16x16/gear.svg</file>
+ <file>icons/dark/actions/16x16/gear_check.svg</file>
+ <file>icons/dark/actions/16x16/settings_reset.svg</file>
+ <file>icons/dark/actions/16x16/clear.svg</file>
+ <file>icons/dark/actions/16x16/undo.svg</file>
+ <file>icons/dark/actions/16x16/redo.svg</file>
+ <file>icons/dark/actions/16x16/delete.svg</file>
+ <file>icons/dark/actions/16x16/new_scene.svg</file>
+ <file>icons/dark/actions/16x16/revert_scene.svg</file>
+ <file>icons/dark/actions/16x16/save_scene.svg</file>
+ <file>icons/dark/actions/16x16/save_scene_as.svg</file>
+ <file>icons/dark/actions/16x16/load_scene.svg</file>
+ <file>icons/dark/actions/16x16/convert.svg</file>
+ <file>icons/dark/actions/16x16/orientation_h.svg</file>
+ <file>icons/dark/actions/16x16/orientation_v.svg</file>
+ <file>icons/dark/actions/16x16/load_as_sub_xsheet.svg</file>
+ <file>icons/dark/actions/16x16/export_scene.svg</file>
<!-- Arrange -->
- <file>icons/dark/actions/16/move_back_one.svg</file>
- <file>icons/dark/actions/16/move_forward_one.svg</file>
- <file>icons/dark/actions/16/move_to_back.svg</file>
- <file>icons/dark/actions/16/move_to_front.svg</file>
+ <file>icons/dark/actions/16x16/move_back_one.svg</file>
+ <file>icons/dark/actions/16x16/move_forward_one.svg</file>
+ <file>icons/dark/actions/16x16/move_to_back.svg</file>
+ <file>icons/dark/actions/16x16/move_to_front.svg</file>
<!-- Group -->
- <file>icons/dark/actions/16/group.svg</file>
- <file>icons/dark/actions/16/ungroup.svg</file>
- <file>icons/dark/actions/16/enter_group.svg</file>
- <file>icons/dark/actions/16/leave_group.svg</file>
+ <file>icons/dark/actions/16x16/group.svg</file>
+ <file>icons/dark/actions/16x16/ungroup.svg</file>
+ <file>icons/dark/actions/16x16/enter_group.svg</file>
+ <file>icons/dark/actions/16x16/leave_group.svg</file>
<!-- Scan and Cleanup -->
- <file>icons/dark/actions/16/preview_settings.svg</file>
- <file>icons/dark/actions/16/preview.svg</file>
- <file>icons/dark/actions/16/camera_test.svg</file>
- <file>icons/dark/actions/16/cleanup_settings.svg</file>
- <file>icons/dark/actions/16/cleanup_preview.svg</file>
- <file>icons/dark/actions/16/cleanup.svg</file>
- <file>icons/dark/actions/16/cleanup_add.svg</file>
- <file>icons/dark/actions/16/autocenter.svg</file>
- <file>icons/dark/actions/16/camera_capture.svg</file>
- <file>icons/dark/actions/16/subcamera.svg</file>
- <file>icons/dark/actions/16/centerline.svg</file>
- <file>icons/dark/actions/16/set_cropbox.svg</file>
- <file>icons/dark/actions/16/reset_cropbox.svg</file>
+ <file>icons/dark/actions/16x16/camera_test.svg</file>
+ <file>icons/dark/actions/16x16/cleanup_settings.svg</file>
+ <file>icons/dark/actions/16x16/cleanup_preview.svg</file>
+ <file>icons/dark/actions/16x16/cleanup.svg</file>
+ <file>icons/dark/actions/16x16/cleanup_add.svg</file>
+ <file>icons/dark/actions/16x16/autocenter.svg</file>
+ <file>icons/dark/actions/16x16/camera_capture.svg</file>
+ <file>icons/dark/actions/16x16/subcamera.svg</file>
+ <file>icons/dark/actions/16x16/centerline.svg</file>
+ <file>icons/dark/actions/16x16/set_cropbox.svg</file>
+ <file>icons/dark/actions/16x16/reset_cropbox.svg</file>
<!-- File Browser -->
- <file>icons/dark/actions/16/my_computer.svg</file>
- <file>icons/dark/actions/16/my_documents.svg</file>
- <file>icons/dark/actions/16/network.svg</file>
- <file>icons/dark/actions/16/desktop.svg</file>
- <file>icons/dark/actions/16/library.svg</file>
- <file>icons/dark/actions/16/history.svg</file>
- <file>icons/dark/actions/16/fb_fwd.svg</file>
- <file>icons/dark/actions/16/fb_back.svg</file>
- <file>icons/dark/actions/16/fb_up.svg</file>
- <file>icons/dark/actions/16/fb_down.svg</file>
- <file>icons/dark/actions/16/viewlist.svg</file>
- <file>icons/dark/actions/16/viewicon.svg</file>
- <file>icons/dark/actions/16/collect_assets.svg</file>
-
- <file>icons/dark/actions/18/folder_project_root.svg</file>
- <file>icons/dark/actions/60/folder_browser.svg</file>
- <file>icons/dark/actions/60/folder_browser_link.svg</file>
- <file>icons/dark/actions/60/folder_browser_up.svg</file>
+ <file>icons/dark/actions/16x16/my_computer.svg</file>
+ <file>icons/dark/actions/16x16/my_documents.svg</file>
+ <file>icons/dark/actions/16x16/network.svg</file>
+ <file>icons/dark/actions/16x16/desktop.svg</file>
+ <file>icons/dark/actions/16x16/library.svg</file>
+ <file>icons/dark/actions/16x16/history.svg</file>
+ <file>icons/dark/actions/16x16/fb_fwd.svg</file>
+ <file>icons/dark/actions/16x16/fb_back.svg</file>
+ <file>icons/dark/actions/16x16/fb_up.svg</file>
+ <file>icons/dark/actions/16x16/fb_down.svg</file>
+ <file>icons/dark/actions/16x16/viewlist.svg</file>
+ <file>icons/dark/actions/16x16/viewicon.svg</file>
+ <file>icons/dark/actions/16x16/collect_assets.svg</file>
+
+ <file>icons/dark/actions/18x18/colored/folder_project_root.svg</file>
+
+ <file>icons/dark/actions/80x60/colored/folder_browser.svg</file>
+ <file>icons/dark/actions/80x60/colored/folder_browser_link.svg</file>
+ <file>icons/dark/actions/80x60/colored/folder_browser_up.svg</file>
<!-- Tasks, SVN -->
- <file>icons/dark/actions/18/folder_vc.svg</file>
- <file>icons/dark/actions/18/folder_vc_on.svg</file>
- <file>icons/dark/actions/35/task_cln_suspended.svg</file>
- <file>icons/dark/actions/35/task_cln_computing.svg</file>
- <file>icons/dark/actions/35/task_cln_completed.svg</file>
- <file>icons/dark/actions/35/task_cln_completed_with_errors.svg</file>
- <file>icons/dark/actions/35/task_cln_failed.svg</file>
- <file>icons/dark/actions/35/task_cleanup_suspended.svg</file>
- <file>icons/dark/actions/35/task_cleanup_computing.svg</file>
- <file>icons/dark/actions/35/task_cleanup_completed.svg</file>
- <file>icons/dark/actions/35/task_cleanup_completed_with_errors.svg</file>
- <file>icons/dark/actions/35/task_cleanup_failed.svg</file>
- <file>icons/dark/actions/35/task_render_suspended.svg</file>
- <file>icons/dark/actions/35/task_render_computing.svg</file>
- <file>icons/dark/actions/35/task_render_completed.svg</file>
- <file>icons/dark/actions/35/task_render_completed_with_errors.svg</file>
- <file>icons/dark/actions/35/task_render_failed.svg</file>
+ <file>icons/dark/actions/18x18/colored/folder_vc.svg</file>
+ <file>icons/dark/actions/18x18/colored/folder_vc_on.svg</file>
+ <file>icons/dark/actions/35x18/task_root.svg</file>
+ <file>icons/dark/actions/35x18/colored/task_cln_suspended.svg</file>
+ <file>icons/dark/actions/35x18/colored/task_cln_computing.svg</file>
+ <file>icons/dark/actions/35x18/colored/task_cln_completed.svg</file>
+ <file>icons/dark/actions/35x18/colored/task_cln_completed_with_errors.svg</file>
+ <file>icons/dark/actions/35x18/colored/task_cln_failed.svg</file>
+ <file>icons/dark/actions/35x18/colored/task_cleanup_suspended.svg</file>
+ <file>icons/dark/actions/35x18/colored/task_cleanup_computing.svg</file>
+ <file>icons/dark/actions/35x18/colored/task_cleanup_completed.svg</file>
+ <file>icons/dark/actions/35x18/colored/task_cleanup_completed_with_errors.svg</file>
+ <file>icons/dark/actions/35x18/colored/task_cleanup_failed.svg</file>
+ <file>icons/dark/actions/35x18/colored/task_render_suspended.svg</file>
+ <file>icons/dark/actions/35x18/colored/task_render_computing.svg</file>
+ <file>icons/dark/actions/35x18/colored/task_render_completed.svg</file>
+ <file>icons/dark/actions/35x18/colored/task_render_completed_with_errors.svg</file>
+ <file>icons/dark/actions/35x18/colored/task_render_failed.svg</file>
<!-- Mimetypes -->
- <file>icons/dark/mimetypes/tasklist_icon.svg</file>
- <file>icons/dark/mimetypes/xdts_icon.svg</file>
- <file>icons/dark/mimetypes/missing_icon.svg</file>
- <file>icons/dark/mimetypes/motionpath_icon.svg</file>
- <file>icons/dark/mimetypes/curve_icon.svg</file>
- <file>icons/dark/mimetypes/unknown_icon.svg</file>
- <file>icons/dark/mimetypes/cleanup_icon.svg</file>
- <file>icons/dark/mimetypes/psd_icon.svg</file>
- <file>icons/dark/mimetypes/svg_icon.svg</file>
- <file>icons/dark/mimetypes/audio_icon.svg</file>
- <file>icons/dark/mimetypes/script_icon.svg</file>
- <file>icons/dark/mimetypes/broken_icon.svg</file>
- <file>icons/dark/mimetypes/json_icon.svg</file>
+ <file>icons/dark/mimetypes/64x64/colored/tasklist_icon.svg</file>
+ <file>icons/dark/mimetypes/64x64/colored/xdts_icon.svg</file>
+ <file>icons/dark/mimetypes/64x64/colored/missing_icon.svg</file>
+ <file>icons/dark/mimetypes/64x64/colored/motionpath_icon.svg</file>
+ <file>icons/dark/mimetypes/64x64/colored/curve_icon.svg</file>
+ <file>icons/dark/mimetypes/64x64/colored/unknown_icon.svg</file>
+ <file>icons/dark/mimetypes/64x64/colored/cleanup_icon.svg</file>
+ <file>icons/dark/mimetypes/64x64/colored/psd_icon.svg</file>
+ <file>icons/dark/mimetypes/64x64/colored/svg_icon.svg</file>
+ <file>icons/dark/mimetypes/64x64/colored/audio_icon.svg</file>
+ <file>icons/dark/mimetypes/64x64/colored/script_icon.svg</file>
+ <file>icons/dark/mimetypes/64x64/colored/broken_icon.svg</file>
+ <file>icons/dark/mimetypes/64x64/colored/json_icon.svg</file>
<!-- Render -->
- <file>icons/dark/actions/16/render.svg</file>
- <file>icons/dark/actions/16/save_and_render.svg</file>
- <file>icons/dark/actions/16/output_settings.svg</file>
- <file>icons/dark/actions/16/fast_render_mp4.svg</file>
- <file>icons/dark/actions/16/save_previewed_frames.svg</file>
+ <file>icons/dark/actions/16x16/render.svg</file>
+ <file>icons/dark/actions/16x16/save_and_render.svg</file>
+ <file>icons/dark/actions/16x16/output_settings.svg</file>
+ <file>icons/dark/actions/16x16/fast_render_mp4.svg</file>
+ <file>icons/dark/actions/16x16/save_previewed_frames.svg</file>
<!-- Level -->
- <file>icons/dark/actions/16/load_level.svg</file>
- <file>icons/dark/actions/16/remove_level.svg</file>
- <file>icons/dark/actions/16/merge_levels.svg</file>
- <file>icons/dark/actions/16/merge_levels_tlv.svg</file>
- <file>icons/dark/actions/16/resize.svg</file>
- <file>icons/dark/actions/16/remove_unused_levels.svg</file>
- <file>icons/dark/actions/16/brightness_contrast.svg</file>
- <file>icons/dark/actions/16/contrast.svg</file>
- <file>icons/dark/actions/16/binarize.svg</file>
- <file>icons/dark/actions/16/antialias.svg</file>
- <file>icons/dark/actions/16/colorfade.svg</file>
- <file>icons/dark/actions/16/thickness.svg</file>
- <file>icons/dark/actions/16/remove_vector_overflow.svg</file>
- <file>icons/dark/actions/16/revert_level_to_cleanup.svg</file>
- <file>icons/dark/actions/16/reload_level.svg</file>
- <file>icons/dark/actions/16/delete_lines.svg</file>
- <file>icons/dark/actions/16/delete_match_lines.svg</file>
- <file>icons/dark/actions/16/apply_match_lines.svg</file>
- <file>icons/dark/actions/16/level_settings.svg</file>
- <file>icons/dark/actions/16/level_info.svg</file>
- <file>icons/dark/actions/16/replace_parent_directory.svg</file>
+ <file>icons/dark/actions/16x16/load_level.svg</file>
+ <file>icons/dark/actions/16x16/remove_level.svg</file>
+ <file>icons/dark/actions/16x16/merge_levels.svg</file>
+ <file>icons/dark/actions/16x16/merge_levels_tlv.svg</file>
+ <file>icons/dark/actions/16x16/resize.svg</file>
+ <file>icons/dark/actions/16x16/remove_unused_levels.svg</file>
+ <file>icons/dark/actions/16x16/brightness_contrast.svg</file>
+ <file>icons/dark/actions/16x16/contrast.svg</file>
+ <file>icons/dark/actions/16x16/binarize.svg</file>
+ <file>icons/dark/actions/16x16/antialias.svg</file>
+ <file>icons/dark/actions/16x16/colorfade.svg</file>
+ <file>icons/dark/actions/16x16/thickness.svg</file>
+ <file>icons/dark/actions/16x16/remove_vector_overflow.svg</file>
+ <file>icons/dark/actions/16x16/revert_level_to_cleanup.svg</file>
+ <file>icons/dark/actions/16x16/reload_level.svg</file>
+ <file>icons/dark/actions/16x16/delete_lines.svg</file>
+ <file>icons/dark/actions/16x16/delete_match_lines.svg</file>
+ <file>icons/dark/actions/16x16/apply_match_lines.svg</file>
+ <file>icons/dark/actions/16x16/level_settings.svg</file>
+ <file>icons/dark/actions/16x16/level_info.svg</file>
+ <file>icons/dark/actions/16x16/replace_parent_directory.svg</file>
<!-- Console, Channel and Play Controls -->
- <file>icons/dark/actions/16/play.svg</file>
- <file>icons/dark/actions/16/pause.svg</file>
- <file>icons/dark/actions/16/stop.svg</file>
- <file>icons/dark/actions/16/record.svg</file>
- <file>icons/dark/actions/16/loop.svg</file>
- <file>icons/dark/actions/16/framefirst.svg</file>
- <file>icons/dark/actions/16/framelast.svg</file>
- <file>icons/dark/actions/16/frameprev.svg</file>
- <file>icons/dark/actions/16/framenext.svg</file>
- <file>icons/dark/actions/16/prev_drawing.svg</file>
- <file>icons/dark/actions/16/next_drawing.svg</file>
- <file>icons/dark/actions/16/nextstep.svg</file>
- <file>icons/dark/actions/16/prevstep.svg</file>
- <file>icons/dark/actions/16/nextkey.svg</file>
- <file>icons/dark/actions/16/prevkey.svg</file>
- <file>icons/dark/actions/16/blankframes.svg</file>
-
- <file>icons/dark/actions/16/snapshot.svg</file>
- <file>icons/dark/actions/16/compare.svg</file>
- <file>icons/dark/actions/16/histograms.svg</file>
- <file>icons/dark/actions/16/sound.svg</file>
- <file>icons/dark/actions/16/sound_on.svg</file>
- <file>icons/dark/actions/16/preview_black.svg</file>
- <file>icons/dark/actions/16/preview_checkboard.svg</file>
- <file>icons/dark/actions/16/preview_white.svg</file>
- <file>icons/dark/actions/16/locator.svg</file>
- <file>icons/dark/actions/16/define_subcamera_preview.svg</file>
- <file>icons/dark/actions/16/use_subcamera_preview.svg</file>
- <file>icons/dark/actions/16/use_subcamera_preview_on.svg</file>
-
- <file>icons/dark/console/20/half_R.svg</file>
- <file>icons/dark/console/20/half_R_on.svg</file>
- <file>icons/dark/console/20/half_R_over.svg</file>
- <file>icons/dark/console/20/half_G.svg</file>
- <file>icons/dark/console/20/half_G_on.svg</file>
- <file>icons/dark/console/20/half_G_over.svg</file>
- <file>icons/dark/console/20/half_B.svg</file>
- <file>icons/dark/console/20/half_B_on.svg</file>
- <file>icons/dark/console/20/half_B_over.svg</file>
- <file>icons/dark/console/20/half_bw.svg</file>
- <file>icons/dark/console/20/half_bw_on.svg</file>
- <file>icons/dark/console/20/half_bw_over.svg</file>
- <file>icons/dark/console/20/channelmatte.svg</file>
- <file>icons/dark/console/20/channelmatte_on.svg</file>
- <file>icons/dark/console/20/channelred.svg</file>
- <file>icons/dark/console/20/channelred_over.svg</file>
- <file>icons/dark/console/20/channelred_on.svg</file>
- <file>icons/dark/console/20/channelgreen.svg</file>
- <file>icons/dark/console/20/channelgreen_over.svg</file>
- <file>icons/dark/console/20/channelgreen_on.svg</file>
- <file>icons/dark/console/20/channelblue.svg</file>
- <file>icons/dark/console/20/channelblue_over.svg</file>
- <file>icons/dark/console/20/channelblue_on.svg</file>
+ <file>icons/dark/actions/16x16/play.svg</file>
+ <file>icons/dark/actions/16x16/pause.svg</file>
+ <file>icons/dark/actions/16x16/stop.svg</file>
+ <file>icons/dark/actions/16x16/colored/record.svg</file>
+ <file>icons/dark/actions/16x16/loop.svg</file>
+ <file>icons/dark/actions/16x16/framefirst.svg</file>
+ <file>icons/dark/actions/16x16/framelast.svg</file>
+ <file>icons/dark/actions/16x16/frameprev.svg</file>
+ <file>icons/dark/actions/16x16/framenext.svg</file>
+ <file>icons/dark/actions/16x16/prev_drawing.svg</file>
+ <file>icons/dark/actions/16x16/next_drawing.svg</file>
+ <file>icons/dark/actions/16x16/nextstep.svg</file>
+ <file>icons/dark/actions/16x16/prevstep.svg</file>
+ <file>icons/dark/actions/16x16/nextkey.svg</file>
+ <file>icons/dark/actions/16x16/prevkey.svg</file>
+ <file>icons/dark/actions/16x16/blankframes.svg</file>
+
+ <file>icons/dark/actions/16x16/snapshot.svg</file>
+ <file>icons/dark/actions/16x16/compare.svg</file>
+ <file>icons/dark/actions/16x16/histograms.svg</file>
+ <file>icons/dark/actions/16x16/sound.svg</file>
+ <file>icons/dark/actions/16x16/sound_on.svg</file>
+ <file>icons/dark/actions/16x16/preview_black.svg</file>
+ <file>icons/dark/actions/16x16/preview_checkboard.svg</file>
+ <file>icons/dark/actions/16x16/preview_white.svg</file>
+ <file>icons/dark/actions/16x16/locator.svg</file>
+ <file>icons/dark/actions/16x16/define_subcamera_preview.svg</file>
+ <file>icons/dark/actions/16x16/use_subcamera_preview.svg</file>
+ <file>icons/dark/actions/16x16/use_subcamera_preview_on.svg</file>
+
+ <file>icons/dark/console/20x11/colored/half_R.svg</file>
+ <file>icons/dark/console/20x11/colored/half_R_on.svg</file>
+ <file>icons/dark/console/20x11/colored/half_R_over.svg</file>
+ <file>icons/dark/console/20x11/colored/half_G.svg</file>
+ <file>icons/dark/console/20x11/colored/half_G_on.svg</file>
+ <file>icons/dark/console/20x11/colored/half_G_over.svg</file>
+ <file>icons/dark/console/20x11/colored/half_B.svg</file>
+ <file>icons/dark/console/20x11/colored/half_B_on.svg</file>
+ <file>icons/dark/console/20x11/colored/half_B_over.svg</file>
+ <file>icons/dark/console/20x11/colored/half_bw.svg</file>
+ <file>icons/dark/console/20x11/colored/half_bw_on.svg</file>
+ <file>icons/dark/console/20x11/colored/half_bw_over.svg</file>
+ <file>icons/dark/console/20x20/colored/channelmatte.svg</file>
+ <file>icons/dark/console/20x20/colored/channelmatte_on.svg</file>
+ <file>icons/dark/console/20x20/colored/channelred.svg</file>
+ <file>icons/dark/console/20x20/colored/channelred_over.svg</file>
+ <file>icons/dark/console/20x20/colored/channelred_on.svg</file>
+ <file>icons/dark/console/20x20/colored/channelgreen.svg</file>
+ <file>icons/dark/console/20x20/colored/channelgreen_over.svg</file>
+ <file>icons/dark/console/20x20/colored/channelgreen_on.svg</file>
+ <file>icons/dark/console/20x20/colored/channelblue.svg</file>
+ <file>icons/dark/console/20x20/colored/channelblue_over.svg</file>
+ <file>icons/dark/console/20x20/colored/channelblue_on.svg</file>
<!-- FX / Schematic -->
- <file>icons/dark/actions/16/output.svg</file>
- <file>icons/dark/actions/16/fx_logo.svg</file>
- <file>icons/dark/actions/16/fx_settings.svg</file>
- <file>icons/dark/actions/16/preset.svg</file>
- <file>icons/dark/actions/20/switchport.svg</file>
- <file>icons/dark/actions/20/switchport_on.svg</file>
- <file>icons/dark/actions/20/switchport_over.svg</file>
- <file>icons/dark/actions/20/motionpath.svg</file>
- <file>icons/dark/actions/20/pegbar.svg</file>
- <file>icons/dark/actions/16/camera.svg</file>
- <file>icons/dark/actions/20/iconifynodes.svg</file>
- <file>icons/dark/actions/20/iconifynodes_on.svg</file>
- <file>icons/dark/actions/20/iconifynodes_over.svg</file>
- <file>icons/dark/actions/20/reorder.svg</file>
- <file>icons/dark/actions/20/maximizenodes.svg</file>
- <file>icons/dark/actions/20/minimizenodes.svg</file>
- <file>icons/dark/actions/20/swap.svg</file>
- <file>icons/dark/actions/20/hand_schematic.svg</file>
- <file>icons/dark/actions/20/zoom_schematic.svg</file>
- <file>icons/dark/actions/20/selection_schematic.svg</file>
- <file>icons/dark/actions/16/focus.svg</file>
- <file>icons/dark/actions/18/fx.svg</file>
+ <file>icons/dark/actions/16x16/output.svg</file>
+ <file>icons/dark/actions/16x16/fx_logo.svg</file>
+ <file>icons/dark/actions/16x16/fx_settings.svg</file>
+ <file>icons/dark/actions/16x16/preset.svg</file>
+ <file>icons/dark/actions/20x20/switchport.svg</file>
+ <file>icons/dark/actions/20x20/switchport_on.svg</file>
+ <file>icons/dark/actions/20x20/switchport_over.svg</file>
+ <file>icons/dark/actions/20x20/motionpath.svg</file>
+ <file>icons/dark/actions/20x20/pegbar.svg</file>
+ <file>icons/dark/actions/16x16/camera.svg</file>
+ <file>icons/dark/actions/20x20/iconifynodes.svg</file>
+ <file>icons/dark/actions/20x20/iconifynodes_on.svg</file>
+ <file>icons/dark/actions/20x20/iconifynodes_over.svg</file>
+ <file>icons/dark/actions/20x20/reorder.svg</file>
+ <file>icons/dark/actions/20x20/maximizenodes.svg</file>
+ <file>icons/dark/actions/20x20/minimizenodes.svg</file>
+ <file>icons/dark/actions/20x20/swap.svg</file>
+ <file>icons/dark/actions/20x20/hand_schematic.svg</file>
+ <file>icons/dark/actions/20x20/zoom_schematic.svg</file>
+ <file>icons/dark/actions/20x20/selection_schematic.svg</file>
+ <file>icons/dark/actions/16x16/focus.svg</file>
+ <file>icons/dark/actions/18x18/fx.svg</file>
<!-- View Controls -->
- <file>icons/dark/actions/16/zoomin.svg</file>
- <file>icons/dark/actions/16/zoomout.svg</file>
- <file>icons/dark/actions/16/reset.svg</file>
- <file>icons/dark/actions/16/fliphoriz.svg</file>
- <file>icons/dark/actions/16/flipvert.svg</file>
- <file>icons/dark/actions/16/actual_pixel_size.svg</file>
- <file>icons/dark/actions/16/fit_to_window.svg</file>
- <file>icons/dark/actions/16/zoom_reset.svg</file>
- <file>icons/dark/actions/16/rotate_reset.svg</file>
+ <file>icons/dark/actions/16x16/zoomin.svg</file>
+ <file>icons/dark/actions/16x16/zoomout.svg</file>
+ <file>icons/dark/actions/16x16/reset.svg</file>
+ <file>icons/dark/actions/16x16/fliphoriz.svg</file>
+ <file>icons/dark/actions/16x16/flipvert.svg</file>
+ <file>icons/dark/actions/16x16/actual_pixel_size.svg</file>
+ <file>icons/dark/actions/16x16/fit_to_window.svg</file>
+ <file>icons/dark/actions/16x16/zoom_reset.svg</file>
+ <file>icons/dark/actions/16x16/rotate_reset.svg</file>
<!-- XSheet & Cells -->
- <file>icons/dark/actions/16/reverse.svg</file>
- <file>icons/dark/actions/16/swing.svg</file>
- <file>icons/dark/actions/16/random.svg</file>
- <file>icons/dark/actions/16/repeat.svg</file>
- <file>icons/dark/actions/16/time_stretch.svg</file>
- <file>icons/dark/actions/16/set_key.svg</file>
- <file>icons/dark/actions/16/shift_keys_down.svg</file>
- <file>icons/dark/actions/16/shift_keys_up.svg</file>
- <file>icons/dark/actions/16/insert_multiple_keys.svg</file>
- <file>icons/dark/actions/16/remove_multiple_keys.svg</file>
- <file>icons/dark/actions/16/renumber.svg</file>
- <file>icons/dark/actions/16/rollup.svg</file>
- <file>icons/dark/actions/16/rolldown.svg</file>
- <file>icons/dark/actions/16/remove_empty_columns.svg</file>
- <file>icons/dark/actions/16/merge.svg</file>
-
- <file>icons/dark/actions/16/new_level.svg</file>
- <file>icons/dark/actions/16/new_raster_level.svg</file>
- <file>icons/dark/actions/16/new_note_level.svg</file>
- <file>icons/dark/actions/16/new_vector_level.svg</file>
- <file>icons/dark/actions/16/new_toonz_raster_level.svg</file>
- <file>icons/dark/actions/16/save_level.svg</file>
- <file>icons/dark/actions/16/save_level_as.svg</file>
- <file>icons/dark/actions/16/save_all_levels.svg</file>
- <file>icons/dark/actions/16/replace_level.svg</file>
- <file>icons/dark/actions/16/export_level.svg</file>
- <file>icons/dark/actions/16/export_all_levels.svg</file>
-
- <file>icons/dark/actions/16/on_1s.svg</file>
- <file>icons/dark/actions/16/on_2s.svg</file>
- <file>icons/dark/actions/16/on_3s.svg</file>
- <file>icons/dark/actions/16/on_4s.svg</file>
- <file>icons/dark/actions/16/on_with_empty.svg</file>
- <file>icons/dark/actions/16/step_plus.svg</file>
- <file>icons/dark/actions/16/step_reset.svg</file>
- <file>icons/dark/actions/16/step_minus.svg</file>
- <file>icons/dark/actions/16/step_2.svg</file>
- <file>icons/dark/actions/16/step_3.svg</file>
- <file>icons/dark/actions/16/step_4.svg</file>
-
- <file>icons/dark/actions/16/sub_collapse.svg</file>
- <file>icons/dark/actions/16/sub_explode.svg</file>
- <file>icons/dark/actions/16/sub_enter.svg</file>
- <file>icons/dark/actions/16/sub_leave.svg</file>
- <file>icons/dark/actions/16/sub_xsheet.svg</file>
- <file>icons/dark/actions/16/sub_xsheet_saveas.svg</file>
- <file>icons/dark/actions/16/fold_column.svg</file>
- <file>icons/dark/actions/16/sub_edit_in_place.svg</file>
- <file>icons/dark/actions/16/sub_clone.svg</file>
- <file>icons/dark/actions/16/duplicate.svg</file>
- <file>icons/dark/actions/20/onionskin_toggle.svg</file>
- <file>icons/dark/actions/16/insert_frame.svg</file>
- <file>icons/dark/actions/16/remove_frame.svg</file>
- <file>icons/dark/actions/16/add_cell.svg</file>
- <file>icons/dark/actions/16/add_cells.svg</file>
- <file>icons/dark/actions/16/remove_cell.svg</file>
- <file>icons/dark/actions/16/remove_cells.svg</file>
- <file>icons/dark/actions/16/duplicate_drawing.svg</file>
-
- <file>icons/dark/actions/16/camera_settings.svg</file>
- <file>icons/dark/actions/16/autoexpose.svg</file>
- <file>icons/dark/actions/16/scene_settings.svg</file>
- <file>icons/dark/actions/16/fill_empty_cells.svg</file>
- <file>icons/dark/actions/16/clone_cells.svg</file>
- <file>icons/dark/actions/16/auto_input_cell_number.svg</file>
- <file>icons/dark/actions/16/resequence.svg</file>
-
- <file>icons/dark/actions/30/newmemo.svg</file>
- <file>icons/dark/actions/20/toggle_xsheet_orientation.svg</file>
- <file>icons/dark/actions/15/zoom_in.svg</file>
- <file>icons/dark/actions/15/zoom_in_rollover.svg</file>
- <file>icons/dark/actions/15/zoom_out.svg</file>
- <file>icons/dark/actions/15/zoom_out_rollover.svg</file>
- <file>icons/dark/actions/30/sound_header.svg</file>
- <file>icons/dark/actions/30/sound_header_on.svg</file>
- <file>icons/dark/actions/74/notelevel.svg</file>
-
- <file>icons/dark/actions/16/connect.svg</file>
- <file>icons/dark/actions/16/disconnect.svg</file>
- <file>icons/dark/actions/16/xsheet_connect.svg</file>
- <file>icons/dark/actions/16/xsheet_disconnect.svg</file>
- <file>icons/dark/actions/16/cache_fx.svg</file>
- <file>icons/dark/actions/16/uncache_fx.svg</file>
- <file>icons/dark/actions/16/link.svg</file>
- <file>icons/dark/actions/16/unlink.svg</file>
- <file>icons/dark/actions/16/macro.svg</file>
-
- <file>icons/dark/actions/16/toggle_nav_tag.svg</file>
- <file>icons/dark/actions/16/next_nav_tag.svg</file>
- <file>icons/dark/actions/16/prev_nav_tag.svg</file>
-
- <file>icons/dark/actions/16/toggle_sub_nav.svg</file>
-
- <!-- Modes, Types, Options -->
- <file>icons/dark/actions/16/ink_check.svg</file>
- <file>icons/dark/actions/16/inks_only.svg</file>
- <file>icons/dark/actions/16/transparency_check.svg</file>
- <file>icons/dark/actions/16/fill_check.svg</file>
- <file>icons/dark/actions/16/gap_check.svg</file>
- <file>icons/dark/actions/16/paint_check.svg</file>
- <file>icons/dark/actions/16/ink_no1_check.svg</file>
- <file>icons/dark/actions/16/blackbg_check.svg</file>
- <file>icons/dark/actions/16/opacity_check.svg</file>
- <file>icons/dark/actions/16/view_guided_drawing.svg</file>
- <file>icons/dark/actions/16/view_guided_drawing_on.svg</file>
- <file>icons/dark/actions/16/view_vector_as_raster.svg</file>
-
- <file>icons/dark/actions/20/mode_lines.svg</file>
- <file>icons/dark/actions/20/mode_areas.svg</file>
- <file>icons/dark/actions/20/mode_areas_lines.svg</file>
-
- <file>icons/dark/actions/20/fill_rectangular.svg</file>
- <file>icons/dark/actions/20/fill_normal.svg</file>
- <file>icons/dark/actions/20/fill_freehand.svg</file>
- <file>icons/dark/actions/20/fill_polyline.svg</file>
- <file>icons/dark/actions/20/fill_mode_areas.svg</file>
- <file>icons/dark/actions/20/fill_mode_lines.svg</file>
- <file>icons/dark/actions/20/fill_mode_lines_areas.svg</file>
- <file>icons/dark/actions/20/fill_freepick.svg</file>
- <file>icons/dark/actions/16/toggle_autofill.svg</file>
-
- <file>icons/dark/actions/20/stylepicker_areas.svg</file>
- <file>icons/dark/actions/20/stylepicker_lines.svg</file>
- <file>icons/dark/actions/20/stylepicker_lines_areas.svg</file>
-
- <file>icons/dark/actions/20/paintbrush_mode_areas.svg</file>
- <file>icons/dark/actions/20/paintbrush_mode_lines.svg</file>
- <file>icons/dark/actions/20/paintbrush_mode_lines_areas.svg</file>
-
- <file>icons/dark/actions/20/eraser_normal.svg</file>
- <file>icons/dark/actions/20/eraser_polyline.svg</file>
- <file>icons/dark/actions/20/eraser_rectangular.svg</file>
- <file>icons/dark/actions/20/eraser_freehand.svg</file>
- <file>icons/dark/actions/20/eraser_segment.svg</file>
-
- <file>icons/dark/actions/20/geometric_arc.svg</file>
- <file>icons/dark/actions/20/geometric_circle.svg</file>
- <file>icons/dark/actions/20/geometric_ellipse.svg</file>
- <file>icons/dark/actions/20/geometric_line.svg</file>
- <file>icons/dark/actions/20/geometric_multiarc.svg</file>
- <file>icons/dark/actions/20/geometric_polygon.svg</file>
- <file>icons/dark/actions/20/geometric_polyline.svg</file>
- <file>icons/dark/actions/20/geometric_rectangle.svg</file>
-
- <file>icons/dark/actions/20/selection_rectangular.svg</file>
- <file>icons/dark/actions/20/selection_polyline.svg</file>
- <file>icons/dark/actions/20/selection_normal.svg</file>
- <file>icons/dark/actions/20/selection_freehand.svg</file>
-
- <file>icons/dark/actions/20/type_lasso.svg</file>
- <file>icons/dark/actions/20/type_pickerlasso.svg</file>
- <file>icons/dark/actions/20/type_rectangular.svg</file>
- <file>icons/dark/actions/20/type_polyline.svg</file>
- <file>icons/dark/actions/20/type_normal.svg</file>
- <file>icons/dark/actions/20/type_erase_segment.svg</file>
-
- <file>icons/dark/actions/20/tape_rectangular.svg</file>
- <file>icons/dark/actions/20/tape_freehand.svg</file>
- <file>icons/dark/actions/20/tape_polyline.svg</file>
- <file>icons/dark/actions/20/tape_normal.svg</file>
- <file>icons/dark/actions/16/tape_end_to_end.svg</file>
- <file>icons/dark/actions/16/tape_end_to_line.svg</file>
- <file>icons/dark/actions/16/tape_line_to_line.svg</file>
-
- <file>icons/dark/actions/16/shift_and_trace.svg</file>
- <file>icons/dark/actions/16/shift_and_trace_edit.svg</file>
- <file>icons/dark/actions/16/shift_and_trace_no_shift.svg</file>
- <file>icons/dark/actions/16/shift_and_trace_reset.svg</file>
+ <file>icons/dark/actions/16x16/reverse.svg</file>
+ <file>icons/dark/actions/16x16/swing.svg</file>
+ <file>icons/dark/actions/16x16/random.svg</file>
+ <file>icons/dark/actions/16x16/repeat.svg</file>
+ <file>icons/dark/actions/16x16/time_stretch.svg</file>
+ <file>icons/dark/actions/16x16/set_keyframe.svg</file>
+ <file>icons/dark/actions/16x16/shift_keys_down.svg</file>
+ <file>icons/dark/actions/16x16/shift_keys_up.svg</file>
+ <file>icons/dark/actions/16x16/insert_multiple_keys.svg</file>
+ <file>icons/dark/actions/16x16/remove_multiple_keys.svg</file>
+ <file>icons/dark/actions/16x16/renumber.svg</file>
+ <file>icons/dark/actions/16x16/rollup.svg</file>
+ <file>icons/dark/actions/16x16/rolldown.svg</file>
+ <file>icons/dark/actions/16x16/remove_empty_columns.svg</file>
+ <file>icons/dark/actions/16x16/merge.svg</file>
+
+ <file>icons/dark/actions/16x16/new_level.svg</file>
+ <file>icons/dark/actions/16x16/colored/new_raster_level.svg</file>
+ <file>icons/dark/actions/16x16/colored/new_note_level.svg</file>
+ <file>icons/dark/actions/16x16/colored/new_vector_level.svg</file>
+ <file>icons/dark/actions/16x16/colored/new_toonz_raster_level.svg</file>
+ <file>icons/dark/actions/16x16/save_level.svg</file>
+ <file>icons/dark/actions/16x16/save_level_as.svg</file>
+ <file>icons/dark/actions/16x16/save_all_levels.svg</file>
+ <file>icons/dark/actions/16x16/replace_level.svg</file>
+ <file>icons/dark/actions/16x16/export_level.svg</file>
+ <file>icons/dark/actions/16x16/export_all_levels.svg</file>
+
+ <file>icons/dark/actions/16x16/on_1s.svg</file>
+ <file>icons/dark/actions/16x16/on_2s.svg</file>
+ <file>icons/dark/actions/16x16/on_3s.svg</file>
+ <file>icons/dark/actions/16x16/on_4s.svg</file>
+ <file>icons/dark/actions/16x16/on_with_empty.svg</file>
+ <file>icons/dark/actions/16x16/step_plus.svg</file>
+ <file>icons/dark/actions/16x16/step_reset.svg</file>
+ <file>icons/dark/actions/16x16/step_minus.svg</file>
+ <file>icons/dark/actions/16x16/step_2.svg</file>
+ <file>icons/dark/actions/16x16/step_3.svg</file>
+ <file>icons/dark/actions/16x16/step_4.svg</file>
+
+ <file>icons/dark/actions/16x16/sub_collapse.svg</file>
+ <file>icons/dark/actions/16x16/sub_explode.svg</file>
+ <file>icons/dark/actions/16x16/sub_enter.svg</file>
+ <file>icons/dark/actions/16x16/sub_leave.svg</file>
+ <file>icons/dark/actions/16x16/sub_xsheet.svg</file>
+ <file>icons/dark/actions/16x16/sub_xsheet_saveas.svg</file>
+ <file>icons/dark/actions/16x16/fold_column.svg</file>
+ <file>icons/dark/actions/16x16/sub_edit_in_place.svg</file>
+ <file>icons/dark/actions/16x16/sub_clone.svg</file>
+ <file>icons/dark/actions/16x16/duplicate.svg</file>
+ <file>icons/dark/actions/20x20/onionskin_toggle.svg</file>
+ <file>icons/dark/actions/16x16/insert_frame.svg</file>
+ <file>icons/dark/actions/16x16/remove_frame.svg</file>
+ <file>icons/dark/actions/16x16/add_cell.svg</file>
+ <file>icons/dark/actions/16x16/add_cells.svg</file>
+ <file>icons/dark/actions/16x16/remove_cell.svg</file>
+ <file>icons/dark/actions/16x16/remove_cells.svg</file>
+ <file>icons/dark/actions/16x16/duplicate_drawing.svg</file>
+
+ <file>icons/dark/actions/16x16/camera_settings.svg</file>
+ <file>icons/dark/actions/16x16/autoexpose.svg</file>
+ <file>icons/dark/actions/16x16/scene_settings.svg</file>
+ <file>icons/dark/actions/16x16/fill_empty_cells.svg</file>
+ <file>icons/dark/actions/16x16/clone_cells.svg</file>
+ <file>icons/dark/actions/16x16/auto_input_cell_number.svg</file>
+ <file>icons/dark/actions/16x16/resequence.svg</file>
+
+ <file>icons/dark/actions/30x20/newmemo.svg</file>
+ <file>icons/dark/actions/20x20/toggle_xsheet_orientation.svg</file>
+ <file>icons/dark/actions/15x15/zoom_in.svg</file>
+ <file>icons/dark/actions/15x15/zoom_in_rollover.svg</file>
+ <file>icons/dark/actions/15x15/zoom_out.svg</file>
+ <file>icons/dark/actions/15x15/zoom_out_rollover.svg</file>
+ <file>icons/dark/actions/40x30/sound_header.svg</file>
+ <file>icons/dark/actions/40x30/sound_header_on.svg</file>
+ <file>icons/dark/actions/73x43/notelevel.svg</file>
+
+ <file>icons/dark/actions/16x16/connect.svg</file>
+ <file>icons/dark/actions/16x16/disconnect.svg</file>
+ <file>icons/dark/actions/16x16/xsheet_connect.svg</file>
+ <file>icons/dark/actions/16x16/xsheet_disconnect.svg</file>
+ <file>icons/dark/actions/16x16/cache_fx.svg</file>
+ <file>icons/dark/actions/16x16/uncache_fx.svg</file>
+ <file>icons/dark/actions/16x16/link.svg</file>
+ <file>icons/dark/actions/16x16/unlink.svg</file>
+ <file>icons/dark/actions/16x16/macro.svg</file>
+
+ <!-- X-Sheet/Timeline Navigation Tags -->
+ <file>icons/dark/actions/16x16/toggle_nav_tag.svg</file>
+ <file>icons/dark/actions/16x16/next_nav_tag.svg</file>
+ <file>icons/dark/actions/16x16/prev_nav_tag.svg</file>
+ <file>icons/dark/actions/16x16/toggle_sub_nav.svg</file>
+
+ <!-- Modes, Types, Options -->
+ <file>icons/dark/actions/16x16/ink_check.svg</file>
+ <file>icons/dark/actions/16x16/inks_only.svg</file>
+ <file>icons/dark/actions/16x16/transparency_check.svg</file>
+ <file>icons/dark/actions/16x16/fill_check.svg</file>
+ <file>icons/dark/actions/16x16/gap_check.svg</file>
+ <file>icons/dark/actions/16x16/paint_check.svg</file>
+ <file>icons/dark/actions/16x16/ink_no1_check.svg</file>
+ <file>icons/dark/actions/16x16/blackbg_check.svg</file>
+ <file>icons/dark/actions/16x16/opacity_check.svg</file>
+ <file>icons/dark/actions/16x16/view_guided_drawing.svg</file>
+ <file>icons/dark/actions/16x16/view_guided_drawing_on.svg</file>
+ <file>icons/dark/actions/16x16/view_vector_as_raster.svg</file>
+
+ <file>icons/dark/actions/20x20/mode_lines.svg</file>
+ <file>icons/dark/actions/20x20/mode_areas.svg</file>
+ <file>icons/dark/actions/20x20/mode_areas_lines.svg</file>
+
+ <file>icons/dark/actions/20x20/fill_rectangular.svg</file>
+ <file>icons/dark/actions/20x20/fill_normal.svg</file>
+ <file>icons/dark/actions/20x20/fill_freehand.svg</file>
+ <file>icons/dark/actions/20x20/fill_polyline.svg</file>
+ <file>icons/dark/actions/20x20/fill_mode_areas.svg</file>
+ <file>icons/dark/actions/20x20/fill_mode_lines.svg</file>
+ <file>icons/dark/actions/20x20/fill_mode_lines_areas.svg</file>
+ <file>icons/dark/actions/20x20/fill_freepick.svg</file>
+ <file>icons/dark/actions/16x16/toggle_autofill.svg</file>
+
+ <file>icons/dark/actions/20x20/stylepicker_areas.svg</file>
+ <file>icons/dark/actions/20x20/stylepicker_lines.svg</file>
+ <file>icons/dark/actions/20x20/stylepicker_lines_areas.svg</file>
+
+ <file>icons/dark/actions/20x20/paintbrush_mode_areas.svg</file>
+ <file>icons/dark/actions/20x20/paintbrush_mode_lines.svg</file>
+ <file>icons/dark/actions/20x20/paintbrush_mode_lines_areas.svg</file>
+
+ <file>icons/dark/actions/20x20/eraser_normal.svg</file>
+ <file>icons/dark/actions/20x20/eraser_polyline.svg</file>
+ <file>icons/dark/actions/20x20/eraser_rectangular.svg</file>
+ <file>icons/dark/actions/20x20/eraser_freehand.svg</file>
+ <file>icons/dark/actions/20x20/eraser_segment.svg</file>
+
+ <file>icons/dark/actions/20x20/geometric_arc.svg</file>
+ <file>icons/dark/actions/20x20/geometric_circle.svg</file>
+ <file>icons/dark/actions/20x20/geometric_ellipse.svg</file>
+ <file>icons/dark/actions/20x20/geometric_line.svg</file>
+ <file>icons/dark/actions/20x20/geometric_multiarc.svg</file>
+ <file>icons/dark/actions/20x20/geometric_polygon.svg</file>
+ <file>icons/dark/actions/20x20/geometric_polyline.svg</file>
+ <file>icons/dark/actions/20x20/geometric_rectangle.svg</file>
+
+ <file>icons/dark/actions/20x20/selection_rectangular.svg</file>
+ <file>icons/dark/actions/20x20/selection_polyline.svg</file>
+ <file>icons/dark/actions/20x20/selection_normal.svg</file>
+ <file>icons/dark/actions/20x20/selection_freehand.svg</file>
+
+ <file>icons/dark/actions/20x20/type_lasso.svg</file>
+ <file>icons/dark/actions/20x20/type_pickerlasso.svg</file>
+ <file>icons/dark/actions/20x20/type_rectangular.svg</file>
+ <file>icons/dark/actions/20x20/type_polyline.svg</file>
+ <file>icons/dark/actions/20x20/type_normal.svg</file>
+ <file>icons/dark/actions/20x20/type_erase_segment.svg</file>
+
+ <file>icons/dark/actions/20x20/tape_rectangular.svg</file>
+ <file>icons/dark/actions/20x20/tape_freehand.svg</file>
+ <file>icons/dark/actions/20x20/tape_polyline.svg</file>
+ <file>icons/dark/actions/20x20/tape_normal.svg</file>
+ <file>icons/dark/actions/16x16/tape_end_to_end.svg</file>
+ <file>icons/dark/actions/16x16/tape_end_to_line.svg</file>
+ <file>icons/dark/actions/16x16/tape_line_to_line.svg</file>
+
+ <file>icons/dark/actions/16x16/shift_and_trace.svg</file>
+ <file>icons/dark/actions/16x16/shift_and_trace_edit.svg</file>
+ <file>icons/dark/actions/16x16/shift_and_trace_no_shift.svg</file>
+ <file>icons/dark/actions/16x16/shift_and_trace_reset.svg</file>
<!-- Folders -->
- <file>icons/dark/actions/18/folder.svg</file>
- <file>icons/dark/actions/18/folder_on.svg</file>
- <file>icons/dark/actions/16/folder_new.svg</file>
- <file>icons/dark/actions/16/load_folder.svg</file>
- <file>icons/dark/actions/18/folder_project_on.svg</file>
- <file>icons/dark/actions/18/folder_project.svg</file>
- <file>icons/dark/actions/18/folder_inactive.svg</file>
- <file>icons/dark/actions/18/folder_inactive_on.svg</file>
- <file>icons/dark/actions/18/folder_anim_on.svg</file>
- <file>icons/dark/actions/18/folder_anim.svg</file>
- <file>icons/dark/actions/18/folder_anim_inactive.svg</file>
- <file>icons/dark/actions/18/folder_anim_inactive_on.svg</file>
- <file>icons/dark/actions/18/folder_preset_on.svg</file>
- <file>icons/dark/actions/18/folder_preset.svg</file>
+ <file>icons/dark/actions/16x16/folder_new.svg</file>
+ <file>icons/dark/actions/16x16/load_folder.svg</file>
+
+ <file>icons/dark/actions/18x18/colored/folder.svg</file>
+ <file>icons/dark/actions/18x18/colored/folder_on.svg</file>
+ <file>icons/dark/actions/18x18/colored/folder_project_on.svg</file>
+ <file>icons/dark/actions/18x18/colored/folder_project.svg</file>
+ <file>icons/dark/actions/18x18/colored/folder_inactive.svg</file>
+ <file>icons/dark/actions/18x18/colored/folder_inactive_on.svg</file>
+ <file>icons/dark/actions/18x18/colored/folder_anim_on.svg</file>
+ <file>icons/dark/actions/18x18/colored/folder_anim.svg</file>
+ <file>icons/dark/actions/18x18/colored/folder_anim_inactive.svg</file>
+ <file>icons/dark/actions/18x18/colored/folder_anim_inactive_on.svg</file>
+ <file>icons/dark/actions/18x18/colored/folder_preset_on.svg</file>
+ <file>icons/dark/actions/18x18/colored/folder_preset.svg</file>
<!-- Palette -->
- <file>icons/dark/actions/16/newstyle.svg</file>
- <file>icons/dark/actions/16/newpage.svg</file>
- <file>icons/dark/actions/16/palette.svg</file>
- <file>icons/dark/actions/16/palette_tab.svg</file>
- <file>icons/dark/actions/20/dragpalette.svg</file>
- <file>icons/dark/actions/16/palettegizmo.svg</file>
- <file>icons/dark/actions/16/delete_unused_styles.svg</file>
- <file>icons/dark/actions/16/paste_color.svg</file>
- <file>icons/dark/actions/16/paste_name.svg</file>
- <file>icons/dark/actions/16/paste_color_and_name.svg</file>
-
- <!-- Titlebars -->
- <file>icons/dark/actions/20/pane_table.svg</file>
- <file>icons/dark/actions/20/pane_safe.svg</file>
- <file>icons/dark/actions/20/pane_grid.svg</file>
- <file>icons/dark/actions/20/pane_cam.svg</file>
- <file>icons/dark/actions/20/pane_freeze.svg</file>
- <file>icons/dark/actions/20/pane_preview.svg</file>
- <file>icons/dark/actions/20/pane_subpreview.svg</file>
- <file>icons/dark/actions/20/pane_3d.svg</file>
- <file>icons/dark/actions/20/pane_minimize.svg</file>
- <file>icons/dark/actions/20/pane_close.svg</file>
+ <file>icons/dark/actions/16x16/newstyle.svg</file>
+ <file>icons/dark/actions/16x16/newpage.svg</file>
+ <file>icons/dark/actions/16x16/palette.svg</file>
+ <file>icons/dark/actions/16x16/palette_tab.svg</file>
+ <file>icons/dark/actions/20x20/dragpalette.svg</file>
+ <file>icons/dark/actions/16x16/palettegizmo.svg</file>
+ <file>icons/dark/actions/16x16/delete_unused_styles.svg</file>
+ <file>icons/dark/actions/16x16/paste_color.svg</file>
+ <file>icons/dark/actions/16x16/paste_name.svg</file>
+ <file>icons/dark/actions/16x16/paste_color_and_name.svg</file>
<!-- Textstyle -->
- <file>icons/dark/actions/16/bold.svg</file>
- <file>icons/dark/actions/16/italic.svg</file>
- <file>icons/dark/actions/16/underline.svg</file>
- <file>icons/dark/actions/16/align_left.svg</file>
- <file>icons/dark/actions/16/align_right.svg</file>
- <file>icons/dark/actions/16/align_center.svg</file>
+ <file>icons/dark/actions/16x16/bold.svg</file>
+ <file>icons/dark/actions/16x16/italic.svg</file>
+ <file>icons/dark/actions/16x16/underline.svg</file>
+ <file>icons/dark/actions/16x16/align_left.svg</file>
+ <file>icons/dark/actions/16x16/align_right.svg</file>
+ <file>icons/dark/actions/16x16/align_center.svg</file>
<!-- Devices -->
- <file>icons/dark/actions/16/printer.svg</file>
- <file>icons/dark/actions/16/scanner.svg</file>
- <file>icons/dark/actions/16/scanner_settings.svg</file>
- <file>icons/dark/actions/16/scanner_define.svg</file>
+ <file>icons/dark/actions/16x16/printer.svg</file>
+ <file>icons/dark/actions/16x16/scanner.svg</file>
+ <file>icons/dark/actions/16x16/scanner_settings.svg</file>
+ <file>icons/dark/actions/16x16/scanner_define.svg</file>
<!-- Misc -->
- <file>icons/dark/actions/16/minus.svg</file>
- <file>icons/dark/actions/16/plus.svg</file>
- <file>icons/dark/actions/16/web.svg</file>
- <file>icons/dark/actions/16/help.svg</file>
- <file>icons/dark/actions/16/info.svg</file>
- <file>icons/dark/actions/16/notice.svg</file>
- <file>icons/dark/actions/16/run_script.svg</file>
- <file>icons/dark/actions/16/console.svg</file>
- <file>icons/dark/actions/16/pickscreen.svg</file>
- <file>icons/dark/actions/16/toggle_fullscreen.svg</file>
- <file>icons/dark/actions/16/toggle_seethroughwin_on.svg</file>
- <file>icons/dark/actions/16/toggle_seethroughwin_off.svg</file>
- <file>icons/dark/actions/16/schematic.svg</file>
- <file>icons/dark/actions/16/viewer.svg</file>
- <file>icons/dark/actions/16/comboviewer.svg</file>
- <file>icons/dark/actions/16/guided_drawing.svg</file>
- <file>icons/dark/actions/16/studiopalette.svg</file>
- <file>icons/dark/actions/16/colormodel.svg</file>
- <file>icons/dark/actions/16/load_colormodel.svg</file>
- <file>icons/dark/actions/16/styleeditor.svg</file>
- <file>icons/dark/actions/16/messagecenter.svg</file>
- <file>icons/dark/actions/16/recordaudio.svg</file>
- <file>icons/dark/actions/16/flipbook.svg</file>
- <file>icons/dark/actions/16/flipbook_link.svg</file>
- <file>icons/dark/actions/16/timeline.svg</file>
- <file>icons/dark/actions/16/xsheet.svg</file>
- <file>icons/dark/actions/16/clapboard.svg</file>
- <file>icons/dark/actions/16/tasks.svg</file>
- <file>icons/dark/actions/16/batchservers.svg</file>
- <file>icons/dark/actions/16/opentoonz.svg</file>
- <file>icons/dark/actions/16/manual.svg</file>
- <file>icons/dark/actions/16/filebrowser.svg</file>
- <file>icons/dark/actions/16/scenecast.svg</file>
- <file>icons/dark/actions/16/function_editor.svg</file>
- <file>icons/dark/actions/20/segment_linked.svg</file>
- <file>icons/dark/actions/20/segment_linked_on.svg</file>
- <file>icons/dark/actions/11/menu_toggle.svg</file>
- <file>icons/dark/actions/11/menu_toggle_on.svg</file>
- <file>icons/dark/actions/16/squarepixel.svg</file>
- <file>icons/dark/actions/48/colorchiporder_leftup.svg</file>
- <file>icons/dark/actions/48/colorchiporder_lowleft.svg</file>
- <file>icons/dark/actions/48/colorchiporder_upleft.svg</file>
- <file>icons/dark/misc/opentoonz_logo.svg</file>
- <file>icons/dark/actions/20/touch.svg</file>
- <file>icons/dark/actions/16/quit.svg</file>
- <file>icons/dark/actions/16/clear_cache.svg</file>
- <file>icons/dark/actions/16/dialogue.svg</file>
- <file>icons/dark/actions/16/dialogue_import.svg</file>
- <file>icons/dark/actions/16/rename.svg</file>
- <file>icons/dark/actions/16/separate_colors.svg</file>
- <file>icons/dark/actions/16/shortcuts.svg</file>
- <file>icons/dark/actions/16/show_folder_contents.svg</file>
- <file>icons/dark/actions/16/star.svg</file>
- <file>icons/dark/actions/16/tool.svg</file>
- <file>icons/dark/actions/16/tool_options.svg</file>
- <file>icons/dark/actions/16/view_file.svg</file>
- <file>icons/dark/actions/16/level_strip.svg</file>
- <file>icons/dark/actions/17/syncscale.svg</file>
- <file>icons/dark/actions/16/new_project.svg</file>
- <file>icons/dark/actions/16/project_settings.svg</file>
- <file>icons/dark/actions/16/save_default_settings.svg</file>
- <file>icons/dark/actions/16/zero_thick_lines.svg</file>
- <file>icons/dark/actions/16/table.svg</file>
-
- <file>icons/dark/actions/16/export_oca.svg</file>
- <file>icons/dark/actions/16/import_oca.svg</file>
+ <file>icons/dark/actions/16x16/minus.svg</file>
+ <file>icons/dark/actions/16x16/plus.svg</file>
+ <file>icons/dark/actions/16x16/web.svg</file>
+ <file>icons/dark/actions/16x16/help.svg</file>
+ <file>icons/dark/actions/16x16/info.svg</file>
+ <file>icons/dark/actions/16x16/notice.svg</file>
+ <file>icons/dark/actions/16x16/run_script.svg</file>
+ <file>icons/dark/actions/16x16/console.svg</file>
+ <file>icons/dark/actions/16x16/pickscreen.svg</file>
+ <file>icons/dark/actions/16x16/toggle_fullscreen.svg</file>
+ <file>icons/dark/actions/16x16/toggle_seethroughwin_on.svg</file>
+ <file>icons/dark/actions/16x16/toggle_seethroughwin_off.svg</file>
+ <file>icons/dark/actions/16x16/schematic.svg</file>
+ <file>icons/dark/actions/16x16/viewer.svg</file>
+ <file>icons/dark/actions/16x16/comboviewer.svg</file>
+ <file>icons/dark/actions/16x16/guided_drawing.svg</file>
+ <file>icons/dark/actions/16x16/studiopalette.svg</file>
+ <file>icons/dark/actions/16x16/preproductionboard.svg</file>
+ <file>icons/dark/actions/16x16/colormodel.svg</file>
+ <file>icons/dark/actions/16x16/load_colormodel.svg</file>
+ <file>icons/dark/actions/16x16/styleeditor.svg</file>
+ <file>icons/dark/actions/16x16/messagecenter.svg</file>
+ <file>icons/dark/actions/16x16/recordaudio.svg</file>
+ <file>icons/dark/actions/16x16/flipbook.svg</file>
+ <file>icons/dark/actions/16x16/flipbook_link.svg</file>
+ <file>icons/dark/actions/16x16/timeline.svg</file>
+ <file>icons/dark/actions/16x16/xsheet.svg</file>
+ <file>icons/dark/actions/16x16/clapboard.svg</file>
+ <file>icons/dark/actions/16x16/tasks.svg</file>
+ <file>icons/dark/actions/16x16/batchservers.svg</file>
+ <file>icons/dark/actions/16x16/opentoonz.svg</file>
+ <file>icons/dark/actions/16x16/manual.svg</file>
+ <file>icons/dark/actions/16x16/filebrowser.svg</file>
+ <file>icons/dark/actions/16x16/scenecast.svg</file>
+ <file>icons/dark/actions/16x16/function_editor.svg</file>
+ <file>icons/dark/actions/20x20/segment_linked.svg</file>
+ <file>icons/dark/actions/20x20/segment_linked_on.svg</file>
+ <file>icons/dark/actions/11x11/menu_toggle.svg</file>
+ <file>icons/dark/actions/11x11/menu_toggle_on.svg</file>
+ <file>icons/dark/actions/16x16/squarepixel.svg</file>
+ <file>icons/dark/actions/48x42/colorchiporder_leftup.svg</file>
+ <file>icons/dark/actions/48x42/colorchiporder_lowleft.svg</file>
+ <file>icons/dark/actions/48x42/colorchiporder_upleft.svg</file>
+ <file>icons/dark/misc/315x77/opentoonz_logo.svg</file>
+ <file>icons/dark/actions/20x20/touch.svg</file>
+ <file>icons/dark/actions/16x16/quit.svg</file>
+ <file>icons/dark/actions/16x16/clear_cache.svg</file>
+ <file>icons/dark/actions/16x16/dialogue.svg</file>
+ <file>icons/dark/actions/16x16/dialogue_import.svg</file>
+ <file>icons/dark/actions/16x16/rename.svg</file>
+ <file>icons/dark/actions/16x16/separate_colors.svg</file>
+ <file>icons/dark/actions/16x16/shortcuts.svg</file>
+ <file>icons/dark/actions/16x16/show_folder_contents.svg</file>
+ <file>icons/dark/actions/16x16/star.svg</file>
+ <file>icons/dark/actions/16x16/tool.svg</file>
+ <file>icons/dark/actions/16x16/tool_options.svg</file>
+ <file>icons/dark/actions/16x16/view_file.svg</file>
+ <file>icons/dark/actions/16x16/level_strip.svg</file>
+ <file>icons/dark/actions/17x17/syncscale.svg</file>
+ <file>icons/dark/actions/16x16/new_project.svg</file>
+ <file>icons/dark/actions/16x16/project_settings.svg</file>
+ <file>icons/dark/actions/16x16/save_default_settings.svg</file>
+ <file>icons/dark/actions/16x16/zero_thick_lines.svg</file>
+ <file>icons/dark/actions/16x16/table.svg</file>
+ <file>icons/dark/actions/16x16/preview_settings.svg</file>
+ <file>icons/dark/actions/16x16/preview.svg</file>
+ <file>icons/dark/actions/18x18/subpreview.svg</file>
+ <file>icons/dark/actions/16x16/3dview.svg</file>
+ <file>icons/dark/actions/16x16/safearea.svg</file>
+ <file>icons/dark/actions/16x16/fieldguide.svg</file>
+ <file>icons/dark/actions/16x16/freeze.svg</file>
+ <file>icons/dark/actions/16x16/minimize.svg</file>
+ <file>icons/dark/actions/16x16/closewindow.svg</file>
+
+ <file>icons/dark/actions/16x16/export_oca.svg</file>
+ <file>icons/dark/actions/16x16/import_oca.svg</file>
<!-- Keyframe -->
- <file>icons/dark/actions/20/key_off.svg</file>
- <file>icons/dark/actions/20/key_on.svg</file>
- <file>icons/dark/actions/20/key_modified.svg</file>
- <file>icons/dark/actions/20/key_partial.svg</file>
+ <file>icons/dark/actions/20x20/keyframe.svg</file>
+ <file>icons/dark/actions/20x20/keyframe_on.svg</file>
+ <file>icons/dark/actions/20x20/keyframe_modified.svg</file>
+ <file>icons/dark/actions/20x20/keyframe_partial.svg</file>
<!-- ===================================================== -->
<!-- Light =============================================== -->
-
+
<!-- ===================================================== -->
<!-- Legacy resources ==================================== -->
-
+
<file>Resources/3Dside_l.svg</file>
<file>Resources/3Dside_r.svg</file>
<file>Resources/3Dtop.svg</file>
diff --git a/toonz/sources/toonz/tpanels.cpp b/toonz/sources/toonz/tpanels.cpp
index 8481780f8..91fe27933 100644
--- a/toonz/sources/toonz/tpanels.cpp
+++ b/toonz/sources/toonz/tpanels.cpp
@@ -542,8 +542,7 @@ void PaletteViewerPanel::reset() {
//-----------------------------------------------------------------------------
void PaletteViewerPanel::initializeTitleBar() {
- m_freezeButton =
- new TPanelTitleBarButton(getTitleBar(), getIconPath("pane_freeze"));
+ m_freezeButton = new TPanelTitleBarButton(getTitleBar(), "freeze");
m_freezeButton->setToolTip(tr("Freeze"));
getTitleBar()->add(QPoint(-54, 0), m_freezeButton);
m_freezeButton->setPressed(m_isFrozen);
@@ -1124,7 +1123,7 @@ void FlipbookPanel::initializeTitleBar(TPanelTitleBar *titleBar) {
// safe area button
TPanelTitleBarButtonForSafeArea *safeAreaButton =
- new TPanelTitleBarButtonForSafeArea(titleBar, getIconPath("pane_safe"));
+ new TPanelTitleBarButtonForSafeArea(titleBar, "safearea");
safeAreaButton->setToolTip(tr("Safe Area (Right Click to Select)"));
titleBar->add(QPoint(x, 0), safeAreaButton);
ret = ret && connect(safeAreaButton, SIGNAL(toggled(bool)),
@@ -1139,8 +1138,7 @@ void FlipbookPanel::initializeTitleBar(TPanelTitleBar *titleBar) {
x += 28 + iconWidth;
// minimize button
- m_button = new TPanelTitleBarButton(
- titleBar, getIconPath("pane_minimize"));
+ m_button = new TPanelTitleBarButton(titleBar, "minimize");
m_button->setToolTip(tr("Minimize"));
m_button->setPressed(false);
@@ -1211,7 +1209,8 @@ class BrowserFactory final : public TPanelFactory {
public:
BrowserFactory() : TPanelFactory("Browser") {}
void initialize(TPanel *panel) override {
- FileBrowser *browser = new FileBrowser(panel, Qt::WindowFlags(), false, true);
+ FileBrowser *browser =
+ new FileBrowser(panel, Qt::WindowFlags(), false, true);
panel->setWidget(browser);
panel->setWindowTitle(QObject::tr("File Browser"));
TFilePath currentProjectFolder =
@@ -1228,7 +1227,8 @@ class PreproductionBoardFactory final : public TPanelFactory {
public:
PreproductionBoardFactory() : TPanelFactory("PreproductionBoard") {}
void initialize(TPanel *panel) override {
- SceneBrowser *browser = new SceneBrowser(panel, Qt::WindowFlags(), false, true);
+ SceneBrowser *browser =
+ new SceneBrowser(panel, Qt::WindowFlags(), false, true);
panel->setWidget(browser);
panel->setWindowTitle(QObject::tr("Preproduction Board"));
TFilePath scenesFolder =
diff --git a/toonz/sources/toonz/viewerpane.cpp b/toonz/sources/toonz/viewerpane.cpp
index 34db9edf4..c15d6376a 100644
--- a/toonz/sources/toonz/viewerpane.cpp
+++ b/toonz/sources/toonz/viewerpane.cpp
@@ -377,13 +377,13 @@ void BaseViewerPanel::initializeTitleBar(TPanelTitleBar *titleBar) {
TPanelTitleBarButtonSet *viewModeButtonSet;
m_referenceModeBs = viewModeButtonSet = new TPanelTitleBarButtonSet();
- int x = -232;
+ int x = -244;
int iconWidth = 20;
TPanelTitleBarButton *button;
// buttons for show / hide toggle for the field guide and the safe area
TPanelTitleBarButtonForSafeArea *safeAreaButton =
- new TPanelTitleBarButtonForSafeArea(titleBar, getIconPath("pane_safe"));
+ new TPanelTitleBarButtonForSafeArea(titleBar, "safearea");
safeAreaButton->setToolTip(tr("Safe Area (Right Click to Select)"));
titleBar->add(QPoint(x, 0), safeAreaButton);
ret = ret && connect(safeAreaButton, SIGNAL(toggled(bool)),
@@ -396,7 +396,7 @@ void BaseViewerPanel::initializeTitleBar(TPanelTitleBar *titleBar) {
safeAreaButton->setPressed(
CommandManager::instance()->getAction(MI_SafeArea)->isChecked());
- button = new TPanelTitleBarButton(titleBar, getIconPath("pane_grid"));
+ button = new TPanelTitleBarButton(titleBar, "fieldguide");
button->setToolTip(tr("Field Guide"));
x += 1 + iconWidth;
titleBar->add(QPoint(x, 0), button);
@@ -410,20 +410,20 @@ void BaseViewerPanel::initializeTitleBar(TPanelTitleBar *titleBar) {
CommandManager::instance()->getAction(MI_FieldGuide)->isChecked());
// view mode toggles
- button = new TPanelTitleBarButton(titleBar, getIconPath("pane_table"));
+ button = new TPanelTitleBarButton(titleBar, "table");
button->setToolTip(tr("Camera Stand View"));
x += 10 + iconWidth;
titleBar->add(QPoint(x, 0), button);
button->setButtonSet(viewModeButtonSet, SceneViewer::NORMAL_REFERENCE);
button->setPressed(true);
- button = new TPanelTitleBarButton(titleBar, getIconPath("pane_3d"));
+ button = new TPanelTitleBarButton(titleBar, "3dview");
button->setToolTip(tr("3D View"));
x += 1 + iconWidth;
titleBar->add(QPoint(x, 0), button);
button->setButtonSet(viewModeButtonSet, SceneViewer::CAMERA3D_REFERENCE);
- button = new TPanelTitleBarButton(titleBar, getIconPath("pane_cam"));
+ button = new TPanelTitleBarButton(titleBar, "camera");
button->setToolTip(tr("Camera View"));
x += 1 + iconWidth;
titleBar->add(QPoint(x, 0), button);
@@ -432,7 +432,7 @@ void BaseViewerPanel::initializeTitleBar(TPanelTitleBar *titleBar) {
SLOT(setReferenceMode(int)));
// freeze button
- button = new TPanelTitleBarButton(titleBar, getIconPath("pane_freeze"));
+ button = new TPanelTitleBarButton(titleBar, "freeze");
x += 10 + iconWidth;
button->setToolTip(tr("Freeze"));
@@ -442,7 +442,7 @@ void BaseViewerPanel::initializeTitleBar(TPanelTitleBar *titleBar) {
// preview toggles
m_previewButton =
- new TPanelTitleBarButtonForPreview(titleBar, getIconPath("pane_preview"));
+ new TPanelTitleBarButtonForPreview(titleBar, "preview");
x += 10 + iconWidth;
titleBar->add(QPoint(x, 0), m_previewButton);
m_previewButton->setToolTip(tr("Preview"));
@@ -451,8 +451,8 @@ void BaseViewerPanel::initializeTitleBar(TPanelTitleBar *titleBar) {
// SLOT(enableFullPreview(bool)));
m_subcameraPreviewButton = new TPanelTitleBarButtonForPreview(
- titleBar, getIconPath("pane_subpreview"));
- x += 1 + 24;
+ titleBar, "subpreview");
+ x += 1 + 30;
titleBar->add(QPoint(x, 0), m_subcameraPreviewButton);
m_subcameraPreviewButton->setToolTip(tr("Sub-camera Preview"));
diff --git a/toonz/sources/toonz/xshcolumnviewer.cpp b/toonz/sources/toonz/xshcolumnviewer.cpp
index 6154cb592..b787da31c 100644
--- a/toonz/sources/toonz/xshcolumnviewer.cpp
+++ b/toonz/sources/toonz/xshcolumnviewer.cpp
@@ -803,11 +803,14 @@ void ColumnArea::DrawHeader::prepare() const {
//-----------------------------------------------------------------------------
const QPixmap &ColumnArea::Pixmaps::sound() {
- static QPixmap sound = generateIconPixmap("sound_header");
+ static QPixmap sound = createQIcon("sound_header")
+ .pixmap(QSize(40, 30), QIcon::Normal, QIcon::Off);
return sound;
}
const QPixmap &ColumnArea::Pixmaps::soundPlaying() {
- static QPixmap soundPlaying = generateIconPixmap("sound_header_on");
+ static QPixmap soundPlaying =
+ createQIcon("sound_header")
+ .pixmap(QSize(40, 30), QIcon::Normal, QIcon::On);
return soundPlaying;
}
@@ -938,7 +941,7 @@ void ColumnArea::DrawHeader::drawEye() const {
QRect eyeRect = o->rect(PredefinedRect::EYE).translated(orig);
// preview visible toggle
if (o->isVerticalTimeline())
- p.setPen(m_viewer->getColumnIconLineColor()); // Preview border color
+ p.setPen(m_viewer->getColumnIconLineColor()); // Preview border color
else
p.setPen(m_viewer->getTimelineIconLineColor()); // Preview border color
@@ -981,7 +984,7 @@ void ColumnArea::DrawHeader::drawPreviewToggle(int opacity) const {
o->rect(PredefinedRect::PREVIEW_LAYER).translated(orig);
if (o->isVerticalTimeline())
- p.setPen(m_viewer->getColumnIconLineColor()); // Camstand border color
+ p.setPen(m_viewer->getColumnIconLineColor()); // Camstand border color
else
p.setPen(m_viewer->getTimelineIconLineColor()); // Camstand border color
@@ -1028,7 +1031,7 @@ void ColumnArea::DrawHeader::drawUnifiedViewToggle(int opacity) const {
o->rect(PredefinedRect::UNIFIEDVIEW_LAYER).translated(orig);
if (o->isVerticalTimeline())
- p.setPen(m_viewer->getColumnIconLineColor()); // border color
+ p.setPen(m_viewer->getColumnIconLineColor()); // border color
else
p.setPen(m_viewer->getTimelineIconLineColor()); // border color
@@ -1070,7 +1073,7 @@ void ColumnArea::DrawHeader::drawLock() const {
// lock button
if (o->isVerticalTimeline())
- p.setPen(m_viewer->getColumnIconLineColor()); // Lock border color
+ p.setPen(m_viewer->getColumnIconLineColor()); // Lock border color
else
p.setPen(m_viewer->getTimelineIconLineColor()); // Lock border color
@@ -1787,7 +1790,7 @@ void ColumnArea::drawSoundTextColumnHead(QPainter &p, int col) { // AREA
drawHeader.drawConfig();
drawHeader.drawColumnName();
drawHeader.drawColumnNumber();
- static QPixmap iconPixmap(generateIconPixmap("notelevel"));
+ static QPixmap iconPixmap(svgToPixmap(getIconPath("notelevel")));
drawHeader.drawThumbnail(iconPixmap);
drawHeader.drawPegbarName();
drawHeader.drawParentHandleName();
@@ -2343,7 +2346,7 @@ void ColumnArea::mousePressEvent(QMouseEvent *event) {
TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
return;
}
-
+
TXshColumn *column = xsh->getColumn(m_col);
bool isEmpty = !column || column->isEmpty();
TApp::instance()->getCurrentObject()->setIsSpline(false);
@@ -2355,24 +2358,23 @@ void ColumnArea::mousePressEvent(QMouseEvent *event) {
// int y = event->pos().y();
// QPoint mouseInCell(x, y);
int x = mouseInCell.x(), y = mouseInCell.y();
-
+
// don't make column current when click on some of its toggle buttons
bool needMakeColumnCurrent = true;
- if ( o->rect(PredefinedRect::LOCK_AREA).contains(mouseInCell)
- || o->rect(PredefinedRect::CONFIG_AREA).contains(mouseInCell) )
+ if (o->rect(PredefinedRect::LOCK_AREA).contains(mouseInCell) ||
+ o->rect(PredefinedRect::CONFIG_AREA).contains(mouseInCell))
needMakeColumnCurrent = false;
- if ( Preferences::instance()->isUnifyColumnVisibilityTogglesEnabled() ) {
- if ( o->rect(PredefinedRect::UNIFIEDVIEW_LAYER_AREA).contains(mouseInCell) )
+ if (Preferences::instance()->isUnifyColumnVisibilityTogglesEnabled()) {
+ if (o->rect(PredefinedRect::UNIFIEDVIEW_LAYER_AREA).contains(mouseInCell))
needMakeColumnCurrent = false;
} else {
- if ( o->rect(PredefinedRect::EYE_AREA).contains(mouseInCell)
- || o->rect(PredefinedRect::PREVIEW_LAYER_AREA).contains(mouseInCell) )
+ if (o->rect(PredefinedRect::EYE_AREA).contains(mouseInCell) ||
+ o->rect(PredefinedRect::PREVIEW_LAYER_AREA).contains(mouseInCell))
needMakeColumnCurrent = false;
}
-
+
// set the clicked column to current
- if (needMakeColumnCurrent)
- m_viewer->setCurrentColumn(m_col);
+ if (needMakeColumnCurrent) m_viewer->setCurrentColumn(m_col);
// clicking on the camera column
if (m_col < 0) {
diff --git a/toonz/sources/toonzlib/preferences.cpp b/toonz/sources/toonzlib/preferences.cpp
index c2f153c0e..ee155e57c 100644
--- a/toonz/sources/toonzlib/preferences.cpp
+++ b/toonz/sources/toonzlib/preferences.cpp
@@ -1,5 +1,4 @@
-
#include "toonz/preferences.h"
// TnzLib includes
@@ -1021,30 +1020,28 @@ QString Preferences::getCurrentLanguage() const {
QString Preferences::getCurrentStyleSheet() const {
QString currentStyleSheetName = getStringValue(CurrentStyleSheetName);
if (currentStyleSheetName.isEmpty()) return QString();
+
TFilePath path(TEnv::getConfigDir() + "qss");
QString string = currentStyleSheetName + QString("/") +
currentStyleSheetName + QString(".qss");
QString styleSheetPath = path.getQString() + "/" + string;
- QString additionalSheetStr = getStringValue(additionalStyleSheet);
- // if there is no additional style sheet, return the path and let
- // Qt to load and parse it
- if (additionalSheetStr.isEmpty()) return QString("file:///" + styleSheetPath);
-
- // if there is any additional style sheet, load the style sheet
- // from the file and combine with it
QString styleSheetStr;
+
+ // Always read the main stylesheet from the file
QFile f(styleSheetPath);
if (f.open(QFile::ReadOnly | QFile::Text)) {
QTextStream ts(&f);
styleSheetStr = ts.readAll();
}
- styleSheetStr += additionalSheetStr;
- // here we will convert all relative paths to absolute paths
- // or Qt will look for images relative to the current working directory
- // since it has no idea where the style sheet comes from.
+ // Append additional stylesheet if provided
+ QString additionalSheetStr = getStringValue(additionalStyleSheet);
+ if (!additionalSheetStr.isEmpty()) {
+ styleSheetStr += additionalSheetStr;
+ }
+ // Fix relative paths in stylesheets
QString currentStyleFolderPath =
path.getQString().replace("\\", "/") + "/" + currentStyleSheetName;
diff --git a/toonz/sources/toonzqt/functionsheet.cpp b/toonz/sources/toonzqt/functionsheet.cpp
index 9fcb1e299..e8ca16e2b 100644
--- a/toonz/sources/toonzqt/functionsheet.cpp
+++ b/toonz/sources/toonzqt/functionsheet.cpp
@@ -196,18 +196,11 @@ FunctionSheetButtonArea::FunctionSheetButtonArea(QWidget *parent)
m_syncSizeBtn = new QPushButton("", this);
m_syncSizeBtn->setCheckable(true);
m_syncSizeBtn->setFixedSize(20, 20);
- static QPixmap syncScaleImg = generateIconPixmap("syncscale");
- QPixmap offPm(17, 17);
- offPm.fill(Qt::transparent);
- {
- QPainter p(&offPm);
- p.setOpacity(0.7);
- p.drawPixmap(0, 0, syncScaleImg);
- }
- QIcon icon;
- icon.addPixmap(offPm);
- icon.addPixmap(syncScaleImg, QIcon::Normal, QIcon::On);
+
+ // Create icon
+ QIcon icon(createQIcon("syncscale"));
m_syncSizeBtn->setIcon(icon);
+ m_syncSizeBtn->setIconSize(QSize(16, 16));
m_syncSizeBtn->setToolTip(tr("Toggle synchronizing zoom with xsheet"));
diff --git a/toonz/sources/toonzqt/functiontreeviewer.cpp b/toonz/sources/toonzqt/functiontreeviewer.cpp
index 38b9e98c5..99e9b54e7 100644
--- a/toonz/sources/toonzqt/functiontreeviewer.cpp
+++ b/toonz/sources/toonzqt/functiontreeviewer.cpp
@@ -151,20 +151,20 @@ QVariant FunctionTreeModel::ChannelGroup::data(int role) const {
bool ignored = (animated) ? isIgnored() : false;
if (active) {
- static QIcon folderAnimOpen(createQIcon("folder_anim_on", true));
- static QIcon folderAnimClose(createQIcon("folder_anim", true));
- static QIcon folderOpen(createQIcon("folder_on", true));
- static QIcon folderClose(createQIcon("folder", true));
+ static QIcon folderAnimOpen(createQIcon("folder_anim_on"));
+ static QIcon folderAnimClose(createQIcon("folder_anim"));
+ static QIcon folderOpen(createQIcon("folder_on"));
+ static QIcon folderClose(createQIcon("folder"));
static QIcon ignoredOn(":Resources/paramignored_on.svg");
return animated ? (isOpen() ? folderAnimOpen
: (ignored ? ignoredOn : folderAnimClose))
: (isOpen() ? folderOpen : folderClose);
} else {
- static QIcon folderAnimOpen(createQIcon("folder_anim_inactive_on", true));
- static QIcon folderAnimClose(createQIcon("folder_anim_inactive", true));
- static QIcon folderOpen(createQIcon("folder_inactive_on", true));
- static QIcon folderClose(createQIcon("folder_inactive", true));
+ static QIcon folderAnimOpen(createQIcon("folder_anim_inactive_on"));
+ static QIcon folderAnimClose(createQIcon("folder_anim_inactive"));
+ static QIcon folderOpen(createQIcon("folder_inactive_on"));
+ static QIcon folderClose(createQIcon("folder_inactive"));
static QIcon ignoredOff(":Resources/paramignored_off.svg");
return animated ? (isOpen() ? folderAnimOpen
@@ -359,20 +359,20 @@ QVariant FxChannelGroup::data(int role) const {
}
bool ignored = (isAnimated) ? isIgnored() : false;
if (isOneChildActive) {
- static QIcon folderAnimOpen(createQIcon("folder_anim_on", true));
- static QIcon folderAnimClose(createQIcon("folder_anim", true));
- static QIcon folderOpen(createQIcon("folder_on", true));
- static QIcon folderClose(createQIcon("folder", true));
+ static QIcon folderAnimOpen(createQIcon("folder_anim_on"));
+ static QIcon folderAnimClose(createQIcon("folder_anim"));
+ static QIcon folderOpen(createQIcon("folder_on"));
+ static QIcon folderClose(createQIcon("folder"));
static QIcon ignoredOn(":Resources/paramignored_on.svg");
return isAnimated ? (isOpen() ? folderAnimOpen
: (ignored ? ignoredOn : folderAnimClose))
: (isOpen() ? folderOpen : folderClose);
} else {
- static QIcon folderAnimOpen(createQIcon("folder_anim_inactive_on", true));
- static QIcon folderAnimClose(createQIcon("folder_anim_inactive", true));
- static QIcon folderOpen(createQIcon("folder_inactive_on", true));
- static QIcon folderClose(createQIcon("folder_inactive", true));
+ static QIcon folderAnimOpen(createQIcon("folder_anim_inactive_on"));
+ static QIcon folderAnimClose(createQIcon("folder_anim_inactive"));
+ static QIcon folderOpen(createQIcon("folder_inactive_on"));
+ static QIcon folderClose(createQIcon("folder_inactive"));
static QIcon ignoredOff(":Resources/paramignored_off.svg");
return isAnimated ? (isOpen() ? folderAnimOpen
diff --git a/toonz/sources/toonzqt/gutil.cpp b/toonz/sources/toonzqt/gutil.cpp
index 1fba57fd1..ec780f046 100644
--- a/toonz/sources/toonzqt/gutil.cpp
+++ b/toonz/sources/toonzqt/gutil.cpp
@@ -19,10 +19,12 @@
// Qt includes
#include <QDirIterator>
#include <QPixmap>
+#include <QPixmapCache>
#include <QImage>
#include <QPainter>
#include <QPainterPath>
#include <QIcon>
+#include <QIconEngine>
#include <QString>
#include <QApplication>
#include <QMouseEvent>
@@ -32,6 +34,7 @@
#include <QFileInfo>
#include <QDesktopWidget>
#include <QSvgRenderer>
+#include <QRegularExpression>
#include <QScreen>
#include <QWindow>
#include <QDebug>
@@ -197,7 +200,6 @@ int getDevicePixelRatio(const QWidget *widget) {
//-----------------------------------------------------------------------------
-// Calculate render params for use by svgToImage() and svgToPixmap()
SvgRenderParams calculateSvgRenderParams(const QSize &desiredSize,
QSize &imageSize,
Qt::AspectRatioMode aspectRatioMode) {
@@ -277,9 +279,7 @@ QImage svgToImage(const QString &svgFilePath, QSize size,
return QImage();
}
- static int devPixRatio = getHighestDevicePixelRatio();
-
- QSize imageSize = svgRenderer.defaultSize() * devPixRatio;
+ QSize imageSize = !size.isEmpty() ? size : svgRenderer.defaultSize();
SvgRenderParams params =
calculateSvgRenderParams(size, imageSize, aspectRatioMode);
QImage image(params.size, QImage::Format_ARGB32_Premultiplied);
@@ -287,7 +287,7 @@ QImage svgToImage(const QString &svgFilePath, QSize size,
image.fill(bgColor);
if (!painter.begin(&image)) {
- qDebug() << "Failed to begin QPainter on image";
+ qDebug() << "Failed to begin QPainter on image:" << svgFilePath;
return QImage();
}
@@ -298,258 +298,68 @@ QImage svgToImage(const QString &svgFilePath, QSize size,
//-----------------------------------------------------------------------------
-// Change the opacity of a QImage (0.0 - 1.0)
-QImage adjustImageOpacity(const QImage &input, qreal opacity) {
- if (input.isNull()) return QImage();
-
- QImage result(input.size(), QImage::Format_ARGB32_Premultiplied);
-
- QPainter painter(&result);
- if (!painter.isActive()) return QImage();
-
- painter.setCompositionMode(QPainter::CompositionMode_Source);
- painter.fillRect(result.rect(), Qt::transparent);
- painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
- painter.drawImage(0, 0, input);
- painter.setCompositionMode(QPainter::CompositionMode_DestinationIn);
- painter.fillRect(
- result.rect(),
- QColor(0, 0, 0, qBound(0, static_cast<int>(opacity * 255), 255)));
- painter.end();
-
- return result;
-}
-
-//-----------------------------------------------------------------------------
-
-// Resizes a QImage, if scaleInput is true then input image will scale according
-// to newSize otherwise the input image will be centered and not scaled
-QImage compositeImage(const QImage &input, QSize newSize, bool scaleInput,
- QColor bgColor) {
+QImage colorizeBlackPixels(const QImage &input, const QColor color) {
if (input.isNull()) return QImage();
+ if (!color.isValid()) return input;
- int devPixRatio = getHighestDevicePixelRatio();
-
- int w, h, x = 0, y = 0;
- if (newSize.isEmpty()) {
- w = input.width();
- h = input.height();
- } else {
- w = newSize.width() * devPixRatio;
- h = newSize.height() * devPixRatio;
- if (!scaleInput) {
- x = (w - input.width()) / 2;
- y = (h - input.height()) / 2;
+ QImage image = input.convertToFormat(QImage::Format_ARGB32);
+ QRgb targetColor = color.rgb();
+ int height = image.height();
+ int width = image.width();
+ for (int y = 0; y < height; ++y) {
+ QRgb *pixel = reinterpret_cast<QRgb *>(image.scanLine(y));
+ QRgb *end = pixel + width;
+ for (; pixel != end; ++pixel) {
+ if (qGray(*pixel) == 0) {
+ *pixel = (targetColor & 0x00FFFFFF) | (qAlpha(*pixel) << 24);
+ }
}
}
- QImage newImage(w, h, QImage::Format_ARGB32_Premultiplied);
- newImage.fill(bgColor);
-
- if (scaleInput) {
- return input.scaled(w, h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
- } else {
- QPainter painter(&newImage);
- if (!painter.isActive()) return QImage();
- painter.drawImage(QPoint(x, y), input);
- painter.end();
-
- return newImage;
- }
-}
-
-//-----------------------------------------------------------------------------
-
-// Convert QImage to QPixmap and set device pixel ratio
-QPixmap convertImageToPixmap(const QImage &image) {
- if (image.isNull()) return QPixmap();
-
- QPixmap pixmap(QPixmap::fromImage(image));
- int devPixRatio = getHighestDevicePixelRatio();
- pixmap.setDevicePixelRatio(devPixRatio);
-
- return pixmap;
-}
-
-//-----------------------------------------------------------------------------
-
-// Load, theme colorize and change opacity of an icon image
-QImage generateIconImage(const QString &iconSVGName, qreal opacity,
- QSize newSize, Qt::AspectRatioMode aspectRatioMode) {
- static ThemeManager &themeManager = ThemeManager::getInstance();
-
- if (iconSVGName.isEmpty() || !themeManager.hasIcon(iconSVGName)) {
- return QImage();
- }
-
- int devPixRatio = getHighestDevicePixelRatio();
- newSize *= devPixRatio;
-
- // Path to icon image
- const QString imgPath = themeManager.getIconPath(iconSVGName);
-
- // Convert SVG to QImage
- QImage image(svgToImage(imgPath, newSize, aspectRatioMode));
-
- // Colorize QImage
- image = themeManager.recolorBlackPixels(image);
-
- // Change opacity if required
- if (opacity != qreal(1.0)) image = adjustImageOpacity(image, opacity);
-
return image;
}
//-----------------------------------------------------------------------------
-// Load, theme colorize and change opacity of an icon image file
-QPixmap generateIconPixmap(const QString &iconSVGName, qreal opacity,
- QSize newSize, Qt::AspectRatioMode aspectRatioMode) {
- QImage image =
- generateIconImage(iconSVGName, opacity, newSize, aspectRatioMode);
- return convertImageToPixmap(image);
-}
-
-//-----------------------------------------------------------------------------
+// Expand area around pixmap and center it
+QPixmap expandPixmap(const QPixmap &pixmap, const QSize &expandSize,
+ QColor bgColor) {
+ if (pixmap.isNull()) return QPixmap();
+ if (pixmap.size() == expandSize) return pixmap;
-// Process and populate all modes and states of a QIcon
-void addImagesToIcon(QIcon &icon, const QImage &baseImg, const QImage &overImg,
- const QImage &onImg, bool useFullOpacity) {
- if (baseImg.isNull()) return;
+ // Get DPR from pixmap
+ qreal dpr = pixmap.devicePixelRatioF();
- ThemeManager &themeManager = ThemeManager::getInstance();
- const qreal offOpacity = useFullOpacity ? 1.0 : themeManager.getOffOpacity();
- const qreal onOpacity = themeManager.getOnOpacity();
- const qreal disabledOpacity = themeManager.getDisabledOpacity();
+ // Create a new pixmap with the specified size in pixels
+ QPixmap expandedPixmap(expandSize);
+ expandedPixmap.setDevicePixelRatio(dpr);
- // Generate more images using input images for other modes and states
- QImage offImg = adjustImageOpacity(baseImg, offOpacity);
- QImage disabledImg = adjustImageOpacity(baseImg, disabledOpacity);
- QImage onDisabledImg =
- !onImg.isNull() ? adjustImageOpacity(onImg, disabledOpacity) : QImage();
+ // Fill with background color
+ expandedPixmap.fill(bgColor);
- // Convert images to pixmaps and set device pixel ratio
- QPixmap basePm(convertImageToPixmap(baseImg));
- QPixmap offPm(convertImageToPixmap(offImg));
- QPixmap disabledPm(convertImageToPixmap(disabledImg));
- QPixmap overPm(convertImageToPixmap(overImg));
- QPixmap onPm(convertImageToPixmap(onImg));
- QPixmap onDisabledPm(convertImageToPixmap(onDisabledImg));
+ // Create a painter
+ QPainter painter(&expandedPixmap);
- // Add pixmaps to icon and fallback to basePm if 'over' and 'on' are null
- icon.addPixmap(offPm, QIcon::Normal, QIcon::Off);
- icon.addPixmap(disabledPm, QIcon::Disabled, QIcon::Off);
- icon.addPixmap(!overPm.isNull() ? overPm : basePm, QIcon::Active);
- icon.addPixmap(!onPm.isNull() ? onPm : basePm, QIcon::Normal, QIcon::On);
- icon.addPixmap(!onPm.isNull() ? onDisabledPm : disabledPm, QIcon::Disabled,
- QIcon::On);
-}
+ // Calculate the centered position in pixel coordinates
+ int xPos = (expandSize.width() - pixmap.width()) / (2 * dpr);
+ int yPos = (expandSize.height() - pixmap.height()) / (2 * dpr);
-//-----------------------------------------------------------------------------
+ // Draw the original pixmap
+ painter.drawPixmap(xPos, yPos, pixmap);
-void addSpecifiedSizedImageToIcon(QIcon &icon, const char *iconSVGName,
- QSize newSize) {
- static int devPixRatio = getHighestDevicePixelRatio();
- newSize *= devPixRatio;
-
- // Construct icon filenames
- QString iconName = QString::fromUtf8(iconSVGName);
- QString overIconName = iconName + "_over";
- QString onIconName = iconName + "_on";
-
- // Generate icon images
- QImage baseImg = generateIconImage(iconName, 1.0, newSize);
- QImage overImg = generateIconImage(overIconName, 1.0, newSize);
- QImage onImg = generateIconImage(onIconName, 1.0, newSize);
-
- // Add newly sized images to the icon
- addImagesToIcon(icon, baseImg, overImg, onImg);
+ return expandedPixmap;
}
//-----------------------------------------------------------------------------
-// Add the same pixmap to all modes and states of a QIcon
-void addPixmapToAllModesAndStates(QIcon &icon, const QPixmap &pixmap) {
- QIcon::Mode modes[] = {QIcon::Normal, QIcon::Disabled, QIcon::Selected};
- QIcon::State states[] = {QIcon::On, QIcon::Off};
-
- for (const auto &mode : modes) {
- for (const auto &state : states) {
- icon.addPixmap(pixmap, mode, state);
- }
- }
- icon.addPixmap(pixmap, QIcon::Active, QIcon::Off);
-}
-
-//-----------------------------------------------------------------------------
-
-/// @brief Return a themed icon
-/// @param iconSVGName Name of the icon (SVG file base name)
-/// @param useFullOpacity If true the icon will be max brightness
-/// @param isForMenuItem For special handling of menu icons
-/// @param newSize Render the SVG images of the icon at the specified size
-/// @return QIcon
-QIcon createQIcon(const QString &iconSVGName, bool useFullOpacity,
- bool isForMenuItem, QSize newSize) {
- static ThemeManager &themeManager = ThemeManager::getInstance();
- if (iconSVGName.isEmpty() || !themeManager.hasIcon(iconSVGName)) {
- // Use debug to check if something calls for an icon that doesn't exist
- // qDebug () << "File not found:" << iconSVGName;
+QIcon createQIcon(const QString &iconName, bool isForMenuItem, qreal dpr,
+ QSize newSize) {
+ if (iconName.isEmpty() || !ThemeManager::getInstance().hasIcon(iconName)) {
+ // qWarning() << "No icon with name " << iconName << " exists.";
return QIcon();
}
- // Full opacity for color level icons
- if (iconSVGName.contains("new_toonz_raster_level") ||
- iconSVGName.contains("new_vector_level") ||
- iconSVGName.contains("new_raster_level") ||
- iconSVGName.contains("new_note_level")) {
- useFullOpacity = true;
- }
-
- static int devPixRatio = getHighestDevicePixelRatio();
-
- QImage baseImg(generateIconImage(iconSVGName, qreal(1.0), newSize));
- QImage overImg(generateIconImage(iconSVGName + "_over", qreal(1.0), newSize));
- QImage onImg(generateIconImage(iconSVGName + "_on", qreal(1.0), newSize));
-
- QIcon icon;
-
- // START_BUG_WORKAROUND: #20230627
- // Set an empty pixmap for menu icons when hiding icons from menus is true,
- // search bug ID for more info.
-#ifdef _WIN32
- bool showIconInMenu = Preferences::instance()->getBoolValue(showIconsInMenu);
- if (isForMenuItem && baseImg.width() == (16 * devPixRatio) &&
- baseImg.height() == (16 * devPixRatio) && !showIconInMenu) {
- static QPixmap emptyPm(16 * devPixRatio, 16 * devPixRatio);
- emptyPm.fill(Qt::transparent);
- addPixmapToAllModesAndStates(icon, emptyPm);
- } else
-#endif // END_BUG_WORKAROUND
- {
- addImagesToIcon(icon, baseImg, overImg, onImg, useFullOpacity);
- }
-
- // For tool bars we draw menu sized icons onto tool bar sized images otherwise
- // there can be scaling artifacts with high dpi and load these in addition
- if (baseImg.width() == (16 * devPixRatio) &&
- baseImg.height() == (16 * devPixRatio)) {
- for (auto screen : QApplication::screens()) {
- QSize expandSize(20, 20);
- int otherDevPixRatio = screen->devicePixelRatio();
- if (otherDevPixRatio != devPixRatio) {
- expandSize.setWidth(16 * otherDevPixRatio);
- expandSize.setHeight(16 * otherDevPixRatio);
- }
- QImage toolBaseImg(compositeImage(baseImg, expandSize));
- QImage toolOverImg(compositeImage(overImg, expandSize));
- QImage toolOnImg(compositeImage(onImg, expandSize));
- addImagesToIcon(icon, toolBaseImg, toolOverImg, toolOnImg,
- useFullOpacity);
- }
- }
-
- return icon;
+ return QIcon(new SvgIconEngine(iconName, isForMenuItem, dpr, newSize));
}
//-----------------------------------------------------------------------------
@@ -589,10 +399,10 @@ QIcon createQIconOnOffPNG(const char *iconPNGName, bool withOver) {
QIcon createTemporaryIconFromName(const char *commandName) {
const int visibleIconSize = 20;
- const int menubarIconSize = 16;
QString name(commandName);
QList<QChar> iconChar;
+ // Extract up to 2 characters from the command name
for (int i = 0; i < name.length(); i++) {
QChar c = name.at(i);
if (c.isUpper() && iconChar.size() < 2)
@@ -613,44 +423,51 @@ QIcon createTemporaryIconFromName(const char *commandName) {
QString iconStr;
for (auto c : iconChar) iconStr.append(c);
- QIcon icon;
- // Prepare for both normal and high dpi
- for (int devPixelRatio = 1; devPixelRatio <= 2; devPixelRatio++) {
- QImage transparentImg(menubarIconSize * devPixelRatio,
- menubarIconSize * devPixelRatio,
- QImage::Format_ARGB32);
- transparentImg.fill(Qt::transparent);
-
- int pxSize = visibleIconSize * devPixelRatio;
-
- QImage charImg(pxSize, pxSize, QImage::Format_ARGB32_Premultiplied);
- QPainter painter;
- charImg.fill(Qt::transparent);
- painter.begin(&charImg);
-
- painter.setPen(Preferences::instance()->getIconTheme() ? Qt::black
- : Qt::white);
-
- QRect rect(0, -2, pxSize, pxSize);
- if (iconStr.size() == 2) {
- painter.scale(0.6, 1.0);
- rect.setRight(pxSize / 0.6);
- }
- QFont font = painter.font();
- font.setPixelSize(pxSize);
- painter.setFont(font);
- painter.drawText(rect, Qt::AlignCenter, iconStr);
+ QColor textColor = Qt::black;
- painter.end();
+ // Create the image with the characters
+ int devPixelRatio = 2; // Using highest DPR for best quality
+ int pxSize = visibleIconSize * devPixelRatio;
+ QImage charImg(pxSize, pxSize, QImage::Format_ARGB32_Premultiplied);
+ charImg.fill(Qt::transparent);
- // For menu only
- addPixmapToAllModesAndStates(icon, QPixmap::fromImage(transparentImg));
+ QPainter painter(&charImg);
+ painter.setPen(textColor);
- // For toolbars
- addImagesToIcon(icon, charImg);
+ QRect rect(0, -2, pxSize, pxSize);
+ if (iconStr.size() == 2) {
+ painter.scale(0.6, 1.0);
+ rect.setRight(pxSize / 0.6);
}
- return icon;
+ QFont font = painter.font();
+ font.setPixelSize(pxSize);
+ painter.setFont(font);
+ painter.drawText(rect, Qt::AlignCenter, iconStr);
+ painter.end();
+
+ return QIcon(new SvgIconEngine(iconStr, charImg));
+}
+
+//-----------------------------------------------------------------------------
+
+QImage adjustImageOpacity(const QImage &input, qreal opacity) {
+ if (input.isNull()) return QImage();
+ if (opacity == 1.0) return input;
+
+ QImage result(input.size(), QImage::Format_ARGB32_Premultiplied);
+ QPainter painter(&result);
+ if (!painter.isActive()) return QImage();
+
+ painter.setCompositionMode(QPainter::CompositionMode_Source);
+ painter.fillRect(result.rect(), Qt::transparent);
+ painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
+ painter.drawImage(0, 0, input);
+ painter.setCompositionMode(QPainter::CompositionMode_DestinationIn);
+ painter.fillRect(result.rect(),
+ QColor(0, 0, 0, qBound(0, qRound(opacity * 255), 255)));
+
+ return result;
}
//-----------------------------------------------------------------------------
@@ -845,8 +662,6 @@ TabBarContainter::TabBarContainter(QWidget *parent) : QFrame(parent) {
void TabBarContainter::paintEvent(QPaintEvent *event) {
QPainter p(this);
- p.setPen(getBottomAboveLineColor());
- p.drawLine(0, height() - 2, width(), height() - 2);
p.setPen(getBottomBelowLineColor());
p.drawLine(0, height() - 1, width(), height() - 1);
}
@@ -871,24 +686,66 @@ QString operator+(const QString &a, const TFilePath &fp) {
}
//=============================================================================
-// Theme Manager
+// QPixmapCache
+
//-----------------------------------------------------------------------------
-class ThemeManager::ThemeManagerImpl {
-public:
- QMap<QString, QString> m_iconPaths;
- qreal m_onOpacity = 1.0;
- qreal m_offOpacity = 0.8;
- qreal m_disabledOpacity = 0.3;
-};
+static QMutex s_cacheMutex;
+
+QString generateCacheKey(const QString &keyName, const QSize &size,
+ QIcon::Mode mode, QIcon::State state) {
+ static QString modeNames[] = {"Normal", "Disabled", "Active", "Selected"};
+ static QString stateNames[] = {"Off", "On"};
+
+ return QString("%1_%2x%3_%4_%5")
+ .arg(keyName)
+ .arg(size.width())
+ .arg(size.height())
+ .arg(modeNames[mode])
+ .arg(stateNames[state]);
+}
//-----------------------------------------------------------------------------
-ThemeManager::ThemeManager() : impl(new ThemeManagerImpl) {}
+void addToPixmapCache(const QString &key, const QPixmap &pixmap) {
+ if (!pixmap.isNull()) {
+ QMutexLocker locker(&s_cacheMutex);
+ QPixmapCache::insert(key, pixmap);
+ } else {
+ qWarning() << "Cannot add empty pixmap to QPixmapCache";
+ }
+}
+
+//-----------------------------------------------------------------------------
+
+QPixmap getFromPixmapCache(const QString &key) {
+ QMutexLocker locker(&s_cacheMutex);
+ QPixmap pm;
+ if (QPixmapCache::find(key, &pm)) {
+ return pm;
+ } else {
+ return QPixmap();
+ }
+}
+
+//-----------------------------------------------------------------------------
+
+void clearQPixmapCache() {
+ QPixmapCache::clear();
+ qDebug() << "Global QPixmapCache cleared";
+}
+
+//=============================================================================
+// ThemeManager
+
+QString getIconPath(const QString &iconSVGName) {
+ ThemeManager &themeManager = ThemeManager::getInstance();
+ return themeManager.getIconPath(iconSVGName);
+}
//-----------------------------------------------------------------------------
-ThemeManager::~ThemeManager() {}
+ThemeManager::ThemeManager() {}
//-----------------------------------------------------------------------------
@@ -899,120 +756,498 @@ ThemeManager &ThemeManager::getInstance() {
//-----------------------------------------------------------------------------
-// Populate a QMap with icon filepaths and assign their basename as the key
-void ThemeManager::buildIconPathsMap(const QString &path) {
+void ThemeManager::initialize() { preloadIconMetadata(":/icons"); }
+
+//-----------------------------------------------------------------------------
+
+void ThemeManager::updateThemeColor() {
+ // Base icon colors
+ setIconBaseColor(QColor(getCustomProperty("icon-base-color")));
+ setIconActiveColor(QColor(getCustomProperty("icon-active-color")));
+ setIconOnColor(QColor(getCustomProperty("icon-on-color")));
+ setIconSelectedColor(QColor(getCustomProperty("icon-selected-color")));
+
+ // Individual icon colors
+ setIconCloseColor(QColor(getCustomProperty("icon-close-color")));
+ setIconPreviewColor(QColor(getCustomProperty("icon-preview-color")));
+ setIconLockColor(QColor(getCustomProperty("icon-lock-color")));
+
+ // Keyframe icon colors
+ setIconKeyframeColor(QColor(getCustomProperty("icon-keyframe-color")));
+ setIconKeyframeModifiedColor(
+ QColor(getCustomProperty("icon-keyframe-modified-color")));
+
+ // Viewer check icon colors
+ setIconVCheckColor(QColor(getCustomProperty("icon-vcheck-color")));
+
+ // Invalidate cache to force re-rendering of icons
+ clearQPixmapCache();
+}
+
+//-----------------------------------------------------------------------------
+
+// Fetch icon SVG metadata
+void ThemeManager::preloadIconMetadata(const QString &path) {
+ qDebug() << "[ThemeManager:::preloadIconMetadata] STARTED with path:" << path;
+
QDir dir(path);
- if (!dir.exists(path)) {
- qDebug() << "Resource path does not exist:" << path;
+ if (!dir.exists()) {
+ qWarning() << "[ThemeManager] Resource path does not exist:" << path;
return;
}
- QDirIterator it(path,
- QStringList() << "*.svg"
- << "*.png",
- QDir::Files, QDirIterator::Subdirectories);
+ QDirIterator it(path, {"*.svg", "*.png"}, QDir::Files,
+ QDirIterator::Subdirectories);
+
+ static const QStringList states = {"on", "over"};
+ static const QRegularExpression stateRegex(R"((.+)_(on|over)$)");
while (it.hasNext()) {
it.next();
+ const QFileInfo fileInfo = it.fileInfo();
+ const QString iconPath = fileInfo.filePath();
+ const QString fileName = fileInfo.baseName(); // "name", "name_on", etc.
+
+ QString iconName = fileName;
+ QString state;
+
+ // Check if the file matches a known state pattern
+ QRegularExpressionMatch match = stateRegex.match(fileName);
+ if (match.hasMatch()) {
+ iconName = match.captured(1); // Extract base icon name
+ state = match.captured(2); // Extract state
+ }
+
+ // Store the icon path in m_iconPaths
+ if (!m_iconPaths.contains(fileName)) {
+ m_iconPaths.insert(fileName, iconPath);
+
+ // Extract and store the icon size from dir path
+ QSize iconSize = parseIconSize(iconPath);
+ m_iconSizes.insert(iconName, iconSize);
+
+ // Check if this is a menu icon (16x16)
+ if (iconSize.width() == 16 && iconSize.height() == 16) {
+ m_menuIcons.insert(iconName, true);
+ }
+
+ // Check if this is a colored icon
+ if (parseIsColored(iconPath)) {
+ m_coloredIcons.insert(iconName, true);
+ }
+ }
+ }
+}
+
+//-----------------------------------------------------------------------------
+
+QString ThemeManager::getIconPath(const QString &iconBaseName, QIcon::Mode mode,
+ QIcon::State state) const {
+ if (!hasIcon(iconBaseName)) return QString();
+
+ QString suffix;
+ if (state == QIcon::On)
+ suffix = "_on";
+ else if (mode == QIcon::Active)
+ suffix = "_over";
+
+ QString fullName = iconBaseName + suffix;
+ if (m_iconPaths.contains(fullName)) return m_iconPaths[fullName];
+ if (m_iconPaths.contains(iconBaseName)) return m_iconPaths[iconBaseName];
+
+ qWarning() << "Icon not found:" << iconBaseName;
+ return QString();
+}
+
+//-----------------------------------------------------------------------------
+
+QSize ThemeManager::parseIconSize(const QString &iconPath) const {
+ // Match pattern like "16x16" in dir path
+ static const QRegularExpression sizeRegex(R"(/(\d+)x(\d+)/)");
+
+ QRegularExpressionMatch match = sizeRegex.match(iconPath);
+ if (match.hasMatch()) {
+ return QSize(match.captured(1).toInt(), match.captured(2).toInt());
+ }
+
+ qWarning() << "Could not parse size from path:" << iconPath;
+ return QSize(16, 16); // Fallback
+}
+
+//-----------------------------------------------------------------------------
+
+bool ThemeManager::parseIsColored(const QString &iconPath) const {
+ // Check if the path contains "colored"
+ static const QRegularExpression coloredRegex(R"(/colored/)");
- const QString iconPath = it.fileInfo().filePath();
- const QString iconName = it.fileInfo().baseName();
+ return coloredRegex.match(iconPath).hasMatch();
+}
+
+//-----------------------------------------------------------------------------
+
+bool ThemeManager::isColoredIcon(const QString &iconName) const {
+ QString baseName = iconName;
+ if (baseName.endsWith("_on") || baseName.endsWith("_over")) {
+ baseName = baseName.left(baseName.lastIndexOf('_'));
+ }
+ return m_coloredIcons.contains(baseName);
+}
+
+//-----------------------------------------------------------------------------
- if (!impl->m_iconPaths.contains(iconName)) {
- impl->m_iconPaths.insert(iconName, iconPath);
- } else {
- qDebug() << "Icon with file name already exists in iconPaths, ensure "
- "icons have unique file names:"
- << "\nCurrently added:" << getIconPath(iconName)
- << "\nTried to add:" << iconPath;
+// Parse custom properties from stylesheet to this format:
+// :TOONZCOLORS { -custom-property: black; }
+// Then get with: getCustomProperty(QColor("custom-property"));
+void ThemeManager::parseCustomPropertiesFromStylesheet(
+ const QString &styleSheet) {
+ QRegularExpression rootRegex(R"(:TOONZCOLORS\s*\{([^}]*)\})");
+ QRegularExpressionMatchIterator rootMatches =
+ rootRegex.globalMatch(styleSheet);
+
+ while (rootMatches.hasNext()) {
+ QRegularExpressionMatch rootMatch = rootMatches.next();
+ QString rootContent = rootMatch.captured(1); // Extract block content
+
+ QRegularExpression propertyRegex(R"(-([a-zA-Z0-9-]+):\s*([^;]+);)");
+ QRegularExpressionMatchIterator propertyMatches =
+ propertyRegex.globalMatch(rootContent);
+
+ while (propertyMatches.hasNext()) {
+ QRegularExpressionMatch propMatch = propertyMatches.next();
+ QString propertyName = propMatch.captured(1);
+ QString propertyValue = propMatch.captured(2).trimmed();
+
+ // Set or override the property
+ setCustomProperty(propertyName, propertyValue);
}
}
+
+ updateThemeColor();
+}
+
+//-----------------------------------------------------------------------------
+
+void ThemeManager::setCustomProperty(const QString &name,
+ const QString &value) {
+ m_customProperties[name] = value;
}
//-----------------------------------------------------------------------------
-// Get the full filepath of an icon image by basename
-QString ThemeManager::getIconPath(const QString &iconName) const {
- return impl->m_iconPaths.value(iconName);
+QString ThemeManager::getCustomProperty(const QString &name) const {
+ return m_customProperties.value(name, QString());
+}
+
+//-----------------------------------------------------------------------------
+
+QSize ThemeManager::getIconSize(const QString &iconName) const {
+ QString baseName = iconName;
+ if (baseName.endsWith("_on") || baseName.endsWith("_over")) {
+ baseName = baseName.left(baseName.lastIndexOf('_'));
+ }
+ return m_iconSizes.value(baseName, QSize());
}
//-----------------------------------------------------------------------------
-// Boolean to check if iconName is contained within the iconPaths QMap
bool ThemeManager::hasIcon(const QString &iconName) const {
- return impl->m_iconPaths.contains(iconName);
+ return m_iconPaths.contains(iconName);
}
//-----------------------------------------------------------------------------
-qreal ThemeManager::getOnOpacity() const { return impl->m_onOpacity; }
+bool ThemeManager::isMenuIcon(const QString &iconName) const {
+ QString baseName = iconName;
+ if (baseName.endsWith("_on") || baseName.endsWith("_over")) {
+ baseName = baseName.left(baseName.lastIndexOf('_'));
+ }
+ return m_menuIcons.contains(baseName);
+}
+
+//=============================================================================
+// SvgIconEngine
//-----------------------------------------------------------------------------
-qreal ThemeManager::getOffOpacity() const { return impl->m_offOpacity; }
+// Regular icon
+SvgIconEngine::SvgIconEngine(const QString &iconName, bool isForMenuItem,
+ qreal dpr, QSize newSize)
+ : m_iconName(iconName)
+ , m_isForMenuItem(isForMenuItem)
+ , m_isTemporaryCommandIcon(false)
+ , m_dpr(dpr > 0.0 ? dpr : getHighestDevicePixelRatio())
+ , m_iconSize(newSize) {
+ ThemeManager &tm = ThemeManager::getInstance();
+
+ m_isMenuIcon = tm.isMenuIcon(iconName);
+ m_isColored = tm.isColoredIcon(iconName);
+}
//-----------------------------------------------------------------------------
-qreal ThemeManager::getDisabledOpacity() const {
- return impl->m_disabledOpacity;
+// For temporary icon with command name only
+SvgIconEngine::SvgIconEngine(const QString &commandName, const QImage image)
+ : SvgIconEngine("") {
+ m_iconName = commandName;
+ m_isTemporaryCommandIcon = true;
+ m_image = image;
}
//-----------------------------------------------------------------------------
-// Colorize black pixels in a QImage while retaining other colors, however be
-// mindful that if black pixels overlap color pixels it can cause artifacting
-QImage ThemeManager::recolorBlackPixels(const QImage &input, QColor color) {
- if (input.isNull() || color == Qt::black) return QImage();
+QIconEngine *SvgIconEngine::clone() const {
+ if (!m_iconName.isEmpty()) { // Regular icon
+ return new SvgIconEngine(m_iconName, m_isForMenuItem, m_dpr, m_iconSize);
+ } else { // For temporary command icon images
+ return new SvgIconEngine(m_iconName, m_image);
+ }
+}
- // Default is icon theme color
- if (!color.isValid())
- color = Preferences::instance()->getIconTheme() ? Qt::black : Qt::white;
+//-----------------------------------------------------------------------------
- QImage image = input.convertToFormat(QImage::Format_ARGB32);
- QRgb targetColor = color.rgb();
- int height = image.height();
- int width = image.width();
- for (int y = 0; y < height; ++y) {
- QRgb *pixel = reinterpret_cast<QRgb *>(image.scanLine(y));
- QRgb *end = pixel + width;
- for (; pixel != end; ++pixel) {
- if (qGray(*pixel) == 0) {
- *pixel = (targetColor & 0x00FFFFFF) | (qAlpha(*pixel) << 24);
- }
- }
+// Determine icon theme color (or individual color) for mode/state
+QColor SvgIconEngine::getThemeColor(const QString &iconName, QIcon::Mode mode,
+ QIcon::State state) {
+ ThemeManager &tm = ThemeManager::getInstance();
+
+ // Check for unique first
+ QColor color = getUniqueIconColor(iconName, mode, state);
+ if (color.isValid()) return color;
+
+ // Regular
+ if (state == QIcon::On) return tm.getIconOnColor();
+ if (mode == QIcon::Active) return tm.getIconActiveColor();
+ if (mode == QIcon::Selected) return tm.getIconSelectedColor();
+
+ return tm.getIconBaseColor();
+}
+
+//-----------------------------------------------------------------------------
+
+// Set colors to specific icons
+QColor SvgIconEngine::getUniqueIconColor(const QString &iconName,
+ QIcon::Mode mode, QIcon::State state) {
+ ThemeManager &tm = ThemeManager::getInstance();
+
+ // Rollover mode
+ if (mode == QIcon::Active) {
+ if (iconName.contains("closewindow")) return tm.getIconCloseColor();
}
- return image;
+ // On state
+ if (state == QIcon::On) {
+ if (iconName == "preview") return tm.getIconPreviewColor();
+ if (iconName == "subpreview") return tm.getIconPreviewColor();
+
+ if (iconName.contains("freeze")) return tm.getIconLockColor();
+ if (iconName.contains("lock")) return tm.getIconLockColor();
+
+ if (iconName.contains("keyframe_partial")) return tm.getIconKeyframeColor();
+ if (iconName.contains("keyframe_modified"))
+ return tm.getIconKeyframeModifiedColor();
+ if (iconName.contains("keyframe")) return tm.getIconKeyframeColor();
+
+ if (iconName.contains("transparency_check")) return tm.getIconVCheckColor();
+ if (iconName.contains("paint_check")) return tm.getIconVCheckColor();
+ if (iconName.contains("opacity_check")) return tm.getIconVCheckColor();
+ if (iconName.contains("ink_check")) return tm.getIconVCheckColor();
+ if (iconName.contains("ink_no1_check")) return tm.getIconVCheckColor();
+ if (iconName.contains("gap_check")) return tm.getIconVCheckColor();
+ if (iconName.contains("fill_check")) return tm.getIconVCheckColor();
+ if (iconName.contains("blackbg_check")) return tm.getIconVCheckColor();
+ if (iconName.contains("inks_only")) return tm.getIconVCheckColor();
+ }
+
+ return QColor();
}
//-----------------------------------------------------------------------------
-// Colorize black pixels in a QPixmap while retaining other colors, however be
-// mindful that if black pixels overlap color pixels if can cause artifacting
-QPixmap ThemeManager::recolorBlackPixels(const QPixmap &input, QColor color) {
- if (input.isNull() || color == Qt::black) return QPixmap();
+void SvgIconEngine::paint(QPainter *painter, const QRect &rect,
+ QIcon::Mode mode, QIcon::State state) {
+ if (!painter || rect.isEmpty()) return;
- QImage image = input.toImage();
- QImage recoloredImage = recolorBlackPixels(image, color);
- QPixmap pixmap = convertImageToPixmap(recoloredImage);
+ ThemeManager &tm = ThemeManager::getInstance();
- return pixmap;
+ qreal dpr = painter->device()->devicePixelRatio();
+
+ QPixmap pm = pixmap(rect.size() * dpr, mode, state);
+ if (!pm.isNull()) {
+ //! Don't set SmoothPixmapTransform otherwise at 1x pixmaps will look blurry
+
+ pm.setDevicePixelRatio(dpr);
+
+ // Calculate the target rect to maintain aspect ratio
+ QSize pmSize = pm.size() / dpr; // Logical size of the pixmap
+ QSize scaledSize = pmSize.scaled(rect.size(), Qt::KeepAspectRatio);
+
+ // Center scaled pixmap within rect
+ int x = rect.x() + (rect.width() - scaledSize.width()) / 2;
+ int y = rect.y() + (rect.height() - scaledSize.height()) / 2;
+ QRect targetRect(QPoint(x, y), scaledSize);
+
+ painter->drawPixmap(targetRect, pm);
+ }
}
//-----------------------------------------------------------------------------
-// For debugging contents
-void ThemeManager::printiconPathsMap() {
- const QMap<QString, QString> map = impl->m_iconPaths;
- qDebug() << "Contents of QMap:";
- for (auto it = map.constBegin(); it != map.constEnd(); ++it) {
- qDebug() << it.key() << ":" << it.value();
+qreal SvgIconEngine::getOpacityForModeState(QIcon::Mode mode,
+ QIcon::State state) {
+ qreal opacity;
+ if (m_isColored) {
+ opacity = (mode == QIcon::Disabled) ? 0.4 : 1.0;
+ } else {
+ opacity = (mode == QIcon::Disabled) ? 0.4
+ : (mode == QIcon::Normal && state == QIcon::Off) ? 0.8
+ : 1.0;
}
+
+ return opacity;
}
//-----------------------------------------------------------------------------
-// Public version of ThemeManager::getIconPath()
-QString getIconPath(const QString &path) {
- return ThemeManager::getInstance().getIconPath(path);
+// Load SVG themed for mode/state
+QPixmap SvgIconEngine::loadPixmap(const QString &iconName, QIcon::Mode mode,
+ QIcon::State state, QSize physicalSize,
+ QColor color) {
+ ThemeManager &tm = ThemeManager::getInstance();
+ QString path = tm.getIconPath(iconName, mode, state);
+
+ if (physicalSize.isEmpty()) physicalSize = tm.getIconSize(iconName);
+ qreal opacity = getOpacityForModeState(mode, state);
+
+ QImage img(svgToImage(path, physicalSize));
+ img = adjustImageOpacity(colorizeBlackPixels(img, color), opacity);
+ return QPixmap::fromImage(img);
+}
+
+//-----------------------------------------------------------------------------
+
+QPixmap SvgIconEngine::pixmap(const QSize &size, QIcon::Mode mode,
+ QIcon::State state) {
+ qreal dpr = m_dpr;
+ QSize requestSize = !m_iconSize.isEmpty() ? (m_iconSize * m_dpr) : size;
+
+ // Early out for hidden menu icons
+ bool hideIcon = shouldHideIcon(m_isForMenuItem);
+ if (hideIcon && size == QSize(16 * dpr, 16 * dpr)) {
+ static QPixmap emptyPm(size);
+ emptyPm.fill(Qt::transparent);
+ return emptyPm;
+ }
+
+ // Generate cache key
+ QString cacheKey = generateCacheKey(m_iconName, requestSize, mode, state);
+ if (m_isTemporaryCommandIcon) cacheKey += "_cmdNameIcon";
+ // Check cache for pixmap
+ QPixmap cachedPm = getFromPixmapCache(cacheKey);
+ if (!cachedPm.isNull()) return cachedPm;
+
+ // --------------------------------------------------------------------------
+ // NOT FOUND: RENDER NEW PIXMAPS
+ // --------------------------------------------------------------------------
+
+ ThemeManager &tm = ThemeManager::getInstance();
+
+ // Determine icon theme color
+ QColor color =
+ m_isColored ? QColor() : getThemeColor(m_iconName, mode, state);
+
+ // Get base icon size
+ QSize baseIconLogicalSize = tm.getIconSize(m_iconName);
+ QSize baseIconPhysicalSize = baseIconLogicalSize * dpr;
+ // Menu and Toolbar size
+ QSize menuIconPhysicalSize(16 * dpr, 16 * dpr);
+ QSize toolbarIconPhysicalSize = getBestToolbarSizeByDpr(size);
+
+ QPixmap renderedPm;
+
+ //---------- Temmporary command icons by name abbreviation
+ if (m_isTemporaryCommandIcon && size != menuIconPhysicalSize) {
+ QImage adjusted = adjustImageOpacity(colorizeBlackPixels(m_image, color),
+ getOpacityForModeState(mode, state));
+ // Scale to physical size
+ renderedPm = QPixmap::fromImage(adjusted).scaled(
+ requestSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
+ }
+
+ //---------- Menu command icons (toolbar-sized request but is a menu icon)
+ else if (requestSize == toolbarIconPhysicalSize && m_isMenuIcon) {
+ QPixmap loadedPm =
+ loadPixmap(m_iconName, mode, state, baseIconPhysicalSize, color)
+ .scaled(toolbarIconPhysicalSize * 0.8, Qt::KeepAspectRatio,
+ Qt::SmoothTransformation);
+ loadedPm.setDevicePixelRatio(dpr);
+ renderedPm = expandPixmap(loadedPm, requestSize);
+ }
+
+ //---------- Regular icons
+ else {
+ // Maintain aspect ratio
+ QSize adjustedSize =
+ baseIconPhysicalSize.scaled(requestSize, Qt::KeepAspectRatio);
+
+ QPixmap loadedPm = loadPixmap(m_iconName, mode, state, adjustedSize, color);
+ loadedPm.setDevicePixelRatio(dpr);
+ renderedPm = expandPixmap(loadedPm.scaled(requestSize, Qt::KeepAspectRatio,
+ Qt::SmoothTransformation),
+ requestSize);
+ }
+
+ renderedPm.setDevicePixelRatio(dpr);
+ addToPixmapCache(cacheKey, renderedPm);
+
+ return getFromPixmapCache(cacheKey);
+}
+
+//-----------------------------------------------------------------------------
+
+// Determine if icon should be hidden in menus
+bool SvgIconEngine::shouldHideIcon(bool isForMenuItem) {
+ //! This is a workaround for a Qt bug, this can be removed and setVisible used
+ //! instead when Qt is updated
+#ifdef _WIN32
+ if (isForMenuItem) {
+ return !Preferences::instance()->getBoolValue(showIconsInMenu);
+ }
+ return false;
+#else
+ return false;
+#endif
+}
+
+//-----------------------------------------------------------------------------
+
+// Compares requestedSize to toolbar icon size checking for the best match
+// scaling by each unique DPR on the system.
+QSize SvgIconEngine::getBestToolbarSizeByDpr(const QSize &requestedSize) {
+ //! This function should be removed when SvgIconEngine gets widget DPR
+
+ const auto screens = QGuiApplication::screens();
+ if (screens.isEmpty()) return QSize(20, 20);
+
+ // Lambda to compute the difference between two sizes
+ auto diff = [&requestedSize](const QSize &size) {
+ return std::abs(size.width() - requestedSize.width()) +
+ std::abs(size.height() - requestedSize.height());
+ };
+
+ // Initialize with the first screen's scaled size
+ QSize bestSize =
+ (QSizeF(20, 20) * screens.first()->devicePixelRatio()).toSize();
+ int bestDiff = diff(bestSize);
+
+ // Iterate through all screens to find the size with the smallest difference
+ for (const QScreen *screen : screens) {
+ QSize size = (QSizeF(20, 20) * screen->devicePixelRatio()).toSize();
+ int currentDiff = diff(size);
+ if (currentDiff < bestDiff) {
+ bestSize = size;
+ bestDiff = currentDiff;
+ }
+ }
+
+ return bestSize;
}
diff --git a/toonz/sources/toonzqt/icongenerator.cpp b/toonz/sources/toonzqt/icongenerator.cpp
index 560f3c016..1aeb159b0 100644
--- a/toonz/sources/toonzqt/icongenerator.cpp
+++ b/toonz/sources/toonzqt/icongenerator.cpp
@@ -1189,9 +1189,7 @@ void FileIconRenderer::run() {
setIcon(rasterFromQImage(palette));
return;
} else if (type == "svg") {
- QImage svg(generateIconImage("svg_icon", qreal(1.0),
- QSize(iconSize.lx, iconSize.ly),
- Qt::KeepAspectRatio));
+ QImage svg(getIconPath("svg_icon"));
setIcon(rasterFromQImage(svg));
return;
} else if (type == "tzu") {
@@ -1199,9 +1197,7 @@ void FileIconRenderer::run() {
setIcon(rasterFromQImage(palette));
return;
} else if (TFileType::getInfo(m_path) == TFileType::AUDIO_LEVEL) {
- QImage loudspeaker(generateIconImage("audio_icon", qreal(1.0),
- QSize(iconSize.lx, iconSize.ly),
- Qt::KeepAspectRatio));
+ QImage loudspeaker(getIconPath("audio_icon"));
setIcon(rasterFromQImage(loudspeaker));
return;
} else if (type == "scr") {
@@ -1209,9 +1205,7 @@ void FileIconRenderer::run() {
setIcon(rasterFromQImage(screensaver));
return;
} else if (type == "psd") {
- QImage psdPath(generateIconImage("psd_icon", qreal(1.0),
- QSize(iconSize.lx, iconSize.ly),
- Qt::KeepAspectRatio));
+ QImage psdPath(getIconPath("psd_icon"));
setIcon(rasterFromQImage(psdPath));
return;
} else if (type == "mesh")
@@ -1220,79 +1214,55 @@ void FileIconRenderer::run() {
iconRaster =
IconGenerator::generateRasterFileIcon(m_path, iconSize, m_fid);
else if (type == "mpath") {
- QImage motionPath(generateIconImage("motionpath_icon", qreal(1.0),
- QSize(iconSize.lx, iconSize.ly),
- Qt::KeepAspectRatio));
+ QImage motionPath(getIconPath("motionpath_icon"));
setIcon(rasterFromQImage(motionPath));
return;
} else if (type == "curve") {
- QImage curve(generateIconImage("curve_icon", qreal(1.0),
- QSize(iconSize.lx, iconSize.ly),
- Qt::KeepAspectRatio));
+ QImage curve(getIconPath("curve_icon"));
setIcon(rasterFromQImage(curve));
return;
} else if (type == "cln") {
- QImage cln(generateIconImage("cleanup_icon", qreal(1.0),
- QSize(iconSize.lx, iconSize.ly),
- Qt::KeepAspectRatio));
+ QImage cln(getIconPath("cleanup_icon"));
setIcon(rasterFromQImage(cln));
return;
} else if (type == "tnzbat") {
- QImage tnzBat(generateIconImage("tasklist_icon", qreal(1.0),
- QSize(iconSize.lx, iconSize.ly),
- Qt::KeepAspectRatio));
+ QImage tnzBat(getIconPath("tasklist_icon"));
setIcon(rasterFromQImage(tnzBat));
return;
} else if (type == "tls") {
- QImage tls(svgToImage(":Resources/magpie.svg",
- QSize(iconSize.lx, iconSize.ly),
- Qt::KeepAspectRatio));
+ QImage tls(":Resources/magpie.svg");
setIcon(rasterFromQImage(tls));
return;
} else if (type == "xdts") {
- QImage xdts(generateIconImage("xdts_icon", qreal(1.0),
- QSize(iconSize.lx, iconSize.ly),
- Qt::KeepAspectRatio));
+ QImage xdts(getIconPath("xdts_icon"));
setIcon(rasterFromQImage(xdts));
return;
} else if (type == "js") {
- QImage script(generateIconImage("script_icon", qreal(1.0),
- QSize(iconSize.lx, iconSize.ly),
- Qt::KeepAspectRatio));
+ QImage script(getIconPath("script_icon"));
setIcon(rasterFromQImage(script));
return;
} else if (type == "json") {
- QImage json(generateIconImage("json_icon", qreal(1.0),
- QSize(iconSize.lx, iconSize.ly),
- Qt::KeepAspectRatio));
+ QImage json(getIconPath("json_icon"));
setIcon(rasterFromQImage(json));
return;
}
else {
- QImage unknown(generateIconImage("unknown_icon", qreal(1.0),
- QSize(iconSize.lx, iconSize.ly),
- Qt::KeepAspectRatio));
+ QImage unknown(getIconPath("unknown_icon"));
setIcon(rasterFromQImage(unknown));
return;
}
if (!iconRaster) {
- QImage broken(generateIconImage("broken_icon", qreal(1.0),
- QSize(iconSize.lx, iconSize.ly),
- Qt::KeepAspectRatio));
+ QImage broken(getIconPath("broken_icon"));
setIcon(rasterFromQImage(broken));
return;
}
setIcon(iconRaster);
} catch (const TImageVersionException &) {
- QImage unknown(generateIconImage("unknown_icon", qreal(1.0),
- QSize(iconSize.lx, iconSize.ly),
- Qt::KeepAspectRatio));
+ QImage unknown(getIconPath("unknown_icon"));
setIcon(rasterFromQImage(unknown));
} catch (...) {
- QImage broken(generateIconImage("broken_icon", qreal(1.0),
- QSize(iconSize.lx, iconSize.ly),
- Qt::KeepAspectRatio));
+ QImage broken(getIconPath("broken_icon"));
setIcon(rasterFromQImage(broken));
}
}
diff --git a/toonz/sources/toonzqt/keyframenavigator.cpp b/toonz/sources/toonzqt/keyframenavigator.cpp
index 976f7744a..c18616a53 100644
--- a/toonz/sources/toonzqt/keyframenavigator.cpp
+++ b/toonz/sources/toonzqt/keyframenavigator.cpp
@@ -41,49 +41,47 @@ KeyframeNavigator::KeyframeNavigator(QWidget *parent, TFrameHandle *frameHandle)
setIconSize(QSize(20, 20));
setObjectName("keyFrameNavigator");
- // previous key button
+ // Previous key button
QIcon prevKeyIcon = createQIcon("prevkey");
m_actPreviewKey = new QAction(prevKeyIcon, tr("Previous Key"), this);
connect(m_actPreviewKey, SIGNAL(triggered()), SLOT(togglePrevKeyAct()));
addAction(m_actPreviewKey);
- QWidget *prevWidget = widgetForAction(
- m_actPreviewKey); // obtain a widget generated from QAction
+ QWidget *prevWidget = widgetForAction(m_actPreviewKey);
prevWidget->setObjectName("PreviousKey");
- // key off button
- QIcon keyIcon = createQIcon("key_off");
+ // Key buttons with proper icon states
+ // Note: We're using one createQIcon call and making the actions checkable
+ QIcon keyIcon = createQIcon("keyframe");
m_actKeyNo = new QAction(keyIcon, tr("Set Key"), this);
+ m_actKeyNo->setCheckable(true);
connect(m_actKeyNo, SIGNAL(triggered()), SLOT(toggleKeyAct()));
addAction(m_actKeyNo);
- QWidget *keyNoWidget =
- widgetForAction(m_actKeyNo); // obtain a widget generated from QAction
+ QWidget *keyNoWidget = widgetForAction(m_actKeyNo);
keyNoWidget->setObjectName("KeyNo");
- // key partial button
- QIcon keyPartialIcon = createQIcon("key_partial", true);
+ QIcon keyPartialIcon = createQIcon("keyframe_partial");
m_actKeyPartial = new QAction(keyPartialIcon, tr("Set Key"), this);
+ m_actKeyPartial->setCheckable(true);
connect(m_actKeyPartial, SIGNAL(triggered()), SLOT(toggleKeyAct()));
addAction(m_actKeyPartial);
- QWidget *keyPartialWidget = widgetForAction(
- m_actKeyPartial); // obtain a widget generated from QAction
+ QWidget *keyPartialWidget = widgetForAction(m_actKeyPartial);
keyPartialWidget->setObjectName("KeyPartial");
- // key total button
- QIcon keyTotalIcon = createQIcon("key_on", true);
- m_actKeyTotal = new QAction(keyTotalIcon, tr("Set Key"), this);
+ QIcon keyTotalIcon = createQIcon(
+ "keyframe"); // Same as keyNo but will be set to checked state
+ m_actKeyTotal = new QAction(keyTotalIcon, tr("Set Key"), this);
+ m_actKeyTotal->setCheckable(true);
connect(m_actKeyTotal, SIGNAL(triggered()), SLOT(toggleKeyAct()));
addAction(m_actKeyTotal);
- QWidget *keyTotalWidget =
- widgetForAction(m_actKeyTotal); // obtain a widget generated from QAction
+ QWidget *keyTotalWidget = widgetForAction(m_actKeyTotal);
keyTotalWidget->setObjectName("KeyTotal");
- // next key button
+ // Next key button
QIcon nextKeyIcon = createQIcon("nextkey");
m_actNextKey = new QAction(nextKeyIcon, tr("Next Key"), this);
connect(m_actNextKey, SIGNAL(triggered()), SLOT(toggleNextKeyAct()));
addAction(m_actNextKey);
- QWidget *nextWidget =
- widgetForAction(m_actNextKey); // obtain a widget generated from QAction
+ QWidget *nextWidget = widgetForAction(m_actNextKey);
nextWidget->setObjectName("NextKey");
}
@@ -91,38 +89,33 @@ KeyframeNavigator::KeyframeNavigator(QWidget *parent, TFrameHandle *frameHandle)
void KeyframeNavigator::update() {
// Prev button
- if (hasPrev())
- m_actPreviewKey->setDisabled(false);
- else
- m_actPreviewKey->setDisabled(true);
+ m_actPreviewKey->setDisabled(!hasPrev());
bool isFullKey = isFullKeyframe();
bool isKey = isKeyframe();
+ // Hide all key buttons first
+ m_actKeyNo->setVisible(false);
+ m_actKeyPartial->setVisible(false);
+ m_actKeyTotal->setVisible(false);
+
+ // Show the appropriate button based on the current state
if (isKey && !isFullKey) {
- m_actKeyNo->setVisible(false);
- m_actKeyTotal->setVisible(false);
m_actKeyPartial->setVisible(true);
- m_actKeyPartial->setDisabled(false);
- }
- if (isFullKey) {
- m_actKeyNo->setVisible(false);
- m_actKeyPartial->setVisible(false);
+ // Set the action to checked to use the "On" icon state
+ m_actKeyPartial->setChecked(true);
+ } else if (isFullKey) {
m_actKeyTotal->setVisible(true);
- m_actKeyTotal->setDisabled(false);
- }
- if (!isKey && !isFullKey) {
- m_actKeyPartial->setVisible(false);
- m_actKeyTotal->setVisible(false);
+ // Set the action to checked to use the "On" icon state
+ m_actKeyTotal->setChecked(true);
+ } else { // !isKey && !isFullKey
m_actKeyNo->setVisible(true);
- m_actKeyNo->setDisabled(false);
+ // Make sure it's unchecked to use the "Off" icon state
+ m_actKeyNo->setChecked(false);
}
// Next button
- if (hasNext())
- m_actNextKey->setDisabled(false);
- else
- m_actNextKey->setDisabled(true);
+ m_actNextKey->setDisabled(!hasNext());
}
//-----------------------------------------------------------------------------
diff --git a/toonz/sources/toonzqt/menubarcommand.cpp b/toonz/sources/toonzqt/menubarcommand.cpp
index ae926ee96..92f8d0295 100644
--- a/toonz/sources/toonzqt/menubarcommand.cpp
+++ b/toonz/sources/toonzqt/menubarcommand.cpp
@@ -410,8 +410,6 @@ void CommandManager::enlargeIcon(CommandId id, const QSize dstSize) {
return;
}
- addSpecifiedSizedImageToIcon(icon, iconSVGName, dstSize);
-
action->setIcon(icon);
}
diff --git a/toonz/sources/toonzqt/paletteviewer.cpp b/toonz/sources/toonzqt/paletteviewer.cpp
index 46cff3b6d..33d3cbf1b 100644
--- a/toonz/sources/toonzqt/paletteviewer.cpp
+++ b/toonz/sources/toonzqt/paletteviewer.cpp
@@ -596,7 +596,7 @@ void PaletteViewer::createPaletteToolBar() {
m_toolbarParts.clear();
QAction *openStyleNameEditorAct = new QAction(tr("Name Editor"));
- openStyleNameEditorAct->setIcon(createQIcon("rename", false, true));
+ openStyleNameEditorAct->setIcon(createQIcon("rename", true));
connect(openStyleNameEditorAct, &QAction::triggered, [&]() {
if (!m_styleNameEditor) {
m_styleNameEditor = new StyleNameEditor(this);
diff --git a/toonz/sources/toonzqt/paletteviewergui.cpp b/toonz/sources/toonzqt/paletteviewergui.cpp
index ce59847a7..3ee3dd831 100644
--- a/toonz/sources/toonzqt/paletteviewergui.cpp
+++ b/toonz/sources/toonzqt/paletteviewergui.cpp
@@ -1163,7 +1163,7 @@ void PageViewer::contextMenuEvent(QContextMenuEvent *event) {
QAction *openStyleControlAct = cmd->getAction("MI_OpenStyleControl");
menu.addAction(openStyleControlAct);
QAction *openStyleNameEditorAct = menu.addAction(tr("Name Editor"));
- openStyleNameEditorAct->setIcon(createQIcon("rename", false, true));
+ openStyleNameEditorAct->setIcon(createQIcon("rename"));
connect(openStyleNameEditorAct, &QAction::triggered, [&]() {
if (!m_styleNameEditor) {
m_styleNameEditor = new StyleNameEditor(this);
@@ -1217,10 +1217,10 @@ void PageViewer::contextMenuEvent(QContextMenuEvent *event) {
if (m_page) {
menu.addSeparator();
- QIcon newStyleIco = createQIcon("newstyle", false, true);
+ QIcon newStyleIco = createQIcon("newstyle");
QAction *newStyle = menu.addAction(newStyleIco, tr("New Style"));
connect(newStyle, SIGNAL(triggered()), SLOT(addNewColor()));
- QIcon newPageIco = createQIcon("newpage", false, true);
+ QIcon newPageIco = createQIcon("newpage");
QAction *newPage = menu.addAction(newPageIco, tr("New Page"));
connect(newPage, SIGNAL(triggered()), SLOT(addNewPage()));
}
@@ -1692,17 +1692,17 @@ PaletteIconWidget::~PaletteIconWidget() {}
void PaletteIconWidget::paintEvent(QPaintEvent *) {
QPainter p(this);
- // generate icon and extract the pixmaps
- QIcon dragPaletteIcon = createQIcon("dragpalette");
- if (m_isOver) {
- static QPixmap dragPaletteIconPixmapOver(
- dragPaletteIcon.pixmap(20, QIcon::Active));
- p.drawPixmap(5, 1, dragPaletteIconPixmapOver);
- } else {
- static QPixmap dragPaletteIconPixmap(
- dragPaletteIcon.pixmap(20, QIcon::Normal, QIcon::Off));
- p.drawPixmap(5, 1, dragPaletteIconPixmap);
- }
+
+ // The icon engine already handles caching
+ QIcon icon = createQIcon("dragpalette");
+
+ // Get the appropriate pixmap based on hover state
+ QPixmap pixmap = icon.pixmap(QSize(20, 20),
+ m_isOver ? QIcon::Active : QIcon::Normal,
+ QIcon::Off);
+
+ // Draw the pixmap
+ p.drawPixmap(5, 1, pixmap);
}
//-----------------------------------------------------------------------------
diff --git a/toonz/sources/toonzqt/paramfield.cpp b/toonz/sources/toonzqt/paramfield.cpp
index d8ae05fd7..bd83b8f50 100644
--- a/toonz/sources/toonzqt/paramfield.cpp
+++ b/toonz/sources/toonzqt/paramfield.cpp
@@ -709,7 +709,7 @@ void ParamFieldKeyToggle::paintEvent(QPaintEvent *e) {
pen = QColor(getKeyBorderOffColor());
p.setPen(pen);
p.fillPath(path, getKeyOffColor());
- m_pixmap = QPixmap(createQIcon("key_off").pixmap(
+ m_pixmap = QPixmap(createQIcon("keyframe").pixmap(
iconSize, iconSize, QIcon::Normal, QIcon::Off));
icon.addPixmap(m_pixmap);
icon.paint(&p, QRect(0, 0, iconSize, iconSize));
@@ -719,8 +719,8 @@ void ParamFieldKeyToggle::paintEvent(QPaintEvent *e) {
p.setPen(pen);
p.fillPath(path, getKeyOnColor());
m_pixmap =
- QPixmap(createQIcon("key_on", true)
- .pixmap(iconSize, iconSize, QIcon::Normal, QIcon::Off));
+ QPixmap(createQIcon("keyframe")
+ .pixmap(iconSize, iconSize, QIcon::Normal, QIcon::On));
icon.addPixmap(m_pixmap);
icon.paint(&p, QRect(0, 0, iconSize, iconSize));
break;
@@ -729,8 +729,8 @@ void ParamFieldKeyToggle::paintEvent(QPaintEvent *e) {
p.setPen(pen);
p.fillPath(path, getKeyModifiedColor());
m_pixmap =
- QPixmap(createQIcon("key_modified", true)
- .pixmap(iconSize, iconSize, QIcon::Normal, QIcon::Off));
+ QPixmap(createQIcon("keyframe_modified")
+ .pixmap(iconSize, iconSize, QIcon::Normal, QIcon::On));
icon.addPixmap(m_pixmap);
icon.paint(&p, QRect(0, 0, iconSize, iconSize));
break;
@@ -739,8 +739,8 @@ void ParamFieldKeyToggle::paintEvent(QPaintEvent *e) {
p.setPen(pen);
p.fillPath(path, getKeyInbetweenColor());
m_pixmap =
- QPixmap(createQIcon("key_on", true)
- .pixmap(iconSize, iconSize, QIcon::Normal, QIcon::Off));
+ QPixmap(createQIcon("keyframe")
+ .pixmap(iconSize, iconSize, QIcon::Normal, QIcon::On));
icon.addPixmap(m_pixmap);
icon.paint(&p, QRect(0, 0, iconSize, iconSize));
break;