Page 1 of 1

MRU for tabs - development proposal

PostPosted: Fri Jul 08, 2011 10:35 pm
by abirvalg
Hello, this is a development proposal.
Even though there is a Development section in Russian, I decided not to clutter it with English text and so I'm posting here.

gd's tabs use default QTabWidget's Ctrl+Tab behaviour, which is switching to the next tab in line.
It would nice to have a most-recently-used tab switching order (MRU), pretty much what Opera browser does when you press Ctrl and start pressing Tab and then release Ctrl.
If a translator like my wife has many tabs open and compares them, MRU greatly increases productivity/ decreases annoyance.
Implementing it would be pretty easy and I would like to do it myself. I'm asking whether such a feature would be welcome.

The workflow would be:
Implement a custom KeyPressEvent for QTabWidget to react to Ctrl+Tab
Have a QList<int> which keeps the MRU order of tabs
Update QList on CloseTab, NewTab, whenever user clicks a tab etc.
Modify tablist widget to show tabs in MRU order
Optionally tablist widget could popup on Ctrl+Tab just like in Opera.

Please let me know what you think.

Re: MRU for tabs - development proposal

PostPosted: Sat Jul 09, 2011 1:48 am
by ikm
Sure, you are welcome to implement it. The best workflow is to create your own clone of the repository at github and make a pull request when you're ready.

Re: MRU for tabs - development proposal

PostPosted: Sat Jul 09, 2011 6:41 am
by Tvangeste
Good idea worth implementing, yeah.

And we have a special place for Tab options, F4 -> Interface -> Tabbed browsing. There could be a new option there, specifying which behavior to use, the default one or the MRU.

Personally, I very much prefer MRU tab switching in browsers. But Chrome, my main browser, just decided not to support this at all, and I'm getting used to old default tab behavior.

Re: MRU for tabs - development proposal

PostPosted: Sat Jul 09, 2011 6:59 am
by ikm
Tvangeste wrote:which behavior to use, the default one or the MRU.

I had a feeling that we don't have any existing Ctrl-Tab behavior at all right now.

Re: MRU for tabs - development proposal

PostPosted: Sat Jul 09, 2011 7:00 am
by Tvangeste
ikm wrote:I had a feeling that we don't have any existing Ctrl-Tab behavior at all right now.

Ctrl-Tab works just fine by default now, it switches to the next Tab. Ctrl-Shift-Tab - goes to the previous tab.

P.S. Assuming that the QTabWidget is the currently focused component. When the focus on something else (translate line, for example), Ctrl-Tab doesn't work, which is expected, I guess.

Re: MRU for tabs - development proposal

PostPosted: Sat Jul 09, 2011 7:03 am
by ikm
Right - I was trying Ctrl-Tab from the word input line. That didn't work. Switching while an article is focused works indeed.

Re: MRU for tabs - development proposal

PostPosted: Tue Feb 07, 2012 10:44 am
by abirvalg
Hi, I have submitted a pull request to github 3 months ago.
https://github.com/goldendict/goldendict/pull/62

Could I please have any feedback on it?
Cheers.