Expose ProgressBackgroundColor for improved coloring per theme

This commit is contained in:
John Lewin 2018-06-24 17:18:37 -07:00
parent 70ed64f6c9
commit 3a2a2c9313
2 changed files with 14 additions and 4 deletions

View file

@ -38,16 +38,17 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
public class RunningTaskRow : FlowLayoutWidget
{
private ProgressBar progressBar;
private ExpandCheckboxButton expandButton;
internal RunningTaskDetails taskDetails;
private ProgressBar progressBar;
private ExpandCheckboxButton expandButton;
private ThemeConfig theme;
public RunningTaskRow(string title, RunningTaskDetails taskDetails, ThemeConfig theme)
: base(FlowDirection.TopToBottom)
{
this.taskDetails = taskDetails;
this.theme = theme;
this.MinimumSize = new Vector2(100, 20);
@ -172,6 +173,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
taskDetails.ProgressChanged += TaskDetails_ProgressChanged;
}
public Color ProgressBackgroundColor
{
get => progressBar.BackgroundColor = this.BorderColor;
set => progressBar.BackgroundColor = value;
}
private void SetExpansionMode(ThemeConfig theme, GuiWidget detailsPanel, bool isExpanded)
{
expandButton.Checked = isExpanded;

View file

@ -90,6 +90,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
}
}
var progressBackgroundColor = borderColor.AdjustAlpha(35);
// Add new items
foreach (var taskItem in tasks.RunningTasks.Where(t => !displayedTasks.Contains(t)))
{
@ -99,6 +101,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
BackgroundColor = theme.AccentMimimalOverlay,
Border = new BorderDouble(1, 1, 1, 0),
BorderColor = borderColor,
ProgressBackgroundColor = progressBackgroundColor
};
pendingTasksList.AddChild(taskRow);