Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Ink Canvas/Resources/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public class Settings
[JsonProperty("notification")]
public NotificationSettings Notification { get; set; } = new NotificationSettings();

[JsonProperty("timer")]
public TimerSettings Timer { get; set; } = new TimerSettings();

[JsonProperty("toolbar")]
public ToolbarLayoutSettings Toolbar { get; set; } = new ToolbarLayoutSettings();

Expand Down Expand Up @@ -300,6 +303,12 @@ public class NotificationSettings
public bool IsDictationDoNotDisturbInWhiteboardEnabled { get; set; } = true;
}

public class TimerSettings
{
[JsonProperty("isOpenTransparency")]
public bool IsOpenTransparency { get; set; } = true;
}

public class Security
{
[JsonProperty("passwordEnabled")]
Expand Down
27 changes: 27 additions & 0 deletions Ink Canvas/Windows/NewStyleMinimizedTimerWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
Background="Transparent" BorderThickness="0"
Click="CloseButton_Click"
Cursor="Hand" Opacity="0.7">

<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="12">
Expand All @@ -50,6 +51,32 @@
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>

<!-- ToggleTransparency button -->
<Button x:Name="ToggleTransparency"
Width="24" Height="24"
HorizontalAlignment="Right" VerticalAlignment="Bottom"
Margin="0,6,10,0"
Background="Transparent" BorderThickness="0"
Click="ToggleTransparency_Click"
Cursor="Hand" Opacity="0.7">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="12">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#E81123"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
<TextBlock Text="💡" FontSize="14"
Foreground="{DynamicResource {x:Static ui:ThemeKeys.TextFillColorPrimaryBrushKey}}"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>

<!-- Digits -->
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal">
<Path x:Name="MinHour1Display" Data="{StaticResource Digit0}" Fill="{DynamicResource NewTimerWindowDigitForeground}" Width="40" Height="40" Stretch="Uniform" Margin="0,0,6,0"/>
Expand Down
22 changes: 22 additions & 0 deletions Ink Canvas/Windows/NewStyleMinimizedTimerWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Ink_Canvas.Windows.SettingsViews.Helpers;
using iNKORE.UI.WPF.Modern;
using System;
using System.Timers;
using System.Windows;
Expand Down Expand Up @@ -30,6 +32,10 @@ public NewStyleMinimizedTimerWindow(
Action stopTimerCallback)
{
InitializeComponent();
if (!SettingsManager.Settings.Timer.IsOpenTransparency)
{
MainBorder.Background = (Brush)FindResource("NewTimerWindowBackground");
}
_getRemainingTime = remainingTime;
_shouldHide = shouldHide;
_restoreCallback = restoreCallback;
Expand Down Expand Up @@ -152,5 +158,21 @@ private void CloseButton_Click(object sender, RoutedEventArgs e)
_stopTimerCallback?.Invoke();
Close();
}

private void ToggleTransparency_Click(object sender, RoutedEventArgs e)
{
if(SettingsManager.Settings.Timer.IsOpenTransparency)
{
MainBorder.Background = (Brush)FindResource("NewTimerWindowBackground");
SettingsManager.Settings.Timer.IsOpenTransparency = false;
SettingsManager.SaveSettingsToFile();
}
else
{
MainBorder.Background = (Brush)FindResource(ThemeKeys.CardBackgroundFillColorDefaultBrushKey);//还原
SettingsManager.Settings.Timer.IsOpenTransparency = true;
SettingsManager.SaveSettingsToFile();
}
}
}
}
Loading