mirror of
https://github.com/GradienceTeam/Gradience.git
synced 2024-06-29 07:59:56 +00:00
feat(option-row): set activatable widget
This commit is contained in:
parent
ce2472dfdd
commit
ce061f353e
|
@ -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;
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue