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 changing relative width of views #12

Closed
bertsky opened this issue Oct 15, 2020 · 6 comments
Closed

allow changing relative width of views #12

bertsky opened this issue Oct 15, 2020 · 6 comments

Comments

@bertsky
Copy link
Contributor

bertsky commented Oct 15, 2020

It would be wonderful if the vertical divider between multiple views was a slider that could be clicked and dragged to change their relative width (as can already be done for the preview pane on the left).

@hnesk
Copy link
Owner

hnesk commented Oct 15, 2020

This is possible with Gtk.Paned: https://developer.gnome.org/gtk3/stable/GtkPaned.html , but it only has two panes.
To use Gtk.Paned for more views, it would be necessary to put Gtk.Paned inside of other Gtk.Paned and do some bookkeeping where to "pane" next. Quite possible but not trivial.
Another idea: Make it possible to open a new window per view and let the window manager do the placement, sizing, etc.. (GIMP style). I will look into it.

@bertsky
Copy link
Contributor Author

bertsky commented Oct 15, 2020

This is possible with Gtk.Paned: https://developer.gnome.org/gtk3/stable/GtkPaned.html , but it only has two panes.
To use Gtk.Paned for more views, it would be necessary to put Gtk.Paned inside of other Gtk.Paned and do some bookkeeping where to "pane" next. Quite possible but not trivial.

Yes, maybe even in a mix of vertical and horizontal panes. Indeed not trivial to implement and also probably tricky to use (cmp. awful manual control of column sliders in windows explorer and the like).

As an alternative, you could use a Grid view, and have two instead of one button for adding views: insert/add to row vs insert/add to column.

Another idea: Make it possible to open a new window per view and let the window manager do the placement, sizing, etc.. (GIMP style). I will look into it.

Yes, absolutely no objection here (but I already use a tiling window manager anyway).

@bertsky
Copy link
Contributor Author

bertsky commented Nov 2, 2020

This is possible with Gtk.Paned: https://developer.gnome.org/gtk3/stable/GtkPaned.html , but it only has two panes.
To use Gtk.Paned for more views, it would be necessary to put Gtk.Paned inside of other Gtk.Paned and do some bookkeeping where to "pane" next. Quite possible but not trivial.

How about the following: besides the view_menu_button in the header_bar to add views to the view_container as Gtk.Box, add two similar buttons to each view's action_bar (left of CloseButton):

  • a button to re-spawn the current box as a Gtk.HPaned with the existing view on the left and the new view on the right
  • a button to re-spawn the current box as a Gtk.VPaned with the existing view on the top and the new view on the bottom

Thus, the user could easily set up her own horizontal and vertical layout, adapting sizes via sliders. (Some bookkeeping would still be necessary, of course.)

@hnesk
Copy link
Owner

hnesk commented Nov 5, 2020

I'm on it...

@hnesk
Copy link
Owner

hnesk commented Nov 11, 2020

A prototype which initially spawns an empty view, from which a new view can be selected, is here: https://github.com/hnesk/browse-ocrd/tree/resizable-views
Still needs some polish ad testing.

@hnesk hnesk closed this as completed in 18576b1 Nov 11, 2020
@bertsky
Copy link
Contributor Author

bertsky commented Nov 12, 2020

This looks fantastic – thanks!

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

No branches or pull requests

2 participants