Merge pull request #1424 from mtkennerly/bugfix/pane-grid-undraggable-area-when-cramped
When pane grid title bar is cramped, still show content until hover and allow dragging where content would've been
This commit is contained in:
commit
94fc3d993e
1 changed files with 15 additions and 9 deletions
|
|
@ -144,14 +144,14 @@ where
|
|||
let mut show_title = true;
|
||||
|
||||
if let Some(controls) = &self.controls {
|
||||
let controls_layout = children.next().unwrap();
|
||||
if title_layout.bounds().width + controls_layout.bounds().width
|
||||
> padded.bounds().width
|
||||
{
|
||||
show_title = false;
|
||||
}
|
||||
|
||||
if show_controls || self.always_show_controls {
|
||||
let controls_layout = children.next().unwrap();
|
||||
if title_layout.bounds().width + controls_layout.bounds().width
|
||||
> padded.bounds().width
|
||||
{
|
||||
show_title = false;
|
||||
}
|
||||
|
||||
controls.as_widget().draw(
|
||||
&tree.children[1],
|
||||
renderer,
|
||||
|
|
@ -195,8 +195,14 @@ where
|
|||
if self.controls.is_some() {
|
||||
let controls_layout = children.next().unwrap();
|
||||
|
||||
!controls_layout.bounds().contains(cursor_position)
|
||||
&& !title_layout.bounds().contains(cursor_position)
|
||||
if title_layout.bounds().width + controls_layout.bounds().width
|
||||
> padded.bounds().width
|
||||
{
|
||||
!controls_layout.bounds().contains(cursor_position)
|
||||
} else {
|
||||
!controls_layout.bounds().contains(cursor_position)
|
||||
&& !title_layout.bounds().contains(cursor_position)
|
||||
}
|
||||
} else {
|
||||
!title_layout.bounds().contains(cursor_position)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue