WIP UI refractor

Swapped stack panels for using the grid's rows. Unfortunately, this is causing some height problems.
This commit is contained in:
Tony Bark 2026-05-16 07:45:01 -04:00
parent 71cc94e251
commit 77cc3b4364
2 changed files with 72 additions and 72 deletions

View file

@ -1,8 +1,8 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:CyberBits.ViewModels"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:CyberBits.ViewModels"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="530"
Width="800" Height="530" CanResize="False"
ExtendClientAreaToDecorationsHint="True"
@ -26,68 +26,72 @@
</TextBlock>
</Border>
<Grid ColumnDefinitions="*,*" HorizontalAlignment="Center">
<!-- Left column: Image -->
<Image x:Name="BitsImage" Grid.Column="0" Source="avares://CyberBits/Assets/cock.jpg" />
<GridSplitter Grid.Column="1" ResizeDirection="Columns"/>
<StackPanel Grid.Column="1">
<Grid ColumnDefinitions="200,180">
<GridSplitter ResizeDirection="Columns"/>
<StackPanel Grid.Column="0" >
<ComboBox ItemsSource="{Binding GenitalOptions}"
SelectedItem="{Binding SelectedBits}"
PlaceholderText="Genitals"
<!-- Right column: main content grid (replaces the two StackPanels) -->
<Grid Grid.Column="1"
RowDefinitions="Auto,Auto,Auto,*,*,*"
ColumnDefinitions="200,Auto,180">
<!-- First column (200px) Bit selection and model lists -->
<ComboBox Grid.Row="0" Grid.Column="0"
Width="120"
HorizontalContentAlignment="Center"
SelectedValue="0"
x:Name="BitSelection"
PlaceholderText="Genitals"
HorizontalAlignment="Center"
SelectionChanged="SelectedBitsControl_OnSelectionChanged"
Margin="5" />
<ListBox ItemsSource="{Binding ModelsList}"
<ListBox Grid.Row="1" Grid.Column="0"
ItemsSource="{Binding ModelsList}"
SelectedItem="{Binding SelectedModels}"
Name="ModelItems"
Margin="5"
Height="110" />
<Border Height="10" />
<TextBlock Text="Pubes" HorizontalAlignment="Center" />
<ListBox ItemsSource="{Binding PubesList}"
SelectedItem="{Binding SelectedPubes}"
Name="PubesItems"
<ListBox Grid.Row="2" Grid.Column="0"
Margin="5"
Height="110" />
<TextBlock Name="ExtrasText" Text="Balls" HorizontalAlignment="Center" />
<ListBox
<TextBlock Name="ExtrasText" Grid.Row="3" Grid.Column="0" Text="Balls" />
<ListBox Grid.Row="4" Grid.Column="0"
ItemsSource="{Binding ExtrasList}"
SelectedItem="{Binding SelectedExtras}"
Name="ExtraItems"
Margin="5"
Height="110"
/>
</StackPanel>
<GridSplitter Grid.Column="1" ResizeDirection="Columns"/>
<StackPanel Grid.Column="1">
<TextBlock Text="Aesthetics" HorizontalAlignment="Center" />
<ListBox ItemsSource="{Binding AestheticsList}"
Height="110" />
<!-- Splitter between the two inner columns -->
<GridSplitter Grid.Row="0" Grid.RowSpan="4"
Grid.Column="1"
ResizeDirection="Columns" />
<!-- Second column Aesthetics, Cyberware, etc. -->
<TextBlock Grid.Row="0" Grid.Column="2"
Text="Aesthetics"
HorizontalAlignment="Center" />
<ListBox Grid.Row="1" Grid.Column="2"
ItemsSource="{Binding AestheticsList}"
SelectedItem="{Binding SelectedAesthetics}"
Name="AestheticsItems"
Margin="5"
Height="110" />
<Border Height="10" />
<TextBlock Text="Cyberware" HorizontalAlignment="Center" />
<ListBox ItemsSource="{Binding CyberwareList}"
<TextBlock Grid.Row="2" Grid.Column="2"
Text="Cyberware"
HorizontalAlignment="Center" />
<ListBox Grid.Row="3" Grid.Column="2"
ItemsSource="{Binding CyberwareList}"
SelectedItem="{Binding SelectedCyberware}"
Name="CyberwareItems"
Height="110" />
<TextBlock Grid.Row="4" Grid.Column="2" Text="Butts" />
<ListBox Grid.Row="5" Grid.Column="2"
Margin="5"
Height="110" />
<TextBlock Text="Butt" HorizontalAlignment="Center" />
<ListBox ItemsSource="{Binding ButtsList}"
SelectedItem="{Binding SelectedButt}"
Name="ButtOptions"
Margin="5"
Height="110"
/>
</StackPanel>
</Grid>
</StackPanel>
</Grid>
<Border Margin="2" VerticalAlignment="Bottom">
<TextBlock HorizontalAlignment="Right" Name="VersionBox" Margin="10" Text="v0.1.100" />

View file

@ -6,7 +6,7 @@ namespace CyberBits.Views;
public partial class MainWindow : Window
{
private string? AppPath => Path.GetDirectoryName(Assembly.GetAssembly(typeof(MainWindow))?.Location);
private static string? AppPath => Path.GetDirectoryName(Assembly.GetAssembly(typeof(MainWindow))?.Location);
public MainWindow()
@ -18,11 +18,10 @@ public partial class MainWindow : Window
var commonFile = File.ReadAllText($"{AppPath}//{DataFiles.COMMON_JSON}");
var commonData = JsonSerializer.Deserialize<UniversalModel>(commonFile);
PubesItems.ItemsSource = commonData?.Pubes;
/*PubesItems.ItemsSource = commonData?.Pubes;
CyberwareItems.ItemsSource = commonData?.Cyberware;
AestheticsItems.ItemsSource = commonData?.Aesthetic;
ButtOptions.ItemsSource = commonData?.Butt;
ButtOptions.ItemsSource = commonData?.Butt;*/
}
catch (Exception e)
{
@ -35,12 +34,10 @@ public partial class MainWindow : Window
#else
VersionBox.Text = AppConsts.VERSION;
#endif
}
private void GenitalSwap(string image, string data)
{
try
{
var genitalFile = File.ReadAllText($"{AppPath}//{data}");
@ -56,7 +53,6 @@ public partial class MainWindow : Window
Console.WriteLine(e);
throw;
}
}
private void SelectedBitsControl_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)