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

Allow to use scroll buttons in QTabWidgets created by RViz #1148

Closed
VictorLamoine opened this issue Sep 11, 2017 · 4 comments
Closed

Allow to use scroll buttons in QTabWidgets created by RViz #1148

VictorLamoine opened this issue Sep 11, 2017 · 4 comments

Comments

@VictorLamoine
Copy link
Contributor

If you stack a lot of widgets inside RViz, the labels becomes hard to read like this:
capture du 2017-09-11 11-17-43

Solutions:

  • Use shorter tab names (+ a tooltip)
  • Expand the tab so that labels becomes easy to read again:
    capture du 2017-09-11 11-17-54
  • Allow to use scroll buttons in the QTabWidget:
    • fusion-tabbar (without scroll buttons)
    • fusion-tabbar-truncated (with scroll buttons)

Last solution is by far the best in my opinion.
I think one solution is to subclass the tab bar and add a right click action to choose between scroll buttons, no scroll buttons.

@wjwwood wjwwood added this to the untargeted milestone Sep 11, 2017
@VictorLamoine
Copy link
Contributor Author

VictorLamoine commented Oct 23, 2017

I can't find the code that manages that part. I searched for QTabWidget but it's only returning one results which is not what I'm looking for (src/rviz/add_display_dialog.cpp).

Which part of the RViz code manages the stacking/moving of whole RViz panels?

@wjwwood
Copy link
Member

wjwwood commented Oct 26, 2017

@VictorLamoine I believe it is just done by QtMainWindow (of which VisualizationFrame inherits

class VisualizationFrame : public QMainWindow, public WindowManagerInterface
). Maybe what you want is https://doc.qt.io/qt-5/qmainwindow.html#DockOption-enum?

@VictorLamoine
Copy link
Contributor Author

Thanks @wjwwood, it helped me a lot because I did not know the "dock widget" names.

I made a test and this is exactly what I wanted:

Default behaviour

default_behaviour

Don't elide text in QTabBar

no_elide

Now I need to find a place/signal to put this code (each time a panel is added or moved); the code itself is very straightforward:

https://github.com/ros-visualization/rviz/compare/kinetic-devel...VictorLamoine:QTabWidget_elide?expand=1

@gavanderhoorn
Copy link
Contributor

gavanderhoorn commented Oct 26, 2017

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

No branches or pull requests

3 participants