Skip to content

Conversation

@jeremypw
Copy link
Collaborator

@jeremypw jeremypw commented Jan 6, 2025

Fixes #655

We can't just show tab numbers immediatley when <Alt> is pressed as this key is also used for e.g. <Alt>BackSpace>. The solution adopted is to use a "long-press" on the <Alt> key. A previous solution was use the unused <Alt>+0 combination to show the tab numbers immediately. This is retained for now but can be removed if considered superfluous.

The tab numbers are removed when a key is released, another key is pressed or focus lost.

It would be better to used an icon to show the numbers as that would be independent of the label and there is a suitable tabpage property, but there is no quick way to create an icon from a number (there are no builtin number icons available and we cannot use an emblem).

So the tab number is prefixed to the tab label for now.

Screenshot from 2025-01-06 20 27 58

@jeremypw jeremypw marked this pull request as ready for review February 6, 2025 17:36
@jeremypw
Copy link
Collaborator Author

jeremypw commented Feb 6, 2025

Marking ready for review but if anyone can suggest how emblems can be applied to the tabs to indicate the number more elegantly I would be grateful.

@jeremypw jeremypw requested a review from a team February 6, 2025 17:37
@zeebok
Copy link
Contributor

zeebok commented Apr 16, 2025

Would it be possible to show tool tips for all of the tabs with the shortcut? Also, you say we can't use <Alt> because there is the <Alt>Backspace shortcut but couldn't it enter a state and show something when holding <Alt> for some amount of time?

@jeremypw jeremypw changed the title Show tab numbers with shortcut <Alt>0 Show tab numbers with shortcut Apr 19, 2025
@jeremypw
Copy link
Collaborator Author

@zeebok

couldn't it enter a state and show something when holding for some amount of time?

I have produced an implementation of this behaviour.

Would it be possible to show tool tips for all of the tabs with the shortcut?

Do you mean show each tab's shortcut window permanently until tab numbers removed? Not sure this is possible - maybe use the show_help signal (in Gtk3). I'll investigate.

@jeremypw
Copy link
Collaborator Author

Cannot use the "show_help" signal for tab tooltips because tabpages are not widgets but sealed objects.

@zeebok
Copy link
Contributor

zeebok commented Apr 19, 2025

@jeremypw

Do you mean show each tab's shortcut window permanently until tab numbers removed? Not sure this is possible - maybe use the show_help signal (in Gtk3). I'll investigate.

Mostly trying to think of a way to display the emblems without having to modify the tab widgets directly. I thought maybe having the shortcut emblem in the tooltip and having it display while holding might be a good way to only show the shortcuts in a temporary fashion. If it doesn't, it doesn't work.

@jeremypw
Copy link
Collaborator Author

jeremypw commented Apr 20, 2025

@zeebok

Do you mean show each tab's shortcut window permanently until tab numbers removed? Not sure this is possible - maybe use the show_help signal (in Gtk3). I'll investigate.

Mostly trying to think of a way to display the emblems without having to modify the tab widgets directly. I thought maybe having the shortcut emblem in the tooltip and having it display while holding might be a good way to only show the shortcuts in a temporary fashion. If it doesn't, it doesn't work.

I see. The problem is the tabs are not widgets (or at least not accessible ones) so we can only do what the API allows 😞 If we could generate a numeric emblem icon then it could be assigned to the existing tab property. I'll see how numeric emblems are added to dock items to see whether it can be adopted.

@jeremypw
Copy link
Collaborator Author

Looks like the badges in the dock are styled labels not icons. Gtk3 has NumerableIcon which would be suitable but it is now deprecated unfortiunately.

zeebok
zeebok previously approved these changes Jun 4, 2025
@jeremypw jeremypw added the Status: Blocked Something else needs to be done before this can be fixed label Jul 14, 2025
@jeremypw jeremypw dismissed zeebok’s stale review July 14, 2025 17:41

Need to get input from a design point of view before merging

@jeremypw
Copy link
Collaborator Author

@zeebok I have dismissed your review to ensure this is not prematurely merged - but it is appreciated as always.

@danirabbit I am doubtful whether the appearance of this PR is up to elementary standards - do you have any better solution? Or is the issue sufficiently worthwhile to fix anyway?

@jeremypw jeremypw marked this pull request as draft July 31, 2025 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Blocked Something else needs to be done before this can be fixed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show the number of tabs.

3 participants