Skip to content

Gtk4Prep: ProjectChooserButton#1753

Merged
danirabbit merged 8 commits into
masterfrom
jeremypw/gtk4prep/project-button
Jul 6, 2026
Merged

Gtk4Prep: ProjectChooserButton#1753
danirabbit merged 8 commits into
masterfrom
jeremypw/gtk4prep/project-button

Conversation

@jeremypw

@jeremypw jeremypw commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator
  • Use Controller instead of button_release_event
  • Define action and target on each listboxrow instead of deprecated get_action_group/activate_action
  • Do not listen to listbox remove signal - the GitManager is source of truth and we already listen to changes there. There is no way to remove rows (projects) through the UI of this widget.

This should work in Gtk4 with minimal changes for porting purposes.

There are no dead areas when clicking on the listboxrows.

}
});

project_listbox.row_activated.connect ((row) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rows can be activated in other ways than just button presses, such as with the keyboard. So we really need to keep this

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure? The rows are bound to an action now so it doesn't matter how they are activated, the action will fire.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think itts possible for the checkboxes to get focus and change without activating the row but I'll check.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, it is possible (though not obvious how) so I'll make the checkbuttons non-focusable.

@jeremypw

Copy link
Copy Markdown
Collaborator Author

I've fixed it so that it is possible to operate the chooser with the keyboard (once it has been opened) but because of a previously reported css bug (upstream) there is no visible focus on the rows. But the whole issue of keyboard accessibility needs revisiting after the port anyway.

@danirabbit danirabbit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works I think. It looks like we can get into a broken state with the selection so we should probably revisit this after the GTK4 port since we'll have some more flexibility, but I'm happy with this for now :)

Just one little thing that looks like an accident

Comment thread src/Widgets/Sidebar.vala Outdated
Comment on lines +4 to +6
* This program is free software: you can redistribute it and/or * it under the terms of the GNU General Public License as published by

modify * the Free Software Foundation, either version 3 of the License, or

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this was an accident?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! Now fixed. Thanks for spotting.

@jeremypw jeremypw force-pushed the jeremypw/gtk4prep/project-button branch from a7c92ce to 8046464 Compare July 6, 2026 17:09
@danirabbit danirabbit merged commit 028e373 into master Jul 6, 2026
5 of 6 checks passed
@danirabbit danirabbit deleted the jeremypw/gtk4prep/project-button branch July 6, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants