Keep chat titles readable in narrow headers
Prioritize the conversation title on narrow chat bars, move compact controls and overflow actions into More, and omit the duplicate title in floating windows. Add focused widget coverage for title sizing, icon dimensions, menus, and floating chrome.
This commit is contained in:
@@ -69,8 +69,14 @@ class SegmentedBar extends StatefulWidget implements PreferredSizeWidget {
|
||||
this.foregroundColor,
|
||||
this.bottomPadding = 8,
|
||||
this.backdrop,
|
||||
this.titleShare,
|
||||
});
|
||||
|
||||
/// The share of the bar the title always keeps beside the actions, when it
|
||||
/// must hold more than the default (a long conversation name in a narrow
|
||||
/// bar). Null keeps the default shares.
|
||||
final double? titleShare;
|
||||
|
||||
/// The title; empty shows no title pill unless there is a [subtitle].
|
||||
final String title;
|
||||
|
||||
@@ -390,8 +396,11 @@ class _SegmentedBarState extends State<SegmentedBar> {
|
||||
// width (a destination's name) up to [SegmentedBar.maxTitleShare];
|
||||
// actions that do not fit beside it move into the More menu.
|
||||
final width = constraints.maxWidth;
|
||||
final titleShare = widget.titleShare;
|
||||
final titleMinimum = titleWidget != null || !showTitle
|
||||
? width * SegmentedBar.minTitleShare
|
||||
: titleShare != null
|
||||
? width * titleShare
|
||||
: math.max(
|
||||
width * SegmentedBar.minTitleShare,
|
||||
math.min(
|
||||
@@ -405,9 +414,9 @@ class _SegmentedBarState extends State<SegmentedBar> {
|
||||
width * SegmentedBar.maxTitleShare,
|
||||
),
|
||||
);
|
||||
final minimumTitleShare = widget.separateActionIslands
|
||||
? .10
|
||||
: SegmentedBar.minTitleShare;
|
||||
final minimumTitleShare =
|
||||
titleShare ??
|
||||
(widget.separateActionIslands ? .10 : SegmentedBar.minTitleShare);
|
||||
final besideTitle =
|
||||
width - (leading == null ? 0 : segmentedPieceHeight() + 8) - 8;
|
||||
// Actions that cannot move (a model picker) may take the room down
|
||||
|
||||
Reference in New Issue
Block a user