mirror of
https://git.tonybark.com/tonytins/CyberBits.git
synced 2026-06-28 04:03:37 -04:00
WIP UI refractor
Swapped stack panels for using the grid's rows. Unfortunately, this is causing some height problems.
This commit is contained in:
parent
71cc94e251
commit
77cc3b4364
2 changed files with 72 additions and 72 deletions
|
|
@ -1,10 +1,10 @@
|
|||
<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"
|
||||
Width="800" Height="530" CanResize="False"
|
||||
ExtendClientAreaToDecorationsHint="True"
|
||||
x:Class="CyberBits.Views.MainWindow"
|
||||
x:DataType="vm:MainWindowViewModel"
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
<Design.DataContext>
|
||||
<!-- This only sets the DataContext for the previewer in an IDE,
|
||||
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
|
||||
<vm:MainWindowViewModel/>
|
||||
<vm:MainWindowViewModel />
|
||||
</Design.DataContext>
|
||||
|
||||
<StackPanel>
|
||||
|
|
@ -22,72 +22,76 @@
|
|||
WindowDecorationProperties.ElementRole="TitleBar">
|
||||
<TextBlock Margin="12,0" FontSize="17"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
Text="CyberBits" >
|
||||
Text="CyberBits">
|
||||
</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"
|
||||
Width="120"
|
||||
HorizontalContentAlignment="Center"
|
||||
SelectedValue="0"
|
||||
x:Name="BitSelection"
|
||||
HorizontalAlignment="Center"
|
||||
SelectionChanged="SelectedBitsControl_OnSelectionChanged"
|
||||
Margin="5"/>
|
||||
<ListBox 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"
|
||||
Margin="5"
|
||||
Height="110"/>
|
||||
<TextBlock Name="ExtrasText" Text="Balls" HorizontalAlignment="Center" />
|
||||
<ListBox
|
||||
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}"
|
||||
SelectedItem="{Binding SelectedAesthetics}"
|
||||
Name="AestheticsItems"
|
||||
Margin="5"
|
||||
Height="110"/>
|
||||
<Border Height="10" />
|
||||
<TextBlock Text="Cyberware" HorizontalAlignment="Center" />
|
||||
<ListBox ItemsSource="{Binding CyberwareList}"
|
||||
SelectedItem="{Binding SelectedCyberware}"
|
||||
Name="CyberwareItems"
|
||||
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>
|
||||
|
||||
<!-- 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"
|
||||
Margin="5" />
|
||||
|
||||
<ListBox Grid.Row="1" Grid.Column="0"
|
||||
ItemsSource="{Binding ModelsList}"
|
||||
SelectedItem="{Binding SelectedModels}"
|
||||
Name="ModelItems"
|
||||
Margin="5"
|
||||
Height="110" />
|
||||
|
||||
<ListBox Grid.Row="2" Grid.Column="0"
|
||||
Margin="5"
|
||||
Height="110" />
|
||||
<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"
|
||||
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" />
|
||||
|
||||
<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" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Border Margin="2" VerticalAlignment="Bottom">
|
||||
<TextBlock HorizontalAlignment="Right" Name="VersionBox" Margin="10" Text="v0.1.100" />
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue