diff --git a/data/extensions/aseprite-theme/dark/sheet.png b/data/extensions/aseprite-theme/dark/sheet.png
index cba0df3fa..15b3cfb16 100644
Binary files a/data/extensions/aseprite-theme/dark/sheet.png and b/data/extensions/aseprite-theme/dark/sheet.png differ
diff --git a/data/extensions/aseprite-theme/dark/theme.xml b/data/extensions/aseprite-theme/dark/theme.xml
index bc91481e1..6999ab9aa 100644
--- a/data/extensions/aseprite-theme/dark/theme.xml
+++ b/data/extensions/aseprite-theme/dark/theme.xml
@@ -265,8 +265,8 @@
-
-
+
+
@@ -434,6 +434,7 @@
+
diff --git a/data/extensions/aseprite-theme/sheet.png b/data/extensions/aseprite-theme/sheet.png
index 5354fd1a3..5cb155426 100644
Binary files a/data/extensions/aseprite-theme/sheet.png and b/data/extensions/aseprite-theme/sheet.png differ
diff --git a/data/extensions/aseprite-theme/theme.xml b/data/extensions/aseprite-theme/theme.xml
index b67704b26..7c6f9c492 100644
--- a/data/extensions/aseprite-theme/theme.xml
+++ b/data/extensions/aseprite-theme/theme.xml
@@ -261,8 +261,8 @@
-
-
+
+
@@ -430,6 +430,7 @@
+
diff --git a/src/app/ui/context_bar.cpp b/src/app/ui/context_bar.cpp
index da2feae7a..1f55c7f99 100644
--- a/src/app/ui/context_bar.cpp
+++ b/src/app/ui/context_bar.cpp
@@ -1156,6 +1156,11 @@ public:
addItem(SkinTheme::get(this)->parts.dynamics(), "dynamics_field");
loadDynamicsPref();
+ initTheme();
+ }
+
+ void updateIconFromActiveToolPref() {
+ initTheme();
}
void switchPopup() {
@@ -1210,11 +1215,8 @@ public:
void saveDynamicsPref() {
m_sameInAllTools = m_popup->sharedSettings();
Preferences::instance().shared.shareDynamics(m_sameInAllTools);
- tools::Tool* tool = nullptr;
- if (!m_sameInAllTools)
- tool = App::instance()->activeTool();
- auto& dynaPref = Preferences::instance().tool(tool).dynamics;
+ auto& dynaPref = Preferences::instance().tool(getTool()).dynamics;
m_dynamics = m_popup->getDynamics();
dynaPref.stabilizer(m_dynamics.stabilizer);
dynaPref.stabilizerFactor(m_dynamics.stabilizerFactor);
@@ -1229,15 +1231,14 @@ public:
dynaPref.maxVelocityThreshold(m_dynamics.maxVelocityThreshold);
dynaPref.colorFromTo(m_dynamics.colorFromTo);
dynaPref.matrixName(m_popup->ditheringMatrixName());
+
+ initTheme();
}
void loadDynamicsPref() {
m_sameInAllTools = Preferences::instance().shared.shareDynamics();
- tools::Tool* tool = nullptr;
- if (!m_sameInAllTools)
- tool = App::instance()->activeTool();
- auto& dynaPref = Preferences::instance().tool(tool).dynamics;
+ auto& dynaPref = Preferences::instance().tool(getTool()).dynamics;
m_dynamics.stabilizer = dynaPref.stabilizer();
m_dynamics.stabilizerFactor = dynaPref.stabilizerFactor();
m_dynamics.size = dynaPref.size();
@@ -1282,6 +1283,12 @@ private:
Preferences::instance().tool(tool).brush.angle(angle);
}
+ void onDynamicsChange(const tools::DynamicsOptions& dynamicsOptions) override {
+ updateIcon(dynamicsOptions.size != tools::DynamicSensor::Static ||
+ dynamicsOptions.angle != tools::DynamicSensor::Static ||
+ dynamicsOptions.gradient != tools::DynamicSensor::Static);
+ }
+
// ButtonSet overrides
void onItemChange(Item* item) override {
ButtonSet::onItemChange(item);
@@ -1291,10 +1298,29 @@ private:
// Widget overrides
void onInitTheme(InitThemeEvent& ev) override {
ButtonSet::onInitTheme(ev);
+
+ auto& dynaPref = Preferences::instance().tool(getTool()).dynamics;
+ updateIcon(dynaPref.size() != tools::DynamicSensor::Static ||
+ dynaPref.angle() != tools::DynamicSensor::Static ||
+ dynaPref.gradient() != tools::DynamicSensor::Static);
+
if (m_popup)
m_popup->initTheme();
}
+ tools::Tool* getTool() const {
+ if (m_sameInAllTools)
+ return nullptr; // For shared dynamic options we use tool=nullptr
+ else
+ return App::instance()->activeTool();
+ }
+
+ void updateIcon(const bool dynamicsOn) {
+ auto theme = SkinTheme::get(this);
+ getItem(0)->setIcon(dynamicsOn ? theme->parts.dynamicsOn():
+ theme->parts.dynamics());
+ }
+
std::unique_ptr m_popup;
ContextBar* m_ctxBar;
mutable tools::DynamicsOptions m_dynamics;
@@ -2202,6 +2228,8 @@ void ContextBar::updateForTool(tools::Tool* tool)
m_autoSelectLayer->setVisible(isMove);
m_dynamics->setVisible(supportDynamics);
m_dynamics->setOptionsGridVisibility(isFreehand && !hasSelectOptions);
+ if (supportDynamics)
+ m_dynamics->updateIconFromActiveToolPref();
m_freehandBox->setVisible(isFreehand && (supportOpacity || hasSelectOptions));
m_toleranceLabel->setVisible(hasTolerance);
m_tolerance->setVisible(hasTolerance);
diff --git a/src/app/ui/dynamics_popup.cpp b/src/app/ui/dynamics_popup.cpp
index 678937554..c2e3dda96 100644
--- a/src/app/ui/dynamics_popup.cpp
+++ b/src/app/ui/dynamics_popup.cpp
@@ -482,6 +482,10 @@ void DynamicsPopup::refreshVisibility()
m_hotRegion |= gfx::Region(boundsOnScreen());
setHotRegion(m_hotRegion);
+
+ // Inform to the delegate that the dynamics have changed (so the
+ // delegate can update the UI to show if the dynamics are on/off).
+ m_delegate->onDynamicsChange(getDynamics());
}
bool DynamicsPopup::sharedSettings() const
diff --git a/src/app/ui/dynamics_popup.h b/src/app/ui/dynamics_popup.h
index e8b194a74..911e8e2a6 100644
--- a/src/app/ui/dynamics_popup.h
+++ b/src/app/ui/dynamics_popup.h
@@ -32,6 +32,7 @@ namespace app {
virtual doc::BrushRef getActiveBrush() = 0;
virtual void setMaxSize(int size) = 0;
virtual void setMaxAngle(int angle) = 0;
+ virtual void onDynamicsChange(const tools::DynamicsOptions& dynamicsOptions) = 0;
};
DynamicsPopup(Delegate* delegate);