feat(option-row): set activatable widget

This commit is contained in:
FineFindus 2023-06-26 20:59:42 +02:00
parent ce2472dfdd
commit ce061f353e
No known key found for this signature in database
GPG key ID: 64873EE210FF8E6B
2 changed files with 5 additions and 4 deletions

View file

@ -2,6 +2,8 @@ using Gtk 4.0;
using Adw 1;
template GradienceOptionRow : Adw.ActionRow {
activatable-widget: color-value;
[suffix]
MenuButton warning-button {
valign: center;

View file

@ -89,10 +89,9 @@ class GradienceOptionRow(Adw.ActionRow):
@Gtk.Template.Callback()
def on_text_value_toggled(self, *_args):
if self.text_value_toggle.get_active():
self.value_stack.set_visible_child(self.text_value)
else:
self.value_stack.set_visible_child(self.color_value)
widget = self.text_value if self.text_value_toggle.get_active() else self.color_value
self.value_stack.set_visible_child(widget)
self.set_activatable_widget(widget)
def update_value(self, new_value, update_vars=False, **kwargs):
rgba = Gdk.RGBA()