Uitrol 27-09-2026 18:30
This commit is contained in:
@@ -1,14 +1,16 @@
|
|||||||
<Window x:Class="MijnBesluit.Uitroller.Instellingenvenster"
|
<Window x:Class="MijnBesluit.Uitroller.Instellingenvenster"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
Title="Instellingen" Height="620" Width="560"
|
Title="Instellingen" Height="620" Width="640"
|
||||||
Icon="uitroller.ico"
|
Icon="uitroller.ico"
|
||||||
WindowStartupLocation="CenterOwner" Background="#F4F5F7"
|
WindowStartupLocation="CenterOwner" Background="#F4F5F7"
|
||||||
TextOptions.TextFormattingMode="Ideal" UseLayoutRounding="True"
|
TextOptions.TextFormattingMode="Ideal" UseLayoutRounding="True"
|
||||||
FontFamily="Segoe UI">
|
FontFamily="Segoe UI">
|
||||||
|
|
||||||
<!-- Zelfde palet en stijlen als Hoofdvenster.xaml, hier los gehouden omdat dit een eigen
|
<!-- Zelfde palet en stijlen als Hoofdvenster.xaml, hier los gehouden omdat dit een eigen
|
||||||
venster is (geen gedeeld resource-woordenboek in dit project). -->
|
venster is (geen gedeeld resource-woordenboek in dit project). Indeling (Grid per groep:
|
||||||
|
label/veld/knop, groepen recht onder elkaar) is overgenomen van RenH.Uitroller, zodat
|
||||||
|
instellingenschermen van verschillende projecten er hetzelfde uitzien. -->
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<SolidColorBrush x:Key="Vlak" Color="#FFFFFF" />
|
<SolidColorBrush x:Key="Vlak" Color="#FFFFFF" />
|
||||||
<SolidColorBrush x:Key="Rand" Color="#E3E6EC" />
|
<SolidColorBrush x:Key="Rand" Color="#E3E6EC" />
|
||||||
@@ -25,7 +27,7 @@
|
|||||||
<Setter Property="Foreground" Value="{StaticResource Tekst}" />
|
<Setter Property="Foreground" Value="{StaticResource Tekst}" />
|
||||||
<Setter Property="BorderBrush" Value="{StaticResource RandDonker}" />
|
<Setter Property="BorderBrush" Value="{StaticResource RandDonker}" />
|
||||||
<Setter Property="BorderThickness" Value="1" />
|
<Setter Property="BorderThickness" Value="1" />
|
||||||
<Setter Property="Padding" Value="14,7" />
|
<Setter Property="Padding" Value="12,6" />
|
||||||
<Setter Property="FontSize" Value="13" />
|
<Setter Property="FontSize" Value="13" />
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||||
@@ -81,6 +83,7 @@
|
|||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style TargetType="GroupBox">
|
<Style TargetType="GroupBox">
|
||||||
|
<Setter Property="Margin" Value="0,0,0,12" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="GroupBox">
|
<ControlTemplate TargetType="GroupBox">
|
||||||
@@ -96,12 +99,6 @@
|
|||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="VeldLabel" TargetType="TextBlock">
|
|
||||||
<Setter Property="Foreground" Value="{StaticResource TekstDof}" />
|
|
||||||
<Setter Property="Margin" Value="0,0,0,3" />
|
|
||||||
<Setter Property="FontSize" Value="12" />
|
|
||||||
</Style>
|
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
|
|
||||||
<Grid Margin="18">
|
<Grid Margin="18">
|
||||||
@@ -119,105 +116,108 @@
|
|||||||
|
|
||||||
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
|
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<GroupBox Header="Server en geheim" Margin="0,0,0,14">
|
<GroupBox Header="Mappen en e-mail">
|
||||||
<StackPanel>
|
<Grid>
|
||||||
<TextBlock Text="Server" Style="{StaticResource VeldLabel}" />
|
<Grid.ColumnDefinitions>
|
||||||
<TextBox x:Name="VeldServer" Margin="0,0,0,10" />
|
<ColumnDefinition Width="140" />
|
||||||
<Grid>
|
<ColumnDefinition Width="*" />
|
||||||
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
</Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="14" />
|
<Grid.RowDefinitions>
|
||||||
<ColumnDefinition Width="120" />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
<RowDefinition Height="Auto" />
|
||||||
<StackPanel Grid.Column="0">
|
<RowDefinition Height="Auto" />
|
||||||
<TextBlock Text="Geheim" Style="{StaticResource VeldLabel}" />
|
<RowDefinition Height="Auto" />
|
||||||
<TextBox x:Name="VeldGeheim" />
|
</Grid.RowDefinitions>
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Grid.Column="2">
|
<TextBlock Grid.Row="0" Grid.Column="0" Text="Projectmap" VerticalAlignment="Center" Margin="0,5" Foreground="{StaticResource TekstDof}" />
|
||||||
<TextBlock Text="Poort" Style="{StaticResource VeldLabel}" />
|
<TextBox Grid.Row="0" Grid.Column="1" x:Name="VeldProjectmap" Margin="0,5" />
|
||||||
<TextBox x:Name="VeldPoort" />
|
<Button Grid.Row="0" Grid.Column="2" Content="Bladeren…" Margin="8,5,0,5" Click="Bladeren_Projectmap" />
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
<TextBlock Grid.Row="1" Grid.Column="0" Text="Publicatiemap" VerticalAlignment="Center" Margin="0,5" Foreground="{StaticResource TekstDof}" />
|
||||||
</StackPanel>
|
<TextBox Grid.Row="1" Grid.Column="1" x:Name="VeldPublicatiemap" Margin="0,5" />
|
||||||
|
<Button Grid.Row="1" Grid.Column="2" Content="Bladeren…" Margin="8,5,0,5" Click="Bladeren_Publicatiemap" />
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="2" Grid.Column="0" Text="E-mailadres (test)" VerticalAlignment="Center" Margin="0,5" Foreground="{StaticResource TekstDof}" />
|
||||||
|
<TextBox Grid.Row="2" Grid.Column="1" x:Name="VeldEmail" Margin="0,5" />
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="3" Grid.Column="0" Text="Auto-verversen (sec)" VerticalAlignment="Center" Margin="0,5" Foreground="{StaticResource TekstDof}" />
|
||||||
|
<TextBox Grid.Row="3" Grid.Column="1" x:Name="VeldGiteaVerversen" Margin="0,5" Width="90" HorizontalAlignment="Left"
|
||||||
|
ToolTip="Elke zoveel seconden vernieuwen de Gitea-knoppen zich vanzelf. 0 = uit; minimaal 10." />
|
||||||
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
<GroupBox Header="Mappen" Margin="0,0,0,14">
|
<GroupBox Header="Server en geheim">
|
||||||
<StackPanel>
|
<Grid>
|
||||||
<TextBlock Text="Projectmap" Style="{StaticResource VeldLabel}" />
|
<Grid.ColumnDefinitions>
|
||||||
<Grid Margin="0,0,0,10">
|
<ColumnDefinition Width="140" />
|
||||||
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="120" />
|
||||||
<ColumnDefinition Width="10" />
|
</Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<Grid.RowDefinitions>
|
||||||
</Grid.ColumnDefinitions>
|
<RowDefinition Height="Auto" />
|
||||||
<TextBox Grid.Column="0" x:Name="VeldProjectmap" />
|
<RowDefinition Height="Auto" />
|
||||||
<Button Grid.Column="2" Content="Bladeren…" Click="Bladeren_Projectmap" />
|
</Grid.RowDefinitions>
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<TextBlock Text="Publicatiemap" Style="{StaticResource VeldLabel}" />
|
<TextBlock Grid.Row="0" Grid.Column="0" Text="Server" VerticalAlignment="Center" Margin="0,5" Foreground="{StaticResource TekstDof}" />
|
||||||
<Grid>
|
<TextBox Grid.Row="0" Grid.Column="1" x:Name="VeldServer" Margin="0,5,8,5" />
|
||||||
<Grid.ColumnDefinitions>
|
<TextBox Grid.Row="0" Grid.Column="2" x:Name="VeldPoort" Margin="0,5" />
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
<ColumnDefinition Width="10" />
|
<TextBlock Grid.Row="1" Grid.Column="0" Text="Geheim" VerticalAlignment="Center" Margin="0,5" Foreground="{StaticResource TekstDof}" />
|
||||||
<ColumnDefinition Width="Auto" />
|
<TextBox Grid.Row="1" Grid.Column="1" x:Name="VeldGeheim" Grid.ColumnSpan="2" Margin="0,5" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid>
|
||||||
<TextBox Grid.Column="0" x:Name="VeldPublicatiemap" />
|
|
||||||
<Button Grid.Column="2" Content="Bladeren…" Click="Bladeren_Publicatiemap" />
|
|
||||||
</Grid>
|
|
||||||
</StackPanel>
|
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
<GroupBox Header="Lokaal testen" Margin="0,0,0,14">
|
<GroupBox Header="Lokaal testen">
|
||||||
<StackPanel>
|
<Grid>
|
||||||
<TextBlock Text="Testadres (van MijnBesluit.Web, launchSettings.json)" Style="{StaticResource VeldLabel}" />
|
<Grid.ColumnDefinitions>
|
||||||
<TextBox x:Name="VeldTestadres" Margin="0,0,0,10" />
|
<ColumnDefinition Width="140" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<TextBlock Text="Chrome.exe (leeg = de gewone plek)" Style="{StaticResource VeldLabel}" />
|
<TextBlock Grid.Row="0" Grid.Column="0" Text="Testadres" VerticalAlignment="Center" Margin="0,5" Foreground="{StaticResource TekstDof}" />
|
||||||
<Grid Margin="0,0,0,10">
|
<TextBox Grid.Row="0" Grid.Column="1" x:Name="VeldTestadres" Grid.ColumnSpan="2" Margin="0,5" />
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
<ColumnDefinition Width="10" />
|
|
||||||
<ColumnDefinition Width="Auto" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<TextBox Grid.Column="0" x:Name="VeldChrome" />
|
|
||||||
<Button Grid.Column="2" Content="Bladeren…" Click="Bladeren_Chrome" />
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<TextBlock Text="E-mailadres (invullen bij inloggen tijdens lokaal testen)" Style="{StaticResource VeldLabel}" />
|
<TextBlock Grid.Row="1" Grid.Column="0" Text="Chrome.exe" VerticalAlignment="Center" Margin="0,5" Foreground="{StaticResource TekstDof}" />
|
||||||
<TextBox x:Name="VeldEmail" />
|
<TextBox Grid.Row="1" Grid.Column="1" x:Name="VeldChrome" Margin="0,5" />
|
||||||
</StackPanel>
|
<Button Grid.Row="1" Grid.Column="2" Content="Bladeren…" Margin="8,5,0,5" Click="Bladeren_Chrome" />
|
||||||
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
<GroupBox Header="Gitea (alleen invullen als de git-remote 'origin' ontbreekt of niet te ontleden is)">
|
<GroupBox Header="Gitea (alleen invullen als de git-remote 'origin' ontbreekt of niet te ontleden is)">
|
||||||
<StackPanel>
|
<Grid>
|
||||||
<TextBlock Text="Basis-URL" Style="{StaticResource VeldLabel}" />
|
<Grid.ColumnDefinitions>
|
||||||
<TextBox x:Name="VeldGiteaUrl" Margin="0,0,0,10" />
|
<ColumnDefinition Width="140" />
|
||||||
<Grid>
|
<ColumnDefinition Width="*" />
|
||||||
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="14" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="140" />
|
||||||
<ColumnDefinition Width="14" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="*" />
|
</Grid.ColumnDefinitions>
|
||||||
</Grid.ColumnDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<StackPanel Grid.Column="0">
|
<RowDefinition Height="Auto" />
|
||||||
<TextBlock Text="Eigenaar" Style="{StaticResource VeldLabel}" />
|
<RowDefinition Height="Auto" />
|
||||||
<TextBox x:Name="VeldGiteaEigenaar" />
|
</Grid.RowDefinitions>
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Grid.Column="2">
|
|
||||||
<TextBlock Text="Repo" Style="{StaticResource VeldLabel}" />
|
|
||||||
<TextBox x:Name="VeldGiteaRepo" />
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<TextBlock Text="Auto-verversen (sec, 0 = uit, minimaal 10)" Style="{StaticResource VeldLabel}" Margin="0,10,0,3" />
|
<TextBlock Grid.Row="0" Grid.Column="0" Text="Basis-URL" VerticalAlignment="Center" Margin="0,5" Foreground="{StaticResource TekstDof}" />
|
||||||
<TextBox x:Name="VeldGiteaVerversen" Width="120" HorizontalAlignment="Left" />
|
<TextBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="4" x:Name="VeldGiteaUrl" Margin="0,5" />
|
||||||
</StackPanel>
|
|
||||||
|
<TextBlock Grid.Row="1" Grid.Column="0" Text="Eigenaar" VerticalAlignment="Center" Margin="0,5" Foreground="{StaticResource TekstDof}" />
|
||||||
|
<TextBox Grid.Row="1" Grid.Column="1" x:Name="VeldGiteaEigenaar" Margin="0,5" />
|
||||||
|
<TextBlock Grid.Row="1" Grid.Column="3" Text="Repo" VerticalAlignment="Center" Margin="0,5" Foreground="{StaticResource TekstDof}" />
|
||||||
|
<TextBox Grid.Row="1" Grid.Column="4" x:Name="VeldGiteaRepo" Margin="0,5" />
|
||||||
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|
||||||
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,16,0,0">
|
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,16,0,0">
|
||||||
<Button Content="Annuleren" Margin="0,0,10,0" Click="Annuleren_Click" />
|
<Button Content="Opslaan" Style="{StaticResource Primair}" Padding="18,7" Margin="0,0,8,0" Click="Opslaan_Click" IsDefault="True" />
|
||||||
<Button Content="Opslaan" Style="{StaticResource Primair}" Click="Opslaan_Click" />
|
<Button Content="Annuleren" Padding="18,7" Click="Annuleren_Click" IsCancel="True" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -14,12 +14,19 @@ namespace MijnBesluit.Uitroller;
|
|||||||
public partial class Instellingenvenster : Window
|
public partial class Instellingenvenster : Window
|
||||||
{
|
{
|
||||||
private readonly Instellingen _instellingen;
|
private readonly Instellingen _instellingen;
|
||||||
|
private readonly Vensterstand _vensterstand =
|
||||||
|
Vensterstand.Lees(Instellingen.InstellingenVensterPad, Instellingen.InstellingenVensterPadNaastExe);
|
||||||
|
|
||||||
public Instellingenvenster(Instellingen instellingen)
|
public Instellingenvenster(Instellingen instellingen)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_instellingen = instellingen;
|
_instellingen = instellingen;
|
||||||
VeldenVullen();
|
VeldenVullen();
|
||||||
|
|
||||||
|
// Positie/grootte van de vorige keer terugzetten en bij sluiten weer bewaren (eigen
|
||||||
|
// bestand, los van het hoofdvenster). Geport van RenH.Uitroller.
|
||||||
|
VensterstandTerugzetten();
|
||||||
|
Closing += (_, __) => VensterstandBewaren();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void VeldenVullen()
|
private void VeldenVullen()
|
||||||
@@ -38,6 +45,51 @@ public partial class Instellingenvenster : Window
|
|||||||
VeldGiteaVerversen.Text = _instellingen.GiteaVerversSeconden.ToString();
|
VeldGiteaVerversen.Text = _instellingen.GiteaVerversSeconden.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>Zet het venster terug op de onthouden plek en grootte, mits die nog (deels) op een
|
||||||
|
/// beeldscherm valt (anders opent hij gecentreerd op de eigenaar, zoals in de XAML).</summary>
|
||||||
|
private void VensterstandTerugzetten()
|
||||||
|
{
|
||||||
|
if (!_vensterstand.Bruikbaar) return;
|
||||||
|
|
||||||
|
double schermL = SystemParameters.VirtualScreenLeft;
|
||||||
|
double schermB = SystemParameters.VirtualScreenTop;
|
||||||
|
double schermBr = SystemParameters.VirtualScreenWidth;
|
||||||
|
double schermH = SystemParameters.VirtualScreenHeight;
|
||||||
|
|
||||||
|
const double kier = 60;
|
||||||
|
bool zichtbaar =
|
||||||
|
(_vensterstand.Links + _vensterstand.Breedte) > schermL + kier &&
|
||||||
|
_vensterstand.Links < schermL + schermBr - kier &&
|
||||||
|
(_vensterstand.Boven + _vensterstand.Hoogte) > schermB + kier &&
|
||||||
|
_vensterstand.Boven < schermB + schermH - kier;
|
||||||
|
|
||||||
|
if (!zichtbaar) return;
|
||||||
|
|
||||||
|
WindowStartupLocation = WindowStartupLocation.Manual;
|
||||||
|
Left = _vensterstand.Links;
|
||||||
|
Top = _vensterstand.Boven;
|
||||||
|
Width = _vensterstand.Breedte;
|
||||||
|
Height = _vensterstand.Hoogte;
|
||||||
|
if (_vensterstand.Gemaximaliseerd) WindowState = WindowState.Maximized;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Bewaart de huidige plek en grootte (RestoreBounds bij gemaximaliseerd), in het eigen
|
||||||
|
/// bestand van het instellingenscherm.</summary>
|
||||||
|
private void VensterstandBewaren()
|
||||||
|
{
|
||||||
|
Rect b = WindowState == WindowState.Normal
|
||||||
|
? new Rect(Left, Top, Width, Height)
|
||||||
|
: RestoreBounds;
|
||||||
|
if (b.IsEmpty || b.Width < 1 || b.Height < 1) return;
|
||||||
|
|
||||||
|
_vensterstand.Links = b.Left;
|
||||||
|
_vensterstand.Boven = b.Top;
|
||||||
|
_vensterstand.Breedte = b.Width;
|
||||||
|
_vensterstand.Hoogte = b.Height;
|
||||||
|
_vensterstand.Gemaximaliseerd = WindowState == WindowState.Maximized;
|
||||||
|
_vensterstand.Bewaar(Instellingen.InstellingenVensterPad);
|
||||||
|
}
|
||||||
|
|
||||||
private static void Kies(System.Windows.Controls.TextBox veld)
|
private static void Kies(System.Windows.Controls.TextBox veld)
|
||||||
{
|
{
|
||||||
var dlg = new Microsoft.Win32.OpenFolderDialog { Title = "Kies een map" };
|
var dlg = new Microsoft.Win32.OpenFolderDialog { Title = "Kies een map" };
|
||||||
|
|||||||
Reference in New Issue
Block a user