Skip to content

Conversation

@danirabbit
Copy link
Member

We can't use GLib.Menu here yet because SourceView gives us a Gtk.Menu, but we can make sure that we're only using what's available to us in GLib.Menu so that porting will be less painful later. Also do some cleanup of strings while we're here. I can break that into a separate branch if you'd like.

  • Make sure all items use action_name instead of manually connecting to activate
  • Don't set sensitive on menu items. Ideally we really should set actions enabled/disabled in the document because we also have to worry about keyboard shortcuts, but for now we can consistently use the workaround of removing the action name. Menu items with no action name will automatically be insensitive.
  • Add all the menu items together and then set action sensitivity at the end. Makes it easier to see the order the menu is constructed in and make sure we're not conflating widget construction with logic

Menu item renames:

  • "Sort Selected Lines" → "Sort Lines". Other menu items like "Copy" or "Cut" don't have the qualifier "Selected". It's understood that context menus operate on the selection. Keep the qualifier "Lines" so it's clear this doesn't sort characters
  • "Mark Current Line" → "Mark Line". Same logic. We don't need to specific that context menus operate on the selection
  • "Goto Previous Edit Mark" → "Previous Mark". "Goto" is not an English word, but we also don't need to add "Go to" to navigation items. Other navigation items just say "Back" or "Forward". We also don't use the phrase "Edit Mark" when marking the line, it's just "Mark", so mirror that here.

@danirabbit danirabbit requested a review from a team November 15, 2025 18:50
@danirabbit danirabbit moved this to Needs Review in GTK4 Porting Nov 15, 2025
Copy link
Collaborator

@jeremypw jeremypw left a comment

Choose a reason for hiding this comment

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

Makes sense and everything seems to still work

@jeremypw jeremypw merged commit e71134a into master Nov 17, 2025
6 checks passed
@jeremypw jeremypw deleted the danirabbit/sourceview-menu branch November 17, 2025 13:29
@github-project-automation github-project-automation bot moved this from Needs Review to Done in GTK4 Porting Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants