kuthulux / gnome-connection-manager

repository for gnome-connection-manager from kuthulu.com/gcm
Other
68 stars 28 forks source link

In multi-pane mode, can not resize the panes #4

Closed jimklimov closed 4 years ago

jimklimov commented 4 years ago

With gcm-1.1.0 I could rearrange the panels with multiple terminals to size their screen estate as I need. With 1.2.0-HEAD I can not :(

When I hover near the divider of panes as before, the mouse pointer does not even change to arrows for resizing.

UPDATE: Even with the single default pane to Local host, I cannot resize the list of saved server connections. This should allow for simpler reproduction of the issue :)

kuthulux commented 4 years ago

doesn't happen here maybe the handle is too thin in the gtk theme you are using, try setting the property wide_handle and see if you can move the handle between the servers and the terminal.


index 58ab11c..bd30c7d 100644
--- a/gnome-connection-manager.glade
+++ b/gnome-connection-manager.glade
@@ -3096,6 +3096,7 @@ if not, write to the Free Software Foundation, Inc.,
               <object class="GtkHPaned" id="hpMain">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
+                <property name="wide_handle">True</property>
                 <signal name="button-press-event" handler="on_hpMain_button_press_event" swapped="no"/>
                 <child>
                   <object class="GtkScrolledWindow" id="scrolledwindow1">```
jimklimov commented 4 years ago

Visually, it does not seem any wider with this change, and the mouse cursor does not change when I hover it over the thin line between the scrollbar of servers list and the terminal pane, but it is now draggable. While comparing with the older running copy of gcm, I managed to drag its thin line once, but could not catch it again.

So I guess it is rendered the same, but the mouse catchment area is a bit larger with this setting and so more usable.

jimklimov commented 4 years ago

So... it is barely possible (and with no cues from mouse cursor) to resize the terminal panes in original instance of the gcm too, but takes about 10 clicks to catch the right pixel to pull :\

Curiously, for two vertical panes side by side, there seems to be a minimal width imposed now: if I move the separator too far to the left, the whole pane and the tab label on top scroll left out of sight ("under" the server list); there is no scroll bar to get them visible again - only resizing to make it big enough or more helps.

This minimal width seems to be 73 chars for me, before it wraps the line:

jim@jimoi:~$ for A in `seq 0 7` ; do printf $A ; for B in `seq 1 9` ; do printf . ; done ; done
0.........1.........2.........3.........4.........5.........6.........7...
jimklimov commented 4 years ago

A bit more, and it seems the pane size limit is half the original window size. I started with a smaller gcm window, the minimal pane size varied 60-63 chars (then the window drag refused to change width to smaller). Adding another tab and making a vertical split, the panes were okay with 28 chars wide, only scrolled away to the left when resizing (by dragging the middle divider line) from that point down.

kuthulux commented 4 years ago

The minimial width is an issue with gtk3. In gtk2 I set a minimal width/height but then when moving the handle the width/height of the terminal can be modified, but that doesn't happen now. To overcome this, apply this patch to avoid setting a minimal size, instead just set the position of the handle to the middle of boths terminals after splitting them.

index c17b93b..b46ccee 100755
--- a/gnome_connection_manager.py
+++ b/gnome_connection_manager.py
@@ -1651,12 +1651,11 @@ class Wmain(SimpleGladeApp):
             cp  = cnb.get_parent()

             if direction==HSPLIT:
-                w,h = cnb.get_allocated_width()/2, cnb.get_allocated_height()
+                p = cnb.get_allocated_width()/2
             else:                
-                w,h = cnb.get_allocated_width(), cnb.get_allocated_height()/2
-
-            cnb.set_size_request(w,h)
-            hp.set_size_request(nb.get_allocated_width(), cnb.get_allocated_height())
+                p = cnb.get_allocated_height()/2
+            hp.set_position(p)
+            hp.set_wide_handle(True)

             cp.remove(cnb)
             cp.add(hp)
jimklimov commented 4 years ago

Thanks, this seems better. At least, now the minimal width is effectively the size of a single tab (row with several collapses into one tab and arrows to choose, when there is not enough space for two). And then this tab can slide away along with the pane :)

Similarly for horizontal split, the top pane can reduce to about 5 lines of text and then slides up with its tab line.

Extra kudos for embedding the wide_handle, it makes resizing almost usable again :)

Unless you have some more ideas to try, this may be good enough regarding the sizing... though it could be helpful, if possible, to forbid resizing the pane under the limit that its tabs can slide away.

And getting back the mouse cursor for hovering over the handle area where resizing would work (so I know where to click and drag) - that could also be a nice UX fix :) But not sure if that is a WM or GTK nuance, or GCM/glade's? The window resizing cursor (at app window border) works well.