Skip to content

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

C

Palette Gizmo Button

justburnerb1f3a4af0061
diff --git a/toonz/sources/toonzqt/paletteviewer.cpp b/toonz/sources/toonzqt/paletteviewer.cpp
index ecfe3a6c1..9996acaf1 100644
--- a/toonz/sources/toonzqt/paletteviewer.cpp
+++ b/toonz/sources/toonzqt/paletteviewer.cpp
@@ -477,6 +477,13 @@ void PaletteViewer::createPaletteToolBar() {
m_paletteToolBar->addWidget(viewModeButton);
m_paletteToolBar->addSeparator();
+ if (m_viewType == LEVEL_PALETTE) {
+ CommandManager *cmd = CommandManager::instance();
+ QAction *gizmo = cmd->getAction("MI_OpenPltGizmo");
+ m_paletteToolBar->addAction(gizmo);
+ m_paletteToolBar->addSeparator();
+ }
+
if (m_hasPageCommand) {
QAction *addPage;
QIcon addPageIcon = createQIcon("newpage");
diff --git a/toonz/sources/toonzqt/paletteviewergui.cpp b/toonz/sources/toonzqt/paletteviewergui.cpp
index 759eaab0f..e6fbc7236 100644
--- a/toonz/sources/toonzqt/paletteviewergui.cpp
+++ b/toonz/sources/toonzqt/paletteviewergui.cpp
@@ -703,12 +703,16 @@ void PageViewer::paintEvent(QPaintEvent *e) {
}
// draw frame if the style is selected or current
- if (m_styleSelection->isSelected(m_page->getIndex(), i) ||
- currentStyleIndex == styleIndex) {
+ if (m_styleSelection->isSelected(m_page->getIndex(), i)) {
QRect itemRect = getItemRect(i).adjusted(0, -1, 0, 1);
p.setPen(Qt::NoPen);
p.setBrush(getSelectedBorderColor());
p.drawRoundRect(itemRect, 7, 25);
+ } else if (currentStyleIndex == styleIndex) {
+ QRect itemRect = getItemRect(i).adjusted(1, 0, -1, 0);
+ p.setPen(Qt::NoPen);
+ p.setBrush(getSelectedBorderColor());
+ p.drawRoundRect(itemRect, 7, 25);
}
// paint style
QRect chipRect = getItemRect(i).adjusted(4, 4, -5, -5);
@@ -1140,8 +1144,12 @@ void PageViewer::contextMenuEvent(QContextMenuEvent *event) {
menu.addAction(clearAct);
menu.addSeparator();
- QAction *openPltGizmoAct = cmd->getAction("MI_OpenPltGizmo");
- menu.addAction(openPltGizmoAct);
+ // currently palette gizmo can only change colors from the current level
+ // palette due to the way modifyColor works.
+ if (m_viewType == LEVEL_PALETTE) {
+ QAction *openPltGizmoAct = cmd->getAction("MI_OpenPltGizmo");
+ menu.addAction(openPltGizmoAct);
+ }
QAction *openStyleControlAct = cmd->getAction("MI_OpenStyleControl");
menu.addAction(openStyleControlAct);
QAction *openStyleNameEditorAct = menu.addAction(tr("Name Editor"));