Skip to content

Commit

Permalink
call on_tool_options_changed when the color changed #357
Browse files Browse the repository at this point in the history
  • Loading branch information
maoschanz committed Jan 29, 2023
1 parent 9e8419f commit 20547fa
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/optionsbars/classic/optionsbar_classic.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ def _on_size_changed(self, *args):
############################################################################
# Colors ###################################################################

def _on_color_changed(self, *args):
# TODO connect that to whatever needs it
self.window.on_tool_options_changed()

def middle_click_action(self):
left_color = self._color_l.color_widget.get_rgba()
self._color_l.color_widget.set_rgba(self._color_r.color_widget.get_rgba())
Expand Down
2 changes: 2 additions & 0 deletions src/optionsbars/classic/optionsbar_color_popover.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ def _on_color_changed(self, *args):
op_as_string = self._options_manager.get_value('cairo_operator')
self._set_thumbnail_color(op_as_string)

self._options_manager.window.on_tool_options_changed()

def _set_thumbnail_color(self, op_as_string):
"""Sets the icon and the tooltip of the popover's button. The icon can
be an actual icon, or a rectangle of color. The tooltip shows the active
Expand Down
2 changes: 1 addition & 1 deletion src/tools/transform_tools/tool_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def on_tool_selected(self, *args):
operation['radius'] = 0
# when the active filter is blurring the image, we cheat a little to
# improve performance, but the filtered pixbuf isn't preview until
# the user explicitely clicks on the canvas to preview
# the user explicitly clicks on the canvas to preview
self.do_tool_operation(operation)

def _async_open_menu(self, *args):
Expand Down
2 changes: 2 additions & 0 deletions src/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,8 @@ def _build_options_menu(self):
pane.build_options_menu(widget, model, label)

def on_tool_options_changed(self, *args):
if self.active_tool_id is None:
return
self.active_tool().on_options_changed()
self.set_window_subtitles()

Expand Down

0 comments on commit 20547fa

Please sign in to comment.