Skip to content
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

Request: allow tab bar on other sides of the screen. #35

Closed
hrasdt opened this issue Jan 5, 2014 · 5 comments
Closed

Request: allow tab bar on other sides of the screen. #35

hrasdt opened this issue Jan 5, 2014 · 5 comments
Labels

Comments

@hrasdt
Copy link

hrasdt commented Jan 5, 2014

One of my favourite features from pre-blink Opera was the ability to move the tab bar to any of the four sides of the screen. I use the tab bar on the left because of limited vertical space on my laptop's screen. It's also great if you have lots of tabs open - much more space-efficient.

I'm not sure how much effort this would be, or if QTabBar even supports this, but if someone were to give me pointers on where to start, I'll have a bash at implementing it.

@Emdek
Copy link
Member

Emdek commented Jan 5, 2014

It is already available for long time. :-P
Really nobody tried to investigate that little gap left to it?
It is handle to drag it (yes, should be styled to look like handle first - that will be done later).
Tab bar currently uses standard dock widget offered by Qt (this may change when flexible tool bars will be implemented).

@Emdek Emdek closed this as completed Jan 5, 2014
@hrasdt
Copy link
Author

hrasdt commented Jan 6, 2014

Thanks! I mostly use Gtk programs, and obviously didn't recognise the cue.

It's a bit different to Opera's behaviour though; Qt rotates the text too, making it almost useless for saving space. This screenshot from an old version of Firefox shows the correct sort of behaviour.

I'll have a go writing a patch; after consulting Google, it seems like a custom QProxyStyle like this is the way to go.

@Emdek
Copy link
Member

Emdek commented Jan 6, 2014

Well yeah, it is not the same yet (and I would like to keep option to draw it that way too, it also saves space, just in different way ;-)). Also that gap needs p[roper handle drawn on it, like that of QToolBar (at least when UI is in unlocked mode).
Be warned that drawing procedure of QTabBar has to be rewritten anyway to support tab detaching by drag and drop (not really custom drawing, but implementing it will interfere with handling of mouse events in tab bar and indirectly may cause drawing issues), classic tab grouping (stacking) and ability to embed tab previews in tab handles (easiest part).

Related issues: #6, #30.

@cgschwarz
Copy link
Contributor

I tested the QProxyStyle code that hrasdt linked above, as a way to experiment a little once I got the build environment set up. Simply pasting in the class TabStyle : public QProxyStyle { }; class fully-unmodified, and adding one line to TabBarWidget's constructor:
setStyle(new TabStyle(Qt::Horizontal));

Was enough to get it running with tabs on the left side with horizontal text. It would be usable as-is except sometimes loading a tab with a longer page title forces the bar to resize horizontally and take half the screen. I haven't dug into how one would prevent that. Since Emdek says the drawing procedure is going to be rewritten anyway, it didn't seem particularly worth it, but thought I'd share in case this knowledge is at all useful to someone. Thanks for working on it!

@Emdek
Copy link
Member

Emdek commented Jan 7, 2014

@cgschwarz, thanks for testing, probably proxy style is not enough, probably there is also need to modify methods that return preferred size of tab handle etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants