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

WIP: Add text above orientation slider #7211

Conversation

GuillaumeFavelier
Copy link
Contributor

This PR updates the orientation slider of _TimeViewer and adds a vtkTextActor above the slider.

Known issues

For now, the text does not scale with the window size

Fullscreen Resized
2020-01-15_1920x1080 2020-01-15_1920x1080

It's an item of #7162

@codecov
Copy link

codecov bot commented Jan 15, 2020

Codecov Report

Merging #7211 into master will increase coverage by <.01%.
The diff coverage is 78.16%.

@@            Coverage Diff             @@
##           master    #7211      +/-   ##
==========================================
+ Coverage   89.77%   89.77%   +<.01%     
==========================================
  Files         445      445              
  Lines       79890    79993     +103     
  Branches    12773    12788      +15     
==========================================
+ Hits        71720    71814      +94     
- Misses       5372     5373       +1     
- Partials     2798     2806       +8

@larsoner
Copy link
Member

BTW @GuillaumeFavelier I wonder if we should try to take the opposite approach by keeping our controls some fixed size. For example:

            scalar_bar.SetUnconstrainedFontSize(True)
            scalar_bar.GetLabelTextProperty().SetFontSize(14)

Makes the labels always the same size, which is kind of nice. If we could make our controls always on the right with some fixed width, this is more like how most GUIs display -- you scale up the window, the controls do not also scale up.

The time slider scaling to fill the width and colorbar scaling to fill the height are probably okay. But if we fix those, too, it might not be so bad.

Just some more ideas for someday. But I would say let's tackle this after the multi-view and linked-plotter ideas.

@GuillaumeFavelier
Copy link
Contributor Author

GuillaumeFavelier commented Jan 16, 2020

Just some more ideas for someday. But I would say let's tackle this after the multi-view and linked-plotter ideas.

I'm tempted to try those ideas in this PR actually.

And in this case the fixed size of the label would not be a bug but a feature.

@codecov
Copy link

codecov bot commented Jan 16, 2020

Codecov Report

Merging #7211 into master will increase coverage by <.01%.
The diff coverage is 78.16%.

@@            Coverage Diff             @@
##           master    #7211      +/-   ##
==========================================
+ Coverage   89.77%   89.77%   +<.01%     
==========================================
  Files         445      445              
  Lines       79890    79993     +103     
  Branches    12773    12788      +15     
==========================================
+ Hits        71720    71814      +94     
- Misses       5372     5373       +1     
- Partials     2798     2806       +8

@larsoner
Copy link
Member

Over in #7219 it looks like you are doing some coordinate gymnastics anyway, might not be a bad time to figure out how to get some controls to always be some fixed width, fixed height, and fixed distance from the screen edge regardless of screen size.

Even the time slider and colorbar could in principle be made some fixed size. Though the time slider does become more usable the larger it gets, so maybe that one should grow. I'll let you think on it :)

@mmagnuski
Copy link
Member

Just a thought: I think extending the sliders a bit (for example up to some max length) might be helpful in bigger windows - it gives the user more precision in selecting time and color limits (but still allows for all the sliders to fit in a smaller window).

@larsoner
Copy link
Member

@GuillaumeFavelier do we still need this? The current behavior seems okay, this seems more like a "nice to have someday maybe" option

@GuillaumeFavelier
Copy link
Contributor Author

The priority is really low and this is not so trivial to achieve. We can delay it further and focus on the layout itself.

Either way, I agree with you this 'nice to have'.

@larsoner
Copy link
Member

Okay let's close for now and reopen when someone is motivated

@larsoner larsoner closed this Aug 24, 2020
@GuillaumeFavelier
Copy link
Contributor Author

I could find this SetUnconstrainedFontSize() function only for vtkScalarBarActor, not any other. It seems to be what we want though:

Set/Get whether the font size of title and labels is unconstrained.

Default is off. When it is constrained, the size of the scalar bar will constrained the font size. When it is not, the size of the font will always be respected.

Reference: https://vtk.org/doc/nightly/html/classvtkScalarBarActor.html#a668d039964548cca8f2b6c1a4e664689

@GuillaumeFavelier GuillaumeFavelier deleted the time_viewer_orientation_label branch November 15, 2021 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants