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

Gtk4 prep - Move zoom actions to MainWindow #786

Closed
wants to merge 3 commits into from

Conversation

jeremypw
Copy link
Collaborator

@jeremypw jeremypw commented Sep 6, 2024

Having the zoom actions in TerminalWidget does not work in Gtk4 as it is not an ancestor of SettingsPopover which needs to use them.

@Marukesu
Copy link
Contributor

Marukesu commented Sep 6, 2024

For Gtk4, the idea was to use Gtk.Widget.add_binding_signal() to handle the shortcuts and remove the action.

In the SettingsPopover, you can use a GLib.SignalGroup to connect the buttons to the {decrease,increase}_font_size signals in the Vte.Terminal.

@jeremypw
Copy link
Collaborator Author

jeremypw commented Sep 6, 2024

@Marukesu This is mainly to decrease the diff between the Gtk3 and Gtk4 versions by using code that works in both. After the initial port then the Gtk4 version can be improved to use unique features of Gtk4. However, it may not be worth having the intermediate step in this case?

@jeremypw
Copy link
Collaborator Author

jeremypw commented Sep 8, 2024

@danirabbit Do you recommend going straight to using add_binding_signal in the Gtk4 port or have this intermediate step?

@danirabbit
Copy link
Member

@jeremypw I'm not actually familiar with add_binding_signal or GLib.SignalGroup so I'm not sure I can give a meaningful opinion on what would be the easier path forward, sorry! So far what's in the main port branch isn't terribly difficult to review so either would probably be fine?

@jeremypw
Copy link
Collaborator Author

jeremypw commented Sep 11, 2024

@jeremypw Me neither but it looks like you can move a set of signal bindings in one instance of a class to another instance in one go. Could be useful - otherwise you would have to bind to each terminal separately if you were to use signals instead of an action.

@danirabbit
Copy link
Member

Since neither of us are familiar with the new method, let's move forward with this way and then we can revisit it in the future

Copy link
Member

@danirabbit danirabbit left a comment

Choose a reason for hiding this comment

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

For some reason accelerators aren't working correctly here. Keypad accels work, but Ctrl + and Ctrl - do not

@jeremypw
Copy link
Collaborator Author

@danirabbit Just realized there is a much easier way to do this! I forgot that SettingsPopover already has a reference to the current terminal via its terminal_binding_group so we can just call its functions directly. I'll close this and propose a better PR.

@jeremypw jeremypw closed this Sep 11, 2024
@jeremypw jeremypw deleted the jeremypw/zoomaction-mainwinddow branch September 11, 2024 17:43
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