-
Notifications
You must be signed in to change notification settings - Fork 39
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
cycle on the edge to move from left to right in the icon history #133
Comments
If you can create a PR, that would be great! |
I'm just looking at emote/picker.py I'm not used on Gtk programming in Python, could you point me which part of code would be involved? I found: But, it doesn't look like the motion in the picker is handled here? Any hint? |
🤔 hum may be more on: def on_emoji_btn_event(self, btn, event): I suppose Gtk.Box object some what offer key motion for free? May be not. I also found which create a def create_emoji_results(self, emojis, for_category=False): |
The selection is not something I've written explicity myselef. It's part of |
Chat GPT gave me some hints. Still wrong, but brings me the basics to figure out what to call. Here follow a sample code (verbatim) that popup a small 5x5 grid, that somewhat implement cycle by driving focus. We may need to add a property to keep track of the current row/col or something to compute the edge behavior. import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk
class GridExample(Gtk.Window):
def __init__(self):
super(GridExample, self).__init__()
self.connect("destroy", Gtk.main_quit)
self.grid = Gtk.Grid()
self.add(self.grid)
self.buttons = [[None for _ in range(5)] for _ in range(5)]
for i in range(5):
for j in range(5):
button_label = str(i * 5 + j + 1)
self.buttons[i][j] = Gtk.Button(label=button_label)
self.grid.attach(self.buttons[i][j], j, i, 1, 1)
self.current_row = 0
self.current_column = 0
self.buttons[self.current_row][self.current_column].grab_focus()
self.connect("key-press-event", self.on_key_press)
def on_key_press(self, widget, event):
keyval = event.keyval
if keyval == Gdk.KEY_Right:
self.current_column = (self.current_column + 1) % 5
elif keyval == Gdk.KEY_Left:
self.current_column = (self.current_column - 1) % 5
self.buttons[self.current_row][self.current_column].grab_focus()
if __name__ == "__main__":
win = GridExample()
win.show_all()
Gtk.main() I stop my exploration for today. I will setup a my dev copy of Emote, in the next days. |
Alright - good luck! |
Cross-linking #82, and taking the opportunity to suggest considering the behavior proposed there: instead of jumping back to the start of the same line, it would be nice to go to the end of a line and jump to the start of the next line. |
Done: I probably have much more (lib and package installed) git clone [email protected]:tom-james-watson/Emote.git
cd Emote
python -m venv emote_venv
. ./emote_venv/bin/activate
pip install pipenv
make install
export PIPENV_VERBOSITY=-1
pip install PyGObject
make dev I also played with some version of the Now I've to figure out the code path in See next episode. 😁 |
I agree with @waldyrious. I had misunderstood the original post here. I think treating the grid as a single continous line makes more sense than looping round the same row. |
I actually disagree. Because on my use-case See my post here This would make-me -think: how to go to the end of the first history row?
Instead of just ⬇️ + ⬅️ (without thinking because it's brain friendly 🧠) But please, give use-case where it would benefit to go next continuous instead of cycling. On TV virtual keyboard for example (which is painful to move) it's cycling on the same row. 🤷♀️ As the issue #82 is closed we can continue discussing here, no problem. 😉 Note: The code to produce between the two behaviors is trivial, though. |
I think for a vertical scrolling grid of items, the wrapping on to next behaviour is the norm. I'm on macOS right now and the system emoji picker works how I describe. I also wouldn't want to support an option for this - adding options for everything is tempting but leads to a confusing ux and much more complex maintenance. |
🤔 I see. It's kind of brain already trained, but for mac user. 😉 I didn't have any emoji picker before using Emote. So I've my own Do you use Emote on macos too? I need to have use-cases in order to figure out corner case, in term of number of keystroke needed to reach an emoji. Mostly in recently used I would say. 😕 (will be described in use-case dedicated post ⬇️) I will create a new reply in the issue to sum-up use-cases mentioned with visual help (screeshot) and number of keystroke, etc. (then I will edit this new post and maintain the proposed alternatives)
🤔 Not sure to follow, here. It's not exactly the purpose of having settings? For example, in this video 📽️ macos system emoji selector (if I found the good one 🤷) you can see a sample of usage of "skin tone" selector. By long clinking on the icon may be. If your user experience is based on this feeling and you like it, you will tend to reproduce it. But if a user is coming from an alternative background, and you change from old "skin tone" selector to a new "macos like" may it will confuse user. In closed source code, obviously you cannot change anything. 😉 |
Nope, Emote is linux only. The macOS emoji selector is already great, so there's not really any need for a 3rd party selector. The question about how arrows work in the grid is not just a question of minimizing keystrokes to get to a given coordinate, it's more about the UX doing what the user expects. For me, that is that pressing right at the end of a row should go to the first entry on the next row.
As a maintainer of open source software, you receive A LOT of opinions on how things should or should not work. There are a lot of feature requests and often these contradict the feature requests of other people. If you added every single thing that people asked for and added options where there was disagreement, the app would end up being a bit of a mess. Sometimes you just need to have someone make a decision and stick to it. Obviously also the less branching paths/behaviours there are in the app, the easier it is to maintain. Happy for you to keep looking at this and submit a PR, of course, but IMO it should be for the next row behaviour, with no additional preferences. The benefit of open source is that anybody can take the code and do whatever they want with it - tweak it, fork it, anything. It doesn't necessarily mean that every feature request gets to make it into the software, though. |
🤔 it could be a very personal feeling, right? The User eXperience.
I agree! 😁 Let's move on, today I crafted a draft prototype (recall I'm not used in Gtk programming) So I got some result, first implementing (cycling I also posted the famous use-case ⬆️ (version 1). I need it to handle extra behavior in corner cases. 😉 So producing the algorithm. So what about my draft:
The Draft PR in order to compare code change. 😉 |
Hello,
👌 Congratulation very nice job. I love your tool. Using under xubuntu.
A feature request:
Allow to move from left / right on the edge with the key to save keystroke.
I may submit a PR. Should be easy to implement. 😁
The text was updated successfully, but these errors were encountered: