mirror of
https://github.com/GradienceTeam/Gradience.git
synced 2024-07-01 08:59:57 +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;
|
using Adw 1;
|
||||||
|
|
||||||
template GradienceOptionRow : Adw.ActionRow {
|
template GradienceOptionRow : Adw.ActionRow {
|
||||||
|
activatable-widget: color-value;
|
||||||
|
|
||||||
[suffix]
|
[suffix]
|
||||||
MenuButton warning-button {
|
MenuButton warning-button {
|
||||||
valign: center;
|
valign: center;
|
||||||
|
|
|
@ -89,10 +89,9 @@ class GradienceOptionRow(Adw.ActionRow):
|
||||||
|
|
||||||
@Gtk.Template.Callback()
|
@Gtk.Template.Callback()
|
||||||
def on_text_value_toggled(self, *_args):
|
def on_text_value_toggled(self, *_args):
|
||||||
if self.text_value_toggle.get_active():
|
widget = self.text_value if self.text_value_toggle.get_active() else self.color_value
|
||||||
self.value_stack.set_visible_child(self.text_value)
|
self.value_stack.set_visible_child(widget)
|
||||||
else:
|
self.set_activatable_widget(widget)
|
||||||
self.value_stack.set_visible_child(self.color_value)
|
|
||||||
|
|
||||||
def update_value(self, new_value, update_vars=False, **kwargs):
|
def update_value(self, new_value, update_vars=False, **kwargs):
|
||||||
rgba = Gdk.RGBA()
|
rgba = Gdk.RGBA()
|
||||||
|
|
Loading…
Reference in a new issue