Skip to content

Commit

Permalink
hide target = all in packagemanager
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikMennen committed Aug 8, 2024
1 parent 2f6b0de commit fe9d994
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 2 additions & 0 deletions src/OneWare.Essentials/PackageManager/PackageVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ public class PackageVersion
public string? Version { get; init; }

public PackageTarget[]? Targets { get; init; }

public bool TargetAll => Targets is [{ Target: "all" }];
}
4 changes: 2 additions & 2 deletions src/OneWare.PackageManager/Views/PackageView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<ItemsControl ItemsSource="{Binding Links}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" Spacing="5" />
<StackPanel Orientation="Horizontal" Spacing="7" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.DataTemplates>
Expand Down Expand Up @@ -68,7 +68,7 @@
</StackPanel>
</StackPanel>

<ItemsControl ItemsSource="{Binding SelectedVersion.Targets}">
<ItemsControl ItemsSource="{Binding SelectedVersion.Targets, FallbackValue={x:Null}}" IsVisible="{Binding !SelectedVersion.TargetAll, FallbackValue={x:False}}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" Spacing="5" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ public static async Task<HardwareGuiViewModel> CreateGuiAsync(string guiPath, IH
var connectorStyle = element.TryGetProperty("connectorStyle", out var connectorStyleProperty)
? connectorStyleProperty.GetString()
: "default";

var fontSize = element.TryGetProperty("fontSize", out var fontSizeProperty)
? fontSizeProperty.GetInt32()
: 10;

switch (element.GetProperty("type").GetString()?.ToLower())
{
Expand Down Expand Up @@ -132,11 +136,7 @@ public static async Task<HardwareGuiViewModel> CreateGuiAsync(string guiPath, IH
var text = element.TryGetProperty("text", out var textProperty)
? textProperty.GetString()
: null;

var fontSize = element.TryGetProperty("fontSize", out var fontSizeProperty)
? fontSizeProperty.GetInt32()
: 12;


vm.AddElement(new FpgaGuiElementRectViewModel(x, y, width, height)
{
Color = color,
Expand Down Expand Up @@ -232,6 +232,7 @@ public static async Task<HardwareGuiViewModel> CreateGuiAsync(string guiPath, IH
FlipLabel = flipLabel,
Parent = hardwareModel,
Foreground = foreground,
FontSize = fontSize,
Rotation = isHorizontal ? 90 : 0
});
}
Expand Down Expand Up @@ -264,6 +265,7 @@ public static async Task<HardwareGuiViewModel> CreateGuiAsync(string guiPath, IH
Text = label,
FlipLabel = flipLabel,
Parent = hardwareModel,
FontSize = fontSize,
Foreground = foreground
});
break;
Expand All @@ -281,10 +283,6 @@ public static async Task<HardwareGuiViewModel> CreateGuiAsync(string guiPath, IH

var text = element.GetProperty("text").GetString();

var fontSize = element.TryGetProperty("fontSize", out var fontSizeProperty)
? fontSizeProperty.GetInt32()
: 12;

vm.AddElement(new FpgaGuiElementTextViewModel(x, y)
{
Rotation = rotation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<RotateTransform Angle="{Binding Rotation}" />
</UserControl.RenderTransform>
<StackPanel Orientation="Horizontal" Margin="{Binding #Label.Bounds.Width, Converter={x:Static converters:UniversalFpgaProjectSystemConverters.HorizontalLabelMarginConverter}}">
<TextBlock IsVisible="{Binding !FlipLabel}" Padding="2 0" VerticalAlignment="Center" ClipToBounds="False" Name="Label" FontSize="{Binding Height}" Text="{Binding Text}" Foreground="{Binding Foreground}">
<TextBlock IsVisible="{Binding !FlipLabel}" Padding="2 0" VerticalAlignment="Center" ClipToBounds="False" Name="Label" FontSize="{Binding FontSize}" Text="{Binding Text}" Foreground="{Binding Foreground}">
<Interaction.Behaviors>
<behaviors:ApplyAlternativeBindingIfNullBehavior OriginalValue="{Binding Foreground}" AlternativeValue="{DynamicResource ThemeForegroundBrush}" />
</Interaction.Behaviors>
Expand Down Expand Up @@ -61,7 +61,7 @@
</DataTriggerBehavior>
</Interaction.Behaviors>
</Button>
<TextBlock IsVisible="{Binding FlipLabel}" Padding="2 0" VerticalAlignment="Center" ClipToBounds="False" Name="FlippedLabel" FontSize="{Binding Height}" Text="{Binding Text}" Foreground="{Binding Foreground}">
<TextBlock IsVisible="{Binding FlipLabel}" Padding="2 0" VerticalAlignment="Center" ClipToBounds="False" Name="FlippedLabel" Height="{Binding Height}" FontSize="{Binding FontSize}" Text="{Binding Text}" Foreground="{Binding Foreground}">
<Interaction.Behaviors>
<behaviors:ApplyAlternativeBindingIfNullBehavior OriginalValue="{Binding Foreground}" AlternativeValue="{DynamicResource ThemeForegroundBrush}" />
</Interaction.Behaviors>
Expand Down

0 comments on commit fe9d994

Please sign in to comment.