Partial solution to Gtk Linux split pane handle too large (#3020) #6059
Replies: 2 comments 4 replies
-
IANAL and I'm not too sure if this is problematic, but it is worth noting that everything on StackOverflow is under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license, which may not be compatible with MIT (again, I don't know if it is or not, I'm just noting this). |
Beta Was this translation helpful? Give feedback.
-
Update: I've got a new branch which change only CSS, and adds padding to pane children on any side which borders a pane separator. You can test it with any version of Ghostty built from a recent copy of
Then paste the CSS into the CSS tab of the inspector, and ensure the 'pause' button is unselected. CSS/* Add 6px padding to any pane side which touches a pane separator.
* This ensures that the pane resize handle and the pane content do
* not overlap.
*
* There are four universal rules for any given pane:
*
* 1. If any ancestor is the first child of a vertical split, add
* bottom padding.
* 2. If any ancestor is the second child of a vertical split, add
* top padding.
* 3. If any ancestor is the first child of a horizontal split, add
* right padding.
* 4. If any ancestor is the second child of a horizontal split,
* add left padding.
*
* However, because the children of split panes may be _either_
* 'overlay' or another 'pane', these four rules become eight, to
* account for these two possibilities in CSS.
*
* Note that we must apply padding _only_ to the overlay element, not
* to a pane element, as this ensures that the separators will
* intersect. If padding is added to a pane element, it will create
* a gap between perpendicular separators.
*/
/* An overlay which descends from the first-child of a horizontal
* pane
*/
.terminal-window .notebook paned.horizontal > :first-child overlay {
padding-right: 6px;
}
/* An overlay which _is_ the first-child of a horizontal pane. */
.terminal-window .notebook paned.horizontal > overlay:first-child {
padding-right: 6px;
}
/* An overlay which descends from the last-child of a horizontal
* pane
*/
.terminal-window .notebook paned.horizontal > :last-child overlay {
padding-left: 6px;
}
/* An overlay which _is_ the last-child of a horizontal pane */
.terminal-window .notebook paned.horizontal > overlay:last-child {
padding-left: 6px;
}
/* An overlay which descends from the first-child of a vertical pane
*/
.terminal-window .notebook paned.vertical > :first-child overlay {
padding-bottom: 6px;
}
/* An overlay which _is_ the first-child of a vertical pane */
.terminal-window .notebook paned.vertical > overlay:first-child {
padding-bottom: 6px;
}
/* An overlay which descends from the last-child of a vertical pane
*/
.terminal-window .notebook paned.vertical > :last-child overlay {
padding-top: 6px;
}
/* An overlay which _is_ the last-child of a vertical pane */
.terminal-window .notebook paned.vertical > overlay:last-child {
padding-top: 6px;
} Open this image in a new tab, and zoom fully to inspect. There are two remaining issues:
6px on each side seems like a lot. But I think this is the minimum required to avoid the drag handle. Strangely, it seems that the 'wide' handle has a smaller drag handle region. |
Beta Was this translation helpful? Give feedback.
-
I want to share my partial progress to solving issue #3020, and seek advice or alternatives to completely solve it.
My current WIP branch is here:
https://github.com/daviewales/ghostty/tree/gtk-paned-wide-handle
My WIP solution is the following patch:
This fixes a few issues, but also creates a few more:
Enabling GtkPaned wide handle ensures that the resize handle no longer covers content in the split panes.
However, by default this appears as a rectangle with 1px borders on each side.
Ideally, it would appear as a single centred 1px line.
The CSS changes above approximate this, but with some remaining issue:
background-color: <theme-background-color>
to thepaned > separator
CSS insrc/apprt/gtk/style.css
, it works. So this needs to be hooked into the code that sets up the background colours somewhere.5px
wide, they don't want to overlap the true (invisible) boundaries.How it looks if I manually add the theme background color:
Beta Was this translation helpful? Give feedback.
All reactions