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
3 changes: 3 additions & 0 deletions ClassIsland/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -767,8 +767,11 @@ private void SetBottom()

private void UpdateWindowFeatures()
{
var isCaptureBlocked = ViewModel.Settings.IsScreenShotBlockingEnabled
|| ViewModel.Settings.IsScreenRecordingBlockingEnabled;
PlatformServices.WindowPlatformService.SetWindowFeature(this, WindowFeatures.ToolWindow, ViewModel is { IsWindowMode: false, Settings.IsScreenRecordingModeEnabled: false });
PlatformServices.WindowPlatformService.SetWindowFeature(this, WindowFeatures.Transparent, !ViewModel.IsEditMode);
PlatformServices.WindowPlatformService.SetWindowFeature(this, WindowFeatures.Private, isCaptureBlocked);
}

private void UpdateWindowLayer()
Expand Down
24 changes: 24 additions & 0 deletions ClassIsland/Models/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1861,6 +1861,8 @@ public int WindowDockingLocation
private bool _isPluginsUpdateNotificationEnabled = true;
private int _windowTopmostRecheckMode = 0;
private bool _isScreenRecordingModeEnabled = false;
private bool _isScreenShotBlockingEnabled = false;
private bool _isScreenRecordingBlockingEnabled = false;
private bool _hasEditModeTutorialShown = false;
private int _classPlanEditModeIndex = 1;
private bool _isRefreshingToastEnabled = true;
Expand Down Expand Up @@ -1948,6 +1950,28 @@ public bool IsScreenRecordingModeEnabled
}
}

public bool IsScreenShotBlockingEnabled
{
get => _isScreenShotBlockingEnabled;
set
{
if (value == _isScreenShotBlockingEnabled) return;
_isScreenShotBlockingEnabled = value;
OnPropertyChanged();
}
}

public bool IsScreenRecordingBlockingEnabled
{
get => _isScreenRecordingBlockingEnabled;
set
{
if (value == _isScreenRecordingBlockingEnabled) return;
_isScreenRecordingBlockingEnabled = value;
OnPropertyChanged();
}
}

/// <summary>
/// 窗口层级
/// </summary>
Expand Down
26 changes: 26 additions & 0 deletions ClassIsland/Views/SettingPages/WindowSettingsPage.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,32 @@
</controls1:SettingsExpander.Footer>
</controls1:SettingsExpander>

<controls1:SettingsExpander IconSource="{ci:FluentIconSource &#xF4A4;}"
Header="阻止被截屏"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

在这两个选项实现相同功能的情况下,请将其合并到一个选项中,并起一个能概括这个功能的名字(如“阻止被捕获”)。

Description="启用后,将阻止其他应用截取 ClassIsland 主界面窗口内容。">
<controls1:SettingsExpander.IsVisible>
<OnPlatform Default="False">
<On Options="Windows" Content="True"/>
</OnPlatform>
</controls1:SettingsExpander.IsVisible>
<controls1:SettingsExpander.Footer>
<ToggleSwitch IsChecked="{Binding ViewModel.SettingsService.Settings.IsScreenShotBlockingEnabled, Mode=TwoWay}"/>
</controls1:SettingsExpander.Footer>
</controls1:SettingsExpander>

<controls1:SettingsExpander IconSource="{ci:FluentIconSource &#xF4A6;}"
Header="阻止被录制"
Description="启用后,将阻止其他应用录制 ClassIsland 主界面窗口内容。若同时开启录制模式,本项优先生效。">
<controls1:SettingsExpander.IsVisible>
<OnPlatform Default="False">
<On Options="Windows" Content="True"/>
</OnPlatform>
</controls1:SettingsExpander.IsVisible>
<controls1:SettingsExpander.Footer>
<ToggleSwitch IsChecked="{Binding ViewModel.SettingsService.Settings.IsScreenRecordingBlockingEnabled, Mode=TwoWay}"/>
</controls1:SettingsExpander.Footer>
</controls1:SettingsExpander>

<!-- 指针穿透 --><!--
<ci:SettingsCard IconGlyph="MouseMoveUp" Header="启用鼠标点击"
Description="启用时鼠标可以与主界面窗口上的元素交互。若禁用,那么鼠标在点击应用主界面窗口时,会穿透到窗口后方。"
Expand Down