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
26 changes: 26 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,12 @@ public NewStyleMinimizedTimerWindow(
Action stopTimerCallback)
{
InitializeComponent();
if (!SettingsManager.Settings.Timer.IsOpenTransparency)
{
MainBorder.Background = new SolidColorBrush(
Color.FromArgb(255, 249, 249, 249)
);
}
_getRemainingTime = remainingTime;
_shouldHide = shouldHide;
_restoreCallback = restoreCallback;
Expand Down Expand Up @@ -152,5 +160,23 @@ 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 = new SolidColorBrush(
Color.FromArgb(255, 249, 249, 249)//完全不透明

@augmentcode augmentcode Bot Sep 13, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the dark theme, NewTimerWindowDigitForeground is white, so this opaque #F9F9F9 background makes the timer digits nearly invisible after transparency is disabled. The same contrast regression also occurs when the persisted disabled state is applied at startup.

Severity: medium

Other Locations
  • Ink Canvas/Windows/NewStyleMinimizedTimerWindow.xaml.cs:38

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个确实没想到,等我下星期回来再改把

);
SettingsManager.Settings.Timer.IsOpenTransparency = false;
SettingsManager.SaveSettingsToFile();
}
else
{
MainBorder.Background = (Brush)FindResource(ThemeKeys.CardBackgroundFillColorDefaultBrushKey);//还原
SettingsManager.Settings.Timer.IsOpenTransparency = true;
SettingsManager.SaveSettingsToFile();
}
}
}
}