Skip to content

Commit

Permalink
Tweak the styling to make the sidebar less greedy
Browse files Browse the repository at this point in the history
By the looks of things, with #77, the issue is that there is a Vertical that
is width auto, which contains a Tree that is width auto, and a label that is
width 100%. The intention seems to be that the sidebar should be as wide as
the tree is, and the tree should be as wide as its content needs; meanwhile
the label should be the full width of its container.

At some point recently it seems the balance in this setup has changed and
the 100% label is making its auto-width container extra greedy.

Given that there's no simple way of saying "be 100% of my parent but don't
put pressure on its width calculation if it's width auto" this commit
changes things so that the label itself is also width auto, and tries to
ensure that the background looks like it did before.

The fundamental fix for this probably needs to be in Textual's layout code,
but this will fix Trogon itself in the meanwhile.

Fixes #77.
  • Loading branch information
davep committed Mar 27, 2024
1 parent a2d8874 commit 659f40a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trogon/trogon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@

#home-commands-label {
color: $text;
background: $background 50%;
width: 100%;
width: auto;
height: 4;
padding: 1 2;
}

#home-sidebar {
background: $background 50%;
dock: left;
width: auto;
}
Expand Down

0 comments on commit 659f40a

Please sign in to comment.