Commit 2672abb5 authored by Jaden Goter's avatar Jaden Goter

Changed toggling boolean to a set copy for prettiness.

parent fdbd02b1
Pipeline #173978 failed with stage
in 5 minutes and 39 seconds
......@@ -252,7 +252,6 @@ class ViewerContainer(Gtk.Box, Loggable):
self.diagonals_switch = self.__create_guidelines_switch_widget()
self._last_guidelines = {self.three_by_three_switch}
self.toggling = False
self.guidelines_button = Gtk.MenuButton.new()
self.guidelines_button.props.image = Gtk.Image.new_from_icon_name("view-grid-symbolic", Gtk.IconSize.BUTTON)
......@@ -396,14 +395,14 @@ class ViewerContainer(Gtk.Box, Loggable):
grid.attach(switch_widget, 1, row, 1, 1)
def __toggle_composition_guidelines_cb(self, unused_entry, unused_parameter):
self.toggling = True
for switch in self._last_guidelines:
last_guidelines_copy = self._last_guidelines.copy()
for switch in last_guidelines_copy:
switch.set_active(not switch.get_active())
self.toggling = False
self._last_guidelines = last_guidelines_copy
def __guideline_switch_cb(self, switch_widget, unused_parameter, drawing_function):
last_guidelines = {switch for switch in self.guidelines_switches if switch.get_active()}
if last_guidelines and not self.toggling:
if last_guidelines:
self._last_guidelines = last_guidelines
if switch_widget.get_active():
self.overlay_stack.composition_guidelines_overlay.add_guideline(drawing_function)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment