Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChooseProjectButton: bind ProjectEntry radio to active #1040

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions src/Widgets/ChooseProjectButton.vala
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public class Code.ChooseProjectButton : Gtk.ToggleButton {
}

public class ProjectEntry : Gtk.ListBoxRow {
public bool active;
public string project_path { get; construct; }
public string project_name {
owned get {
Expand All @@ -175,16 +176,6 @@ public class Code.ChooseProjectButton : Gtk.ToggleButton {

public Gtk.RadioButton project_radio { get; construct; }

public bool active {
get {
return project_radio.active;
}

set {
project_radio.active = value;
}
}

public bool selected {
get {
return project_radio.active;
Expand All @@ -210,8 +201,10 @@ public class Code.ChooseProjectButton : Gtk.ToggleButton {
construct {
project_radio = new Gtk.RadioButton.with_label (null, project_name);
add (project_radio);
project_radio.toggled.connect (radio_toggled);
show_all ();

bind_property ("active", project_radio, "active", BindingFlags.BIDIRECTIONAL);
project_radio.toggled.connect (radio_toggled);
}

private void radio_toggled () {
Expand Down