Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/microbe_stage/gui/CompoundProgressBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ public partial class CompoundProgressBar : Control

private Color fillColour = new(0.6f, 0.6f, 0.6f, 1);

private StyleBoxFlat amountCompactTheme = new()
{
BgColor = new Color(0.2f, 0.2f, 0.2f, 0.45f),
BorderColor = Colors.Transparent,
CornerRadiusBottomLeft = 6,
CornerRadiusBottomRight = 6,
CornerRadiusTopLeft = 6,
CornerRadiusTopRight = 6,
ContentMarginLeft = 6,
ContentMarginRight = 3,
};

public enum BarMode
{
Normal,
Expand Down Expand Up @@ -469,6 +481,7 @@ protected override void Dispose(bool disposing)
minSizeXReference.Dispose();
}

amountCompactTheme.Dispose();
base.Dispose(disposing);
}

Expand Down Expand Up @@ -617,13 +630,15 @@ private void ApplyCompactMode(bool playAnimation)
tween.TweenProperty(this, minSizeXReference,
Narrow ? Constants.COMPOUND_BAR_NARROW_COMPACT_WIDTH : Constants.COMPOUND_BAR_COMPACT_WIDTH, 0.3);

amountLabel.AddThemeStyleboxOverride("normal", amountCompactTheme);
nameLabel.Hide();
}
else
{
tween.TweenProperty(this, minSizeXReference,
Narrow ? Constants.COMPOUND_BAR_NARROW_NORMAL_WIDTH : Constants.COMPOUND_BAR_NORMAL_WIDTH, 0.3);

amountLabel.RemoveThemeStyleboxOverride("normal");
nameLabel.Show();
}
}
Expand All @@ -636,6 +651,7 @@ private void ApplyCompactMode(bool playAnimation)
Narrow ? Constants.COMPOUND_BAR_NARROW_COMPACT_WIDTH : Constants.COMPOUND_BAR_COMPACT_WIDTH,
CustomMinimumSize.Y);

amountLabel.AddThemeStyleboxOverride("normal", amountCompactTheme);
nameLabel.Hide();
}
else
Expand All @@ -645,6 +661,7 @@ private void ApplyCompactMode(bool playAnimation)
Narrow ? Constants.COMPOUND_BAR_NARROW_NORMAL_WIDTH : Constants.COMPOUND_BAR_NORMAL_WIDTH,
CustomMinimumSize.Y);

amountLabel.RemoveThemeStyleboxOverride("normal");
nameLabel.Show();
}
}
Expand Down