Open
Conversation
1fded78 to
d6543f8
Compare
Author
|
Can somebody at least look at this? |
andyholmes
reviewed
Nov 10, 2024
Contributor
andyholmes
left a comment
There was a problem hiding this comment.
Sorry for the delay!
I left a few general notes, mostly for the JavaScript, but I'm not a Python pro so someone else may need to peek at that :)
| gesture_click.connect("pressed", (_self, _n_press, _x, _y) => { | ||
| switch (gesture_click.get_current_button()) { | ||
| let css_class = "suggested-action"; | ||
| if (_self.get_current_event_state() & Gdk.ModifierType.CONTROL_MASK) { |
Contributor
There was a problem hiding this comment.
The _self variable should have the leading underscore removed, if it's being used now.
|
|
||
| Gtk.Button ctrl_button { | ||
| label: _("Ctrl + Click to Activate"); | ||
| label: _("Ctrl Key"); |
Contributor
There was a problem hiding this comment.
I think the label here should indicate that it represents the Control key state, and probably shouldn't be a button anymore since the signal has been removed.
|
|
||
| gesture_click.connect("released", (_self, _n_press, _x, _y) => { | ||
| switch (gesture_click.get_current_button()) { | ||
| switch (_self.get_current_button()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've originally just wanted to remove global variable tracking control key state. It is tad bit quirky and seems like a bad practice.
It was supposed to be a small fix to use
get_current_event_state()directly inGestureClickcontroller instead of global variable. What I didn't notice at first was that the example was showcasingEventControllerKeywhich would be completely removed by this "fix". So in the end I needed to do both fix mouse button events with key modifiers and come up with new show case forEventControllerKey.