new ui and added another error window for wrong login
This commit is contained in:
parent
d29e6b8767
commit
ad25e8c849
@ -5,9 +5,9 @@ namespace Project.Persistence;
|
|||||||
public partial class SQLite
|
public partial class SQLite
|
||||||
{
|
{
|
||||||
//filepath for home-pc:
|
//filepath for home-pc:
|
||||||
private static string _dbPath = "C:/Users/Soi/Desktop/keywi.db";
|
//private static string _dbPath = "C:/Users/Soi/Desktop/keywi.db";
|
||||||
//filepath for work-laptop:
|
//filepath for work-laptop:
|
||||||
//private static string _dbPath = "C:/Users/lowns/Desktop/keywi.db";
|
private static string _dbPath = "C:/Users/lowns/Desktop/keywi.db";
|
||||||
//KLASSENVARIABLEN ERSTELLEN
|
//KLASSENVARIABLEN ERSTELLEN
|
||||||
//private static string loginname;
|
//private static string loginname;
|
||||||
|
|
||||||
|
|||||||
@ -2,50 +2,74 @@
|
|||||||
x:Class="Project.View.LoginPage"
|
x:Class="Project.View.LoginPage"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
<Grid Background="SandyBrown">
|
|
||||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
||||||
<Image
|
|
||||||
Height="400"
|
|
||||||
Source="avares://Project.View/Images/keywi_logo_2.png"
|
|
||||||
Width="400" />
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Orientation="Vertical"
|
|
||||||
VerticalAlignment="Center">
|
|
||||||
<TextBlock>Your Login Name:</TextBlock>
|
|
||||||
<TextBox
|
|
||||||
TextWrapping="Wrap"
|
|
||||||
Watermark="Login-Name"
|
|
||||||
x:Name="LoginNameBox" />
|
|
||||||
|
|
||||||
<TextBlock>Password:</TextBlock>
|
<UserControl.Styles>
|
||||||
|
<Style Selector="Button">
|
||||||
|
<Setter Property="Width" Value="200" />
|
||||||
|
<Setter Property="Height" Value="40" />
|
||||||
|
<Setter Property="CornerRadius" Value="20" />
|
||||||
|
<Setter Property="Margin" Value="0,8" />
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="Background" Value="#4CAF50" />
|
||||||
|
<Setter Property="Foreground" Value="White" />
|
||||||
|
</Style>
|
||||||
|
</UserControl.Styles>
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<Grid.Background>
|
||||||
|
<LinearGradientBrush EndPoint="1,1" StartPoint="0,0">
|
||||||
|
<GradientStop Color="White" Offset="0" />
|
||||||
|
<GradientStop Color="LightGray" Offset="1" />
|
||||||
|
</LinearGradientBrush>
|
||||||
|
</Grid.Background>
|
||||||
|
|
||||||
<TextBox
|
<Border
|
||||||
PasswordChar="*"
|
Background="White"
|
||||||
TextWrapping="Wrap"
|
BoxShadow="0 4 8 0 #40000000"
|
||||||
Watermark="Password"
|
CornerRadius="8"
|
||||||
x:Name="LoginPasswordBox" />
|
Padding="20"
|
||||||
<Button
|
Width="400">
|
||||||
BorderBrush="Black"
|
|
||||||
BorderThickness="1"
|
<StackPanel>
|
||||||
Click="LoginButtonOnClick"
|
<Image
|
||||||
HorizontalAlignment="Center"
|
Height="150"
|
||||||
Margin="20"
|
Margin="0,0,0,20"
|
||||||
Name="ConfirmButton">
|
Source="avares://Project.View/Images/keywi_logo_2.png"
|
||||||
LOGIN
|
Width="150" />
|
||||||
</Button>
|
|
||||||
<Button
|
<TextBlock
|
||||||
BorderBrush="Black"
|
FontSize="24"
|
||||||
BorderThickness="1"
|
FontWeight="Bold"
|
||||||
Click="NewUserButtonOnClick"
|
HorizontalAlignment="Center"
|
||||||
HorizontalAlignment="Center"
|
Margin="0,0,0,20"
|
||||||
Margin="20"
|
Text="Login-Page" />
|
||||||
Name="NewUserButton">
|
|
||||||
Create New User
|
<TextBlock Text="Username:" />
|
||||||
</Button>
|
<TextBox
|
||||||
</StackPanel>
|
TextWrapping="Wrap"
|
||||||
|
Watermark="Your Username"
|
||||||
|
x:Name="LoginNameBox" />
|
||||||
|
|
||||||
|
<TextBlock Text="Password:" />
|
||||||
|
<TextBox
|
||||||
|
PasswordChar="•"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
Watermark="Enter password"
|
||||||
|
x:Name="LoginPasswordBox" />
|
||||||
|
|
||||||
|
<Button Click="LoginButtonOnClick" Name="ConfirmButton">
|
||||||
|
Login
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
Background="#FF9800"
|
||||||
|
Click="NewUserButtonOnClick"
|
||||||
|
Name="NewUserButton">
|
||||||
|
New User
|
||||||
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@ -25,7 +25,7 @@ public partial class LoginPage : UserControl
|
|||||||
string? loginName = LoginNameBox.Text ?? string.Empty;
|
string? loginName = LoginNameBox.Text ?? string.Empty;
|
||||||
string? loginPassword = LoginPasswordBox.Text ?? string.Empty;
|
string? loginPassword = LoginPasswordBox.Text ?? string.Empty;
|
||||||
bool allowLogin = AppController.CompareLogin(loginName, loginPassword);
|
bool allowLogin = AppController.CompareLogin(loginName, loginPassword);
|
||||||
var newPopUp = new PopUp();
|
var newPopUp = new LoginErrorPopUp();
|
||||||
if (allowLogin)
|
if (allowLogin)
|
||||||
{
|
{
|
||||||
//show menuview
|
//show menuview
|
||||||
|
|||||||
56
Project.View/LoginErrorPopup/LoginPageError.axaml
Normal file
56
Project.View/LoginErrorPopup/LoginPageError.axaml
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
<Window
|
||||||
|
SizeToContent="Height"
|
||||||
|
Title="WARNING"
|
||||||
|
Width="500"
|
||||||
|
WindowStartupLocation="CenterOwner"
|
||||||
|
x:Class="Project.View.LoginErrorPopUp"
|
||||||
|
xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
|
||||||
|
<Window.Styles>
|
||||||
|
<Style Selector="TextBlock">
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||||
|
<Setter Property="FontSize" Value="14" />
|
||||||
|
<Setter Property="Foreground" Value="Gray" />
|
||||||
|
<Setter Property="TextWrapping" Value="Wrap" />
|
||||||
|
<Setter Property="Margin" Value="0,5" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="Button">
|
||||||
|
<Setter Property="Width" Value="120" />
|
||||||
|
<Setter Property="Height" Value="40" />
|
||||||
|
<Setter Property="CornerRadius" Value="20" />
|
||||||
|
<Setter Property="Margin" Value="0,15,0,0" />
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="Background" Value="#4CAF50" />
|
||||||
|
<Setter Property="Foreground" Value="White" />
|
||||||
|
</Style>
|
||||||
|
</Window.Styles>
|
||||||
|
|
||||||
|
<Grid Background="#F5F5F5">
|
||||||
|
<Border
|
||||||
|
Background="White"
|
||||||
|
BoxShadow="0 4 8 0 #40000000"
|
||||||
|
CornerRadius="8"
|
||||||
|
Margin="15">
|
||||||
|
|
||||||
|
<ScrollViewer>
|
||||||
|
<StackPanel Margin="20" MaxWidth="450">
|
||||||
|
<TextBlock
|
||||||
|
FontSize="24"
|
||||||
|
FontWeight="Bold"
|
||||||
|
Margin="0,0,0,15"
|
||||||
|
Text="⚠️ Warning" />
|
||||||
|
<TextBlock Text="One or more entries are wrong or missing." />
|
||||||
|
<TextBlock Text="Your username and password do not match." />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
Click="LoginError_Click"
|
||||||
|
Content="OK"
|
||||||
|
Margin="0,15,0,5" />
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
22
Project.View/LoginErrorPopup/LoginPageError.axaml.cs
Normal file
22
Project.View/LoginErrorPopup/LoginPageError.axaml.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Interactivity;
|
||||||
|
using Avalonia.Media;
|
||||||
|
using Project.Controller;
|
||||||
|
using Project.Model;
|
||||||
|
using Project.Persistence;
|
||||||
|
namespace Project.View;
|
||||||
|
|
||||||
|
public partial class LoginErrorPopUp : Window
|
||||||
|
|
||||||
|
{
|
||||||
|
public LoginErrorPopUp()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoginError_Click(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,103 +2,114 @@
|
|||||||
x:Class="Project.View.MenuView"
|
x:Class="Project.View.MenuView"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
|
||||||
|
<UserControl.Styles>
|
||||||
|
<Style Selector="TextBlock">
|
||||||
|
<Setter Property="FontSize" Value="16" />
|
||||||
|
<Setter Property="Margin" Value="0,10" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="TextBox">
|
||||||
|
<Setter Property="Height" Value="35" />
|
||||||
|
<Setter Property="Margin" Value="0,5,0,10" />
|
||||||
|
<Setter Property="CornerRadius" Value="4" />
|
||||||
|
<Setter Property="TextWrapping" Value="Wrap" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="Button.icon">
|
||||||
|
<Setter Property="Width" Value="35" />
|
||||||
|
<Setter Property="Height" Value="35" />
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="CornerRadius" Value="4" />
|
||||||
|
<Setter Property="Margin" Value="5,0" />
|
||||||
|
</Style>
|
||||||
|
</UserControl.Styles>
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="200" />
|
<ColumnDefinition Width="250" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<ScrollViewer
|
<!-- left column -->
|
||||||
Grid.Column="0"
|
<Border Background="#F5F5F5" BoxShadow="2 0 10 0 #20000000">
|
||||||
Margin="0,0,0,40"
|
<Grid>
|
||||||
VerticalScrollBarVisibility="Auto">
|
<ScrollViewer Margin="0,0,0,60" VerticalScrollBarVisibility="Auto">
|
||||||
|
<StackPanel Margin="10" x:Name="entriesContainer" />
|
||||||
|
</ScrollViewer>
|
||||||
|
|
||||||
<StackPanel x:Name="entriesContainer">
|
<Button
|
||||||
|
Background="Red"
|
||||||
</StackPanel>
|
Content="-"
|
||||||
</ScrollViewer>
|
CornerRadius="22"
|
||||||
<Button
|
FontSize="24"
|
||||||
Click="NewEntryButton_OnClick"
|
Foreground="White"
|
||||||
Content="+"
|
Height="45"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Center"
|
||||||
Name="NewEntryButton"
|
IsEnabled="False"
|
||||||
VerticalAlignment="Bottom" />
|
Margin="0,0,-50,20"
|
||||||
|
VerticalAlignment="Bottom"
|
||||||
<Border Background="RosyBrown" Grid.Column="1">
|
Width="45"
|
||||||
<StackPanel Orientation="Horizontal" x:Name="ShowEntryDetails">
|
x:Name="DeleteButton" />
|
||||||
|
<Button
|
||||||
<StackPanel Margin="20,20,100,20" Orientation="Vertical">
|
Background="#4CAF50"
|
||||||
<TextBlock
|
Click="NewEntryButton_OnClick"
|
||||||
FontSize="20"
|
Content="+"
|
||||||
HorizontalAlignment="Left"
|
CornerRadius="22"
|
||||||
Margin="23"
|
FontSize="24"
|
||||||
Text="Name:" />
|
Foreground="White"
|
||||||
<TextBlock
|
Height="45"
|
||||||
FontSize="20"
|
HorizontalAlignment="Right"
|
||||||
HorizontalAlignment="Left"
|
Margin="0,0,20,20"
|
||||||
Margin="23"
|
VerticalAlignment="Bottom"
|
||||||
Text="Login-Name:" />
|
Width="45"
|
||||||
<TextBlock
|
x:Name="NewEntryButton" />
|
||||||
FontSize="20"
|
</Grid>
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Margin="23"
|
|
||||||
Text="URL:" />
|
|
||||||
<TextBlock
|
|
||||||
FontSize="20"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Margin="23"
|
|
||||||
Text="Password:" />
|
|
||||||
<TextBlock
|
|
||||||
FontSize="20"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Margin="23"
|
|
||||||
Text="Note:" />
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<StackPanel Margin="20,20,20,20" Orientation="Vertical">
|
|
||||||
<TextBox
|
|
||||||
Height="30"
|
|
||||||
Margin="20"
|
|
||||||
Text="THE NAME OF YOUR SAVED LOGIN"
|
|
||||||
TextWrapping="Wrap" />
|
|
||||||
<TextBox
|
|
||||||
Height="30"
|
|
||||||
Margin="20"
|
|
||||||
Text="YOUR LOGIN NAME ON THIS PAGE"
|
|
||||||
TextWrapping="Wrap" />
|
|
||||||
<TextBox
|
|
||||||
Height="30"
|
|
||||||
Margin="20"
|
|
||||||
Text="THE URL TO YOUR PAGE"
|
|
||||||
TextWrapping="Wrap" />
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<TextBox
|
|
||||||
Height="30"
|
|
||||||
Margin="20"
|
|
||||||
PasswordChar="*"
|
|
||||||
Text="PASSWORT"
|
|
||||||
TextWrapping="Wrap" />
|
|
||||||
<Button
|
|
||||||
BorderBrush="Black"
|
|
||||||
BorderThickness="1"
|
|
||||||
Content="X"
|
|
||||||
Name="copyPassword" />
|
|
||||||
<Button
|
|
||||||
BorderBrush="Black"
|
|
||||||
BorderThickness="1"
|
|
||||||
Content="X"
|
|
||||||
Name="showPassword" />
|
|
||||||
</StackPanel>
|
|
||||||
<TextBox
|
|
||||||
Height="150"
|
|
||||||
Margin="20"
|
|
||||||
Text="YOUR NOTES"
|
|
||||||
TextWrapping="Wrap" />
|
|
||||||
</StackPanel>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
|
<!-- Right column -->
|
||||||
|
<Border Background="White" Grid.Column="1">
|
||||||
|
<StackPanel Margin="40" x:Name="ShowEntryDetails">
|
||||||
|
|
||||||
|
<Grid ColumnDefinitions="150,*">
|
||||||
|
<!-- Labels -->
|
||||||
|
<StackPanel Grid.Column="0">
|
||||||
|
<TextBlock FontWeight="SemiBold" Text="Name:" />
|
||||||
|
<TextBlock FontWeight="SemiBold" Text="Login-Name:" />
|
||||||
|
<TextBlock FontWeight="SemiBold" Text="URL:" />
|
||||||
|
<TextBlock FontWeight="SemiBold" Text="Password:" />
|
||||||
|
<TextBlock FontWeight="SemiBold" Text="Note:" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!-- entry fields -->
|
||||||
|
<StackPanel Grid.Column="1">
|
||||||
|
<TextBox Text="THE NAME OF YOUR SAVED LOGIN" />
|
||||||
|
<TextBox Text="YOUR LOGIN NAME ON THIS PAGE" />
|
||||||
|
<TextBox Text="THE URL TO YOUR PAGE" />
|
||||||
|
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBox
|
||||||
|
PasswordChar="•"
|
||||||
|
Text="PASSWORT"
|
||||||
|
Width="250" />
|
||||||
|
<Button
|
||||||
|
Classes="icon"
|
||||||
|
Content="📋"
|
||||||
|
ToolTip.Tip="Passwort kopieren"
|
||||||
|
x:Name="copyPassword" />
|
||||||
|
<Button
|
||||||
|
Classes="icon"
|
||||||
|
Content="👁"
|
||||||
|
ToolTip.Tip="Passwort anzeigen"
|
||||||
|
x:Name="showPassword" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<TextBox
|
||||||
|
AcceptsReturn="True"
|
||||||
|
Height="150"
|
||||||
|
Text="YOUR NOTES" />
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@ -45,7 +45,8 @@ public partial class MenuView : Window
|
|||||||
Content = entry.Name, // Display the entry name on the button
|
Content = entry.Name, // Display the entry name on the button
|
||||||
Margin = new Thickness(5),
|
Margin = new Thickness(5),
|
||||||
Padding = new Thickness(10),
|
Padding = new Thickness(10),
|
||||||
Width = 200
|
Width = 200,
|
||||||
|
Background = Brushes.SlateGray,
|
||||||
};
|
};
|
||||||
// add click handler for the button
|
// add click handler for the button
|
||||||
button.Click += (object? sender, Avalonia.Interactivity.RoutedEventArgs e) => EntryDetails(entry);
|
button.Click += (object? sender, Avalonia.Interactivity.RoutedEventArgs e) => EntryDetails(entry);
|
||||||
|
|||||||
@ -4,73 +4,110 @@
|
|||||||
x:Class="Project.View.NewEntry"
|
x:Class="Project.View.NewEntry"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
<Grid>
|
|
||||||
|
|
||||||
<Border Background="SaddleBrown">
|
<UserControl.Styles>
|
||||||
|
<Style Selector="TextBlock">
|
||||||
|
<Setter Property="FontSize" Value="14" />
|
||||||
|
<Setter Property="FontWeight" Value="Medium" />
|
||||||
|
<Setter Property="Margin" Value="0,10,0,5" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="TextBox">
|
||||||
|
<Setter Property="Height" Value="40" />
|
||||||
|
<Setter Property="Margin" Value="0,0,0,10" />
|
||||||
|
<Setter Property="CornerRadius" Value="4" />
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
|
|
||||||
<StackPanel Orientation="Vertical">
|
</Style>
|
||||||
<TextBlock
|
<Style Selector="Button">
|
||||||
FontSize="20"
|
<Setter Property="Height" Value="35" />
|
||||||
HorizontalAlignment="Left"
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||||
Text="Name:" />
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
<TextBox TextWrapping="Wrap" Watermark="Name:" x:Name="NameBox"/>
|
<Setter Property="CornerRadius" Value="4" />
|
||||||
<TextBlock
|
<Setter Property="Margin" Value="5" />
|
||||||
FontSize="20"
|
<Setter Property="Padding" Value="15,0" />
|
||||||
HorizontalAlignment="Left"
|
</Style>
|
||||||
Text="Username/Email:" />
|
</UserControl.Styles>
|
||||||
<TextBox TextWrapping="Wrap" Watermark="Username/Email" x:Name="UsernameMailBox"/>
|
|
||||||
<TextBlock
|
|
||||||
FontSize="20"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Margin="23"
|
|
||||||
Text="URL:" />
|
|
||||||
<TextBox TextWrapping="Wrap" Watermark="E-Mail" x:Name="URLBox"/>
|
|
||||||
<TextBlock
|
|
||||||
FontSize="20"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Margin="23"
|
|
||||||
Text="Password:" />
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
|
|
||||||
|
<Border
|
||||||
|
Background="White"
|
||||||
|
BoxShadow="0 4 8 0 #40000000"
|
||||||
|
CornerRadius="8"
|
||||||
|
Margin="10">
|
||||||
|
|
||||||
|
<Grid Margin="20">
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock
|
||||||
|
FontSize="24"
|
||||||
|
FontWeight="Bold"
|
||||||
|
Foreground="Gray"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Margin="0,0,0,20"
|
||||||
|
Text="New Entry" />
|
||||||
|
|
||||||
|
<TextBlock Text="Name:" />
|
||||||
|
<TextBox Watermark="Enter Name" x:Name="NameBox" />
|
||||||
|
|
||||||
|
<TextBlock Text="Username/E-Mail:" />
|
||||||
|
<TextBox Watermark="Enter username or email" x:Name="UsernameMailBox" />
|
||||||
|
|
||||||
|
<TextBlock Text="URL:" />
|
||||||
|
<TextBox Watermark="Enter URL" x:Name="URLBox" />
|
||||||
|
|
||||||
|
<TextBlock Text="Password:" />
|
||||||
|
<Grid ColumnDefinitions="*, Auto, Auto">
|
||||||
<TextBox
|
<TextBox
|
||||||
|
Grid.Column="0"
|
||||||
Name="NewentryPW"
|
Name="NewentryPW"
|
||||||
PasswordChar="*"
|
PasswordChar="•"
|
||||||
Watermark="Password" x:Name="PassBox"/>
|
Watermark="Enter password"
|
||||||
|
x:Name="PassBox" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
BorderBrush="Black"
|
Background="#4CAF50"
|
||||||
BorderThickness="1"
|
Foreground="White"
|
||||||
Content="Generate Secure Password (WIP)"
|
Grid.Column="1"
|
||||||
Name="newentry_generate_password" />
|
IsEnabled="False"
|
||||||
|
Name="newentry_generate_password"
|
||||||
|
ToolTip.Tip="Generate secure password (WORK IN PROGRESS)">
|
||||||
|
🔒
|
||||||
|
</Button>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
BorderBrush="Black"
|
Background="#607D8B"
|
||||||
BorderThickness="1"
|
|
||||||
Click="NewEntry_ShowPW_Click"
|
Click="NewEntry_ShowPW_Click"
|
||||||
Content="👁"
|
Content="👁"
|
||||||
|
Foreground="White"
|
||||||
|
Grid.Column="2"
|
||||||
Name="newentry_show_password" />
|
Name="newentry_show_password" />
|
||||||
</StackPanel>
|
</Grid>
|
||||||
<TextBlock
|
|
||||||
FontSize="20"
|
<TextBlock Text="Note:" />
|
||||||
HorizontalAlignment="Left"
|
<TextBox
|
||||||
Text="Note:" />
|
AcceptsReturn="True"
|
||||||
<TextBox TextWrapping="Wrap" Watermark="Note" x:Name="NoteBox"/>
|
Height="80"
|
||||||
<StackPanel Orientation="Horizontal">
|
Watermark="Your note:"
|
||||||
|
x:Name="NoteBox" />
|
||||||
|
|
||||||
|
<StackPanel
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Margin="0,20,0,0"
|
||||||
|
Orientation="Horizontal">
|
||||||
<Button
|
<Button
|
||||||
BorderBrush="Black"
|
Background="#4CAF50"
|
||||||
BorderThickness="1"
|
|
||||||
Click="NewEntry_Cancel_Click"
|
|
||||||
Content="X"
|
|
||||||
Name="newentry_cancel_button" />
|
|
||||||
<Button
|
|
||||||
BorderBrush="Black"
|
|
||||||
BorderThickness="1"
|
|
||||||
Click="NewEntry_Save_Click"
|
Click="NewEntry_Save_Click"
|
||||||
Content="✓"
|
Content="Save"
|
||||||
|
Foreground="White"
|
||||||
Name="newentry_save_button" />
|
Name="newentry_save_button" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
Background="#FF5722"
|
||||||
|
Click="NewEntry_Cancel_Click"
|
||||||
|
Content="Cancel"
|
||||||
|
Foreground="White"
|
||||||
|
Name="newentry_cancel_button" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Grid>
|
||||||
|
</Border>
|
||||||
</Grid>
|
|
||||||
|
|
||||||
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@ -1,57 +1,85 @@
|
|||||||
<UserControl
|
<UserControl
|
||||||
Height="500"
|
Height="600"
|
||||||
Width="350"
|
Width="400"
|
||||||
x:Class="Project.View.NewLogin"
|
x:Class="Project.View.NewLogin"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
|
||||||
|
<UserControl.Styles>
|
||||||
|
<Style Selector="TextBlock">
|
||||||
|
<Setter Property="Margin" Value="0,5" />
|
||||||
|
<Setter Property="FontSize" Value="14" />
|
||||||
|
<Setter Property="FontWeight" Value="Medium" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="TextBox">
|
||||||
|
<Setter Property="Width" Value="250" />
|
||||||
|
<Setter Property="Margin" Value="0,5,0,15" />
|
||||||
|
<Setter Property="CornerRadius" Value="4" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="Button">
|
||||||
|
<Setter Property="Width" Value="120" />
|
||||||
|
<Setter Property="Height" Value="40" />
|
||||||
|
<Setter Property="CornerRadius" Value="20" />
|
||||||
|
<Setter Property="Margin" Value="10,8" />
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="Background" Value="#4CAF50" />
|
||||||
|
<Setter Property="Foreground" Value="White" />
|
||||||
|
</Style>
|
||||||
|
</UserControl.Styles>
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
|
<Grid.Background>
|
||||||
|
<LinearGradientBrush EndPoint="1,1" StartPoint="0,0">
|
||||||
|
<GradientStop Color="#FFE0B2" Offset="0" />
|
||||||
|
<GradientStop Color="#FFCC80" Offset="1" />
|
||||||
|
</LinearGradientBrush>
|
||||||
|
</Grid.Background>
|
||||||
|
|
||||||
<Border Background="SandyBrown">
|
<Border
|
||||||
|
Background="White"
|
||||||
|
BoxShadow="0 4 8 0 #40000000"
|
||||||
|
CornerRadius="8"
|
||||||
|
Margin="20">
|
||||||
|
|
||||||
<StackPanel Orientation="Vertical">
|
<StackPanel Margin="20">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
FontSize="20"
|
FontSize="24"
|
||||||
HorizontalAlignment="Left"
|
FontWeight="Bold"
|
||||||
Text="Username:" />
|
HorizontalAlignment="Center"
|
||||||
|
Margin="0,0,0,20"
|
||||||
|
Text="Neuer Benutzer" />
|
||||||
|
|
||||||
|
<TextBlock Text="Benutzername:" />
|
||||||
<TextBox
|
<TextBox
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Watermark="Username"
|
Watermark="Benutzername eingeben"
|
||||||
x:Name="NewLoginUsernameBox" />
|
x:Name="NewLoginUsernameBox" />
|
||||||
<TextBlock
|
|
||||||
FontSize="20"
|
<TextBlock Text="Passwort:" />
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Margin="23"
|
|
||||||
Text="Password:" />
|
|
||||||
<TextBox
|
<TextBox
|
||||||
PasswordChar="*"
|
PasswordChar="•"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Watermark="Password:"
|
Watermark="Passwort eingeben"
|
||||||
x:Name="NewLoginPasswordBox" />
|
x:Name="NewLoginPasswordBox" />
|
||||||
<TextBlock
|
|
||||||
FontSize="20"
|
<TextBlock Text="E-Mail:" />
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Margin="23"
|
|
||||||
Text="Email:" />
|
|
||||||
<TextBox
|
<TextBox
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Watermark="Email:"
|
Watermark="E-Mail-Adresse eingeben"
|
||||||
x:Name="NewLoginEmailBox" />
|
x:Name="NewLoginEmailBox" />
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
|
<StackPanel
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Margin="0,20,0,0"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<Button Click="NewLoginSaveOnClick" Content="Speichern" />
|
||||||
<Button
|
<Button
|
||||||
BorderBrush="Black"
|
Background="#FF5722"
|
||||||
BorderThickness="1"
|
|
||||||
Click="NewLoginSaveOnClick"
|
|
||||||
Content="Save" />
|
|
||||||
<Button
|
|
||||||
BorderBrush="Black"
|
|
||||||
BorderThickness="1"
|
|
||||||
Click="NewLoginCancelOnClick"
|
Click="NewLoginCancelOnClick"
|
||||||
Content="Cancel" />
|
Content="Abbrechen" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@ -1,5 +1,5 @@
|
|||||||
<Window
|
<Window
|
||||||
Height="250"
|
SizeToContent="Height"
|
||||||
Title="WARNING"
|
Title="WARNING"
|
||||||
Width="500"
|
Width="500"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
@ -7,16 +7,53 @@
|
|||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
|
||||||
<StackPanel Margin="20" Spacing="10">
|
<Window.Styles>
|
||||||
<TextBlock HorizontalAlignment="Center" Text="One or more of your inputs are missing or wrong." />
|
<Style Selector="TextBlock">
|
||||||
<TextBlock HorizontalAlignment="Center" Text="All fields must be filled." />
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||||
<TextBlock HorizontalAlignment="Center" Text="Your username needs at least 4 characters." />
|
<Setter Property="FontSize" Value="14" />
|
||||||
<TextBlock HorizontalAlignment="Center" Text="Your password needs at least 8 characters." />
|
<Setter Property="Foreground" Value="Gray" />
|
||||||
<TextBlock HorizontalAlignment="Center" Text="Make sure your email is correct." />
|
<Setter Property="TextWrapping" Value="Wrap" />
|
||||||
<Button
|
<Setter Property="Margin" Value="0,5" />
|
||||||
Click="OkButton_Click"
|
</Style>
|
||||||
Content="OK"
|
<Style Selector="Button">
|
||||||
HorizontalAlignment="Center"
|
<Setter Property="Width" Value="120" />
|
||||||
Width="80" />
|
<Setter Property="Height" Value="40" />
|
||||||
</StackPanel>
|
<Setter Property="CornerRadius" Value="20" />
|
||||||
|
<Setter Property="Margin" Value="0,15,0,0" />
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="Background" Value="#4CAF50" />
|
||||||
|
<Setter Property="Foreground" Value="White" />
|
||||||
|
</Style>
|
||||||
|
</Window.Styles>
|
||||||
|
|
||||||
|
<Grid Background="#F5F5F5">
|
||||||
|
<Border
|
||||||
|
Background="White"
|
||||||
|
BoxShadow="0 4 8 0 #40000000"
|
||||||
|
CornerRadius="8"
|
||||||
|
Margin="15">
|
||||||
|
|
||||||
|
<ScrollViewer>
|
||||||
|
<StackPanel Margin="20" MaxWidth="450">
|
||||||
|
<TextBlock
|
||||||
|
FontSize="24"
|
||||||
|
FontWeight="Bold"
|
||||||
|
Margin="0,0,0,15"
|
||||||
|
Text="⚠️ Warning" />
|
||||||
|
<TextBlock Text="One or more entries are wrong or missing." />
|
||||||
|
<TextBlock Text="All boxes must be filled in." />
|
||||||
|
<TextBlock Text="Your username needs to be at least 4 characters." />
|
||||||
|
<TextBlock Text="Your password needs to be at least 8 characters." />
|
||||||
|
<TextBlock Text="Make sure your e-mail is correct." />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
Click="OkButton_Click"
|
||||||
|
Content="OK"
|
||||||
|
Margin="0,15,0,5" />
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
@ -9,7 +9,8 @@ using Project.Persistence;
|
|||||||
namespace Project.View;
|
namespace Project.View;
|
||||||
|
|
||||||
public partial class PopUp : Window
|
public partial class PopUp : Window
|
||||||
{ public PopUp()
|
{
|
||||||
|
public PopUp()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,6 +36,10 @@
|
|||||||
<DependentUpon>NewEntry.axaml</DependentUpon>
|
<DependentUpon>NewEntry.axaml</DependentUpon>
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Update="LoginErrorPopup\LoginErrorPopup.axaml.cs">
|
||||||
|
<DependentUpon>PopUp.axaml</DependentUpon>
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user