Changeset - 99f3d61e20d7
[Not reviewed]
Tess Snider (Malkyne) - 3 years ago 2021-07-20 20:38:53
this@malkyne.org
Modal Dialogs should no longer get stuck behind main window.
4 files changed with 4 insertions and 6 deletions:
0 comments (0 inline, 0 general)
Views/AboutView.axaml
Show inline comments
 
<Window xmlns="https://github.com/avaloniaui"
 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 
        xmlns:vm="using:DesertPaintCodex.ViewModels"
 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 
        mc:Ignorable="d" d:DesignWidth="296" d:DesignHeight="550"
 
        x:Class="DesertPaintCodex.Views.AboutView"
 
        Width="296" Height="550"
 
        Width="296" Height="550" Topmost="True"
 
        SizeToContent="Height"
 
        SystemDecorations="BorderOnly"
 
        WindowStartupLocation="CenterScreen"
 
        Title="About Desert Paint Codex">
 

	
 
    <Design.DataContext>
 
        <vm:AboutViewModel />
 
    </Design.DataContext>
 

	
 
    <Window.DataContext>
 
        <vm:AboutViewModel />
 
    </Window.DataContext>
 

	
 
    <DockPanel Margin="20" LastChildFill="True">
 
        <Image DockPanel.Dock="Top" Source="{StaticResource Image_Splash}" Width="256" Height="256"/>
 
        <TextBlock DockPanel.Dock="Top" Classes="BlockHeader" Margin="0, 10, 0, 0">DESERT PAINT CODEX - T10</TextBlock>
 

	
 
        <TextBlock DockPanel.Dock="Top" Margin="0, 5, 0, 0">
 
            Authors: Afrah, Snoerr
 
        </TextBlock>
 

	
 
        <Button DockPanel.Dock="Bottom" Command="{Binding CloseDialog}">Done</Button>
 

	
 
        <Button DockPanel.Dock="Bottom" Command="{Binding OpenBrowser}"
 
                CommandParameter="https://repos.malkyne.org/ATITD-Tools/Desert-Paint-Codex" Margin="0, 0, 0, 10">
 
            Visit Repository
 
        </Button>
 

	
 
        <TextBlock TextWrapping="Wrap" Margin="0, 30" Text="{Binding AboutText}" />
 
    </DockPanel>
 
</Window>
...
 
\ No newline at end of file
Views/MainWindow.axaml
Show inline comments
 
<Window xmlns="https://github.com/avaloniaui"
 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 
        xmlns:vm="using:DesertPaintCodex.ViewModels"
 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 
        xmlns:views="clr-namespace:DesertPaintCodex.Views"
 
        mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="800"
 
        Width="640" Height="800"
 
        MinWidth="600" MinHeight="500"
 
        Topmost="True"
 
        Width="640" Height="800" MinWidth="600" MinHeight="500" Topmost="True"
 
        x:Class="DesertPaintCodex.Views.MainWindow"
 
        Icon="/Assets/desert_paint_codex_icon.ico"
 
        Title="Desert Paint Codex">
 

	
 
    <Design.DataContext>
 
        <vm:MainWindowViewModel/>
 
    </Design.DataContext>
 
    
 
    <Window.DataContext>
 
        <vm:MainWindowViewModel/>
 
    </Window.DataContext>
 
    
 
    <Window.Styles>
 
        <!--
 
        <Style Selector="Menu">
 
            <Setter Property="Background" Value="#282828"/>
 
        </Style>
 
        -->
 
        <Style Selector="ContentControl">
 
            <Setter Property="Margin" Value="0 5 0 0"/>
 
        </Style>
 
        <Style Selector="TextBlock.StatusBar">
 
            <Setter Property="Margin" Value="5"/>
 
        </Style>
 
        <Style Selector="TabControl.ActivityPicker WrapPanel">
 
            <Setter Property="Background" Value="{DynamicResource GutterBackgroundBrush}"/>
 
        </Style>
 
    
 
        <Style Selector="TabControl.ActivityPicker">
 
            <Setter Property="Background" Value="{DynamicResource FlatBackgroundBrush}"/>
 
        </Style>
 
    
 
        <Style Selector="TabControl.ActivityPicker > TabItem">
 
            <Setter Property="Padding" Value="15 5"/>
 
        </Style>
 
    
 
        <Style Selector="TabControl.ActivityPicker > TabItem:pointerover">
 
            <Setter Property="Foreground" Value="#000000"/>
 
        </Style>
 

	
 
        <Style Selector="TabControl.ActivityPicker > TabItem:selected">
 
            <Setter Property="Background" Value="{DynamicResource FlatBackgroundBrush}"/>
 
            <Setter Property="Foreground" Value="#FFFFFF"/>
 
        </Style>
 

	
 
        <Style Selector="TabControl.ActivityPicker > TabItem:selected /template/ ContentPresenter#PART_ContentPresenter">
 
            <Setter Property="Background" Value="{DynamicResource FlagBackgroundBrush}"/>
 
        </Style>
 
    </Window.Styles>
 
    <Grid ColumnDefinitions="*" RowDefinitions="*">
 
        <DockPanel Name="Main" Grid.Row="0" Grid.Column="0">
 
            <Menu DockPanel.Dock="Top" Margin="0, 5">
 
                <MenuItem Header="_File">
 
                    <MenuItem Header="Profile">
 
                        <MenuItem Header="Manage Profiles..." Command="{Binding ManageProfiles}"></MenuItem>
 
                        <MenuItem Header="Import Profile..." Command="{Binding ImportProfile}">
 
                            <ToolTip.Tip>
 
                                Will overwrite the current profile with a profile from a zipped folder.
 
                            </ToolTip.Tip>
 
                        </MenuItem>
 
                        <MenuItem Header="Export Profile..." Command="{Binding ExportProfile}">
 
                            <ToolTip.Tip>
 
                                Will export the current profile to a zipped folder.
 
                            </ToolTip.Tip>
 
                        </MenuItem>
 
                        <MenuItem Header="Export for PracticalPaint..." Command="{Binding ExportForPP}">
 
                            <ToolTip.Tip>
 
                                Will generate a Practical Paint reactions file from the current profile.
 
                            </ToolTip.Tip>
 
                        </MenuItem>
 
                    </MenuItem>
 

	
 
                    <MenuItem Header="Recipes">
 
                        <MenuItem Header="Export Paint Recipes..." Command="{Binding ExportPaintRecipes}">
 
                            <ToolTip.Tip>
 
                                Exports recipes in Wiki table format.
 
                            </ToolTip.Tip>
 
                        </MenuItem>
 
                        <MenuItem Header="Export Ribbon Recipes..." Command="{Binding ExportRibbonRecipes}">
 
                            <ToolTip.Tip>
 
                                Exports recipes in Wiki table format.
 
                            </ToolTip.Tip>
 
                        </MenuItem>
 
                        <MenuItem Header="Copy Paint Recipes to Clipboard" Command="{Binding CopyPaintRecipes}">
 
                            <ToolTip.Tip>
 
                                Copies recipes in Wiki table format.
 
                            </ToolTip.Tip>
 
                        </MenuItem>
 
                        <MenuItem Header="Copy Ribbon Recipes to Clipboard" Command="{Binding CopyRibbonRecipes}">
 
                            <ToolTip.Tip>
 
                                Copies recipes in Wiki table format.
 
                            </ToolTip.Tip>
 
                        </MenuItem>
 
                    </MenuItem>
 

	
 
                    <Separator/>
Views/MessageBoxView.axaml
Show inline comments
 
<Window xmlns="https://github.com/avaloniaui"
 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 
        xmlns:vm="clr-namespace:DesertPaintCodex.ViewModels"
 
        Width="300" SizeToContent="Height"
 
        Width="300" SizeToContent="Height" Topmost="True"
 
        mc:Ignorable="d" d:DesignWidth="300" d:DesignHeight="200"
 
        WindowStartupLocation="CenterOwner"
 
        x:Class="DesertPaintCodex.Views.MessageBoxView">
 

	
 
    <Design.DataContext>
 
        <vm:MessageBoxViewModel />
 
    </Design.DataContext>
 

	
 
    <DockPanel Margin="20" HorizontalAlignment="Stretch">
 
        
 
        <TextBlock DockPanel.Dock="Top" Classes="BlockHeader" TextWrapping="Wrap" Text="{Binding Title}" Margin="0, 0, 0, 15" />
 
        
 
        <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Center" Spacing="15" Margin="0, 20, 0, 0">
 
            <Button Command="{Binding PickOption}" CommandParameter="0"
 
                    IsVisible="{Binding OptionAText, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
 
                    Padding="20, 5">
 
                <TextBlock Text="{Binding OptionAText}"/>
 
            </Button>
 
            <Button Command="{Binding PickOption}" CommandParameter="1"
 
                    IsVisible="{Binding OptionBText, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
 
                    Padding="20, 5">
 
                <TextBlock Text="{Binding OptionBText}"/>
 
            </Button>
 
            <Button Command="{Binding PickOption}" CommandParameter="2"
 
                    IsVisible="{Binding OptionCText, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
 
                    Padding="20, 5">
 
                <TextBlock Text="{Binding OptionCText}"/>
 
            </Button>
 
        </StackPanel>
 
        
 
        <TextBlock TextWrapping="Wrap" Text="{Binding Message}" />
 
    </DockPanel>
 
</Window>
...
 
\ No newline at end of file
Views/ScreenSettingsView.axaml
Show inline comments
 
<Window xmlns="https://github.com/avaloniaui"
 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 
        xmlns:vm="using:DesertPaintCodex.ViewModels"
 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 
        x:Class="DesertPaintCodex.Views.ScreenSettingsView"
 
        mc:Ignorable="d" d:DesignWidth="310" d:DesignHeight="330"
 
        Width="320" Height="330"
 
        Width="320" Height="330" Topmost="True"
 
        WindowStartupLocation="CenterScreen"
 
        Title="Screen Settings">
 

	
 
  <Design.DataContext>
 
    <vm:ScreenSettingsViewModel/>
 
  </Design.DataContext>
 
  
 
  <DockPanel Margin="20">
 
    <TextBlock DockPanel.Dock="Top" Margin="0, 0, 0, 4">Which screen is the game on?</TextBlock>
 
    
 
    <Grid DockPanel.Dock="Top" ColumnDefinitions="80,10,80,10,90" RowDefinitions="Auto" Margin="7 0 0 0">
 
      <TextBlock Text="Position" Grid.Row="0" Grid.Column="0"/>
 
      <TextBlock Text="Size" Grid.Row="0" Grid.Column="2"/>
 
    </Grid>
 
    
 
    <Button DockPanel.Dock="Bottom" Command="{Binding Save}">Ok</Button>
 
    
 
    <Grid DockPanel.Dock="Bottom" ColumnDefinitions="*,12,80,12,24" RowDefinitions="Auto,30,Auto" Margin="0, 0, 0, 30">
 
      <TextBlock VerticalAlignment="Center" TextWrapping="Wrap" TextAlignment="Right" Grid.Row="2" Grid.Column="0">
 
        Screen pixels to game pixels:
 
      </TextBlock>
 
      <NumericUpDown Minimum="1" Maximum="4" Increment="1" Value="{Binding PixelMultiplier}" Grid.Row="2" Grid.Column="2"/>
 
      <Border Classes="Help" Grid.Row="2" Grid.Column="4">
 
        <TextBlock>?</TextBlock>
 
        <ToolTip.Tip>
 
          <StackPanel Margin="5" Spacing="20" Orientation="Vertical">
 
            <TextBlock Classes="BlockHeader">Screen Pixels to Game Pixels</TextBlock>
 
            <TextBlock TextWrapping="Wrap">If your screen is scaled at the system-level, you may need to adjust this number to measure UI elements correctly.</TextBlock>
 
          </StackPanel>
 
        </ToolTip.Tip>
 
      </Border>
 
    </Grid>
 

	
 
    <ListBox Items="{Binding Screens}" SelectedIndex="{Binding ScreenIndex, Mode=TwoWay}" Margin="0,4,0,20">
 
      <ListBox.ItemTemplate>
 
        <DataTemplate>
 
          <Grid ColumnDefinitions="80,10,80,10,60" RowDefinitions="Auto">
 
            <TextBlock Text="{Binding PositionToStr}" Grid.Row="0" Grid.Column="0" />
 
            <TextBlock Text="{Binding SizeToStr}"  Grid.Row="0" Grid.Column="2"/>
 
            <TextBlock Text="Primary" IsVisible="{Binding IsPrimary}" Grid.Row="0" Grid.Column="4" />
 
          </Grid>
 
        </DataTemplate>
 
      </ListBox.ItemTemplate>
 
    </ListBox>
 
    
 
  </DockPanel>
 

	
 
</Window>
0 comments (0 inline, 0 general)