Skip to content

allow duplicate key combos and group successive duplicates#28

Open
ynejmidev wants to merge 2 commits into
linuxmobile:mainfrom
ynejmidev:feat/allow-dup-and-count
Open

allow duplicate key combos and group successive duplicates#28
ynejmidev wants to merge 2 commits into
linuxmobile:mainfrom
ynejmidev:feat/allow-dup-and-count

Conversation

@ynejmidev
Copy link
Copy Markdown

No description provided.

ynejmidev added 2 commits May 9, 2026 00:37
When more than 1 successive similar key combos, group into `<key> x <n>`.
I couldnt find how to update widgets in gtk-rs so I just delete the
latest and replace it.
@ynejmidev ynejmidev changed the title allow duplicate key combos and group sucessive duplicates allow duplicate key combos and group successive duplicates May 9, 2026
@linuxmobile
Copy link
Copy Markdown
Owner

Can you add a little showcase? Code looks good!

@ynejmidev
Copy link
Copy Markdown
Author

ynejmidev commented May 9, 2026

something like this?
image

@ynejmidev
Copy link
Copy Markdown
Author

ynejmidev commented May 9, 2026

Also I couldnt find how to update a gtk widget so I just delete the latest and replace it to change the count, idk if thats an acceptable approach

@ynejmidev
Copy link
Copy Markdown
Author

related issue #26

@linuxmobile
Copy link
Copy Markdown
Owner

I couldnt find how to update a gtk widget

Maybe you can add count_label: Option<gtk4::Label> and update only that label.

@ynejmidev
Copy link
Copy Markdown
Author

I really cant see how putting the label as an Option<> could introduce state, could you please show a small example if possible?

Maybe I'm thinking about this wrong since it's my first time interacting with a GObject project, but the closest thing I could find to do reactivity is to write a CustomLabel with custom state or something, however that seems overly complicated, and when I tried the provided example in the book it didn't work anyway, maybe the example is an old version?

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.

2 participants