Skip to content

Commit

Permalink
gmoccapy: fix deprecation warning "Gtk.StyleContext.get_background_co…
Browse files Browse the repository at this point in the history
…lor is deprecated"
  • Loading branch information
hansu committed Sep 23, 2024
1 parent 441c202 commit 5880ca0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/emc/usr_intf/gmoccapy/gmoccapy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4582,10 +4582,12 @@ def on_icon_theme_choice_changed(self, widget):

def _set_sourceview_theme(self, name):
self.widgets["gcode_view"].set_style_scheme(name)
style = self.widgets["gcode_view"].get_style_context()
color = style.get_background_color(Gtk.StateFlags.SELECTED)
color.alpha = 0.5
self.widgets["gcode_view"].add_mark_category('motion', color.to_string())
buffer = self.widgets["gcode_view"].get_buffer()
style = buffer.get_style_scheme().get_style('current-line')
color = style.props.background
rgba = Gdk.RGBA()
rgba.parse(color)
self.widgets["gcode_view"].add_mark_category('motion', rgba.to_string())

def on_sourceview_theme_choice_changed(self, widget):
active = widget.get_active_iter()
Expand Down

0 comments on commit 5880ca0

Please sign in to comment.