| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- /*
- * Copyright (c) 2012-2025 Daniele Bartolini et al.
- * SPDX-License-Identifier: GPL-3.0-or-later
- */
- namespace Crown
- {
- public class InputBool : InputField, Gtk.CheckButton
- {
- public new void set_inconsistent(bool inconsistent)
- {
- base.set_inconsistent(inconsistent);
- }
- public bool is_inconsistent()
- {
- return this.get_inconsistent();
- }
- public GLib.Value union_value()
- {
- return this.value;
- }
- public void set_union_value(GLib.Value v)
- {
- this.value = (bool)v;
- }
- public bool value
- {
- get
- {
- return this.active;
- }
- set
- {
- this.active = value;
- }
- }
- public InputBool()
- {
- // Data
- this.toggled.connect(on_value_changed);
- }
- public void on_value_changed()
- {
- if (base.get_inconsistent()) {
- base.set_inconsistent(false);
- this.value = true;
- }
- value_changed(this);
- }
- }
- } /* namespace Crown */
|