Skip to content
Snippets Groups Projects
Commit 8a946d05 authored by Marcel Kehrberg's avatar Marcel Kehrberg
Browse files

Merge branch 'PagiProgres' into 'develop'

Paginator und screen für Progress in develop

See merge request !33
parents 7192cd25 99d26bd5
No related branches found
No related tags found
1 merge request!33Paginator und screen für Progress in develop
Showing
with 206 additions and 88 deletions
InnoLabProjektDektopApp/InnoLabProjektDektopApp/Assets/filter.png

576 B

InnoLabProjektDektopApp/InnoLabProjektDektopApp/Assets/play.png

814 B

InnoLabProjektDektopApp/InnoLabProjektDektopApp/Assets/settings.png

2.7 KiB

......@@ -35,7 +35,7 @@ namespace InnoLabProjektDektopApp
private void Button_Click(object sender, RoutedEventArgs e)
{
//
this.NavigationService.Navigate(new Progress());
}
}
}
\ No newline at end of file
......@@ -7,17 +7,61 @@
xmlns:header="clr-namespace:InnoLabProjektDektopApp.Screens.Templates"
mc:Ignorable="d">
<Grid>
<Label Content="Your way to working more focused" HorizontalAlignment="Center" Margin="0,119,0,0" VerticalAlignment="Top" Height="108" Width="780" FontSize="48" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<TextBlock HorizontalAlignment="Center" Height="39" TextWrapping="Wrap" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et" VerticalAlignment="Top" Width="324" Margin="0,216,0,0"/>
<Label Content="Edit distracting items" HorizontalAlignment="Left" Height="30" Margin="68,393,0,0" VerticalAlignment="Top" Width="125"/>
<Label Content="Edit Settings" HorizontalAlignment="Left" Height="25" Margin="386,398,0,0" VerticalAlignment="Top" Width="92"/>
<Label Content="Start focus session" HorizontalAlignment="Left" Height="26" Margin="695,397,0,0" VerticalAlignment="Top" Width="130"/>
<TextBlock HorizontalAlignment="Left" Height="68" Margin="68,428,0,0" TextWrapping="Wrap" Text="Aliquam erat volutpat. Integer malesuada turpis id fringilla suscipit. Maecenas ultrices, orci vitae convallis mattis." VerticalAlignment="Top" Width="126"/>
<TextBlock HorizontalAlignment="Center" Height="68" Margin="0,428,0,0" TextWrapping="Wrap" Text="Aliquam erat volutpat. Integer malesuada turpis id fringilla suscipit. Maecenas ultrices, orci vitae convallis mattis." VerticalAlignment="Top" Width="124"/>
<TextBlock HorizontalAlignment="Left" Height="68" Margin="695,428,0,0" TextWrapping="Wrap" Text="Aliquam erat volutpat. Integer malesuada turpis id fringilla suscipit. Maecenas ultrices, orci vitae convallis mattis." VerticalAlignment="Top" Width="125"/>
<Button Content="Button" HorizontalAlignment="Left" Height="40" Margin="68,343,0,0" VerticalAlignment="Top" Width="110" Click="Button_Click1"/>
<Button Content="Button" HorizontalAlignment="Left" Height="40" Margin="388,343,0,0" VerticalAlignment="Top" Width="110" Click="Button_Click2"/>
<Button Content="Button" HorizontalAlignment="Left" Height="40" Margin="695,343,0,0" VerticalAlignment="Top" Width="110" Click="Button_Click2"/>
<Label Content="Your way to working more focused" HorizontalAlignment="Center" Margin="0,91,0,0" VerticalAlignment="Top" Height="108" Width="780" FontSize="48" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<Canvas HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,240,0,0">
<Path StrokeThickness="3" Canvas.Left="-261" Canvas.Top="45.833" HorizontalAlignment="Center" Stretch="Fill" VerticalAlignment="Top" Width="191" Height="30" Stroke="Black">
<Path.Data>
<PathGeometry>
<PathFigure StartPoint="20,100">
<BezierSegment Point1="100,100" Point2="200,0" Point3="300,50" />
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>
<Path StrokeThickness="3" Canvas.Left="50.5" Canvas.Top="45.833" Stretch="Fill" Width="191" Height="30" Stroke="Black" HorizontalAlignment="Center" VerticalAlignment="Top">
<Path.Data>
<PathGeometry Figures="M20,100 C100,100 200,0 300,50"/>
</Path.Data>
</Path>
</Canvas>
<TextBlock HorizontalAlignment="Center" Height="39" TextWrapping="Wrap" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et" VerticalAlignment="Top" Width="324" Margin="0,188,0,0"/>
<Label Content="Edit distracting items" HorizontalAlignment="Left" Height="30" Margin="68,331,0,0" VerticalAlignment="Top" Width="125"/>
<Label Content="Edit Settings" HorizontalAlignment="Left" Height="25" Margin="386,336,0,0" VerticalAlignment="Top" Width="92"/>
<Label Content="Start focus session" HorizontalAlignment="Left" Height="26" Margin="695,335,0,0" VerticalAlignment="Top" Width="130"/>
<TextBlock HorizontalAlignment="Left" Height="68" Margin="68,366,0,0" TextWrapping="Wrap" Text="Aliquam erat volutpat. Integer malesuada turpis id fringilla suscipit. Maecenas ultrices, orci vitae convallis mattis." VerticalAlignment="Top" Width="126"/>
<TextBlock HorizontalAlignment="Center" Height="68" Margin="0,366,0,0" TextWrapping="Wrap" Text="Aliquam erat volutpat. Integer malesuada turpis id fringilla suscipit. Maecenas ultrices, orci vitae convallis mattis." VerticalAlignment="Top" Width="124"/>
<TextBlock HorizontalAlignment="Left" Height="68" Margin="695,366,0,0" TextWrapping="Wrap" Text="Aliquam erat volutpat. Integer malesuada turpis id fringilla suscipit. Maecenas ultrices, orci vitae convallis mattis." VerticalAlignment="Top" Width="125"/>
<!-- Pagination -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,478,0,0" Width="265" VerticalAlignment="Top">
<Button Content="Previous" Width="70" Margin="5" Click="PreviousPage_Click" />
<StackPanel Orientation="Horizontal">
<Ellipse Width="15" Height="15" Fill="Black" Margin="5"/>
<!-- Aktive Seite -->
<Ellipse Width="15" Height="15" Fill="Gray" Margin="5"/>
<!-- Inaktive Seite -->
<Ellipse Width="15" Height="15" Fill="Gray" Margin="5"/>
<Ellipse Width="15" Height="15" Fill="Gray" Margin="5"/>
</StackPanel>
<!--
<Button Content="1" Width="20" Margin="5" Click="first_Page" />
<Button Content="2" Width="20" Margin="5" Click="Second_Page" />
<Button Content="3" Width="20" Margin="5" Click="third_Page" />
<Button Content="4" Width="20" Margin="5" Click="fourth_Page" />
<Button Content="5" Width="20" Margin="5" Click="fifth_Page" />
-->
<Button Content="Next" Width="70" Margin="5" Click="NextPage_Click" />
</StackPanel>
<Image HorizontalAlignment="Left" Height="57" Margin="81,269,0,0" VerticalAlignment="Top" Width="54" Source="/Screens/FirstLaunch/filter.png"/>
<Image HorizontalAlignment="Center" Height="57" Margin="0,269,0,0" VerticalAlignment="Top" Width="54" Source="/Screens/FirstLaunch/settings.png"/>
<Image HorizontalAlignment="Left" Height="57" Margin="731,269,0,0" VerticalAlignment="Top" Width="54" Source="/Screens/FirstLaunch/play.png"/>
</Grid>
</Page>
......@@ -32,5 +32,15 @@ namespace InnoLabProjektDektopApp
{
//this.Content = new AnotherWindow().Content;
}
private void PreviousPage_Click(object sender, RoutedEventArgs e)
{
this.NavigationService.Navigate(new Startscreen());
}
private void NextPage_Click(object sender, RoutedEventArgs e)
{
this.NavigationService.Navigate(new Distractions());
}
}
}
\ No newline at end of file
......@@ -7,7 +7,7 @@
xmlns:header="clr-namespace:InnoLabProjektDektopApp.Screens.Templates"
mc:Ignorable="d">
<Grid>
<StackPanel Margin="20,0,20,20">
<Grid>
......@@ -72,7 +72,7 @@
<StackPanel x:Name="SearchResultsPanel" />
</ScrollViewer>
<!-- Kategorien in UniformGrid -->
......@@ -132,7 +132,7 @@
Background="#ADD8E6"
FontWeight="Bold"
SelectedIndex="4">
<ComboBoxItem Content="Social Media" />
<ComboBoxItem Content="Shopping" />
<ComboBoxItem Content="Games" />
......@@ -268,6 +268,30 @@
</Border>
</StackPanel>
<!-- Pagination -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,478,0,0" Width="265" VerticalAlignment="Top">
<Button Content="Previous" Width="70" Margin="5" Click="PreviousPage_Click" />
<StackPanel Orientation="Horizontal">
<Ellipse Width="15" Height="15" Fill="Black" Margin="5"/>
<!-- Aktive Seite -->
<Ellipse Width="15" Height="15" Fill="Black" Margin="5"/>
<!-- Inaktive Seite -->
<Ellipse Width="15" Height="15" Fill="Gray" Margin="5"/>
<Ellipse Width="15" Height="15" Fill="Gray" Margin="5"/>
</StackPanel>
<!--
<Button Content="1" Width="20" Margin="5" Click="first_Page" />
<Button Content="2" Width="20" Margin="5" Click="Second_Page" />
<Button Content="3" Width="20" Margin="5" Click="third_Page" />
<Button Content="4" Width="20" Margin="5" Click="fourth_Page" />
<Button Content="5" Width="20" Margin="5" Click="fifth_Page" />
-->
<Button Content="Next" Width="70" Margin="5" Click="NextPage_Click" />
</StackPanel>
</Grid>
</Page>
......
......@@ -257,6 +257,14 @@ namespace InnoLabProjektDektopApp
}
}
private void PreviousPage_Click(object sender, RoutedEventArgs e)
{
this.NavigationService.Navigate(new Progress());
}
private void NextPage_Click(object sender, RoutedEventArgs e)
{
this.NavigationService.Navigate(new Settings());
}
}
}
......@@ -7,27 +7,27 @@
xmlns:header="clr-namespace:InnoLabProjektDektopApp.Screens.Templates"
mc:Ignorable="d">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<Grid>
<Grid>
<StackPanel Margin="20,20,20,20">
<TextBlock Style="{StaticResource Header1}"
<StackPanel Margin="20,20,20,20">
<TextBlock Style="{StaticResource Header1}"
Text="Change the settings as you want"
HorizontalAlignment="Left" />
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,10,0,0">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,10,0,0">
<TextBlock Style="{StaticResource Header2}"
<TextBlock Style="{StaticResource Header2}"
Text="What should happen when you try to open a distracting program/page?"
HorizontalAlignment="Left" />
<TextBlock Text="ⓘ"
<TextBlock Text="ⓘ"
FontSize="14"
FontWeight="Bold"
Foreground="Gray"
Margin="5,0,0,0"
VerticalAlignment="Center"
ToolTip="You can choose between 3 modes: In all modes, the mascot gives you visual feedback that you are currently distracting yourself. In full-blocking mode, the distracting item you try to reach is instantly automatically closed. In the warning mode, you receive a warning for X seconds during which you can re-decide if you want to enter the distracting item or not." />
</StackPanel>
</StackPanel>
<RadioButton x:Name="DistractionModeFullBlocking" Content="full-blocking mode" GroupName="Modes" IsChecked="True" />
<RadioButton x:Name="DistractionModeMascotFeedback" Content="only mascot feedback mode" GroupName="Modes" Margin="0,5,0,0"/>
......@@ -52,73 +52,73 @@
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,10,0,0">
<TextBlock Style="{StaticResource Header2}"
<TextBlock Style="{StaticResource Header2}"
Text="Do you want the mascot to be visible while working?"
HorizontalAlignment="Left" />
<TextBlock Text="ⓘ"
<TextBlock Text="ⓘ"
FontSize="14"
FontWeight="Bold"
Foreground="Gray"
Margin="5,0,0,0"
VerticalAlignment="Center"
ToolTip="If the mascot is visible while you work, its emotions reflect how focused you are which can be motivating. Deselect the mascot if you find it annoying." />
</StackPanel>
</StackPanel>
<RadioButton x:Name="MascotVisibleYes" Content="yes" GroupName="MascotVisibility" IsChecked="True" Checked="MascotVisibilityChanged"/>
<RadioButton x:Name="MascotVisibleNo" Content="no" GroupName="MascotVisibility" Checked="MascotVisibilityChanged"/>
<StackPanel x:Name="MotivationSection">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,10,0,0">
<TextBlock Style="{StaticResource Header2}"
<TextBlock Style="{StaticResource Header2}"
Text="How do you want to be motivated by the mascot?"
HorizontalAlignment="Left" />
<TextBlock Text="ⓘ"
<TextBlock Text="ⓘ"
FontSize="14"
FontWeight="Bold"
Foreground="Gray"
Margin="5,0,0,0"
VerticalAlignment="Center"
ToolTip="If words of affirmation are selected and you work focusedly, the mascot is going to tell you stuff like 'You have not distracted yourself for 30 minutes! I am proud of you!' If insulting words are selected and you distract yourself during the focus mode, the mascot is going to tell you stuff like 'I have already finished 10 exercises - why are you not working focused like me?" />
</StackPanel>
<StackPanel Orientation="Horizontal" >
</StackPanel>
<StackPanel Orientation="Horizontal" >
<CheckBox x:Name="WordsOfAffirmationCheckBox" IsChecked="True" VerticalAlignment="Center"/>
<TextBlock
<TextBlock
Style="{StaticResource StandardText}"
Text="by words of affirmation" Margin="10,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" >
</StackPanel>
<StackPanel Orientation="Horizontal" >
<CheckBox x:Name="InsultingWordsCheckBox" IsChecked="True" VerticalAlignment="Center"/>
<TextBlock
<TextBlock
Style="{StaticResource StandardText}"
Text="by insulting words" Margin="10,0,0,0"/>
</StackPanel>
</StackPanel>
</StackPanel>
<!-- Frage 4 -->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,10,0,0">
<TextBlock Style="{StaticResource Header2}"
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,10,0,0">
<TextBlock Style="{StaticResource Header2}"
Text="What should your default focus session look like?"
HorizontalAlignment="Left" />
<TextBlock Text="ⓘ"
<TextBlock Text="ⓘ"
FontSize="14"
FontWeight="Bold"
Foreground="Gray"
Margin="5,0,0,0"
VerticalAlignment="Center"
ToolTip="You can decide how long the focus and break period should be. The focus period is the period in which you want to work focused without taking a break. The break period determines how long the break after each focus period should be. With cycles you can decide how often you want to cycle through focus and break periods. For example, a cylcle of 2, a focus period of 50 and a break period of 10 means that your total focus session looks like this: 50 minutes focused work, 10 minutes break, 50 minutes focused work and 10 minutes break." />
</StackPanel>
</StackPanel>
<!-- Graue Box -->
<Border Background="LightGray" CornerRadius="10" Padding="3" Margin="5" BorderBrush="#D3D3D3" BorderThickness="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- Graue Box -->
<Border Background="LightGray" CornerRadius="10" Padding="3" Margin="5" BorderBrush="#D3D3D3" BorderThickness="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- Focus Period -->
<!-- Focus Period -->
<StackPanel Grid.Column="0" Margin="10">
<TextBlock Text="Focus period" FontSize="14" FontWeight="SemiBold" Foreground="Gray" />
<StackPanel Orientation="Horizontal">
......@@ -156,19 +156,19 @@ ToolTip="You can decide how long the focus and break period should be. The focus
</StackPanel>
<!-- Cycles -->
<StackPanel Grid.Column="2" Margin="10">
<TextBlock Text="Cycles" FontSize="14" FontWeight="SemiBold" Foreground="Gray" />
<StackPanel Grid.Column="2" Margin="10">
<TextBlock Text="Cycles" FontSize="14" FontWeight="SemiBold" Foreground="Gray" />
<ComboBox x:Name="CyclesComboBox" HorizontalAlignment="Left" Height="30" Width="150" FontSize="14" Padding="5" IsEditable="True" PreviewTextInput="ComboBox_PreviewTextInput">>
<ComboBoxItem Content="1" />
<ComboBoxItem Content="2" />
<ComboBoxItem Content="3" />
<ComboBoxItem Content="4" IsSelected="True" />
<ComboBoxItem Content="5" />
<ComboBoxItem Content="6" />
</ComboBox>
</StackPanel>
</Grid>
</Border>
<ComboBoxItem Content="1" />
<ComboBoxItem Content="2" />
<ComboBoxItem Content="3" />
<ComboBoxItem Content="4" IsSelected="True" />
<ComboBoxItem Content="5" />
<ComboBoxItem Content="6" />
</ComboBox>
</StackPanel>
</Grid>
</Border>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,20,0,0">
<!-- Save Button -->
<Button Content="Save" Width="100" Height="30" Margin="0,0,10,0" Click="SaveSettingsButton_Click"/>
......@@ -178,9 +178,33 @@ ToolTip="You can decide how long the focus and break period should be. The focus
</StackPanel>
</StackPanel>
</Grid>
<!-- Pagination -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,478,0,0" Width="265" VerticalAlignment="Top">
<Button Content="Previous" Width="70" Margin="5" Click="PreviousPage_Click" />
<StackPanel Orientation="Horizontal">
<Ellipse Width="15" Height="15" Fill="Black" Margin="5"/>
<!-- Aktive Seite -->
<Ellipse Width="15" Height="15" Fill="Black" Margin="5"/>
<!-- Inaktive Seite -->
<Ellipse Width="15" Height="15" Fill="Black" Margin="5"/>
<Ellipse Width="15" Height="15" Fill="Gray" Margin="5"/>
</StackPanel>
<!--
<Button Content="1" Width="20" Margin="5" Click="first_Page" />
<Button Content="2" Width="20" Margin="5" Click="Second_Page" />
<Button Content="3" Width="20" Margin="5" Click="third_Page" />
<Button Content="4" Width="20" Margin="5" Click="fourth_Page" />
<Button Content="5" Width="20" Margin="5" Click="fifth_Page" />
-->
<Button Content="Next" Width="70" Margin="5" Click="NextPage_Click" />
</StackPanel>
</Grid>
</ScrollViewer>
</Page>
......@@ -62,8 +62,8 @@ namespace InnoLabProjektDektopApp
private void SaveSettingsButton_Click(object sender, RoutedEventArgs e)
{
private void SaveSettingsButton_Click(object sender, RoutedEventArgs e)
{
// Sammle die Werte aus den ComboBoxen oder verwende Standardwerte
string focusPeriod = string.IsNullOrWhiteSpace(FocusPeriodComboBox.Text) ? "50" : FocusPeriodComboBox.Text;
string breakPeriod = string.IsNullOrWhiteSpace(BreakPeriodComboBox.Text) ? "10" : BreakPeriodComboBox.Text;
......@@ -81,11 +81,11 @@ private void SaveSettingsButton_Click(object sender, RoutedEventArgs e)
string mascotVisible = MascotVisibleYes.IsChecked == true ? "Yes" : "No";
bool wordsOfAffirmation = WordsOfAffirmationCheckBox.IsChecked ?? false;
bool insultingWords = InsultingWordsCheckBox.IsChecked ?? false;
bool wordsOfAffirmation = WordsOfAffirmationCheckBox.IsChecked ?? false;
bool insultingWords = InsultingWordsCheckBox.IsChecked ?? false;
// JSON-Datei erstellen
var settings = new Dictionary<string, Dictionary<string, string>>
// JSON-Datei erstellen
var settings = new Dictionary<string, Dictionary<string, string>>
{
{
"profile1",
......@@ -103,31 +103,31 @@ private void SaveSettingsButton_Click(object sender, RoutedEventArgs e)
}
};
string filePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "settings.json");
string filePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "settings.json");
// JSON speichern
File.WriteAllText(filePath, JsonSerializer.Serialize(settings, new JsonSerializerOptions { WriteIndented = true }));
// Nach dem Speichern: JSON lesen und in der MessageBox anzeigen
if (File.Exists(filePath))
{
string jsonContent = File.ReadAllText(filePath);
var savedSettings = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(jsonContent);
// JSON speichern
File.WriteAllText(filePath, JsonSerializer.Serialize(settings, new JsonSerializerOptions { WriteIndented = true }));
if (savedSettings != null && savedSettings.ContainsKey("profile1"))
// Nach dem Speichern: JSON lesen und in der MessageBox anzeigen
if (File.Exists(filePath))
{
var profileSettings = savedSettings["profile1"];
string jsonContent = File.ReadAllText(filePath);
var savedSettings = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(jsonContent);
string message = "Saved Settings for profile1:\n";
foreach (var setting in profileSettings)
if (savedSettings != null && savedSettings.ContainsKey("profile1"))
{
message += $"{setting.Key}: {setting.Value}\n";
}
var profileSettings = savedSettings["profile1"];
string message = "Saved Settings for profile1:\n";
foreach (var setting in profileSettings)
{
message += $"{setting.Key}: {setting.Value}\n";
}
MessageBox.Show(message, "Saved Settings", MessageBoxButton.OK, MessageBoxImage.Information);
MessageBox.Show(message, "Saved Settings", MessageBoxButton.OK, MessageBoxImage.Information);
}
}
}
}
private void NavigateToOverviewButton_Click(object sender, RoutedEventArgs e)
{
......@@ -143,8 +143,16 @@ private void SaveSettingsButton_Click(object sender, RoutedEventArgs e)
private void PreviousPage_Click(object sender, RoutedEventArgs e)
{
this.NavigationService.Navigate(new Distractions());
}
private void NextPage_Click(object sender, RoutedEventArgs e)
{
this.NavigationService.Navigate(new Overview());
}
}
}
}
\ No newline at end of file
InnoLabProjektDektopApp/InnoLabProjektDektopApp/Screens/FirstLaunch/filter.png

576 B

InnoLabProjektDektopApp/InnoLabProjektDektopApp/Screens/FirstLaunch/play.png

814 B

InnoLabProjektDektopApp/InnoLabProjektDektopApp/Screens/FirstLaunch/settings.png

2.7 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment