mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-10 19:18:58 +08:00
Fix Per Object Settings toolbutton enabled state on startup
Contributes to CURA-901
This commit is contained in:
parent
abe184ebff
commit
8d7df76aa1
@ -16,6 +16,7 @@ class PerObjectSettingsTool(Tool):
|
||||
|
||||
self.setExposedProperties("Model", "SelectedIndex")
|
||||
|
||||
Application.getInstance().getController().toolEnabledStateRequest.connect(self._onToolEnabledStateRequested)
|
||||
Preferences.getInstance().preferenceChanged.connect(self._onPreferenceChanged)
|
||||
|
||||
def event(self, event):
|
||||
@ -40,6 +41,9 @@ class PerObjectSettingsTool(Tool):
|
||||
index = self.getModel().find("id", selected_object_id)
|
||||
return index
|
||||
|
||||
def _onToolEnabledStateRequested(self):
|
||||
self._onPreferenceChanged("cura/active_mode")
|
||||
|
||||
def _onPreferenceChanged(self, preference):
|
||||
if preference == "cura/active_mode":
|
||||
enabled = Preferences.getInstance().getValue(preference)==1
|
||||
|
Loading…
x
Reference in New Issue
Block a user