Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b2f8982ee6 | ||
|
|
3f90cbe19a | ||
|
|
da9bcae691 | ||
|
|
cee0956c99 | ||
|
|
98b96267ec | ||
|
|
72ad7d9e36 | ||
|
|
ec4046c385 | ||
|
|
f345769e75 | ||
|
|
d14d64241e |
No files matched your search
@@ -10,7 +10,7 @@
|
||||
"rollForward": false
|
||||
},
|
||||
"jetbrains.resharper.globaltools": {
|
||||
"version": "2026.2.3.1",
|
||||
"version": "2026.2.4",
|
||||
"commands": [
|
||||
"jb"
|
||||
],
|
||||
@@ -24,7 +24,7 @@
|
||||
"rollForward": false
|
||||
},
|
||||
"dotnet-reportgenerator-globaltool": {
|
||||
"version": "5.5.11",
|
||||
"version": "5.5.12",
|
||||
"commands": [
|
||||
"reportgenerator"
|
||||
],
|
||||
@@ -36,6 +36,13 @@
|
||||
"dotnet-CycloneDX"
|
||||
],
|
||||
"rollForward": false
|
||||
},
|
||||
"dotnet-sonarscanner": {
|
||||
"version": "12.0.0",
|
||||
"commands": [
|
||||
"dotnet-sonarscanner"
|
||||
],
|
||||
"rollForward": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
name: Accessibility barrier
|
||||
description: Something is hard or impossible to use with a keyboard, a screen reader, magnification, a contrast theme or other assistive technology.
|
||||
title: "[a11y] "
|
||||
labels: ["accessibility", "triage"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for reporting this. Accessibility barriers are handled before cosmetic issues;
|
||||
see [ACCESSIBILITY.md](https://github.com/poli0981/captureimg/blob/main/ACCESSIBILITY.md)
|
||||
for what is supported today and the known limitations.
|
||||
|
||||
You don't need to tell us about a disability or any other personal information. If you'd
|
||||
rather not use GitHub, email `contact@poli0981.dev` instead.
|
||||
|
||||
- type: textarea
|
||||
id: summary
|
||||
attributes:
|
||||
label: What were you trying to do?
|
||||
description: The task, in a sentence or two.
|
||||
placeholder: "Change the region hotkey in Settings using only the keyboard."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: actual
|
||||
attributes:
|
||||
label: What happened?
|
||||
description: What you heard, saw or couldn't do.
|
||||
placeholder: "Narrator reads the button as 'Region' but doesn't say which keys are set."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: expected
|
||||
attributes:
|
||||
label: What did you expect?
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: repro
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
description: Starting from opening CaptureImage. Keys you pressed are especially helpful.
|
||||
placeholder: |
|
||||
1. Open Settings with Tab and Enter.
|
||||
2. Tab to the Region hotkey.
|
||||
3. …
|
||||
|
||||
- type: dropdown
|
||||
id: technology
|
||||
attributes:
|
||||
label: Assistive technology or setting
|
||||
multiple: true
|
||||
options:
|
||||
- Narrator
|
||||
- NVDA
|
||||
- JAWS
|
||||
- Magnifier or another magnifier
|
||||
- Voice access or speech recognition
|
||||
- Keyboard only (no mouse)
|
||||
- Contrast theme
|
||||
- Large display scaling or text size
|
||||
- Reduced motion (animation effects off)
|
||||
- Other (please describe below)
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: technology-version
|
||||
attributes:
|
||||
label: Assistive technology version
|
||||
description: "For example `NVDA 2026.3`, or `built-in` for Narrator."
|
||||
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: CaptureImage version
|
||||
description: "Shown in the title bar and on the About page, e.g. `2.1.0 (abc1234)`."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: windows
|
||||
attributes:
|
||||
label: Windows version
|
||||
description: "Run `winver`, e.g. `Windows 11 Pro 24H2 (26100.2454)`."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: language
|
||||
attributes:
|
||||
label: App language
|
||||
description: "The language CaptureImage is shown in, e.g. English, Tiếng Việt, العربية."
|
||||
|
||||
- type: dropdown
|
||||
id: impact
|
||||
attributes:
|
||||
label: How much does this affect you?
|
||||
description: Your impression is enough; the maintainer assigns the final severity.
|
||||
options:
|
||||
- I can't complete the task at all
|
||||
- I can complete it only with great difficulty or a workaround
|
||||
- It is slower or confusing, but I can do it
|
||||
- It is a small issue
|
||||
|
||||
- type: textarea
|
||||
id: workaround
|
||||
attributes:
|
||||
label: Workaround
|
||||
description: If you found a way around it, it may help others until it is fixed.
|
||||
|
||||
- type: textarea
|
||||
id: attachments
|
||||
attributes:
|
||||
label: Screenshots, recordings or diagnostics (optional)
|
||||
description: |
|
||||
Only if you're comfortable sharing them. **Settings → Advanced → Export diagnostics**
|
||||
creates a zip with your user paths removed.
|
||||
|
||||
- type: checkboxes
|
||||
id: preflight
|
||||
attributes:
|
||||
label: Before submitting
|
||||
options:
|
||||
- label: I searched existing issues for a duplicate.
|
||||
required: true
|
||||
@@ -13,6 +13,9 @@ body:
|
||||
reproduce the problem, then use **Export diagnostics** and attach the zip below (user
|
||||
paths are removed automatically).
|
||||
|
||||
Something that is hard to use with a keyboard, a screen reader or another assistive
|
||||
technology? Please use the **Accessibility barrier** template instead.
|
||||
|
||||
- type: textarea
|
||||
id: summary
|
||||
attributes:
|
||||
|
||||
@@ -45,6 +45,7 @@ body:
|
||||
- Preview / editing
|
||||
- Tray / hotkey
|
||||
- Localization
|
||||
- Accessibility (keyboard, screen readers, contrast, motion)
|
||||
- Update / About / docs
|
||||
- Build / release / installer
|
||||
- Cloud upload (post-1.0)
|
||||
|
||||
@@ -8,6 +8,9 @@ version: 2
|
||||
# Desktop packages differently: if a PR fails `restore --locked-mode`, run
|
||||
# `dotnet restore CaptureImage.sln --force-evaluate` on Windows and push the
|
||||
# lock files.
|
||||
#
|
||||
# Dependabot pull requests get no repository secrets, so the `sonarcloud` check
|
||||
# passes without analysing them; main is analysed after the merge.
|
||||
|
||||
updates:
|
||||
- package-ecosystem: nuget
|
||||
@@ -33,6 +36,9 @@ updates:
|
||||
patterns:
|
||||
- "Serilog*"
|
||||
skiasharp:
|
||||
# Dependabot reports every SkiaSharp 4.x as "not compatible" with
|
||||
# net10.0-windows10.0.22621 (its net10.0-windows10.0.19041 asset group trips the
|
||||
# updater's compatibility check), so SkiaSharp never gets a pull request: bump it by hand.
|
||||
patterns:
|
||||
- "SkiaSharp*"
|
||||
vortice:
|
||||
@@ -64,6 +70,7 @@ updates:
|
||||
- "nuget-license"
|
||||
- "dotnet-reportgenerator-globaltool"
|
||||
- "cyclonedx"
|
||||
- "dotnet-sonarscanner"
|
||||
|
||||
- package-ecosystem: github-actions
|
||||
directory: "/"
|
||||
|
||||
@@ -20,6 +20,16 @@
|
||||
- [ ] New or changed behavior is covered by tests
|
||||
- [ ] Tried it in the app (describe what you checked)
|
||||
|
||||
## Accessibility (UI changes)
|
||||
|
||||
<!-- See ACCESSIBILITY.md → "Contributor expectations". Delete this section if no UI changed. -->
|
||||
|
||||
- [ ] Everything changed works with the keyboard alone, with a visible focus and no focus trap
|
||||
- [ ] Controls have a unique accessible name (icon-only buttons too) and status text is announced
|
||||
- [ ] Colour is not the only signal; theme brushes are used, and it looks right in a contrast theme
|
||||
- [ ] New animations respect Windows' "Animation effects"; nothing takes the focus unasked
|
||||
- [ ] Checked once with Narrator
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] I read [`CONTRIBUTING.md`](../CONTRIBUTING.md) and license this contribution under GPL-3.0-or-later.
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright (c) CaptureImage Contributors
|
||||
#
|
||||
# NuGet's audit only checks package references, and GitHub's dependency graph doesn't read
|
||||
# .config/dotnet-tools.json, so nothing else watches the local tools (vpk, the Sonar scanner, ...).
|
||||
# The CI `audit` job runs this script: it looks up every tool version in nuget.org's
|
||||
# vulnerability data (the data NuGetAudit uses), fails on any finding (any severity) and lists
|
||||
# them in the job summary.
|
||||
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory)] [string] $Manifest,
|
||||
[string] $ServiceIndex = 'https://api.nuget.org/v3/index.json'
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
# A NuGet version: up to four numbers, an optional pre-release label; build metadata is ignored.
|
||||
function Split-NuGetVersion([string] $Version) {
|
||||
$release, $label = ($Version.Trim() -split '\+', 2)[0] -split '-', 2
|
||||
$parts = [long[]]($release -split '\.')
|
||||
$numbers = [long[]]::new(4)
|
||||
[Array]::Copy($parts, $numbers, $parts.Count)
|
||||
[pscustomobject]@{ Numbers = $numbers; Label = $label }
|
||||
}
|
||||
|
||||
# -1, 0 or 1. A release sorts after its pre-releases; labels compare part by part (SemVer 2.0).
|
||||
function Compare-NuGetVersion([string] $Left, [string] $Right) {
|
||||
$a = Split-NuGetVersion $Left
|
||||
$b = Split-NuGetVersion $Right
|
||||
for ($i = 0; $i -lt 4; $i++) {
|
||||
if ($a.Numbers[$i] -ne $b.Numbers[$i]) { return [Math]::Sign($a.Numbers[$i] - $b.Numbers[$i]) }
|
||||
}
|
||||
if ($a.Label -eq $b.Label) { return 0 }
|
||||
if (-not $a.Label) { return 1 }
|
||||
if (-not $b.Label) { return -1 }
|
||||
$x = $a.Label -split '\.'
|
||||
$y = $b.Label -split '\.'
|
||||
for ($i = 0; $i -lt [Math]::Min($x.Count, $y.Count); $i++) {
|
||||
$xIsNumber = $x[$i] -match '^\d+$'
|
||||
$yIsNumber = $y[$i] -match '^\d+$'
|
||||
$order = if ($xIsNumber -and $yIsNumber) { ([long]$x[$i]).CompareTo([long]$y[$i]) }
|
||||
elseif ($xIsNumber) { -1 }
|
||||
elseif ($yIsNumber) { 1 }
|
||||
else { [string]::Compare($x[$i], $y[$i], [StringComparison]::OrdinalIgnoreCase) }
|
||||
if ($order -ne 0) { return [Math]::Sign($order) }
|
||||
}
|
||||
return [Math]::Sign($x.Count - $y.Count)
|
||||
}
|
||||
|
||||
# NuGet range notation: "1.0" (minimum, inclusive), "[1.0]" (exact), "[1.0, 2.0)", "(, 2.0]", ...
|
||||
function Test-VersionInRange([string] $Version, [string] $Range) {
|
||||
$Range = $Range.Trim()
|
||||
if ($Range -notmatch '^[\[(]') { return (Compare-NuGetVersion $Version $Range) -ge 0 }
|
||||
$inner = $Range.Substring(1, $Range.Length - 2)
|
||||
if ($inner -notmatch ',') { return (Compare-NuGetVersion $Version $inner) -eq 0 }
|
||||
$min, $max = $inner -split ',', 2 | ForEach-Object { $_.Trim() }
|
||||
if ($min) {
|
||||
$order = Compare-NuGetVersion $Version $min
|
||||
if ($order -lt 0 -or ($order -eq 0 -and $Range[0] -eq '(')) { return $false }
|
||||
}
|
||||
if ($max) {
|
||||
$order = Compare-NuGetVersion $Version $max
|
||||
if ($order -gt 0 -or ($order -eq 0 -and $Range[-1] -eq ')')) { return $false }
|
||||
}
|
||||
return $true
|
||||
}
|
||||
|
||||
$tools = @((Get-Content -Raw -LiteralPath $Manifest | ConvertFrom-Json).tools.PSObject.Properties)
|
||||
$resource = (Invoke-RestMethod -Uri $ServiceIndex).resources |
|
||||
Where-Object { $_.'@type' -like 'VulnerabilityInfo/*' } | Select-Object -First 1
|
||||
if (-not $resource) { throw "$ServiceIndex has no VulnerabilityInfo resource." }
|
||||
|
||||
$severities = 'Low', 'Moderate', 'High', 'Critical'
|
||||
$rows = @()
|
||||
# The data comes in pages (a base file plus updates), each keyed by lower-case package id.
|
||||
# Invoke-RestMethod returns a JSON array as one object; `foreach` enumerates it.
|
||||
$pages = Invoke-RestMethod -Uri $resource.'@id'
|
||||
foreach ($page in $pages) {
|
||||
$advisories = Invoke-RestMethod -Uri $page.'@id'
|
||||
foreach ($tool in $tools) {
|
||||
foreach ($advisory in @($advisories.($tool.Name.ToLowerInvariant()))) {
|
||||
if (-not $advisory -or -not (Test-VersionInRange $tool.Value.version $advisory.versions)) { continue }
|
||||
$rows += [pscustomobject]@{
|
||||
Tool = $tool.Name
|
||||
Version = $tool.Value.version
|
||||
Severity = $severities[[int]$advisory.severity]
|
||||
Advisory = $advisory.url
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$rows = @($rows | Sort-Object Tool, Version, Advisory -Unique)
|
||||
$summary = @('## Tool vulnerability audit', '', "Tools checked: **$($tools.Count)**, vulnerable: **$($rows.Count)**", '')
|
||||
if ($rows.Count -gt 0) {
|
||||
$summary += '| Tool | Version | Severity | Advisory |', '|---|---|---|---|'
|
||||
foreach ($r in $rows) {
|
||||
$summary += "| $($r.Tool) | $($r.Version) | $($r.Severity) | $($r.Advisory) |"
|
||||
Write-Output "::error title=Vulnerable tool::$($r.Tool) $($r.Version) ($($r.Severity)) $($r.Advisory)"
|
||||
}
|
||||
}
|
||||
if ($env:GITHUB_STEP_SUMMARY) { $summary | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8 }
|
||||
else { $summary | Write-Output }
|
||||
|
||||
if ($rows.Count -gt 0) { exit 1 }
|
||||
+117
-7
@@ -37,7 +37,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
|
||||
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
|
||||
with:
|
||||
global-json-file: global.json
|
||||
cache: true
|
||||
@@ -77,6 +77,110 @@ jobs:
|
||||
coverage-report/**
|
||||
retention-days: 14
|
||||
|
||||
# SonarQube Cloud, CI-based analysis (automatic analysis is off in the project settings).
|
||||
# Its own build: `begin` turns TreatWarningsAsErrors off, which `build` must keep. The job
|
||||
# fails when the quality gate fails. Runs that can't be analysed pass without analysing:
|
||||
# fork and Dependabot pull requests get no SONAR_TOKEN (main is analysed after the merge),
|
||||
# and the free plan analyses only main and pull requests, not other branches.
|
||||
sonarcloud:
|
||||
name: sonarcloud
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 30
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Analyse this run?
|
||||
id: sonar
|
||||
shell: pwsh
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
REF: ${{ github.ref }}
|
||||
run: |
|
||||
$skip = ''
|
||||
if ([string]::IsNullOrEmpty($env:SONAR_TOKEN)) { $skip = 'no SONAR_TOKEN (fork or Dependabot pull request)' }
|
||||
elseif ($env:EVENT_NAME -ne 'pull_request' -and $env:REF -ne 'refs/heads/main') { $skip = "only main and pull requests are analysed, not $env:REF" }
|
||||
"analyse=$(([string]::IsNullOrEmpty($skip)).ToString().ToLowerInvariant())" | Out-File $env:GITHUB_OUTPUT -Append -Encoding utf8
|
||||
if ($skip) { "::notice title=sonarcloud::Analysis skipped: $skip." }
|
||||
|
||||
- name: Checkout
|
||||
if: steps.sonar.outputs.analyse == 'true'
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0 # full history: new code is found with git blame
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup .NET
|
||||
if: steps.sonar.outputs.analyse == 'true'
|
||||
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
|
||||
with:
|
||||
global-json-file: global.json
|
||||
cache: true
|
||||
cache-dependency-path: "**/packages.lock.json"
|
||||
|
||||
# The scanner downloads its engine, a JRE and the analyzers from SonarQube Cloud.
|
||||
- name: Cache SonarQube Cloud downloads
|
||||
if: steps.sonar.outputs.analyse == 'true'
|
||||
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: ~/.sonar/cache
|
||||
key: sonar-${{ runner.os }}-${{ hashFiles('.config/dotnet-tools.json') }}
|
||||
restore-keys: sonar-${{ runner.os }}-
|
||||
|
||||
- name: Restore (locked)
|
||||
if: steps.sonar.outputs.analyse == 'true'
|
||||
run: dotnet restore CaptureImage.sln --locked-mode
|
||||
|
||||
- name: Restore tools
|
||||
if: steps.sonar.outputs.analyse == 'true'
|
||||
run: dotnet tool restore
|
||||
|
||||
- name: Project version
|
||||
id: version
|
||||
if: steps.sonar.outputs.analyse == 'true'
|
||||
shell: pwsh
|
||||
run: |
|
||||
[xml]$props = Get-Content Directory.Build.props
|
||||
$version = @($props.Project.PropertyGroup | ForEach-Object { $_.Version } | Where-Object { $_ })[0]
|
||||
if (-not $version) { throw 'Directory.Build.props has no <Version>.' }
|
||||
"version=$version" | Out-File $env:GITHUB_OUTPUT -Append -Encoding utf8
|
||||
|
||||
# The project version marks where new code starts (new code = since the previous version).
|
||||
# Not counted for coverage: CaptureImage.UI (the WPF shell) and CaptureImage.App (the host),
|
||||
# which the FlaUI tests and the published-app smoke test exercise out of process, and the
|
||||
# CI scripts under .github. Icons and images are project items but not text.
|
||||
- name: SonarScanner begin
|
||||
if: steps.sonar.outputs.analyse == 'true'
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
VERSION: ${{ steps.version.outputs.version }}
|
||||
run: >
|
||||
dotnet sonarscanner begin /k:poli0981_captureimg /o:poli0981 "/v:$env:VERSION"
|
||||
"/d:sonar.token=$env:SONAR_TOKEN"
|
||||
"/d:sonar.cs.cobertura.reportsPaths=TestResults/*.cobertura.xml"
|
||||
"/d:sonar.cs.vstest.reportsPaths=TestResults/*.trx"
|
||||
"/d:sonar.coverage.exclusions=src/CaptureImage.UI/**,src/CaptureImage.App/**,.github/**"
|
||||
"/d:sonar.exclusions=**/*.ico,**/*.png"
|
||||
/d:sonar.qualitygate.wait=true
|
||||
|
||||
- name: Build
|
||||
if: steps.sonar.outputs.analyse == 'true'
|
||||
run: dotnet build CaptureImage.sln -c Release --no-restore --no-incremental --disable-build-servers
|
||||
|
||||
- name: Test with coverage
|
||||
if: steps.sonar.outputs.analyse == 'true'
|
||||
run: >
|
||||
dotnet test --solution CaptureImage.sln -c Release --no-build
|
||||
--results-directory TestResults
|
||||
--coverage --coverage-output-format cobertura
|
||||
--report-xunit-trx
|
||||
|
||||
- name: SonarScanner end (waits for the quality gate)
|
||||
if: steps.sonar.outputs.analyse == 'true'
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
run: dotnet sonarscanner end "/d:sonar.token=$env:SONAR_TOKEN"
|
||||
|
||||
format:
|
||||
name: format
|
||||
runs-on: windows-latest
|
||||
@@ -90,7 +194,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
|
||||
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
|
||||
with:
|
||||
global-json-file: global.json
|
||||
cache: true
|
||||
@@ -122,7 +226,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
|
||||
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
|
||||
with:
|
||||
global-json-file: global.json
|
||||
cache: true
|
||||
@@ -171,7 +275,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
|
||||
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
|
||||
with:
|
||||
global-json-file: global.json
|
||||
|
||||
@@ -184,6 +288,12 @@ jobs:
|
||||
dotnet list CaptureImage.sln package --vulnerable --include-transitive --format json --output-version 1 > vulnerable.json
|
||||
./.github/scripts/vulnerability-gate.ps1 -Report vulnerable.json
|
||||
|
||||
# The local tools (vpk, the Sonar scanner, …) are neither package references nor in the
|
||||
# dependency graph, so neither NuGet's audit nor Dependabot alerts cover them.
|
||||
- name: Vulnerable tools (.config/dotnet-tools.json)
|
||||
shell: pwsh
|
||||
run: ./.github/scripts/tool-audit.ps1 -Manifest .config/dotnet-tools.json
|
||||
|
||||
- name: Deprecated / outdated packages (report only)
|
||||
if: always()
|
||||
shell: pwsh
|
||||
@@ -206,7 +316,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
|
||||
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
|
||||
with:
|
||||
global-json-file: global.json
|
||||
|
||||
@@ -247,7 +357,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
|
||||
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
|
||||
with:
|
||||
global-json-file: global.json
|
||||
cache: true
|
||||
@@ -313,7 +423,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
|
||||
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
|
||||
with:
|
||||
global-json-file: global.json
|
||||
cache: true
|
||||
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: markdownlint
|
||||
uses: DavidAnson/markdownlint-cli2-action@21c1be1b93ad9ed58fa840aacc3f279cde2a72ff # v24.2.0
|
||||
uses: DavidAnson/markdownlint-cli2-action@696eb3f2509270d7b882d2aa68347bc676e7af34 # v25.0.0
|
||||
with:
|
||||
globs: |
|
||||
**/*.md
|
||||
|
||||
@@ -43,8 +43,10 @@ env:
|
||||
PACK_TITLE: CaptureImage
|
||||
MAIN_EXE: CaptureImage.App.exe
|
||||
CHANNEL: win
|
||||
# Installed by Setup / the updater when missing (the app is framework-dependent).
|
||||
RUNTIME: net10-x64-desktop
|
||||
# The app is framework-dependent: Setup and the updater install the latest .NET 10 Desktop
|
||||
# Runtime when none is installed or only one older than this patch. Raise it with .NET
|
||||
# security releases (10.0.14: October 25, 2026 out-of-band update).
|
||||
RUNTIME: net10.0.14-x64-desktop
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -91,7 +93,7 @@ jobs:
|
||||
|
||||
# No NuGet cache here: a poisoned cache must never reach release binaries.
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
|
||||
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
|
||||
with:
|
||||
global-json-file: global.json
|
||||
|
||||
@@ -182,8 +184,8 @@ jobs:
|
||||
"## CaptureImage v$env:VERSION", '',
|
||||
(Get-Content release-notes.md -Raw), '',
|
||||
'### Downloads',
|
||||
'- **`CaptureImage-win-Setup.exe`** — installer (per-user). Windows 11 22H2 or later; installs the .NET 10 Desktop Runtime if it is missing.',
|
||||
'- **`CaptureImage-win-Portable.zip`** — extract-and-run build without installer (needs the [.NET 10 Desktop Runtime](https://dotnet.microsoft.com/download/dotnet/10.0)).',
|
||||
'- **`CaptureImage-win-Setup.exe`** — installer (per-user). Windows 11 22H2 or later; installs the .NET 10 Desktop Runtime (10.0.14 or later) if it is missing or older.',
|
||||
'- **`CaptureImage-win-Portable.zip`** — extract-and-run build without installer (needs the [.NET 10 Desktop Runtime](https://dotnet.microsoft.com/download/dotnet/10.0) 10.0.14 or later).',
|
||||
'- **`*-full.nupkg`**, **`releases.win.json`** — update feed used by the in-app updater.',
|
||||
'- **`SHA256SUMS.txt`**, **`*-sbom.cdx.json`** — checksums and CycloneDX SBOM.', '',
|
||||
'### Verify the download',
|
||||
|
||||
@@ -37,7 +37,7 @@ jobs:
|
||||
publish_results: true
|
||||
|
||||
- name: Upload to code scanning
|
||||
uses: github/codeql-action/upload-sarif@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
|
||||
uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
|
||||
with:
|
||||
sarif_file: scorecard.sarif
|
||||
category: scorecard
|
||||
@@ -44,9 +44,9 @@ jobs:
|
||||
./actionlint -color
|
||||
|
||||
- name: zizmor
|
||||
uses: zizmorcore/zizmor-action@85b2b9fb8e3325e7a23d7d0a9d7ba5ae0f999e3e # v0.7.1
|
||||
uses: zizmorcore/zizmor-action@45d7276c9ca790aabd705e31ca99c6185c3e76dd # v0.8.1
|
||||
with:
|
||||
version: "1.31.1"
|
||||
version: "1.32.0"
|
||||
advanced-security: false
|
||||
annotations: true
|
||||
persona: regular
|
||||
@@ -50,6 +50,9 @@ _Pvt_Extensions/
|
||||
packages/
|
||||
!packages/build/
|
||||
|
||||
# SonarScanner for .NET working folder
|
||||
.sonarqube/
|
||||
|
||||
# Test results / coverage / build logs
|
||||
TestResults/
|
||||
coverage*.xml
|
||||
|
||||
@@ -0,0 +1,261 @@
|
||||
# Accessibility
|
||||
|
||||
CaptureImage should work for everyone who plays games on Windows. That includes people who use only
|
||||
a keyboard, people who use a screen reader, magnification, a contrast theme or large display
|
||||
scaling, and people who are sensitive to motion. This document describes what the app supports
|
||||
today, what it does not support yet, how we test it, and how to report a barrier.
|
||||
|
||||
It is a statement of goals and of the current state, not a claim of conformance.
|
||||
|
||||
## Priorities
|
||||
|
||||
- **Target:** [WCAG 2.2](https://www.w3.org/TR/WCAG22/) level AA, applied to desktop software as
|
||||
described in the W3C's [WCAG2ICT](https://www.w3.org/TR/wcag2ict-22/) guidance. This is a goal.
|
||||
No formal audit has been made, so CaptureImage makes no conformance claim.
|
||||
- **Keyboard:** everything can be done without a mouse, including region selection and the tray
|
||||
icon. The one exception is listed under [known limitations](#known-limitations).
|
||||
- **Screen readers:** every control has a name, and status changes and notifications are
|
||||
announced. We test with Narrator.
|
||||
- **Vision:** the app follows Windows contrast themes. Colour is never the only way information
|
||||
is shown. Text stays sharp at any display scaling.
|
||||
- **Motion and timing:** the app follows Windows' animation and notification-time settings, and
|
||||
nothing flashes.
|
||||
- **Stays out of your way:** notifications never take the keyboard focus away from your game or
|
||||
your assistive technology.
|
||||
- **Language:** the interface is available in 11 languages, and Arabic is laid out right to left.
|
||||
|
||||
## What works today
|
||||
|
||||
### Keyboard
|
||||
|
||||
- **Main window:** Tab and Shift+Tab move between controls. The arrow keys move within lists and
|
||||
the navigation pane. Enter or Space activates the focused control.
|
||||
- **Capture:** each capture mode has its own global hotkey (see the
|
||||
[keyboard reference](#keyboard-reference)). The keys are registered only while CaptureImage is
|
||||
armed.
|
||||
- **Region selection:** the selection can be drawn, moved and resized with the keyboard. It works
|
||||
on every monitor, even while a full-screen game keeps the keyboard focus.
|
||||
- **Hotkey recorder:** you can record a new hotkey from the keyboard. Tab and Shift+Tab leave the
|
||||
recorder without changing the hotkey.
|
||||
- **Tray icon:** it can be reached with Win+B. Starting CaptureImage again from the Start menu also
|
||||
brings its window back.
|
||||
|
||||
### Screen readers
|
||||
|
||||
- Buttons, toggles, lists and text fields have names. This includes buttons that show only an
|
||||
icon, and each hotkey row's Clear and Reset buttons, which name their capture mode.
|
||||
- **Status changes are read as they happen:**
|
||||
- armed or disarmed
|
||||
- the update status
|
||||
- hotkey problems
|
||||
- an invalid Steam App ID
|
||||
- **Notifications are sent to screen readers** as UI Automation notification events. This happens
|
||||
both from the main window and from the pop-up shown when the main window isn't in front. Errors
|
||||
are marked as important.
|
||||
- **List items are read with the details shown next to them:**
|
||||
- Windows: title, process and the Steam, profile, minimized and locked badges.
|
||||
- Captures: file name, game, date and HDR.
|
||||
- Profiles: what the profile matches, and the auto-arm and disabled badges.
|
||||
- **Headings:** page titles are level 1, sections are level 2 and the disclaimer headings on the
|
||||
About page are level 3. In Narrator's scan mode (Caps Lock+Space), H jumps between them.
|
||||
- The region overlay is named "Select an area", and its help text lists the keys. The size of the
|
||||
selection is read when you change it with the keyboard.
|
||||
|
||||
### Vision
|
||||
|
||||
- **Themes:**
|
||||
- Light, dark and high contrast are available in **Settings → Appearance**.
|
||||
- **System** follows Windows, including its contrast themes.
|
||||
- The region overlay draws its selection and labels in the contrast theme's colours.
|
||||
- **Colour is backed by text:**
|
||||
- The armed state is also shown as text on the Dashboard, in the tray icon's tooltip and in the
|
||||
tray menu.
|
||||
- Log levels and error messages are shown as words.
|
||||
- The app is per-monitor DPI aware, so it stays sharp at any display scaling and across monitors
|
||||
with different scaling.
|
||||
|
||||
### Motion and timing
|
||||
|
||||
- Page transitions are turned off when **Settings → Accessibility → Visual effects → Animation
|
||||
effects** is off in Windows.
|
||||
- Notification pop-ups stay up at least as long as **Dismiss notifications after this amount of
|
||||
time** (same page in Windows Settings). Pointing at a pop-up keeps it open.
|
||||
- Captures never depend on a time limit. The optional countdown (3, 5 or 10 seconds) is a feature
|
||||
you choose, and Esc cancels a region selection at any time.
|
||||
|
||||
### Language
|
||||
|
||||
- English, Tiếng Việt, العربية, 日本語, 简体中文, 한국어, Español, Français, Deutsch, Português (Brasil)
|
||||
and Русский.
|
||||
- The language follows Windows on first run and can be changed in **Settings**.
|
||||
|
||||
## Keyboard reference
|
||||
|
||||
| Where | Keys | What they do |
|
||||
|---|---|---|
|
||||
| Anywhere, while armed | `Ctrl+Shift+F12` | Capture the window in front (or the locked window) |
|
||||
| Anywhere, while armed | `Ctrl+Shift+F11` | Select a region to capture |
|
||||
| Anywhere, while armed | `Ctrl+Shift+F10` | Capture the screen under the mouse pointer |
|
||||
| Region selection | Arrow keys | Move the selection (the first press selects a centred area half the screen's width and height) |
|
||||
| Region selection | `Shift` + arrow keys | Make the selection wider, narrower, taller or shorter |
|
||||
| Region selection | `Ctrl` (with the above) | Move or resize by a single pixel |
|
||||
| Region selection | `Tab` / `Shift+Tab` | Continue on the next / previous monitor |
|
||||
| Region selection | `Enter` | Capture the selection, or the whole screen if nothing is selected |
|
||||
| Region selection | `Esc` | Cancel |
|
||||
| Preview | `Enter` / `Esc` / `Ctrl+C` | Save / discard / copy the capture |
|
||||
| Settings → Hotkeys | `Enter` or `Space` on a hotkey | Start recording, then press the new combination |
|
||||
| Settings → Hotkeys, recording | `Esc` / `Backspace` / `Tab` | Cancel / clear the hotkey / leave without changing it |
|
||||
| Notification area | `Win+B`, arrow keys, then `Enter` | Show the CaptureImage window |
|
||||
| Notification area | `Win+B`, arrow keys, then `Shift+F10` | Open the tray menu (capture, arm, settings, exit) |
|
||||
|
||||
The three capture hotkeys can be changed in **Settings → Hotkeys**. While the region overlay is up,
|
||||
the arrow keys, Tab, Enter and Esc go to CaptureImage, and other apps get them back as soon as the
|
||||
overlay closes.
|
||||
|
||||
## Supported environments
|
||||
|
||||
| Area | Status |
|
||||
|---|---|
|
||||
| Windows | Windows 11 22H2 or later, 64-bit (the same as the app) |
|
||||
| Keyboard only | Supported and tested |
|
||||
| Narrator | Supported and tested |
|
||||
| NVDA, JAWS | Should work, because the app uses UI Automation; **not tested** |
|
||||
| Magnifier | Should work; not tested |
|
||||
| Voice access | Not tested |
|
||||
| Contrast themes | Supported (Theme: System or High contrast) |
|
||||
| Display scaling | Supported per monitor, including mixed scaling |
|
||||
| Windows "Text size" | **Not supported** (see [known limitations](#known-limitations)) |
|
||||
|
||||
## Testing record
|
||||
|
||||
| Date | Version | Environment | Method | Result |
|
||||
|---|---|---|---|---|
|
||||
| 2026-11-09 | 2.0.3 | Windows 11 (Insider build 29648) | Maintainer: keyboard only with the mouse disconnected, and Narrator, across the main window's pages | No blocking problems found |
|
||||
|
||||
Version 2.1.0 adds keyboard region selection, the announcements and the other changes listed in
|
||||
the [changelog](CHANGELOG.md). Unit tests and the UI tests cover them, but they have not yet been
|
||||
checked by hand with Narrator.
|
||||
|
||||
On every pull request, CI checks that:
|
||||
|
||||
- every page opens and has its automation id;
|
||||
- the hotkey buttons have distinct names that include the current binding;
|
||||
- Tab leaves the hotkey recorder without saving a hotkey;
|
||||
- arming the hotkeys raises a live-region announcement.
|
||||
|
||||
## Known limitations
|
||||
|
||||
| Limitation | Workaround |
|
||||
|---|---|
|
||||
| The app doesn't follow **Settings → Accessibility → Text size** (a WPF limitation). | Increase **Settings → System → Display → Scale**, or use Magnifier (`Win` + `+`). |
|
||||
| Pinned thumbnails work only with a mouse. They never take the focus, so they can't interrupt a game. | The **Library** offers the same actions from the keyboard: open, copy, show in folder. |
|
||||
| Notifications close on their own. | Everything they report is also in the **Library** (captures) and on the **Logs** page. Windows' notification-time setting makes them stay longer. |
|
||||
| A capture has no text description. | **Extract text** (Preview or Library) copies the text inside a capture to the clipboard. |
|
||||
| While armed, a capture hotkey doesn't reach other apps. A clash with a shortcut of your assistive technology is possible. | Change the hotkey in **Settings → Hotkeys**, or disarm. The keys are only held while armed. |
|
||||
| Translations are machine-assisted, so wording or pronunciation may be off. | Please report it (see below); corrections from native speakers are welcome. |
|
||||
| Screen readers other than Narrator haven't been tested. | Reports from NVDA and JAWS users are especially welcome. |
|
||||
|
||||
## Contributor expectations
|
||||
|
||||
Accessibility is part of "done" for every change to the user interface.
|
||||
|
||||
**Testing.** Before opening a pull request that changes the UI:
|
||||
|
||||
- Use every changed screen with the keyboard alone, with a visible focus at every step and no
|
||||
place where the focus gets stuck.
|
||||
- Check it once with Narrator (`Ctrl+Win+Enter`). Every control should be read with a name, a role
|
||||
and a state, and changes should be announced.
|
||||
- Check it in a Windows contrast theme and at 200 % display scaling.
|
||||
- Optionally run [Accessibility Insights for Windows](https://accessibilityinsights.io/docs/windows/overview/)
|
||||
FastPass on the changed window.
|
||||
|
||||
**User interface (XAML).**
|
||||
|
||||
- Give every control that shows only an icon an `AutomationProperties.Name`. Names must be unique
|
||||
within a page, so add the context (the mode, the card) when the same action appears twice.
|
||||
- Give list items an accessible name that includes the badges shown next to them (see
|
||||
`TargetItemViewModel.AutomationName`).
|
||||
- Use the `PageTitle` and `SectionHeader` styles (which set heading levels) for headings, and
|
||||
`AutomationProperties.HeadingLevel` for any other heading.
|
||||
- Text that changes to report a status needs `AutomationProperties.LiveSetting`,
|
||||
`a11y:LiveRegion.IsEnabled="True"` and a binding with `NotifyOnTargetUpdated=True`. WPF doesn't
|
||||
announce live regions on its own.
|
||||
- Use theme brushes (`{DynamicResource …}`), not hard-coded colours. Never use colour alone to show
|
||||
a state.
|
||||
- New animations must respect `SystemParameters.ClientAreaAnimation`. Notifications and pop-ups
|
||||
must not take the focus.
|
||||
- Every new string goes into all 11 language files, including names and help text read only by
|
||||
screen readers.
|
||||
|
||||
**Documentation.**
|
||||
|
||||
- Use headings in order, without skipping a level.
|
||||
- Write link text that says where the link goes.
|
||||
- Give images alt text that describes them, for example the README screenshots.
|
||||
- Keep tables for tabular data, and give diagrams (such as the Mermaid diagrams in
|
||||
`docs/ARCHITECTURE.md`) a text explanation next to them.
|
||||
|
||||
**CI.** There is no automated accessibility scanner for WPF in CI. The `ui-tests` job checks
|
||||
automation ids, names and announcements through UI Automation. Reviews use the accessibility
|
||||
checklist in the pull request template.
|
||||
|
||||
## Reporting accessibility issues
|
||||
|
||||
If something in CaptureImage is hard or impossible to use with your setup, please tell us:
|
||||
|
||||
- Open an [accessibility issue](https://github.com/poli0981/captureimg/issues/new?template=accessibility.yml).
|
||||
- Or, if you'd rather not use GitHub, email `contact@poli0981.dev`.
|
||||
|
||||
It helps to include:
|
||||
|
||||
- what you were trying to do, what you expected and what happened;
|
||||
- your assistive technology and its version (or "keyboard only", "contrast theme", …);
|
||||
- your Windows version, the CaptureImage version (shown on the About page) and the app's
|
||||
language.
|
||||
|
||||
Screenshots and recordings are optional. You never need to tell us about a disability or any
|
||||
other personal information.
|
||||
|
||||
### Severity
|
||||
|
||||
The maintainer assigns a severity when triaging a report:
|
||||
|
||||
| Severity | Meaning |
|
||||
|---|---|
|
||||
| Critical | Blocks a core task with no workaround: capturing, arming or disarming, changing hotkeys, finding your captures, updating |
|
||||
| Serious | A core task is possible only with great difficulty or a workaround |
|
||||
| Moderate | Something is slower, confusing or inconsistent, but works |
|
||||
| Minor | A small issue with little effect on use |
|
||||
|
||||
### How we respond
|
||||
|
||||
CaptureImage is maintained by one volunteer, so there are **no fixed response or fix times**. That
|
||||
is the same as for other reports (see [`SUPPORT.md`](SUPPORT.md)). What you can expect:
|
||||
|
||||
- Every report is read and labelled `accessibility`.
|
||||
- Questions are asked respectfully, without doubting your experience.
|
||||
- Critical and Serious barriers are fixed before cosmetic work, usually in the next release.
|
||||
- A workaround is suggested when one exists.
|
||||
- The fix is listed in the [changelog](CHANGELOG.md). If you're willing, we'll ask you to confirm
|
||||
that it works for you.
|
||||
|
||||
## Ownership
|
||||
|
||||
The maintainer, [poli0981](https://github.com/poli0981), is responsible for accessibility. That
|
||||
means:
|
||||
|
||||
- triaging accessibility reports and keeping their issues up to date;
|
||||
- running the keyboard and Narrator check before releases that change the user interface;
|
||||
- keeping this document current: the features, the known limitations and the testing record.
|
||||
|
||||
## Feedback
|
||||
|
||||
Suggestions for this statement or for our practices are welcome in
|
||||
[GitHub Discussions](https://github.com/poli0981/captureimg/discussions). An actual barrier is best
|
||||
reported as described [above](#reporting-accessibility-issues).
|
||||
|
||||
This statement is based on the template of the
|
||||
[Open Source Accessibility toolkit](https://github.com/open-source-accessibility/accessibility-toolkit)
|
||||
and the [Open Source Guide on accessibility](https://opensource.guide/accessibility-best-practices-for-your-project/).
|
||||
|
||||
_Last reviewed: 2026-11-09, for CaptureImage 2.1.0._
|
||||
@@ -7,6 +7,97 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [2.1.0] - 2026-11-09
|
||||
|
||||
### Added
|
||||
|
||||
- **Region selection from the keyboard.**
|
||||
- In the region overlay, the arrow keys move the selection. The first press selects a centred
|
||||
area.
|
||||
- Shift+arrows resize the selection. Holding Ctrl moves or resizes it one pixel at a time.
|
||||
- Tab and Shift+Tab continue on the next or previous monitor, Enter captures and Esc cancels.
|
||||
- The keys work even while a full-screen game keeps the keyboard focus. Holding an arrow key
|
||||
repeats it. Mouse and keyboard can be combined, for example to drag an area and then
|
||||
fine-tune it.
|
||||
- **Screen readers hear what changes.** Narrator and other UI Automation screen readers now
|
||||
announce:
|
||||
- capture notifications, sent as UI Automation notification events;
|
||||
- the armed status;
|
||||
- the update status;
|
||||
- hotkey problems and an invalid Steam App ID.
|
||||
- **Tray icon from the keyboard.** After Win+B, Enter shows the CaptureImage window and Shift+F10
|
||||
opens its menu.
|
||||
- [`ACCESSIBILITY.md`](https://github.com/poli0981/captureimg/blob/main/ACCESSIBILITY.md) describes what CaptureImage supports for keyboard, screen
|
||||
reader, contrast and motion users. It lists every key, what has been tested, the known
|
||||
limitations, and how to report a barrier.
|
||||
|
||||
### Changed
|
||||
|
||||
- Page transitions are turned off when Windows' **Animation effects** setting is off.
|
||||
- Notifications stay up at least as long as Windows' **Dismiss notifications after this amount of
|
||||
time** setting.
|
||||
- In a Windows contrast theme, the region overlay draws its selection and labels in the theme's
|
||||
colours. Its hint now lists the keyboard keys.
|
||||
- Screen readers read more detail:
|
||||
- each hotkey button now includes its current combination;
|
||||
- window, capture and profile list items include the badges shown next to them (Steam, profile,
|
||||
minimized, locked, HDR, auto-arm, disabled);
|
||||
- each hotkey row's Clear and Reset buttons, the About page's contact cards and repeated buttons
|
||||
such as "Open folder" now say what they belong to;
|
||||
- the disclaimer headings on the About page are headings.
|
||||
|
||||
### Fixed
|
||||
|
||||
- While recording a hotkey, Shift+Tab was saved as the new hotkey, and Tab left the keyboard focus
|
||||
stuck on the button. Both keys now end recording without changing the hotkey and move the focus
|
||||
on.
|
||||
- The announcement of a notification pop-up could be lost before a screen reader read it. Pop-ups
|
||||
now send their text with the notification event itself.
|
||||
|
||||
### Project
|
||||
|
||||
- New **Accessibility barrier** issue template and `accessibility` label.
|
||||
- The pull request template has an accessibility checklist, and `CONTRIBUTING.md` points to the
|
||||
rules for user-interface changes.
|
||||
- UI tests check the live-region announcement and the hotkey buttons' names, and that Tab leaves
|
||||
the recorder.
|
||||
|
||||
## [2.0.3] - 2026-11-09
|
||||
|
||||
### Changed
|
||||
|
||||
- The SkiaSharp image library that encodes PNG, JPEG and WebP captures is updated to 4.154.0 (Skia
|
||||
milestone 154 with Chrome's upstream bug fixes).
|
||||
|
||||
### Project
|
||||
|
||||
- The InspectCode and ReportGenerator build tools, the setup-dotnet action and zizmor (1.32.0) are
|
||||
updated. Dependabot can't update SkiaSharp, so `dependabot.yml` notes that it is bumped by hand.
|
||||
|
||||
## [2.0.2] - 2026-10-26
|
||||
|
||||
### Security
|
||||
|
||||
- CaptureImage now needs the .NET 10 Desktop Runtime **10.0.14 or later**, the .NET security update
|
||||
of October 25, 2026. Setup and the in-app updater install it when your PC has an older one, so
|
||||
this update may first ask to install it (Windows asks for administrator approval). With the
|
||||
portable zip, install it yourself from <https://dotnet.microsoft.com/download/dotnet/10.0>.
|
||||
- The Microsoft.Extensions libraries that ship with the app are updated to 10.0.14 from the same
|
||||
security update.
|
||||
|
||||
### Project
|
||||
|
||||
- SonarQube Cloud analyses every pull request and `main` in CI (SonarScanner for .NET 12) instead
|
||||
of automatic analysis, with test coverage and test results imported; its quality gate is a
|
||||
required check.
|
||||
- The dependency audit also checks the .NET tools used to build and release the app.
|
||||
- Code follows the analyzer suggestions SonarQube Cloud reports: primary constructors, view-model
|
||||
state as partial properties, source-generated P/Invoke.
|
||||
- Builds use the .NET 10.0.403 SDK and CsWin32 0.3.367; the markdownlint, CodeQL SARIF upload and
|
||||
zizmor actions are updated.
|
||||
- A test keeps the third-party notices in step with the packages the app ships, and the `vpk`
|
||||
release tool in step with the Velopack library.
|
||||
|
||||
## [2.0.1] - 2026-10-19
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -18,7 +18,7 @@ dotnet test --solution CaptureImage.sln -c Release --no-build # Microsoft.Test
|
||||
dotnet run --project src/CaptureImage.App -c Release -- --data-dir .\.devdata --instance-id dev
|
||||
```
|
||||
|
||||
- SDK pinned in `global.json` (10.0.401, `latestFeature`). Tests are xunit.v3 on
|
||||
- SDK pinned in `global.json` (10.0.403, `latestFeature`). Tests are xunit.v3 on
|
||||
Microsoft.Testing.Platform: use `--report-xunit-trx` and
|
||||
`--coverage --coverage-output-format cobertura` (there is no `--logger trx`).
|
||||
- **Never run a dev build against real user data.** Always pass `--data-dir <temp>` and
|
||||
@@ -29,7 +29,7 @@ dotnet run --project src/CaptureImage.App -c Release -- --data-dir .\.devdata --
|
||||
- UI tests (`tests/CaptureImage.App.UiTests`, FlaUI) move the mouse and type; they skip unless
|
||||
`CAPTUREIMAGE_UI_TESTS=1`. Don't run them on the maintainer's desktop.
|
||||
- Local tools (`dotnet tool restore`): `vpk`, `jb` (InspectCode), `nuget-license`,
|
||||
`reportgenerator`, `dotnet-CycloneDX`.
|
||||
`reportgenerator`, `dotnet-CycloneDX`, `dotnet-sonarscanner` (CI only; needs `SONAR_TOKEN`).
|
||||
|
||||
## Layout and layering rules
|
||||
|
||||
@@ -60,7 +60,28 @@ tests/* Core, Infrastructure, ViewModels tests + App.Ui
|
||||
`dotnet format style --diagnostics IDE0073 IDE0161 IDE0065 IDE0005`. A plain `dotnet format`
|
||||
deletes XAML event handlers.
|
||||
- Pass `CancellationToken`s through (SonarCloud S8949); tests use
|
||||
`TestContext.Current.CancellationToken` (xUnit1051).
|
||||
`TestContext.Current.CancellationToken` (xUnit1051), and async tests await the async `File`
|
||||
APIs (S6966).
|
||||
- SonarQube Cloud imports the build's info-level analyzer suggestions as issues, so follow them:
|
||||
primary constructors that keep `readonly` fields (IDE0290), `var` (IDE0007),
|
||||
`[ObservableProperty]` on `public partial` properties rather than fields (MVVMTK0042),
|
||||
`[LibraryImport]` rather than `[DllImport]` (SYSLIB1054). Fixers for one diagnostic at a time are
|
||||
safe: `dotnet format style|analyzers --diagnostics <ID> --severity info`.
|
||||
|
||||
## Accessibility
|
||||
|
||||
[`ACCESSIBILITY.md`](ACCESSIBILITY.md) is the public statement (supported keys, testing record, known
|
||||
limitations) — update it when UI behaviour changes. In XAML:
|
||||
|
||||
- Every icon-only control gets `AutomationProperties.Name`, unique per page (add the mode or card
|
||||
when an action repeats); list items bind the container's name to an `AutomationName` that
|
||||
includes their badges.
|
||||
- Status text: `AutomationProperties.LiveSetting` + `a11y:LiveRegion.IsEnabled="True"` + a
|
||||
binding with `NotifyOnTargetUpdated=True` (WPF never raises `LiveRegionChanged` itself);
|
||||
notifications go through `Announcer`.
|
||||
- Headings via the `PageTitle`/`SectionHeader` styles or `AutomationProperties.HeadingLevel`; theme
|
||||
brushes, never colour alone; animations honour `SystemParameters.ClientAreaAnimation`; nothing
|
||||
takes the focus from a game.
|
||||
|
||||
## Pitfalls already hit
|
||||
|
||||
@@ -80,15 +101,22 @@ tests/* Core, Infrastructure, ViewModels tests + App.Ui
|
||||
- `main` is protected by a ruleset: PR required, signed commits, linear history, squash merge only
|
||||
(PR title = commit subject, Conventional Commits), branch up to date, no bypass. Release tags `v*`
|
||||
can't be moved or deleted.
|
||||
- Required checks: `build`, `format`, `deadcode` (InspectCode, file-local rules), `audit`,
|
||||
`license` (shipped dependencies vs `.github/license/allowed-licenses.json`), `publish-smoke`
|
||||
(publish + `--smoke-test` + page screenshots artifact), `pr-title`, `dependency-review`,
|
||||
`workflow-lint` (actionlint + zizmor), `docs` (markdownlint + offline lychee), `ui-tests` (FlaUI
|
||||
against the built app), plus CodeQL via the code-scanning rule.
|
||||
- Required checks: `build`, `format`, `deadcode` (InspectCode, file-local rules), `audit`
|
||||
(NuGet packages + the local tools in `.config/dotnet-tools.json`), `license` (shipped
|
||||
dependencies vs `.github/license/allowed-licenses.json`), `publish-smoke` (publish +
|
||||
`--smoke-test` + page screenshots artifact), `pr-title`, `dependency-review`, `workflow-lint`
|
||||
(actionlint + zizmor), `docs` (markdownlint + offline lychee), `ui-tests` (FlaUI against the
|
||||
built app), `sonarcloud`, plus CodeQL via the code-scanning rule.
|
||||
- Never add `paths:` filters to a workflow that provides a required check. Actions are pinned to
|
||||
full commit SHAs with a `# vX.Y.Z` comment.
|
||||
- SonarCloud (automatic analysis, project `poli0981_captureimg`) comments on PRs — fix what it
|
||||
reports.
|
||||
- SonarQube Cloud (project `poli0981_captureimg`, org `poli0981`) runs as CI-based analysis in the
|
||||
`sonarcloud` job (automatic analysis is off): `dotnet sonarscanner` begin → build → tests with
|
||||
Cobertura coverage + TRX → end, which waits for the quality gate ("Sonar way": no new issues,
|
||||
≥ 80 % coverage on new code). `CaptureImage.UI`, `CaptureImage.App` (tested out of process by
|
||||
`ui-tests`/`publish-smoke`) and `.github/**` scripts are excluded from coverage. The job passes
|
||||
without analysing when it can't analyse: no `SONAR_TOKEN` in fork and Dependabot PRs, and the free
|
||||
plan analyses only `main` and PRs (a non-PR run on another branch fails "not allowed to access
|
||||
data from non main branches"). Fix what it reports.
|
||||
- Dependabot NuGet updates rely on `EnableWindowsTargeting=true` in `Directory.Build.props` (the
|
||||
updater runs on Linux).
|
||||
- NuGet prunes the WPF projects' Windows Desktop packages (System.Drawing.Common, EventLog, …) only
|
||||
@@ -105,7 +133,8 @@ tests/* Core, Infrastructure, ViewModels tests + App.Ui
|
||||
2. After the PR merges: `git tag -s vX.Y.Z -m "…"` and push the tag.
|
||||
3. `release.yml` builds, tests, publishes framework-dependent, smoke-tests, packs with Velopack
|
||||
(`packId CaptureImage`, `mainExe CaptureImage.App.exe`, channel `win`, `--framework
|
||||
net10-x64-desktop` — never change the first three), attaches SBOM, SHA256SUMS and provenance
|
||||
net10.0.14-x64-desktop` — never change the first three; the framework names the minimum runtime
|
||||
patch, raised with .NET security releases), attaches SBOM, SHA256SUMS and provenance
|
||||
attestations, and creates a **draft** release.
|
||||
4. Verify the draft (see `docs/RELEASING.md`), then `gh release edit vX.Y.Z --draft=false`.
|
||||
|
||||
|
||||
+14
-2
@@ -12,6 +12,9 @@ Please follow the [Code of Conduct](CODE_OF_CONDUCT.md).
|
||||
file-name tokens unchanged.
|
||||
- **Fix a bug or build a feature.** For anything larger than a small fix, please open an issue or a
|
||||
discussion first so we can agree on the approach.
|
||||
- **Report or fix an accessibility barrier.** Reports from people who use a screen reader, a
|
||||
contrast theme or only a keyboard are especially valuable — see
|
||||
[`ACCESSIBILITY.md`](ACCESSIBILITY.md).
|
||||
|
||||
## Development setup
|
||||
|
||||
@@ -42,10 +45,15 @@ Every pull request must pass the required checks before it can be merged (squash
|
||||
- **build** — warnings are errors, the recommended .NET analyzers are on for `src/`, all tests pass.
|
||||
- **format** — `dotnet format whitespace` and the style rules below.
|
||||
- **deadcode** — JetBrains InspectCode finds no unused or redundant code.
|
||||
- **audit** / **license** — no vulnerable packages; shipped dependencies use a GPL-compatible
|
||||
license.
|
||||
- **audit** / **license** — no vulnerable packages or .NET tools; shipped dependencies use a
|
||||
GPL-compatible license.
|
||||
- **publish-smoke** — the published app starts and opens every page.
|
||||
- **ui-tests** — end-to-end tests drive the built app through UI Automation (FlaUI).
|
||||
- **sonarcloud** — the [SonarQube Cloud](https://sonarcloud.io/project/overview?id=poli0981_captureimg)
|
||||
quality gate: no new issues and at least 80 % test coverage on new code (the WPF shell in
|
||||
`CaptureImage.UI`, the `CaptureImage.App` host and the CI scripts are left out of coverage; the
|
||||
UI tests cover the first two). Pull requests from forks are analysed after they are merged,
|
||||
because the analysis needs a repository secret.
|
||||
- **pr-title** — the title follows [Conventional Commits](https://www.conventionalcommits.org/), e.g.
|
||||
`fix(capture): keep alpha opaque` or `feat(ui)!: …` for breaking changes.
|
||||
- **dependency-review**, **workflow-lint**, **docs**.
|
||||
@@ -66,6 +74,10 @@ Conventions:
|
||||
- Packages are managed centrally in `Directory.Packages.props` with lock files; after changing a
|
||||
dependency run `dotnet restore --force-evaluate` and commit the updated `packages.lock.json` files.
|
||||
- Commits must be signed (GPG or SSH) — the `main` branch requires verified signatures.
|
||||
- User-interface changes follow the accessibility rules in
|
||||
[`ACCESSIBILITY.md`](ACCESSIBILITY.md#contributor-expectations): keyboard access, unique
|
||||
accessible names, announced status text, theme brushes, reduced motion — and a quick check with
|
||||
Narrator. The pull request template has a checklist.
|
||||
|
||||
Before pushing, the quick local check is:
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Label="Version (single source of truth — the release workflow checks the tag against it)">
|
||||
<Version>2.0.1</Version>
|
||||
<Version>2.1.0</Version>
|
||||
<AssemblyVersion>$([System.Text.RegularExpressions.Regex]::Match('$(Version)', '^\d+\.\d+\.\d+').Value).0</AssemblyVersion>
|
||||
<FileVersion>$(AssemblyVersion)</FileVersion>
|
||||
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Label="Microsoft.Extensions">
|
||||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.13" />
|
||||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.13" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.13" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.13" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.13" />
|
||||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.14" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Label="Logging">
|
||||
@@ -33,11 +33,11 @@
|
||||
<PackageVersion Include="Vortice.Direct3D11" Version="3.8.3" />
|
||||
<PackageVersion Include="Vortice.DXGI" Version="3.8.3" />
|
||||
<PackageVersion Include="Vortice.Direct2D1" Version="3.8.3" />
|
||||
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.3.363" />
|
||||
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.3.367" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Label="Imaging">
|
||||
<PackageVersion Include="SkiaSharp" Version="4.153.1" />
|
||||
<PackageVersion Include="SkiaSharp" Version="4.154.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Label="Auto-update (keep in lockstep with the vpk tool in .config/dotnet-tools.json)">
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
[](LICENSE)
|
||||
[](https://dotnet.microsoft.com/download/dotnet/10.0)
|
||||
[](https://securityscorecards.dev/viewer/?uri=github.com/poli0981/captureimg)
|
||||
[](https://sonarcloud.io/summary/new_code?id=poli0981_captureimg)
|
||||
[](https://sonarcloud.io/component_measures?id=poli0981_captureimg&metric=coverage)
|
||||
|
||||
A lightweight Windows screenshot tool for games that don't have their own screenshot key.
|
||||
It sits in the tray, stays out of the way, and takes a clean capture when you press a hotkey.
|
||||
@@ -50,6 +52,9 @@ small tray app that does nothing until you press a hotkey.
|
||||
Français, Deutsch, Português (Brasil), Русский. Translations are machine-assisted — see
|
||||
[`docs/legal/DISCLAIMER.md`](docs/legal/DISCLAIMER.md).
|
||||
- **Light, dark and high-contrast themes**, following Windows by default.
|
||||
- **Keyboard and screen-reader friendly** — everything works without a mouse, including region
|
||||
selection with the arrow keys; Narrator reads every control, status change and notification. See
|
||||
[`ACCESSIBILITY.md`](ACCESSIBILITY.md).
|
||||
- **Start with Windows**, start minimized, arm on startup.
|
||||
- **Private by default** — no telemetry, no account, no cloud. The only network request is the
|
||||
update check. See [`docs/legal/PRIVACY.md`](docs/legal/PRIVACY.md).
|
||||
@@ -68,8 +73,8 @@ small tray app that does nothing until you press a hotkey.
|
||||
## Requirements
|
||||
|
||||
- **Windows 11 22H2 or later** (build 22621+), 64-bit.
|
||||
- **.NET 10 Desktop Runtime** — installed automatically by Setup and by the in-app updater when it
|
||||
is missing. The portable zip needs it installed
|
||||
- **.NET 10 Desktop Runtime 10.0.14 or later** — installed automatically by Setup and by the in-app
|
||||
updater when it is missing or older. The portable zip needs it installed
|
||||
([download](https://dotnet.microsoft.com/download/dotnet/10.0)).
|
||||
|
||||
## Install
|
||||
@@ -115,6 +120,15 @@ Tips:
|
||||
- Settings, logs and the library index are kept in `%LocalAppData%\poli0981\CaptureImage`.
|
||||
**Settings → Advanced → Export diagnostics** creates a zip for bug reports (user paths removed).
|
||||
|
||||
## Accessibility
|
||||
|
||||
CaptureImage aims to be fully usable with a keyboard, a screen reader (tested with Narrator), a
|
||||
contrast theme and large display scaling, and it follows Windows' animation and notification-time
|
||||
settings. In the region overlay the arrow keys move the selection, Shift+arrows resize it, Tab moves
|
||||
to the next monitor and Enter captures. [`ACCESSIBILITY.md`](ACCESSIBILITY.md) lists every key, what
|
||||
has been tested, the known limitations, and how to
|
||||
[report a barrier](https://github.com/poli0981/captureimg/issues/new?template=accessibility.yml).
|
||||
|
||||
## Build from source
|
||||
|
||||
You need the **.NET 10 SDK** (the exact version is pinned in [`global.json`](global.json)) on
|
||||
|
||||
+5
-2
@@ -53,7 +53,9 @@ targets rather than guarantees.
|
||||
described in the [README](README.md#unsigned-installer--smartscreen).
|
||||
- An anti-cheat system flags the app — CaptureImage doesn't inject into or read from games, but we
|
||||
can't control how anti-cheat software classifies capture tools.
|
||||
- Translation, documentation or accessibility issues, and feature requests.
|
||||
- Translation or documentation issues, and feature requests.
|
||||
- Accessibility barriers — please use the accessibility issue template described in
|
||||
[`ACCESSIBILITY.md`](ACCESSIBILITY.md#reporting-accessibility-issues).
|
||||
|
||||
## After you report
|
||||
|
||||
@@ -65,7 +67,8 @@ targets rather than guarantees.
|
||||
## Supply chain
|
||||
|
||||
- Dependencies are pinned centrally with lock files; Dependabot proposes updates after a cooldown,
|
||||
and every pull request is checked for known-vulnerable and incompatibly licensed packages.
|
||||
and every pull request is checked for known-vulnerable packages and build tools and for
|
||||
incompatibly licensed packages.
|
||||
- GitHub Actions are pinned to full commit SHAs and linted with actionlint and zizmor; CodeQL,
|
||||
OpenSSF Scorecard and SonarCloud review the code.
|
||||
- Releases are built by GitHub Actions from signed tags and ship with SHA-256 checksums, a CycloneDX
|
||||
|
||||
@@ -7,6 +7,7 @@ CaptureImage is maintained by one volunteer. Here is where to go:
|
||||
| Ask a question or share an idea | [GitHub Discussions](https://github.com/poli0981/captureimg/discussions) |
|
||||
| Report a bug | [Bug report](https://github.com/poli0981/captureimg/issues/new?template=bug_report.yml) — or **About → Report a bug** in the app |
|
||||
| Suggest a feature | [Feature request](https://github.com/poli0981/captureimg/issues/new?template=feature_request.yml) |
|
||||
| Report an accessibility barrier | [Accessibility barrier](https://github.com/poli0981/captureimg/issues/new?template=accessibility.yml) or `contact@poli0981.dev` — see [`ACCESSIBILITY.md`](ACCESSIBILITY.md) |
|
||||
| Report a security problem | Privately — see [`SECURITY.md`](SECURITY.md) (`security@poli0981.dev`) |
|
||||
| Ask about privacy | `privacy@poli0981.dev` — see [`docs/legal/PRIVACY.md`](docs/legal/PRIVACY.md) |
|
||||
| Raise a game-compatibility or anti-cheat concern (publishers, vendors) | `games@poli0981.dev` |
|
||||
|
||||
+19
-7
@@ -95,8 +95,10 @@ sequenceDiagram
|
||||
- Registration results (registered, conflict, invalid) are shown on the Dashboard and in Settings.
|
||||
- While the hotkey recorder in Settings is listening, the coordinator suspends the hotkeys so the
|
||||
current combination can be pressed again.
|
||||
- During region selection Esc and Enter are registered temporarily, so they work even when a
|
||||
full-screen game keeps the keyboard focus.
|
||||
- During region selection the overlay's keys (`RegionKeyboard` in Core: Esc, Enter, Tab,
|
||||
Shift+Tab, and the arrow keys with Shift / Ctrl) are registered temporarily, so they work even
|
||||
when a full-screen game keeps the keyboard focus. The arrow keys auto-repeat; temporary-key
|
||||
callbacks run off the hotkey thread one at a time, in the order the keys were pressed.
|
||||
|
||||
### Coordinator
|
||||
|
||||
@@ -162,7 +164,15 @@ stateDiagram-v2
|
||||
- Region overlays are placed over each monitor in physical pixels and show the frozen frame at the
|
||||
monitor's DPI, so one image pixel is one screen pixel; the selection is converted back to physical
|
||||
pixels.
|
||||
- The tray icon (H.NotifyIcon) shows a red dot while armed and is re-added after Explorer restarts.
|
||||
- The tray icon (H.NotifyIcon) shows a red dot while armed and is re-added after Explorer restarts;
|
||||
Enter and Shift+F10 on it (after Win+B) show the window and open the menu.
|
||||
- Accessibility (see [`ACCESSIBILITY.md`](../ACCESSIBILITY.md)): pages expose themselves through
|
||||
`PageAutomationPeer`, and every control has an automation id and name. Status text uses
|
||||
`LiveRegion` (`CaptureImage.UI/Accessibility`) to raise `LiveRegionChanged`, which WPF never
|
||||
does on its own. Notifications are read through `Announcer` (UI Automation notification events)
|
||||
and stay up at least as long as Windows' notification-time setting. Page transitions follow
|
||||
`SystemParameters.ClientAreaAnimation`, and region overlays use system colours in contrast
|
||||
themes.
|
||||
- The main window hides to the tray while it idles and the process then runs in Windows' efficiency
|
||||
mode (EcoQoS), lifted during captures.
|
||||
|
||||
@@ -191,7 +201,9 @@ shortcuts never change, so installed copies keep updating. See [RELEASING.md](RE
|
||||
|
||||
Every pull request runs: build with warnings as errors and the recommended .NET analyzers; unit,
|
||||
view-model and integration tests with coverage; formatting and SPDX headers; JetBrains InspectCode
|
||||
(dead and redundant code); vulnerable and incompatibly licensed dependencies; a publish of the app
|
||||
followed by a smoke test that opens every page; PR title; dependency review; workflow lint
|
||||
(actionlint, zizmor); Markdown lint and link check. End-to-end UI tests (FlaUI), CodeQL, OpenSSF
|
||||
Scorecard and SonarCloud run as well.
|
||||
(dead and redundant code); vulnerable dependencies and .NET tools, and incompatibly licensed
|
||||
dependencies; a publish of the app followed by a smoke test that opens every page; end-to-end UI
|
||||
tests (FlaUI); the SonarQube Cloud quality gate (CI-based analysis with test coverage: no new
|
||||
issues, at least 80 % coverage on new code outside the WPF shell, the host and the CI scripts); PR
|
||||
title; dependency review; workflow lint (actionlint, zizmor); Markdown lint and link check. CodeQL
|
||||
and OpenSSF Scorecard run as well.
|
||||
+4
-1
@@ -36,7 +36,7 @@ The workflow then:
|
||||
3. publishes the app (framework-dependent, `win-x64`) and runs it with `--smoke-test`;
|
||||
4. packs it with Velopack (`vpk`, same version as the library): package id `CaptureImage`, main
|
||||
executable `CaptureImage.App.exe`, channel `win`, shortcuts on the desktop and Start menu, the
|
||||
.NET 10 Desktop Runtime as a prerequisite, full packages only;
|
||||
.NET 10 Desktop Runtime (minimum patch from `RUNTIME`) as a prerequisite, full packages only;
|
||||
5. adds a CycloneDX SBOM and `SHA256SUMS.txt`, attests build provenance, and creates or updates a
|
||||
**draft** release with all assets.
|
||||
|
||||
@@ -55,6 +55,9 @@ The workflow then:
|
||||
(`Update.exe apply --package <full.nupkg>` in the install folder, or the in-app updater once
|
||||
published) — settings are kept and migrated.
|
||||
- [ ] The portable zip starts with `--smoke-test --data-dir <temp>` and exits 0.
|
||||
- [ ] If the release changes the user interface: a quick pass with the keyboard alone and with
|
||||
Narrator over the changed screens (see [`ACCESSIBILITY.md`](../ACCESSIBILITY.md)); add the
|
||||
result to its testing record.
|
||||
|
||||
## 4. Publish
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Privacy Policy
|
||||
|
||||
_Last updated: 2026-10-19 (CaptureImage 2.0)_
|
||||
_Last updated: 2026-10-26 (CaptureImage 2.0.2)_
|
||||
|
||||
This policy describes what **CaptureImage** reads on your computer, what it stores, and what it
|
||||
sends over the network. It applies to the official builds published on the project's
|
||||
@@ -79,7 +79,8 @@ No identifiers, cookies or system information are sent beyond what any HTTPS req
|
||||
IP address and a standard user agent). GitHub may log these requests under
|
||||
[its own privacy statement](https://docs.github.com/site-policy/privacy-policies/github-general-privacy-statement).
|
||||
|
||||
When the .NET Desktop Runtime is missing, Setup and the updater download it from Microsoft.
|
||||
When the .NET Desktop Runtime is missing or older than the app needs, Setup and the updater
|
||||
download it from Microsoft.
|
||||
Links in the About page open in your browser; the app itself does not fetch them.
|
||||
|
||||
CaptureImage does **not** send crash reports, contact analytics or license servers, upload
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Third-party Notices
|
||||
|
||||
_Last updated: 2026-10-19 (CaptureImage 2.0)_
|
||||
_Last updated: 2026-11-09 (CaptureImage 2.1.0)_
|
||||
|
||||
CaptureImage is built on open-source components. This file lists every package that ships with
|
||||
the app, with its license and upstream project; the short form is the repository root
|
||||
@@ -25,8 +25,8 @@ within licenses compatible with **GPL-3.0-or-later**.
|
||||
|---|---|---|---|
|
||||
| SharpGen.Runtime | 2.4.2-beta | MIT | <https://github.com/SharpGenTools/SharpGenTools> |
|
||||
| SharpGen.Runtime.COM | 2.4.2-beta | MIT | <https://github.com/SharpGenTools/SharpGenTools> |
|
||||
| SkiaSharp | 4.153.1 | MIT | <https://github.com/mono/SkiaSharp> |
|
||||
| SkiaSharp.NativeAssets.Win32 | 4.153.1 | MIT | <https://github.com/mono/SkiaSharp> |
|
||||
| SkiaSharp | 4.154.0 | MIT | <https://github.com/mono/SkiaSharp> |
|
||||
| SkiaSharp.NativeAssets.Win32 | 4.154.0 | MIT | <https://github.com/mono/SkiaSharp> |
|
||||
| Vortice.Direct2D1 | 3.8.3 | MIT | <https://github.com/amerkoleci/Vortice.Windows> |
|
||||
| Vortice.Direct3D11 | 3.8.3 | MIT | <https://github.com/amerkoleci/Vortice.Windows> |
|
||||
| Vortice.DirectX | 3.8.3 | MIT | <https://github.com/amerkoleci/Vortice.Windows> |
|
||||
@@ -37,33 +37,33 @@ within licenses compatible with **GPL-3.0-or-later**.
|
||||
|
||||
| Package | Version | License | Project |
|
||||
|---|---|---|---|
|
||||
| Microsoft.Extensions.Configuration | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Configuration.Abstractions | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Configuration.Binder | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Configuration.CommandLine | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Configuration.EnvironmentVariables | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Configuration.FileExtensions | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Configuration.Json | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Configuration.UserSecrets | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.DependencyInjection | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.DependencyInjection.Abstractions | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Diagnostics | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Diagnostics.Abstractions | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.FileProviders.Abstractions | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.FileProviders.Physical | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.FileSystemGlobbing | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Hosting | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Hosting.Abstractions | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Logging | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Logging.Abstractions | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Logging.Configuration | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Logging.Console | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Logging.Debug | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Logging.EventLog | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Logging.EventSource | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Options | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Options.ConfigurationExtensions | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Primitives | 10.0.13 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Configuration | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Configuration.Abstractions | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Configuration.Binder | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Configuration.CommandLine | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Configuration.EnvironmentVariables | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Configuration.FileExtensions | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Configuration.Json | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Configuration.UserSecrets | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.DependencyInjection | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.DependencyInjection.Abstractions | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Diagnostics | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Diagnostics.Abstractions | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.FileProviders.Abstractions | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.FileProviders.Physical | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.FileSystemGlobbing | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Hosting | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Hosting.Abstractions | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Logging | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Logging.Abstractions | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Logging.Configuration | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Logging.Console | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Logging.Debug | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Logging.EventLog | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Logging.EventSource | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Options | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Options.ConfigurationExtensions | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Microsoft.Extensions.Primitives | 10.0.14 | MIT | <https://github.com/dotnet/runtime> |
|
||||
|
||||
## Logging
|
||||
|
||||
@@ -84,7 +84,7 @@ within licenses compatible with **GPL-3.0-or-later**.
|
||||
|
||||
| Component | License | Project |
|
||||
|---|---|---|
|
||||
| .NET 10 Desktop Runtime (installed separately by Setup when missing) | MIT | <https://github.com/dotnet/runtime> |
|
||||
| .NET 10 Desktop Runtime, 10.0.14 or later (installed separately by Setup when missing) | MIT | <https://github.com/dotnet/runtime> |
|
||||
| Windows SDK projection for .NET (`Microsoft.Windows.SDK.NET`, C#/WinRT) | MIT | <https://github.com/microsoft/CsWinRT> |
|
||||
| Fluent System Icons (font embedded in WPF UI) | MIT | <https://github.com/microsoft/fluentui-system-icons> |
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"sdk": {
|
||||
"version": "10.0.401",
|
||||
"version": "10.0.403",
|
||||
"rollForward": "latestFeature",
|
||||
"allowPrerelease": false
|
||||
},
|
||||
|
||||
@@ -10,32 +10,32 @@
|
||||
},
|
||||
"Microsoft.Extensions.Hosting": {
|
||||
"type": "Direct",
|
||||
"requested": "[10.0.13, )",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "Q+hmPoDqeHipHyJcY7mDCQiLDUcn9jIgjoCThcgaOgjLTTT3ApTe8p6M2+twsDyfKuuCsKhSNlnNjaaggtXxRA==",
|
||||
"requested": "[10.0.14, )",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "q3f2GLZebtxWG/pDtckPrgIWV22pVmSLSLEkncdmbUz7Z6atwF2wn9ag5cZCc/ndcGe7ffHJom98scauFG+oNQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Binder": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.CommandLine": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.EnvironmentVariables": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.FileExtensions": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Json": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.UserSecrets": "10.0.13",
|
||||
"Microsoft.Extensions.DependencyInjection": "10.0.13",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Diagnostics": "10.0.13",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.FileProviders.Physical": "10.0.13",
|
||||
"Microsoft.Extensions.Hosting.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Logging": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Configuration": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Console": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Debug": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.EventLog": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.EventSource": "10.0.13",
|
||||
"Microsoft.Extensions.Options": "10.0.13"
|
||||
"Microsoft.Extensions.Configuration": "10.0.14",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Configuration.Binder": "10.0.14",
|
||||
"Microsoft.Extensions.Configuration.CommandLine": "10.0.14",
|
||||
"Microsoft.Extensions.Configuration.EnvironmentVariables": "10.0.14",
|
||||
"Microsoft.Extensions.Configuration.FileExtensions": "10.0.14",
|
||||
"Microsoft.Extensions.Configuration.Json": "10.0.14",
|
||||
"Microsoft.Extensions.Configuration.UserSecrets": "10.0.14",
|
||||
"Microsoft.Extensions.DependencyInjection": "10.0.14",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Diagnostics": "10.0.14",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.FileProviders.Physical": "10.0.14",
|
||||
"Microsoft.Extensions.Hosting.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Logging": "10.0.14",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Logging.Configuration": "10.0.14",
|
||||
"Microsoft.Extensions.Logging.Console": "10.0.14",
|
||||
"Microsoft.Extensions.Logging.Debug": "10.0.14",
|
||||
"Microsoft.Extensions.Logging.EventLog": "10.0.14",
|
||||
"Microsoft.Extensions.Logging.EventSource": "10.0.14",
|
||||
"Microsoft.Extensions.Options": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Serilog": {
|
||||
@@ -93,221 +93,221 @@
|
||||
},
|
||||
"Microsoft.Extensions.Configuration": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "inhujYI/nikhmLxYI6ZEcaCgZ28ipJsKMPPxxr2XWf3vM0Q2P+E9R3hDHABZOLBxzD3gjpgcbSH/+hd2+gvI2A==",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "UcnvaEaMvRckDDhyqY1OZkFwBqpZArkHFKB6dWaQWT9XTuNttNNX8Cqsb/Sic2LfJxsMLJUXnYrxY3iX5LN9pQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Primitives": "10.0.13"
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Primitives": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "DY4C2qzTt2lOIY3VoscBH/TCwTolI5DKOfgJLuI+k1QUvRNT5vTMS58AOerNiihdVRStO0wEpLeRWA8jytzHBQ==",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "4YdfvaoWn3tB1xQQHGrhRTFWJ8fGOqxThxduynSZy9ZFTiSaUi3vX4EK/kj8h2HQMwTlks9MWV1fv2WRBv5/1w==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "10.0.13"
|
||||
"Microsoft.Extensions.Primitives": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Binder": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "yJJl/b0+W+GEWbu+7viw6C3h2BoNkB69Vlz7s/4e+hm4mYbJqfhdcDSi9sCXJw47blsBaiQd3UDPgDtop92+ug==",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "brDb5kgle2iY2lWHgeV/KOqnBEpVnlMFigGJ/WW7KP9Nj6C/t53f/h5boYyVXB0bEhgpL+ctbewDJMI+zAMj1w==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13"
|
||||
"Microsoft.Extensions.Configuration": "10.0.14",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.CommandLine": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "RwdNZ9JdGs8eZmeL5qRe7ugp0Irk3KVkWpC/w1c8kjJwu1R4HvCXYz9kwHZxn45WiaRBG5lphQKtqnBaJOQC+Q==",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "/9IqkBeB7mE1enbN4Cfeu4HFPU9uR1JSJh2qwXfwr7SYBxETkTKRht/LoPfajmmlh+BJlH3jm79CLhQPFb9ovw==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13"
|
||||
"Microsoft.Extensions.Configuration": "10.0.14",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.EnvironmentVariables": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "qJK2dm9/AxyPVfqqBaZtjkUFl2hnBR/CQnMJtSO5LdEoyATMqvZjeQVY+8l0oa6PM6qlVe28iMEyXIRQ0wyZjA==",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "jB0UiYjpnneoBH1ZeXPlHYt4zUme6SZlnstL6gsH/0O/d5rOuN5lSIlOIfxXzapl8tAi7QmYOEogP09g/wcHzA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13"
|
||||
"Microsoft.Extensions.Configuration": "10.0.14",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.FileExtensions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "kwC1DY55CsqPmDtJAz+7alD3G+gJcM+XwHSZrcRO8mJGYB9hRq1qC6ZH8DL0SPW9WtJ/Bae5ikzPic8SxSv6Vw==",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "NBIfm8vWNi3UJ9OI9thvREJeV6KzEdPjQ4ONdH+yPWutGBpVnwLbXiEqdEFaGAFYpAluGCfyCwKFgH9pd2scfw==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.FileProviders.Physical": "10.0.13",
|
||||
"Microsoft.Extensions.Primitives": "10.0.13"
|
||||
"Microsoft.Extensions.Configuration": "10.0.14",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.FileProviders.Physical": "10.0.14",
|
||||
"Microsoft.Extensions.Primitives": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Json": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "acCWM2+WR67kBAz6gAhD2zG+IZH9Q2VpKv5le7Msiu0vAMsnnLXpnV3BAzxd8/i+uOEo/dfb2XRYTynRVTDvEg==",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "4Tn8eNg85x+ICDN4OLC7Dl/xvZNREZIf7VSOAdT4Q4KYf5Ip1zAk+0BAx8BsRTomgEpCYV4kKsNNnP/ZXUbQkw==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.FileExtensions": "10.0.13",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.13"
|
||||
"Microsoft.Extensions.Configuration": "10.0.14",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Configuration.FileExtensions": "10.0.14",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.UserSecrets": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "kQ/Tx972unP+ueQL8SSninthIj6w6XP2o0VnJPFC5HQIimPMwEN704MOspEgDkmm4FUL5SuxLEU0bNiW4HEZFA==",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "z+dvl9uQnNzvq6Xco+UQyeujpP/BHs+ahHLPCBMxR5GW6M4JcsN1tupEgn5uWgR1fGCfmxS4QJEMt6eyizXGUA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Json": "10.0.13",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.FileProviders.Physical": "10.0.13"
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Configuration.Json": "10.0.14",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.FileProviders.Physical": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Diagnostics": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "J9ODOrffj1mK3Et69elNsLGRguesPxvThTdVpFmQX7fLNPhIOgqHQfLdGnTBEwNAV3yf8yiyVlpDZNw2qN87Nw==",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "80VqW8eKxQaxBOLDNpLUdxOlxzWn/jqBSxNBCfD8GCjcshNDpFvUgKh8uvvZwvkfBbwmNPWPWHyy9F+RLd1dlQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "10.0.13",
|
||||
"Microsoft.Extensions.Diagnostics.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Options.ConfigurationExtensions": "10.0.13"
|
||||
"Microsoft.Extensions.Configuration": "10.0.14",
|
||||
"Microsoft.Extensions.Diagnostics.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Options.ConfigurationExtensions": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Diagnostics.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "oZzqZze8ed1fLS20HtIrkPxQXGRG/koq09srIw2ptnDHm9RHfwB++d35hosB/cXc55TH7Pshv85O0txongjCIg==",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "vm+PPso6vOwGeX52MdOPh6z/R6KHgxQUwqq7k7Jc9jhy2JOxO2KB4xfoJQBBp2Ni8M4zKgJ4r2a1dgrYG7+MKw==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Options": "10.0.13"
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Options": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "BZDwtN3uoWRghDi5lRRZPDjMMCg2Ds7J6YEYjqka/TLjqnzquEpXyvchrIMeoubwT1ns23ow6PPeAoBHJO81Rw==",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "rAqf2Em2ZjLqNbcLJlboQnXNyJP604F960TsCKNiP00Ur6ExIc1mcwmNb8L2eTRT8RC8UKx/GjecoWcW2Sj7bw==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "10.0.13"
|
||||
"Microsoft.Extensions.Primitives": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.FileProviders.Physical": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "U7HkgGCNPICN5k7NVK6dmLsSPSPeO/EbNcuxOl/5qdC9Ahjp9UZWKOvlnUC+rYurmoxIlwyv9e5j0BaQlTOELA==",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "dcp6eCIk6ZpE3CTNmIna0ifgxsPel/MtOc23/Y/AJlD9SZZr7bhlKK2DAXYlrz81yMkMi6el/LHHUFKCZ3ufuQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.FileSystemGlobbing": "10.0.13",
|
||||
"Microsoft.Extensions.Primitives": "10.0.13"
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.FileSystemGlobbing": "10.0.14",
|
||||
"Microsoft.Extensions.Primitives": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.FileSystemGlobbing": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "vQVzmAbnzlhXSXA2caYnlxtG9GXxEwtj5bODiWLu06A6iqeJmfBtlfKjuOSJGRy0/CFaNUrm7u9nxEUlljc2Rg=="
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "xt6c/PWLL6+CiBiZA3PWRSfkwcPh+HCwiOLrgSUkhzBT7lrT/+QpIKPeuCQyDPspwOuG1q0cbJhuiGpRjr4UNQ=="
|
||||
},
|
||||
"Microsoft.Extensions.Hosting.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "zIrbe9vkIFXxW3mOApIOWXw+xMwX7Cgsptr3ZSlglJt4hW2qp4fB/JU1NHgAevteBNH4PicvU9DsFPHxlnnloA==",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "p6NUEkmlaB+FujQZTtyNBKFULQO+Fj8SKuYdYHASQso+RkeYdFDPNsMM4mtOHqx1GZNQnZm/inmsqGkja/Dw2w==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Diagnostics.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.13"
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Diagnostics.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Configuration": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "OyYJOaE9WbBx1Hp+Dd2zrqeFM0JwH5M/x0VL6tNUv3V18vIAVpix8UjhvY9eW/iXpguEHy68JO/Z9YkBOwftIw==",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "CfFSNbVSXSl8UTH453c0HoY5owcpaY1PMh1xsB+3NWcEq6WUSPHRotydbnMJtmw7Kybp6cTba8e+/uaJI52ANw==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Binder": "10.0.13",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Logging": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Options": "10.0.13",
|
||||
"Microsoft.Extensions.Options.ConfigurationExtensions": "10.0.13"
|
||||
"Microsoft.Extensions.Configuration": "10.0.14",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Configuration.Binder": "10.0.14",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Logging": "10.0.14",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Options": "10.0.14",
|
||||
"Microsoft.Extensions.Options.ConfigurationExtensions": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Console": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "i9rn0rHkiCxfNVbf4DRG7LOFcKPy/BioAxS07w6daWvIpLNRjskqDJcGGaYVFWndsq0iTRaS8Msry0t5fRYQug==",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "8Qx57p3sUAajSZHLQf8eihZqMtSIeI4fZ1JVpL4fvg4QqSbbgJkN0X0owX1cVJJRW2Xw4uqtVv9F7LgdXOBQHQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Logging": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Configuration": "10.0.13",
|
||||
"Microsoft.Extensions.Options": "10.0.13"
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Logging": "10.0.14",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Logging.Configuration": "10.0.14",
|
||||
"Microsoft.Extensions.Options": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Debug": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "yBig0DNMq+3UgliwxYlUC48dg0fPqvqI5B3ljzmLTrpR6maoKTOO5i9QnPgQUmQoaQWZMgu74fuF6oSDihb6pg==",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "8e79uonXzgIsZbdgc5pa2Ybk5W+vUbd+gfGS50E+BW9ApRv9s0qL1DTyqLv7VQEPxTHS/l8Y0AtS7K8do+TczQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Logging": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.13"
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Logging": "10.0.14",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.EventLog": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "OAK40lXhgMuvyNwvzW3fxLvvucN8yr5XS7dQRcPmtnPf+Pt1lpbMgao5T4Wa6VdFagtIeDZNgPtV5Ig4xstziQ==",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "4HbWayQiJdw0lYthC45rElah2mJJeSlHDu3rcIrinGe95JdOt6I/vWQTNUFXiujIsHv3Z8MyA79ZC5P1Ww+jNg==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Logging": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Options": "10.0.13"
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Logging": "10.0.14",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Options": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.EventSource": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "SxJu3oczk+TJtHvpgAmCVzEkzx69/obA6GZCbGrbqYqc981YOAyfEprySBdFX7Yc5qatHJKHNTlpGeeBAQkZcA==",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "Q06Q90D3qnrsKtf1QlaMELCED3ZdMV5SGIRIERUQTTSCoqTNKSitx3KMRgLdxBeqI5ZcbOu5InOu6xQ6o6zmUg==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Logging": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Options": "10.0.13",
|
||||
"Microsoft.Extensions.Primitives": "10.0.13"
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Logging": "10.0.14",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Options": "10.0.14",
|
||||
"Microsoft.Extensions.Primitives": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Options": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "tmMJgdrE4uhf1JcNs9CV9moAHW+hmDuvgMiPpnQxarKaUxqI2eN33sYK5S4l9Uw+rG9PJvlm4qPxMhvolTDTaQ==",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "EeN/33S418m9oWEaZY4N5T+BNxtOqNTIFoFbIgBKwylh4OJPKIWFAzbIhpTdNbwUs26MhkmbLCAbdY+YCJ1dIQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Primitives": "10.0.13"
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Primitives": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Options.ConfigurationExtensions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "xVO5HhATc09WXuS/RaDmx8ZeWS0mTpT1L0tkEDMSBHtAnNpNsDr0ge0wIO2jinCWWqpq5dL1tRTzpYNVlvyqLw==",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "4wcIU0rE04ejEfCwHTftu9O8fgH6CRYCe+tseRapikUBn1Kic3QdO7ku22SwFyLrzdWGYPUZMEgv57ZYuuc5gA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Configuration.Binder": "10.0.13",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Options": "10.0.13",
|
||||
"Microsoft.Extensions.Primitives": "10.0.13"
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Configuration.Binder": "10.0.14",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Options": "10.0.14",
|
||||
"Microsoft.Extensions.Primitives": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Primitives": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "ZjTwxzhiw2TMEzIbUDkMF0dfDB2I4NQgIfKD0ELu9/5Mk+SRGdKZcD0/lvBrRCAPo6KN2r0BW86MRancoyJkoA=="
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "1bbZqqCJTPba3inTADExbp/9PsGVyvGOX3zr6tFr7ySCgVkX9Lpw7BV0TizktNItd3SsbUu1sQfSAYm1GZMoNw=="
|
||||
},
|
||||
"SharpGen.Runtime": {
|
||||
"type": "Transitive",
|
||||
@@ -324,8 +324,8 @@
|
||||
},
|
||||
"SkiaSharp.NativeAssets.Win32": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.153.1",
|
||||
"contentHash": "Yqg6rChTVh0BUE8QQxtOA3uUBnihfgID4yex/AvDa0+os2bVcBjmI3Qj9tnOB+R1hd/Jry1Gwl8qw5JI9HZG8Q=="
|
||||
"resolved": "4.154.0",
|
||||
"contentHash": "GXgoY77GCXdPcveNAmy8o3gVit8sp6YtnI88h5camLPfihjulwJUajZXKhgVuZ8RhuwSTgfyt/00Dx8HRUSeAA=="
|
||||
},
|
||||
"Vortice.DirectX": {
|
||||
"type": "Transitive",
|
||||
@@ -350,16 +350,16 @@
|
||||
"captureimage.core": {
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Logging.Abstractions": "[10.0.13, )"
|
||||
"Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )"
|
||||
}
|
||||
},
|
||||
"captureimage.infrastructure": {
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"CaptureImage.Core": "[2.0.1, )",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "[10.0.13, )",
|
||||
"CaptureImage.Core": "[2.1.0, )",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )",
|
||||
"Serilog": "[4.4.0, )",
|
||||
"SkiaSharp": "[4.153.1, )",
|
||||
"SkiaSharp": "[4.154.0, )",
|
||||
"Velopack": "[1.2.161, )",
|
||||
"Vortice.DXGI": "[3.8.3, )",
|
||||
"Vortice.Direct2D1": "[3.8.3, )",
|
||||
@@ -369,22 +369,22 @@
|
||||
"captureimage.ui": {
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"CaptureImage.Core": "[2.0.1, )",
|
||||
"CaptureImage.ViewModels": "[2.0.1, )",
|
||||
"CaptureImage.Core": "[2.1.0, )",
|
||||
"CaptureImage.ViewModels": "[2.1.0, )",
|
||||
"CommunityToolkit.Mvvm": "[8.4.2, )",
|
||||
"H.NotifyIcon.Wpf": "[2.4.1, )",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "[10.0.13, )",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "[10.0.13, )",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "[10.0.14, )",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )",
|
||||
"WPF-UI": "[4.3.0, )"
|
||||
}
|
||||
},
|
||||
"captureimage.viewmodels": {
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"CaptureImage.Core": "[2.0.1, )",
|
||||
"CaptureImage.Core": "[2.1.0, )",
|
||||
"CommunityToolkit.Mvvm": "[8.4.2, )",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "[10.0.13, )",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "[10.0.13, )"
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "[10.0.14, )",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )"
|
||||
}
|
||||
},
|
||||
"H.NotifyIcon.Wpf": {
|
||||
@@ -398,46 +398,46 @@
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection": {
|
||||
"type": "CentralTransitive",
|
||||
"requested": "[10.0.13, )",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "4tnWU9vrU/A8NwYe9Z6wvieZ0EBb/uM82LAT+edNhdepOBWREZ7M7mzb941EIDPJaeOFdbVrDd5+7s9e89U6bQ==",
|
||||
"requested": "[10.0.14, )",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "2LzcuVjemeXR+WdY9wGIr8iGb7fYsDAit+IScxXX2XJnX0b++mWcE/WO6fEGIqhdMfSQM2ZS5JGMHYZix7YXZg==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13"
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": {
|
||||
"type": "CentralTransitive",
|
||||
"requested": "[10.0.13, )",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "G2GrGWNAPZBsii2F6AU8n+JT2tC1/I0Ml/e9ZyNCgPjf3hZqronP7o0X91aAynCmVeae8KkSIUNXXeXCNRmdVQ=="
|
||||
"requested": "[10.0.14, )",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "QtpQzuSZVyTPCuHW058yCs9Nj0394uUkNyFHS813nOmK9UgUdBdaprJ5PPsBgsQIpxADTsTkbaMMonykem6qdw=="
|
||||
},
|
||||
"Microsoft.Extensions.Logging": {
|
||||
"type": "CentralTransitive",
|
||||
"requested": "[10.0.13, )",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "fqbiPy4nUp4H2XHKAVQXKN2y3T2h4cFIx1DAAgE6iY9OHkN/OA1cKFi+geJKRWGuX6pS5SFbsjIPWHJqrxE0eg==",
|
||||
"requested": "[10.0.14, )",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "O2fXL6JmtkFwkigxS8fPTQpLXxGDjgZco5D+h88s++Cl0bDCs023PVkpNoifciJ+f30I82jnp8tpwF0wCLdFtA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection": "10.0.13",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.13",
|
||||
"Microsoft.Extensions.Options": "10.0.13"
|
||||
"Microsoft.Extensions.DependencyInjection": "10.0.14",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.14",
|
||||
"Microsoft.Extensions.Options": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Abstractions": {
|
||||
"type": "CentralTransitive",
|
||||
"requested": "[10.0.13, )",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "aSZEhEig4fvNiw2zs8Z6NyDlniKtq6YjcF3DyHuqTEHcZ2VKA/6itMPZ+dW+yWABWExlDcQwwdbqX1Rcb7W8WQ==",
|
||||
"requested": "[10.0.14, )",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "SwcbEBtkECq3D2oywvHkm46fyrX9Dd2JPWphDnHUc2+cUWR1Mdo41atAjh/9iZjgQxuvbKfZKXqostT/LZfefA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13"
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14"
|
||||
}
|
||||
},
|
||||
"SkiaSharp": {
|
||||
"type": "CentralTransitive",
|
||||
"requested": "[4.153.1, )",
|
||||
"resolved": "4.153.1",
|
||||
"contentHash": "TghYLOUaP3q6rTjQw7U9uQaaXh8lEs9rfA1U7/VtmyAptVDtj/SmjtcWzFWmcC/VMWxe3QgbV9uyvqDL7ySFtQ==",
|
||||
"requested": "[4.154.0, )",
|
||||
"resolved": "4.154.0",
|
||||
"contentHash": "R3BuszJ3tUFmni37nZIRawXL0yx+XHyx7xi1716/0TybuEQFhnBx48Ig3rFpeVFQVytpGpJZZ+NLW9d9UPG7EA==",
|
||||
"dependencies": {
|
||||
"SkiaSharp.NativeAssets.Win32": "4.153.1"
|
||||
"SkiaSharp.NativeAssets.Win32": "4.154.0"
|
||||
}
|
||||
},
|
||||
"Vortice.Direct2D1": {
|
||||
@@ -483,8 +483,8 @@
|
||||
"net10.0-windows10.0.22621/win-x64": {
|
||||
"SkiaSharp.NativeAssets.Win32": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.153.1",
|
||||
"contentHash": "Yqg6rChTVh0BUE8QQxtOA3uUBnihfgID4yex/AvDa0+os2bVcBjmI3Qj9tnOB+R1hd/Jry1Gwl8qw5JI9HZG8Q=="
|
||||
"resolved": "4.154.0",
|
||||
"contentHash": "GXgoY77GCXdPcveNAmy8o3gVit8sp6YtnI88h5camLPfihjulwJUajZXKhgVuZ8RhuwSTgfyt/00Dx8HRUSeAA=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,8 +49,13 @@ public interface IHotkeyService : IDisposable
|
||||
bool IsTakenByAnotherApp(HotkeyBinding binding);
|
||||
|
||||
/// <summary>
|
||||
/// Register extra keys for a short time (Esc / Enter while the region overlay is up, so
|
||||
/// they work even if the overlay never gets keyboard focus). Dispose to release them.
|
||||
/// Register extra keys for a short time (the region overlay's keys, so they work even if
|
||||
/// the overlay never gets keyboard focus). Keys another program holds are skipped. The
|
||||
/// callback runs off the hotkey thread, one press at a time and in the order the keys were
|
||||
/// pressed. Dispose to release the keys.
|
||||
/// </summary>
|
||||
IDisposable RegisterTemporary(IReadOnlyList<HotkeyBinding> bindings, Action<HotkeyBinding> callback);
|
||||
/// <param name="bindings">The keys to hold.</param>
|
||||
/// <param name="callback">Called with the binding of each press.</param>
|
||||
/// <param name="repeat">Whether holding a key down repeats it (arrow keys) instead of firing once.</param>
|
||||
IDisposable RegisterTemporary(IReadOnlyList<HotkeyBinding> bindings, Action<HotkeyBinding> callback, bool repeat = false);
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (c) CaptureImage Contributors
|
||||
|
||||
using CaptureImage.Core.Models;
|
||||
|
||||
namespace CaptureImage.Core.Capture;
|
||||
|
||||
/// <summary>What a key does while the region overlay is up.</summary>
|
||||
public enum RegionKeyAction
|
||||
{
|
||||
/// <summary>Close the overlay without capturing (Esc).</summary>
|
||||
Cancel,
|
||||
|
||||
/// <summary>Capture the selection, or the whole monitor when nothing is selected (Enter).</summary>
|
||||
Confirm,
|
||||
|
||||
/// <summary>Move the selection by <see cref="RegionKeyCommand.Dx"/> / <see cref="RegionKeyCommand.Dy"/>.</summary>
|
||||
Move,
|
||||
|
||||
/// <summary>Grow or shrink the selection from its bottom-right corner.</summary>
|
||||
Resize,
|
||||
|
||||
/// <summary>Continue on the next monitor (Tab).</summary>
|
||||
NextMonitor,
|
||||
|
||||
/// <summary>Continue on the previous monitor (Shift+Tab).</summary>
|
||||
PreviousMonitor,
|
||||
}
|
||||
|
||||
/// <summary>A key press translated for the region overlay; the offsets are in physical pixels.</summary>
|
||||
public readonly record struct RegionKeyCommand(RegionKeyAction Action, int Dx = 0, int Dy = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Keyboard control of the region overlay, in physical pixels relative to the monitor: the
|
||||
/// arrow keys move the selection, Shift+arrows resize it, Ctrl turns either into a one-pixel
|
||||
/// step, Tab / Shift+Tab continue on the next / previous monitor, Enter captures and Esc
|
||||
/// cancels. The keys are registered only while the overlay is up, so they work even when a
|
||||
/// full-screen game keeps the keyboard focus.
|
||||
/// </summary>
|
||||
public static class RegionKeyboard
|
||||
{
|
||||
/// <summary>Smallest selection, in physical pixels, that is captured instead of the whole monitor.</summary>
|
||||
public const int MinimumSize = 4;
|
||||
|
||||
/// <summary>Length of a normal step in device-independent pixels (scaled by the monitor's DPI).</summary>
|
||||
public const int StepDips = 10;
|
||||
|
||||
private const uint VkTab = 0x09;
|
||||
private const uint VkEnter = 0x0D;
|
||||
private const uint VkEscape = 0x1B;
|
||||
private const uint VkLeft = 0x25;
|
||||
private const uint VkUp = 0x26;
|
||||
private const uint VkRight = 0x27;
|
||||
private const uint VkDown = 0x28;
|
||||
|
||||
/// <summary>Keys that act once per press: Esc, Enter, Tab and Shift+Tab.</summary>
|
||||
public static IReadOnlyList<HotkeyBinding> SingleKeys { get; } =
|
||||
[
|
||||
new(HotkeyModifiers.None, VkEscape),
|
||||
new(HotkeyModifiers.None, VkEnter),
|
||||
new(HotkeyModifiers.None, VkTab),
|
||||
new(HotkeyModifiers.Shift, VkTab),
|
||||
];
|
||||
|
||||
/// <summary>The arrow keys alone and with Shift, Ctrl and Ctrl+Shift; holding one repeats it.</summary>
|
||||
public static IReadOnlyList<HotkeyBinding> RepeatingKeys { get; } =
|
||||
[
|
||||
.. new[] { HotkeyModifiers.None, HotkeyModifiers.Shift, HotkeyModifiers.Control, HotkeyModifiers.Control | HotkeyModifiers.Shift }
|
||||
.SelectMany(modifiers => new[] { VkLeft, VkUp, VkRight, VkDown }.Select(key => new HotkeyBinding(modifiers, key))),
|
||||
];
|
||||
|
||||
/// <summary>A normal step in physical pixels on a monitor with the given scale (1.0 = 100 %).</summary>
|
||||
public static int StepFor(double scale) => Math.Max(1, (int)Math.Round(StepDips * scale, MidpointRounding.AwayFromZero));
|
||||
|
||||
/// <summary>What <paramref name="key"/> does, or <see langword="null"/> when the overlay ignores it.</summary>
|
||||
/// <param name="key">The key and the modifiers held with it.</param>
|
||||
/// <param name="step">Length of a normal step in physical pixels (see <see cref="StepFor"/>).</param>
|
||||
public static RegionKeyCommand? Map(HotkeyBinding key, int step)
|
||||
{
|
||||
var modifiers = key.Modifiers;
|
||||
switch (key.VirtualKey)
|
||||
{
|
||||
case VkEscape when modifiers == HotkeyModifiers.None:
|
||||
return new RegionKeyCommand(RegionKeyAction.Cancel);
|
||||
case VkEnter when modifiers == HotkeyModifiers.None:
|
||||
return new RegionKeyCommand(RegionKeyAction.Confirm);
|
||||
case VkTab when modifiers == HotkeyModifiers.None:
|
||||
return new RegionKeyCommand(RegionKeyAction.NextMonitor);
|
||||
case VkTab when modifiers == HotkeyModifiers.Shift:
|
||||
return new RegionKeyCommand(RegionKeyAction.PreviousMonitor);
|
||||
}
|
||||
|
||||
if ((modifiers & ~(HotkeyModifiers.Control | HotkeyModifiers.Shift)) != 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
(int X, int Y)? direction = key.VirtualKey switch
|
||||
{
|
||||
VkLeft => (-1, 0),
|
||||
VkRight => (1, 0),
|
||||
VkUp => (0, -1),
|
||||
VkDown => (0, 1),
|
||||
_ => null,
|
||||
};
|
||||
if (direction is not { } d)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var distance = modifiers.HasFlag(HotkeyModifiers.Control) ? 1 : Math.Max(1, step);
|
||||
var action = modifiers.HasFlag(HotkeyModifiers.Shift) ? RegionKeyAction.Resize : RegionKeyAction.Move;
|
||||
return new RegionKeyCommand(action, d.X * distance, d.Y * distance);
|
||||
}
|
||||
|
||||
/// <summary>The selection a first arrow key creates: half the monitor, centred.</summary>
|
||||
public static PixelRect Initial(int width, int height)
|
||||
{
|
||||
var w = Math.Max(1, width / 2);
|
||||
var h = Math.Max(1, height / 2);
|
||||
return new PixelRect((width - w) / 2, (height - h) / 2, w, h);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The selection after <paramref name="command"/> on a monitor of the given size. Without a
|
||||
/// selection a move or resize only creates the <see cref="Initial"/> one. Moves stop at the
|
||||
/// monitor's edges; resizes keep the top-left corner and stay between
|
||||
/// <see cref="MinimumSize"/> and the monitor's edges.
|
||||
/// </summary>
|
||||
public static PixelRect? Apply(PixelRect? current, RegionKeyCommand command, int width, int height)
|
||||
{
|
||||
if (command.Action is not (RegionKeyAction.Move or RegionKeyAction.Resize))
|
||||
{
|
||||
return current;
|
||||
}
|
||||
|
||||
if (current is not { IsEmpty: false } rect)
|
||||
{
|
||||
return Initial(width, height);
|
||||
}
|
||||
|
||||
return command.Action == RegionKeyAction.Move
|
||||
? rect with
|
||||
{
|
||||
X = Math.Clamp(rect.X + command.Dx, 0, Math.Max(0, width - rect.Width)),
|
||||
Y = Math.Clamp(rect.Y + command.Dy, 0, Math.Max(0, height - rect.Height)),
|
||||
}
|
||||
: rect with
|
||||
{
|
||||
Width = ClampSize(rect.Width + command.Dx, width - rect.X),
|
||||
Height = ClampSize(rect.Height + command.Dy, height - rect.Y),
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Index of the monitor after (or before) <paramref name="current"/>, ordering the monitors
|
||||
/// left to right and then top to bottom and wrapping around at the ends.
|
||||
/// </summary>
|
||||
public static int Cycle(IReadOnlyList<PixelRect> monitors, int current, bool backwards)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(monitors);
|
||||
if (monitors.Count == 0)
|
||||
{
|
||||
return current;
|
||||
}
|
||||
|
||||
var order = Enumerable.Range(0, monitors.Count)
|
||||
.OrderBy(i => monitors[i].X)
|
||||
.ThenBy(i => monitors[i].Y)
|
||||
.ToList();
|
||||
var position = order.IndexOf(current);
|
||||
if (position < 0)
|
||||
{
|
||||
return order[0];
|
||||
}
|
||||
|
||||
return order[(position + (backwards ? order.Count - 1 : 1)) % order.Count];
|
||||
}
|
||||
|
||||
private static int ClampSize(int value, int available) => Math.Clamp(value, Math.Min(MinimumSize, available), available);
|
||||
}
|
||||
@@ -166,7 +166,7 @@ public sealed partial class CaptureCoordinator : IDisposable
|
||||
}
|
||||
|
||||
// While suspended (hotkey recorder open) only remember the request; resuming registers.
|
||||
IReadOnlyList<HotkeyRegistration> registrations = suspended ? [] : _hotkeys.Activate(hotkeys);
|
||||
var registrations = suspended ? [] : _hotkeys.Activate(hotkeys);
|
||||
lock (_gate)
|
||||
{
|
||||
_armed = true;
|
||||
|
||||
@@ -36,20 +36,16 @@ public sealed record SaveRequest(
|
||||
/// overwriting an existing file (a name stolen by a concurrent write is retried).
|
||||
/// Encoding runs on the thread pool so callers on the UI thread never block.
|
||||
/// </summary>
|
||||
public sealed partial class CaptureFileWriter
|
||||
public sealed partial class CaptureFileWriter(
|
||||
IEnumerable<IImageEncoder> encoders,
|
||||
FileNameStrategy fileNames,
|
||||
ILogger<CaptureFileWriter> logger)
|
||||
{
|
||||
private const int MaxNameAttempts = 8;
|
||||
|
||||
private readonly IReadOnlyList<IImageEncoder> _encoders;
|
||||
private readonly FileNameStrategy _fileNames;
|
||||
private readonly ILogger<CaptureFileWriter> _logger;
|
||||
|
||||
public CaptureFileWriter(IEnumerable<IImageEncoder> encoders, FileNameStrategy fileNames, ILogger<CaptureFileWriter> logger)
|
||||
{
|
||||
_encoders = [.. encoders];
|
||||
_fileNames = fileNames;
|
||||
_logger = logger;
|
||||
}
|
||||
private readonly IReadOnlyList<IImageEncoder> _encoders = [.. encoders];
|
||||
private readonly FileNameStrategy _fileNames = fileNames;
|
||||
private readonly ILogger<CaptureFileWriter> _logger = logger;
|
||||
|
||||
public async Task<CaptureRecord> SaveAsync(SaveRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,8 @@ namespace CaptureImage.Core.Pipeline;
|
||||
/// reserved device names (CON, NUL, COM1…) get a trailing <c>_</c>; the name is capped at
|
||||
/// <see cref="MaxNameLength"/> characters.</para>
|
||||
/// </remarks>
|
||||
public sealed class FileNameStrategy
|
||||
/// <param name="fileExists">Existence check (injected so tests can fake collisions).</param>
|
||||
public sealed class FileNameStrategy(Func<string, bool> fileExists)
|
||||
{
|
||||
/// <summary>Default template: <c>{Game}_{yyyy}-{MM}-{dd}_{HH}-{mm}-{ss}</c>.</summary>
|
||||
public const string DefaultTemplate = "{Game}_{yyyy}-{MM}-{dd}_{HH}-{mm}-{ss}";
|
||||
@@ -42,13 +43,7 @@ public sealed class FileNameStrategy
|
||||
"COM¹", "COM²", "COM³", "LPT¹", "LPT²", "LPT³",
|
||||
};
|
||||
|
||||
private readonly Func<string, bool> _fileExists;
|
||||
|
||||
/// <param name="fileExists">Existence check (injected so tests can fake collisions).</param>
|
||||
public FileNameStrategy(Func<string, bool> fileExists)
|
||||
{
|
||||
_fileExists = fileExists;
|
||||
}
|
||||
private readonly Func<string, bool> _fileExists = fileExists;
|
||||
|
||||
/// <summary>
|
||||
/// A full path under <paramref name="directory"/> that does not collide with an existing
|
||||
|
||||
@@ -4,18 +4,18 @@
|
||||
"net10.0": {
|
||||
"Microsoft.Extensions.Logging.Abstractions": {
|
||||
"type": "Direct",
|
||||
"requested": "[10.0.13, )",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "aSZEhEig4fvNiw2zs8Z6NyDlniKtq6YjcF3DyHuqTEHcZ2VKA/6itMPZ+dW+yWABWExlDcQwwdbqX1Rcb7W8WQ==",
|
||||
"requested": "[10.0.14, )",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "SwcbEBtkECq3D2oywvHkm46fyrX9Dd2JPWphDnHUc2+cUWR1Mdo41atAjh/9iZjgQxuvbKfZKXqostT/LZfefA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13"
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": {
|
||||
"type": "CentralTransitive",
|
||||
"requested": "[10.0.13, )",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "G2GrGWNAPZBsii2F6AU8n+JT2tC1/I0Ml/e9ZyNCgPjf3hZqronP7o0X91aAynCmVeae8KkSIUNXXeXCNRmdVQ=="
|
||||
"requested": "[10.0.14, )",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "QtpQzuSZVyTPCuHW058yCs9Nj0394uUkNyFHS813nOmK9UgUdBdaprJ5PPsBgsQIpxADTsTkbaMMonykem6qdw=="
|
||||
}
|
||||
},
|
||||
"net10.0/win-x64": {}
|
||||
|
||||
@@ -13,18 +13,13 @@ namespace CaptureImage.Infrastructure.Capture;
|
||||
/// GPU reset or driver update the engine calls <see cref="Invalidate"/> and the next capture
|
||||
/// gets a fresh device (v1 never recreated it, so every capture failed until restart).
|
||||
/// </summary>
|
||||
public sealed partial class D3D11DeviceManager : IDisposable
|
||||
public sealed partial class D3D11DeviceManager(ILogger<D3D11DeviceManager> logger) : IDisposable
|
||||
{
|
||||
private readonly ILogger<D3D11DeviceManager> _logger;
|
||||
private readonly ILogger<D3D11DeviceManager> _logger = logger;
|
||||
private readonly Lock _gate = new();
|
||||
private Session? _session;
|
||||
private bool _disposed;
|
||||
|
||||
public D3D11DeviceManager(ILogger<D3D11DeviceManager> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
/// <summary>The device, its immediate context and the WinRT wrapper WGC needs.</summary>
|
||||
internal sealed record Session(ID3D11Device Device, ID3D11DeviceContext Context, IDirect3DDevice WinRtDevice) : IDisposable
|
||||
{
|
||||
@@ -76,7 +71,7 @@ public sealed partial class D3D11DeviceManager : IDisposable
|
||||
// usable GPU driver (virtual machines, CI runners).
|
||||
FeatureLevel[] levels = [FeatureLevel.Level_11_1, FeatureLevel.Level_11_0];
|
||||
var driver = DriverType.Hardware;
|
||||
var result = D3D11.D3D11CreateDevice(null, driver, DeviceCreationFlags.BgraSupport, levels, out ID3D11Device device, out ID3D11DeviceContext context);
|
||||
var result = D3D11.D3D11CreateDevice(null, driver, DeviceCreationFlags.BgraSupport, levels, out var device, out ID3D11DeviceContext context);
|
||||
if (result.Failure)
|
||||
{
|
||||
driver = DriverType.Warp;
|
||||
|
||||
@@ -33,20 +33,16 @@ namespace CaptureImage.Infrastructure.Capture;
|
||||
/// <item>8-bit frames are forced opaque so saved images are never see-through.</item>
|
||||
/// </list>
|
||||
/// </remarks>
|
||||
public sealed partial class WgcCaptureEngine : ICaptureEngine, IDisposable
|
||||
public sealed partial class WgcCaptureEngine(
|
||||
D3D11DeviceManager devices,
|
||||
ILogger<WgcCaptureEngine> logger) : ICaptureEngine, IDisposable
|
||||
{
|
||||
private static readonly TimeSpan FrameTimeout = TimeSpan.FromSeconds(3);
|
||||
|
||||
private readonly D3D11DeviceManager _devices;
|
||||
private readonly ILogger<WgcCaptureEngine> _logger;
|
||||
private readonly D3D11DeviceManager _devices = devices;
|
||||
private readonly ILogger<WgcCaptureEngine> _logger = logger;
|
||||
private readonly SemaphoreSlim _gate = new(1, 1);
|
||||
|
||||
public WgcCaptureEngine(D3D11DeviceManager devices, ILogger<WgcCaptureEngine> logger)
|
||||
{
|
||||
_devices = devices;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public async Task<CapturedFrame> CaptureAsync(CaptureSource source, CaptureOptions options, CancellationToken cancellationToken = default)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(source);
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace CaptureImage.Infrastructure.Capture;
|
||||
/// vtable function pointers so no runtime-callable wrapper is created (v1 leaked one per
|
||||
/// capture and kept full-size GPU textures alive until the next garbage collection).
|
||||
/// </summary>
|
||||
internal static unsafe class WinRtCaptureInterop
|
||||
internal static unsafe partial class WinRtCaptureInterop
|
||||
{
|
||||
private const string GraphicsCaptureItemClass = "Windows.Graphics.Capture.GraphicsCaptureItem";
|
||||
|
||||
@@ -85,6 +85,6 @@ internal static unsafe class WinRtCaptureInterop
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport("d3d11.dll", ExactSpelling = true)]
|
||||
private static extern int CreateDirect3D11DeviceFromDXGIDevice(nint dxgiDevice, out nint graphicsDevice);
|
||||
[LibraryImport("d3d11.dll")]
|
||||
private static partial int CreateDirect3D11DeviceFromDXGIDevice(nint dxgiDevice, out nint graphicsDevice);
|
||||
}
|
||||
@@ -18,24 +18,20 @@ namespace CaptureImage.Infrastructure.Diagnostics;
|
||||
/// system summary (Windows build, .NET, GPUs, monitors with DPI and HDR state). The user's
|
||||
/// profile path is replaced with <c>%USERPROFILE%</c> in every text file.
|
||||
/// </summary>
|
||||
public sealed partial class DiagnosticsExporter : IDiagnosticsExporter
|
||||
public sealed partial class DiagnosticsExporter(
|
||||
AppPaths paths,
|
||||
IDisplayService displays,
|
||||
IUpdateService updates,
|
||||
ILogger<DiagnosticsExporter> logger) : IDiagnosticsExporter
|
||||
{
|
||||
private const int MaxLogFiles = 5;
|
||||
|
||||
private readonly AppPaths _paths;
|
||||
private readonly IDisplayService _displays;
|
||||
private readonly IUpdateService _updates;
|
||||
private readonly ILogger<DiagnosticsExporter> _logger;
|
||||
private readonly AppPaths _paths = paths;
|
||||
private readonly IDisplayService _displays = displays;
|
||||
private readonly IUpdateService _updates = updates;
|
||||
private readonly ILogger<DiagnosticsExporter> _logger = logger;
|
||||
private readonly UserPathRedactionEnricher _redactor = new();
|
||||
|
||||
public DiagnosticsExporter(AppPaths paths, IDisplayService displays, IUpdateService updates, ILogger<DiagnosticsExporter> logger)
|
||||
{
|
||||
_paths = paths;
|
||||
_displays = displays;
|
||||
_updates = updates;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public string SuggestFileName() =>
|
||||
$"CaptureImage-diagnostics-{DateTime.Now.ToString("yyyyMMdd-HHmmss", CultureInfo.InvariantCulture)}.zip";
|
||||
|
||||
|
||||
@@ -10,16 +10,11 @@ using Vortice.WIC;
|
||||
namespace CaptureImage.Infrastructure.Imaging;
|
||||
|
||||
/// <summary>Decodes PNG / JPEG / WebP / TIFF / JPEG XR files into BGRA frames with WIC.</summary>
|
||||
public sealed partial class WicImageDecoder : IImageDecoder, IDisposable
|
||||
public sealed partial class WicImageDecoder(ILogger<WicImageDecoder> logger) : IImageDecoder, IDisposable
|
||||
{
|
||||
private readonly ILogger<WicImageDecoder> _logger;
|
||||
private readonly ILogger<WicImageDecoder> _logger = logger;
|
||||
private readonly Lazy<IWICImagingFactory> _factory = new(() => new IWICImagingFactory(), LazyThreadSafetyMode.ExecutionAndPublication);
|
||||
|
||||
public WicImageDecoder(ILogger<WicImageDecoder> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public Task<CapturedFrame?> LoadAsync(string path, int maxDimension = 0, CancellationToken cancellationToken = default) =>
|
||||
Task.Run(() => Load(path, maxDimension), cancellationToken);
|
||||
|
||||
|
||||
@@ -21,27 +21,23 @@ namespace CaptureImage.Infrastructure.Library;
|
||||
/// JPEG thumbnails. Files deleted outside the app drop out on the next read. The first time
|
||||
/// the index is created, the output folders are scanned so captures made by v1 show up too.
|
||||
/// </summary>
|
||||
public sealed partial class CaptureLibraryService : ICaptureLibrary, IDisposable
|
||||
public sealed partial class CaptureLibraryService(
|
||||
AppPaths paths,
|
||||
ISettingsStore settings,
|
||||
IShellService shell,
|
||||
ILogger<CaptureLibraryService> logger) : ICaptureLibrary, IDisposable
|
||||
{
|
||||
private const int MaxRecords = 2000;
|
||||
private const int MaxSeededFiles = 500;
|
||||
|
||||
private readonly AppPaths _paths;
|
||||
private readonly ISettingsStore _settings;
|
||||
private readonly IShellService _shell;
|
||||
private readonly ILogger<CaptureLibraryService> _logger;
|
||||
private readonly AppPaths _paths = paths;
|
||||
private readonly ISettingsStore _settings = settings;
|
||||
private readonly IShellService _shell = shell;
|
||||
private readonly ILogger<CaptureLibraryService> _logger = logger;
|
||||
private readonly SemaphoreSlim _indexLock = new(1, 1);
|
||||
private readonly Lazy<IWICImagingFactory> _wic = new(() => new IWICImagingFactory(), LazyThreadSafetyMode.ExecutionAndPublication);
|
||||
private List<CaptureRecord>? _records;
|
||||
|
||||
public CaptureLibraryService(AppPaths paths, ISettingsStore settings, IShellService shell, ILogger<CaptureLibraryService> logger)
|
||||
{
|
||||
_paths = paths;
|
||||
_settings = settings;
|
||||
_shell = shell;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public event EventHandler? Changed;
|
||||
|
||||
public async Task<IReadOnlyList<CaptureRecord>> GetAllAsync(CancellationToken cancellationToken = default)
|
||||
|
||||
@@ -9,14 +9,9 @@ using Serilog.Events;
|
||||
namespace CaptureImage.Infrastructure.Logging;
|
||||
|
||||
/// <summary>Changes the live Serilog minimum level (no restart needed).</summary>
|
||||
public sealed class SerilogLogLevelSwitcher : ILogLevelSwitcher
|
||||
public sealed class SerilogLogLevelSwitcher(LoggingLevelSwitch levelSwitch) : ILogLevelSwitcher
|
||||
{
|
||||
private readonly LoggingLevelSwitch _levelSwitch;
|
||||
|
||||
public SerilogLogLevelSwitcher(LoggingLevelSwitch levelSwitch)
|
||||
{
|
||||
_levelSwitch = levelSwitch;
|
||||
}
|
||||
private readonly LoggingLevelSwitch _levelSwitch = levelSwitch;
|
||||
|
||||
public string CurrentLevel => _levelSwitch.MinimumLevel switch
|
||||
{
|
||||
|
||||
@@ -20,16 +20,11 @@ namespace CaptureImage.Infrastructure.Ocr;
|
||||
/// the engine limit are downscaled, engines are cached per language, and failures are
|
||||
/// reported as failures instead of "no text found".
|
||||
/// </summary>
|
||||
public sealed partial class WindowsOcrService : IOcrService
|
||||
public sealed partial class WindowsOcrService(ILogger<WindowsOcrService> logger) : IOcrService
|
||||
{
|
||||
private readonly ILogger<WindowsOcrService> _logger;
|
||||
private readonly ILogger<WindowsOcrService> _logger = logger;
|
||||
private readonly ConcurrentDictionary<string, OcrEngine?> _engines = new(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
public WindowsOcrService(ILogger<WindowsOcrService> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public async Task<OcrResult> RecognizeAsync(CapturedFrame frame, string? languageTag, CancellationToken cancellationToken = default)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(frame);
|
||||
|
||||
@@ -11,7 +11,7 @@ using Windows.Win32.UI.Shell;
|
||||
namespace CaptureImage.Infrastructure.Platform;
|
||||
|
||||
/// <summary>Explorer, default-program and Recycle Bin integration.</summary>
|
||||
public sealed partial class ShellService : IShellService
|
||||
public sealed partial class ShellService(ILogger<ShellService> logger) : IShellService
|
||||
{
|
||||
private const uint FoDelete = 0x0003;
|
||||
private const ushort FofSilent = 0x0004;
|
||||
@@ -22,12 +22,7 @@ public sealed partial class ShellService : IShellService
|
||||
private static readonly string ExplorerPath =
|
||||
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "explorer.exe");
|
||||
|
||||
private readonly ILogger<ShellService> _logger;
|
||||
|
||||
public ShellService(ILogger<ShellService> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
private readonly ILogger<ShellService> _logger = logger;
|
||||
|
||||
public bool Open(string path)
|
||||
{
|
||||
|
||||
@@ -22,18 +22,13 @@ public sealed class SoundService : ISoundService
|
||||
/// Windows 11 efficiency mode: EcoQoS plus below-normal priority while the app idles in the
|
||||
/// tray. <see cref="BeginForegroundWork"/> lifts it for the duration of a capture.
|
||||
/// </summary>
|
||||
public sealed partial class PerformanceModeService : IPerformanceModeService
|
||||
public sealed partial class PerformanceModeService(ILogger<PerformanceModeService> logger) : IPerformanceModeService
|
||||
{
|
||||
private readonly ILogger<PerformanceModeService> _logger;
|
||||
private readonly ILogger<PerformanceModeService> _logger = logger;
|
||||
private readonly Lock _gate = new();
|
||||
private bool _background;
|
||||
private int _foregroundWork;
|
||||
|
||||
public PerformanceModeService(ILogger<PerformanceModeService> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public void SetBackground(bool isBackground)
|
||||
{
|
||||
lock (_gate)
|
||||
@@ -112,17 +107,12 @@ public sealed partial class PerformanceModeService : IPerformanceModeService
|
||||
/// "Start with Windows" via the per-user Run key. Points at the Velopack launcher in the
|
||||
/// install root (stable across updates) when present, otherwise at the running executable.
|
||||
/// </summary>
|
||||
public sealed partial class AutostartService : IAutostartService
|
||||
public sealed partial class AutostartService(ILogger<AutostartService> logger) : IAutostartService
|
||||
{
|
||||
private const string RunKey = @"Software\Microsoft\Windows\CurrentVersion\Run";
|
||||
private const string ValueName = "CaptureImage";
|
||||
|
||||
private readonly ILogger<AutostartService> _logger;
|
||||
|
||||
public AutostartService(ILogger<AutostartService> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
private readonly ILogger<AutostartService> _logger = logger;
|
||||
|
||||
public bool IsEnabled
|
||||
{
|
||||
|
||||
@@ -13,13 +13,19 @@ namespace CaptureImage.Infrastructure.Steam;
|
||||
/// <c>appmanifest_*.acf</c> files of every library. Scanned once, lazily, thread-safe; a scan that
|
||||
/// fails is retried a minute later rather than failing every lookup from then on.
|
||||
/// </summary>
|
||||
public sealed partial class SteamLibraryScanner : ISteamDetector
|
||||
/// <param name="steamRoot">Returns Steam's install folder, or <c>null</c> when Steam isn't installed.</param>
|
||||
/// <param name="logger">Logger.</param>
|
||||
/// <param name="timeProvider">Clock for the retry delay (tests); the system clock by default.</param>
|
||||
public sealed partial class SteamLibraryScanner(
|
||||
Func<string?> steamRoot,
|
||||
ILogger<SteamLibraryScanner> logger,
|
||||
TimeProvider? timeProvider = null) : ISteamDetector
|
||||
{
|
||||
private static readonly TimeSpan RetryDelay = TimeSpan.FromMinutes(1);
|
||||
|
||||
private readonly Func<string?> _steamRoot;
|
||||
private readonly ILogger<SteamLibraryScanner> _logger;
|
||||
private readonly TimeProvider _time;
|
||||
private readonly Func<string?> _steamRoot = steamRoot;
|
||||
private readonly ILogger<SteamLibraryScanner> _logger = logger;
|
||||
private readonly TimeProvider _time = timeProvider ?? TimeProvider.System;
|
||||
private readonly Lock _gate = new();
|
||||
private IReadOnlyList<SteamLibrary>? _libraries;
|
||||
private DateTimeOffset _retryAt = DateTimeOffset.MinValue;
|
||||
@@ -30,16 +36,6 @@ public sealed partial class SteamLibraryScanner : ISteamDetector
|
||||
{
|
||||
}
|
||||
|
||||
/// <param name="steamRoot">Returns Steam's install folder, or <c>null</c> when Steam isn't installed.</param>
|
||||
/// <param name="logger">Logger.</param>
|
||||
/// <param name="timeProvider">Clock for the retry delay (tests); the system clock by default.</param>
|
||||
public SteamLibraryScanner(Func<string?> steamRoot, ILogger<SteamLibraryScanner> logger, TimeProvider? timeProvider = null)
|
||||
{
|
||||
_steamRoot = steamRoot;
|
||||
_logger = logger;
|
||||
_time = timeProvider ?? TimeProvider.System;
|
||||
}
|
||||
|
||||
/// <summary>The scanned libraries, or none while a failed scan waits for its retry.</summary>
|
||||
private IReadOnlyList<SteamLibrary> Libraries
|
||||
{
|
||||
|
||||
@@ -119,13 +119,11 @@ public static class VdfParser
|
||||
}
|
||||
|
||||
/// <summary>Cursor over the input text with helpers for quoted strings and trivia.</summary>
|
||||
private sealed class VdfReader
|
||||
private sealed class VdfReader(string text)
|
||||
{
|
||||
private readonly string _text;
|
||||
private readonly string _text = text;
|
||||
private int _pos;
|
||||
|
||||
public VdfReader(string text) { _text = text; _pos = 0; }
|
||||
|
||||
public int Position => _pos;
|
||||
public bool Eof => _pos >= _text.Length;
|
||||
|
||||
@@ -213,12 +211,7 @@ public static class VdfParser
|
||||
}
|
||||
|
||||
/// <summary>Thrown when a VDF document fails to parse.</summary>
|
||||
public sealed class VdfParseException : FormatException
|
||||
public sealed class VdfParseException(string message, int position) : FormatException(message)
|
||||
{
|
||||
public int Position { get; }
|
||||
|
||||
public VdfParseException(string message, int position) : base(message)
|
||||
{
|
||||
Position = position;
|
||||
}
|
||||
public int Position { get; } = position;
|
||||
}
|
||||
@@ -19,7 +19,8 @@ namespace CaptureImage.Infrastructure.Win32;
|
||||
/// <remarks>
|
||||
/// A registered combination is consumed by Windows and never reaches other applications,
|
||||
/// which is why bindings are only registered while the coordinator is armed.
|
||||
/// <c>MOD_NOREPEAT</c> is always added so holding a key fires once.
|
||||
/// <c>MOD_NOREPEAT</c> is added so holding a capture key fires once; temporary keys can opt
|
||||
/// into auto-repeat (the region overlay's arrow keys).
|
||||
/// </remarks>
|
||||
public sealed partial class Win32HotkeyService : IHotkeyService
|
||||
{
|
||||
@@ -34,6 +35,7 @@ public sealed partial class Win32HotkeyService : IHotkeyService
|
||||
private readonly Dictionary<int, (HotkeyBinding Binding, Action<HotkeyBinding> Callback)> _temporaryIds = [];
|
||||
private IReadOnlyList<HotkeyRegistration> _registrations = [];
|
||||
private int _nextTemporaryId = FirstTemporaryId;
|
||||
private Task _temporaryQueue = Task.CompletedTask;
|
||||
private bool _disposed;
|
||||
|
||||
public Win32HotkeyService(ILogger<Win32HotkeyService> logger)
|
||||
@@ -134,7 +136,7 @@ public sealed partial class Win32HotkeyService : IHotkeyService
|
||||
});
|
||||
}
|
||||
|
||||
public IDisposable RegisterTemporary(IReadOnlyList<HotkeyBinding> bindings, Action<HotkeyBinding> callback)
|
||||
public IDisposable RegisterTemporary(IReadOnlyList<HotkeyBinding> bindings, Action<HotkeyBinding> callback, bool repeat = false)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(bindings);
|
||||
ArgumentNullException.ThrowIfNull(callback);
|
||||
@@ -146,7 +148,7 @@ public sealed partial class Win32HotkeyService : IHotkeyService
|
||||
foreach (var binding in bindings)
|
||||
{
|
||||
var id = _nextTemporaryId++;
|
||||
if (PInvoke.RegisterHotKey(HWND.Null, id, ToModifiers(binding.Modifiers), binding.VirtualKey))
|
||||
if (PInvoke.RegisterHotKey(HWND.Null, id, ToModifiers(binding.Modifiers, noRepeat: !repeat), binding.VirtualKey))
|
||||
{
|
||||
lock (_gate)
|
||||
{
|
||||
@@ -263,12 +265,20 @@ public sealed partial class Win32HotkeyService : IHotkeyService
|
||||
}
|
||||
else if (temporary is { } t)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(_ => t.Callback(t.Binding));
|
||||
// One press at a time, in order: a held arrow key and the Enter after it must not overtake each other.
|
||||
lock (_gate)
|
||||
{
|
||||
_temporaryQueue = _temporaryQueue.ContinueWith(
|
||||
_ => t.Callback(t.Binding),
|
||||
CancellationToken.None,
|
||||
TaskContinuationOptions.None,
|
||||
TaskScheduler.Default);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static HOT_KEY_MODIFIERS ToModifiers(HotkeyModifiers modifiers) =>
|
||||
(HOT_KEY_MODIFIERS)(uint)modifiers | HOT_KEY_MODIFIERS.MOD_NOREPEAT;
|
||||
private static HOT_KEY_MODIFIERS ToModifiers(HotkeyModifiers modifiers, bool noRepeat = true) =>
|
||||
noRepeat ? (HOT_KEY_MODIFIERS)(uint)modifiers | HOT_KEY_MODIFIERS.MOD_NOREPEAT : (HOT_KEY_MODIFIERS)(uint)modifiers;
|
||||
|
||||
[LoggerMessage(Level = LogLevel.Warning, Message = "{Mode} hotkey {Binding} not registered: {Status}.")]
|
||||
private partial void LogNotRegistered(CaptureMode mode, string binding, HotkeyRegistrationStatus status);
|
||||
|
||||
@@ -19,19 +19,14 @@ namespace CaptureImage.Infrastructure.Windowing;
|
||||
/// DXGI adapter (hybrid-GPU laptops attach outputs to different adapters) and recreates the
|
||||
/// DXGI factory when Windows reports it stale (HDR toggled, display plugged in).
|
||||
/// </summary>
|
||||
public sealed partial class DisplayService : IDisplayService, IDisposable
|
||||
public sealed partial class DisplayService(ILogger<DisplayService> logger) : IDisplayService, IDisposable
|
||||
{
|
||||
private const uint MonitorDefaultToNearest = 2;
|
||||
|
||||
private readonly ILogger<DisplayService> _logger;
|
||||
private readonly ILogger<DisplayService> _logger = logger;
|
||||
private readonly Lock _gate = new();
|
||||
private IDXGIFactory1? _factory;
|
||||
|
||||
public DisplayService(ILogger<DisplayService> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public IReadOnlyList<MonitorInfo> GetMonitors()
|
||||
{
|
||||
var handles = new List<HMONITOR>(4);
|
||||
|
||||
@@ -16,22 +16,17 @@ namespace CaptureImage.Infrastructure.Windowing;
|
||||
/// file when it has none. Results (including failures) are cached per path in a bounded
|
||||
/// least-recently-used cache, so long sessions don't grow without limit.
|
||||
/// </summary>
|
||||
public sealed partial class IconExtractor : IDisposable
|
||||
public sealed partial class IconExtractor(ILogger<IconExtractor> logger) : IDisposable
|
||||
{
|
||||
private const int Capacity = 256;
|
||||
private const uint IconSize = 48;
|
||||
|
||||
private readonly ILogger<IconExtractor> _logger;
|
||||
private readonly ILogger<IconExtractor> _logger = logger;
|
||||
private readonly Lock _gate = new();
|
||||
private readonly Dictionary<string, LinkedListNode<(string Path, byte[]? Png)>> _index = new(StringComparer.OrdinalIgnoreCase);
|
||||
private readonly LinkedList<(string Path, byte[]? Png)> _order = new();
|
||||
private readonly Lazy<IWICImagingFactory> _factory = new(() => new IWICImagingFactory(), LazyThreadSafetyMode.ExecutionAndPublication);
|
||||
|
||||
public IconExtractor(ILogger<IconExtractor> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public byte[]? TryGetIconPngBytes(string executablePath)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(executablePath))
|
||||
|
||||
@@ -21,25 +21,21 @@ namespace CaptureImage.Infrastructure.Windowing;
|
||||
/// also works for elevated processes (v1 used <c>Process.MainModule</c>, which throws for
|
||||
/// games running as administrator and left them without icon or Steam badge).
|
||||
/// </summary>
|
||||
public sealed unsafe partial class TargetCatalog : ITargetCatalog
|
||||
public sealed unsafe partial class TargetCatalog(
|
||||
IconExtractor icons,
|
||||
ISteamDetector steam,
|
||||
ILogger<TargetCatalog> logger) : ITargetCatalog
|
||||
{
|
||||
private static readonly HashSet<string> ShellWindowClasses = new(StringComparer.Ordinal)
|
||||
{
|
||||
"Progman", "WorkerW", "Shell_TrayWnd", "Shell_SecondaryTrayWnd", "Windows.UI.Core.CoreWindow",
|
||||
};
|
||||
|
||||
private readonly IconExtractor _icons;
|
||||
private readonly ISteamDetector _steam;
|
||||
private readonly ILogger<TargetCatalog> _logger;
|
||||
private readonly IconExtractor _icons = icons;
|
||||
private readonly ISteamDetector _steam = steam;
|
||||
private readonly ILogger<TargetCatalog> _logger = logger;
|
||||
private readonly uint _ownProcessId = (uint)Environment.ProcessId;
|
||||
|
||||
public TargetCatalog(IconExtractor icons, ISteamDetector steam, ILogger<TargetCatalog> logger)
|
||||
{
|
||||
_icons = icons;
|
||||
_steam = steam;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public Task<IReadOnlyList<GameTarget>> EnumerateAsync(CancellationToken cancellationToken = default) =>
|
||||
Task.Run<IReadOnlyList<GameTarget>>(() =>
|
||||
{
|
||||
|
||||
@@ -4,21 +4,21 @@
|
||||
"net10.0-windows10.0.22621": {
|
||||
"Microsoft.Extensions.Logging.Abstractions": {
|
||||
"type": "Direct",
|
||||
"requested": "[10.0.13, )",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "aSZEhEig4fvNiw2zs8Z6NyDlniKtq6YjcF3DyHuqTEHcZ2VKA/6itMPZ+dW+yWABWExlDcQwwdbqX1Rcb7W8WQ==",
|
||||
"requested": "[10.0.14, )",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "SwcbEBtkECq3D2oywvHkm46fyrX9Dd2JPWphDnHUc2+cUWR1Mdo41atAjh/9iZjgQxuvbKfZKXqostT/LZfefA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13"
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Windows.CsWin32": {
|
||||
"type": "Direct",
|
||||
"requested": "[0.3.363, )",
|
||||
"resolved": "0.3.363",
|
||||
"contentHash": "Fd1p6Fr5H6A+c4FO033CojR8jKsvYZm6vigrKvB/auI40KXb0Vb+ge0F6baGBZptc1yIKVxmh/Iu8/KvLVQ94A==",
|
||||
"requested": "[0.3.367, )",
|
||||
"resolved": "0.3.367",
|
||||
"contentHash": "C4JVE3wmVjCvzpdBzC+HK/boVU6g4ZRDEZ7uDmMJHCkgjFHhiMb9vhe2+wffzWzyNNObpCsIAW4G1t+1CAIEWw==",
|
||||
"dependencies": {
|
||||
"Microsoft.Windows.SDK.Win32Docs": "0.1.42-alpha",
|
||||
"Microsoft.Windows.SDK.Win32Metadata": "71.0.30-preview",
|
||||
"Microsoft.Windows.SDK.Win32Metadata": "71.0.37-preview",
|
||||
"Microsoft.Windows.WDK.Win32Metadata": "0.13.25-experimental"
|
||||
}
|
||||
},
|
||||
@@ -30,11 +30,11 @@
|
||||
},
|
||||
"SkiaSharp": {
|
||||
"type": "Direct",
|
||||
"requested": "[4.153.1, )",
|
||||
"resolved": "4.153.1",
|
||||
"contentHash": "TghYLOUaP3q6rTjQw7U9uQaaXh8lEs9rfA1U7/VtmyAptVDtj/SmjtcWzFWmcC/VMWxe3QgbV9uyvqDL7ySFtQ==",
|
||||
"requested": "[4.154.0, )",
|
||||
"resolved": "4.154.0",
|
||||
"contentHash": "R3BuszJ3tUFmni37nZIRawXL0yx+XHyx7xi1716/0TybuEQFhnBx48Ig3rFpeVFQVytpGpJZZ+NLW9d9UPG7EA==",
|
||||
"dependencies": {
|
||||
"SkiaSharp.NativeAssets.Win32": "4.153.1"
|
||||
"SkiaSharp.NativeAssets.Win32": "4.154.0"
|
||||
}
|
||||
},
|
||||
"Velopack": {
|
||||
@@ -80,8 +80,8 @@
|
||||
},
|
||||
"Microsoft.Windows.SDK.Win32Metadata": {
|
||||
"type": "Transitive",
|
||||
"resolved": "71.0.30-preview",
|
||||
"contentHash": "h/FD+SrIlxgr+HD/WrJnLvpTdyWFAX7F0FCMPRxPJFTt4Qz70wGXKEBZvvIDX7om4hP0Tb7O0s1ND3aUvigL8g=="
|
||||
"resolved": "71.0.37-preview",
|
||||
"contentHash": "0y4uKnOzE+k2zUCxcTOJTOuRuOFiW01A+j1GpjyN11saEjkESLW9XrWkGYG/zdlAAb8oRk4oLdokkcx0X2z7yA=="
|
||||
},
|
||||
"Microsoft.Windows.WDK.Win32Metadata": {
|
||||
"type": "Transitive",
|
||||
@@ -106,8 +106,8 @@
|
||||
},
|
||||
"SkiaSharp.NativeAssets.Win32": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.153.1",
|
||||
"contentHash": "Yqg6rChTVh0BUE8QQxtOA3uUBnihfgID4yex/AvDa0+os2bVcBjmI3Qj9tnOB+R1hd/Jry1Gwl8qw5JI9HZG8Q=="
|
||||
"resolved": "4.154.0",
|
||||
"contentHash": "GXgoY77GCXdPcveNAmy8o3gVit8sp6YtnI88h5camLPfihjulwJUajZXKhgVuZ8RhuwSTgfyt/00Dx8HRUSeAA=="
|
||||
},
|
||||
"Vortice.DirectX": {
|
||||
"type": "Transitive",
|
||||
@@ -127,21 +127,21 @@
|
||||
"captureimage.core": {
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Logging.Abstractions": "[10.0.13, )"
|
||||
"Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": {
|
||||
"type": "CentralTransitive",
|
||||
"requested": "[10.0.13, )",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "G2GrGWNAPZBsii2F6AU8n+JT2tC1/I0Ml/e9ZyNCgPjf3hZqronP7o0X91aAynCmVeae8KkSIUNXXeXCNRmdVQ=="
|
||||
"requested": "[10.0.14, )",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "QtpQzuSZVyTPCuHW058yCs9Nj0394uUkNyFHS813nOmK9UgUdBdaprJ5PPsBgsQIpxADTsTkbaMMonykem6qdw=="
|
||||
}
|
||||
},
|
||||
"net10.0-windows10.0.22621/win-x64": {
|
||||
"SkiaSharp.NativeAssets.Win32": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.153.1",
|
||||
"contentHash": "Yqg6rChTVh0BUE8QQxtOA3uUBnihfgID4yex/AvDa0+os2bVcBjmI3Qj9tnOB+R1hd/Jry1Gwl8qw5JI9HZG8Q=="
|
||||
"resolved": "4.154.0",
|
||||
"contentHash": "GXgoY77GCXdPcveNAmy8o3gVit8sp6YtnI88h5camLPfihjulwJUajZXKhgVuZ8RhuwSTgfyt/00Dx8HRUSeAA=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (c) CaptureImage Contributors
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Automation;
|
||||
using System.Windows.Automation.Peers;
|
||||
|
||||
namespace CaptureImage.UI.Accessibility;
|
||||
|
||||
/// <summary>
|
||||
/// Reads a notification to screen readers with a UI Automation notification event; the text
|
||||
/// travels with the event, so it doesn't depend on what has focus or is visible.
|
||||
/// </summary>
|
||||
public static class Announcer
|
||||
{
|
||||
private const string ActivityId = "CaptureImage.Notification";
|
||||
|
||||
/// <summary>Announce <paramref name="text"/> from <paramref name="source"/>.</summary>
|
||||
/// <param name="source">An element of the window the notification belongs to.</param>
|
||||
/// <param name="text">What to read.</param>
|
||||
/// <param name="important">Errors: read even when the user is busy, replacing older notifications.</param>
|
||||
public static void Announce(UIElement source, string text, bool important = false)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(source);
|
||||
if (string.IsNullOrWhiteSpace(text) || !AutomationPeer.ListenerExists(AutomationEvents.Notification))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
UIElementAutomationPeer.CreatePeerForElement(source)?.RaiseNotificationEvent(
|
||||
AutomationNotificationKind.Other,
|
||||
important ? AutomationNotificationProcessing.ImportantMostRecent : AutomationNotificationProcessing.MostRecent,
|
||||
text,
|
||||
ActivityId);
|
||||
}
|
||||
|
||||
/// <summary>"Title. Message", or just the title when there is no message.</summary>
|
||||
public static string Compose(string title, string? message) =>
|
||||
string.IsNullOrEmpty(message) ? title : $"{title}. {message}";
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (c) CaptureImage Contributors
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Automation.Peers;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace CaptureImage.UI.Accessibility;
|
||||
|
||||
/// <summary>
|
||||
/// Makes a screen reader read a status text when it changes. WPF never raises
|
||||
/// <c>LiveRegionChanged</c> on its own, so <c>AutomationProperties.LiveSetting</c> alone stays
|
||||
/// silent: with <c>IsEnabled</c> set, the element raises it when a binding with
|
||||
/// <c>NotifyOnTargetUpdated=True</c> updates its text and when it becomes visible. Changes in
|
||||
/// quick succession are announced once.
|
||||
/// </summary>
|
||||
public static class LiveRegion
|
||||
{
|
||||
public static readonly DependencyProperty IsEnabledProperty = DependencyProperty.RegisterAttached(
|
||||
"IsEnabled",
|
||||
typeof(bool),
|
||||
typeof(LiveRegion),
|
||||
new PropertyMetadata(false, OnIsEnabledChanged));
|
||||
|
||||
private static readonly DependencyProperty IsPendingProperty = DependencyProperty.RegisterAttached(
|
||||
"IsPending",
|
||||
typeof(bool),
|
||||
typeof(LiveRegion),
|
||||
new PropertyMetadata(false));
|
||||
|
||||
public static bool GetIsEnabled(DependencyObject element)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(element);
|
||||
return (bool)element.GetValue(IsEnabledProperty);
|
||||
}
|
||||
|
||||
public static void SetIsEnabled(DependencyObject element, bool value)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(element);
|
||||
element.SetValue(IsEnabledProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>Announce <paramref name="element"/> (its accessible name) on the next idle moment.</summary>
|
||||
public static void Announce(UIElement element)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(element);
|
||||
if ((bool)element.GetValue(IsPendingProperty))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
element.SetValue(IsPendingProperty, true);
|
||||
element.Dispatcher.BeginInvoke(DispatcherPriority.Background, () =>
|
||||
{
|
||||
element.SetValue(IsPendingProperty, false);
|
||||
if (!element.IsVisible
|
||||
|| element is TextBlock { Text.Length: 0 }
|
||||
|| !AutomationPeer.ListenerExists(AutomationEvents.LiveRegionChanged))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
UIElementAutomationPeer.CreatePeerForElement(element)?.RaiseAutomationEvent(AutomationEvents.LiveRegionChanged);
|
||||
});
|
||||
}
|
||||
|
||||
private static void OnIsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (d is not UIElement element)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
element.RemoveHandler(Binding.TargetUpdatedEvent, (EventHandler<DataTransferEventArgs>)OnTargetUpdated);
|
||||
element.IsVisibleChanged -= OnIsVisibleChanged;
|
||||
if (e.NewValue is true)
|
||||
{
|
||||
element.AddHandler(Binding.TargetUpdatedEvent, (EventHandler<DataTransferEventArgs>)OnTargetUpdated);
|
||||
element.IsVisibleChanged += OnIsVisibleChanged;
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnTargetUpdated(object? sender, DataTransferEventArgs e)
|
||||
{
|
||||
if (ReferenceEquals(e.TargetObject, sender) && e.Property == TextBlock.TextProperty && sender is UIElement element)
|
||||
{
|
||||
Announce(element);
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnIsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.NewValue is true && sender is UIElement element)
|
||||
{
|
||||
Announce(element);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,9 @@ namespace CaptureImage.UI.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Attached to the hotkey button in Settings: while its <see cref="HotkeyBindingViewModel"/>
|
||||
/// is recording, key presses are turned into a binding. Esc cancels, Backspace/Delete clear;
|
||||
/// Alt combinations arrive as <see cref="Key.System"/> and Print Screen only as a key-up.
|
||||
/// is recording, key presses are turned into a binding. Esc cancels, Backspace/Delete clear,
|
||||
/// Tab / Shift+Tab cancel and move the focus on; Alt combinations arrive as
|
||||
/// <see cref="Key.System"/> and Print Screen only as a key-up.
|
||||
/// </summary>
|
||||
public static class HotkeyRecorder
|
||||
{
|
||||
@@ -63,9 +64,14 @@ public static class HotkeyRecorder
|
||||
return;
|
||||
}
|
||||
|
||||
var key = KeyInput.ActualKey(e);
|
||||
var modifiers = KeyInput.CurrentModifiers();
|
||||
if (vm.ReleaseFocus(modifiers, (uint)KeyInterop.VirtualKeyFromKey(key)))
|
||||
{
|
||||
return; // not handled: Tab moves the focus as usual
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
var key = ActualKey(e);
|
||||
var modifiers = CurrentModifiers();
|
||||
if (modifiers == HotkeyModifiers.None && key == Key.Escape)
|
||||
{
|
||||
vm.CancelRecordingCommand.Execute(null);
|
||||
@@ -83,44 +89,13 @@ public static class HotkeyRecorder
|
||||
private static void OnPreviewKeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
// Windows never delivers a key-down for Print Screen.
|
||||
if (Recording(sender) is { } vm && ActualKey(e) == Key.Snapshot)
|
||||
if (Recording(sender) is { } vm && KeyInput.ActualKey(e) == Key.Snapshot)
|
||||
{
|
||||
e.Handled = true;
|
||||
vm.Submit(CurrentModifiers(), VkSnapshot);
|
||||
vm.Submit(KeyInput.CurrentModifiers(), VkSnapshot);
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) =>
|
||||
Recording(sender)?.CancelRecordingCommand.Execute(null);
|
||||
|
||||
private static Key ActualKey(KeyEventArgs e) => e.Key switch
|
||||
{
|
||||
Key.System => e.SystemKey,
|
||||
Key.ImeProcessed => e.ImeProcessedKey,
|
||||
Key.DeadCharProcessed => e.DeadCharProcessedKey,
|
||||
_ => e.Key,
|
||||
};
|
||||
|
||||
private static HotkeyModifiers CurrentModifiers()
|
||||
{
|
||||
var keyboard = Keyboard.Modifiers;
|
||||
var modifiers = HotkeyModifiers.None;
|
||||
if (keyboard.HasFlag(ModifierKeys.Control))
|
||||
{
|
||||
modifiers |= HotkeyModifiers.Control;
|
||||
}
|
||||
if (keyboard.HasFlag(ModifierKeys.Alt))
|
||||
{
|
||||
modifiers |= HotkeyModifiers.Alt;
|
||||
}
|
||||
if (keyboard.HasFlag(ModifierKeys.Shift))
|
||||
{
|
||||
modifiers |= HotkeyModifiers.Shift;
|
||||
}
|
||||
if (keyboard.HasFlag(ModifierKeys.Windows))
|
||||
{
|
||||
modifiers |= HotkeyModifiers.Win;
|
||||
}
|
||||
return modifiers;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (c) CaptureImage Contributors
|
||||
|
||||
using System.Windows.Input;
|
||||
using CaptureImage.Core.Models;
|
||||
|
||||
namespace CaptureImage.UI.Controls;
|
||||
|
||||
/// <summary>Turns WPF key events into the Win32 virtual keys and modifiers hotkeys use.</summary>
|
||||
internal static class KeyInput
|
||||
{
|
||||
/// <summary>The key that was really pressed: Alt combinations arrive as <see cref="Key.System"/>.</summary>
|
||||
public static Key ActualKey(KeyEventArgs e) => e.Key switch
|
||||
{
|
||||
Key.System => e.SystemKey,
|
||||
Key.ImeProcessed => e.ImeProcessedKey,
|
||||
Key.DeadCharProcessed => e.DeadCharProcessedKey,
|
||||
_ => e.Key,
|
||||
};
|
||||
|
||||
public static HotkeyModifiers CurrentModifiers()
|
||||
{
|
||||
var keyboard = Keyboard.Modifiers;
|
||||
var modifiers = HotkeyModifiers.None;
|
||||
if (keyboard.HasFlag(ModifierKeys.Control))
|
||||
{
|
||||
modifiers |= HotkeyModifiers.Control;
|
||||
}
|
||||
if (keyboard.HasFlag(ModifierKeys.Alt))
|
||||
{
|
||||
modifiers |= HotkeyModifiers.Alt;
|
||||
}
|
||||
if (keyboard.HasFlag(ModifierKeys.Shift))
|
||||
{
|
||||
modifiers |= HotkeyModifiers.Shift;
|
||||
}
|
||||
if (keyboard.HasFlag(ModifierKeys.Windows))
|
||||
{
|
||||
modifiers |= HotkeyModifiers.Win;
|
||||
}
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
/// <summary>The pressed key with the modifiers held, as a hotkey binding.</summary>
|
||||
public static HotkeyBinding Binding(KeyEventArgs e) =>
|
||||
new(CurrentModifiers(), (uint)KeyInterop.VirtualKeyFromKey(ActualKey(e)));
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public sealed class InverseBoolConverter : IValueConverter
|
||||
/// <summary>PNG bytes (window icons) → image, cached per byte array.</summary>
|
||||
public sealed class BytesToImageConverter : IValueConverter
|
||||
{
|
||||
private static readonly ConditionalWeakTable<byte[], BitmapImage> Cache = new();
|
||||
private static readonly ConditionalWeakTable<byte[], BitmapImage> Cache = [];
|
||||
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (c) CaptureImage Contributors
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Interop;
|
||||
using CaptureImage.Core.Capture;
|
||||
@@ -10,9 +11,20 @@ using Windows.Win32.UI.WindowsAndMessaging;
|
||||
|
||||
namespace CaptureImage.UI.Interop;
|
||||
|
||||
/// <summary>Win32 window tweaks WPF has no property for.</summary>
|
||||
internal static class WindowInterop
|
||||
/// <summary>Win32 window tweaks and system settings WPF has no property for.</summary>
|
||||
internal static partial class WindowInterop
|
||||
{
|
||||
private const uint SpiGetMessageDuration = 0x2016;
|
||||
|
||||
/// <summary>
|
||||
/// Windows' "Dismiss notifications after this amount of time" (Settings → Accessibility →
|
||||
/// Visual effects), or <see langword="null"/> when it can't be read.
|
||||
/// </summary>
|
||||
public static TimeSpan? NotificationDuration() =>
|
||||
SystemParametersInfo(SpiGetMessageDuration, 0, out var seconds, 0) && seconds > 0
|
||||
? TimeSpan.FromSeconds(seconds)
|
||||
: null;
|
||||
|
||||
/// <summary>
|
||||
/// Keep the window out of screenshots and screen recordings (toasts, overlays, pinned
|
||||
/// thumbnails must never end up in the user's captures).
|
||||
@@ -74,4 +86,8 @@ internal static class WindowInterop
|
||||
}
|
||||
|
||||
private static HWND GetHandle(Window window) => new(new WindowInteropHelper(window).EnsureHandle());
|
||||
|
||||
[LibraryImport("user32.dll", EntryPoint = "SystemParametersInfoW")]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
private static partial bool SystemParametersInfo(uint action, uint parameter, out uint value, uint update);
|
||||
}
|
||||
@@ -60,6 +60,9 @@
|
||||
<!-- Contact -->
|
||||
<TextBlock Style="{StaticResource SectionHeader}" Text="{loc:Tr About_ContactSection}" />
|
||||
<ui:CardControl
|
||||
AutomationProperties.AutomationId="About_Email"
|
||||
AutomationProperties.HelpText="{Binding Contact}"
|
||||
AutomationProperties.Name="{loc:Tr About_Email}"
|
||||
Command="{Binding EmailContactCommand}"
|
||||
Icon="{ui:SymbolIcon Mail24}"
|
||||
Margin="0,0,0,4">
|
||||
@@ -72,6 +75,9 @@
|
||||
<ui:SymbolIcon Symbol="ArrowUpRight24" />
|
||||
</ui:CardControl>
|
||||
<ui:CardControl
|
||||
AutomationProperties.AutomationId="About_OtherChannels"
|
||||
AutomationProperties.HelpText="{Binding LinksPage}"
|
||||
AutomationProperties.Name="{loc:Tr About_OtherChannels}"
|
||||
Command="{Binding OpenLinksPageCommand}"
|
||||
Icon="{ui:SymbolIcon Link24}"
|
||||
Margin="0,0,0,4">
|
||||
@@ -84,6 +90,9 @@
|
||||
<ui:SymbolIcon Symbol="ArrowUpRight24" />
|
||||
</ui:CardControl>
|
||||
<ui:CardControl
|
||||
AutomationProperties.AutomationId="About_Repository"
|
||||
AutomationProperties.HelpText="github.com/poli0981/captureimg"
|
||||
AutomationProperties.Name="{loc:Tr About_RepositoryLabel}"
|
||||
Command="{Binding OpenRepositoryCommand}"
|
||||
Icon="{ui:SymbolIcon Code24}"
|
||||
Margin="0,0,0,4">
|
||||
@@ -229,18 +238,25 @@
|
||||
|
||||
<TextBlock Style="{StaticResource SectionHeader}" Text="{loc:Tr About_DisclaimersSection}" />
|
||||
<TextBlock
|
||||
AutomationProperties.HeadingLevel="Level3"
|
||||
FontWeight="SemiBold"
|
||||
Text="{loc:Tr About_TranslationDisclaimer}" />
|
||||
<TextBlock
|
||||
Margin="0,2,0,10"
|
||||
Style="{StaticResource SecondaryText}"
|
||||
Text="{loc:Tr About_TranslationDisclaimerBody}" />
|
||||
<TextBlock FontWeight="SemiBold" Text="{loc:Tr About_CaptureDisclaimer}" />
|
||||
<TextBlock
|
||||
AutomationProperties.HeadingLevel="Level3"
|
||||
FontWeight="SemiBold"
|
||||
Text="{loc:Tr About_CaptureDisclaimer}" />
|
||||
<TextBlock
|
||||
Margin="0,2,0,10"
|
||||
Style="{StaticResource SecondaryText}"
|
||||
Text="{loc:Tr About_CaptureLimitationDisclaimerBody}" />
|
||||
<TextBlock FontWeight="SemiBold" Text="{loc:Tr About_LiabilityDisclaimer}" />
|
||||
<TextBlock
|
||||
AutomationProperties.HeadingLevel="Level3"
|
||||
FontWeight="SemiBold"
|
||||
Text="{loc:Tr About_LiabilityDisclaimer}" />
|
||||
<TextBlock
|
||||
Margin="0,2,0,10"
|
||||
Style="{StaticResource SecondaryText}"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
x:Class="CaptureImage.UI.Pages.DashboardPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:a11y="clr-namespace:CaptureImage.UI.Accessibility"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:loc="clr-namespace:CaptureImage.UI.Localization"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
@@ -59,11 +60,12 @@
|
||||
</Ellipse>
|
||||
<StackPanel Grid.Column="1">
|
||||
<TextBlock
|
||||
a11y:LiveRegion.IsEnabled="True"
|
||||
AutomationProperties.AutomationId="Dashboard_Status"
|
||||
AutomationProperties.LiveSetting="Polite"
|
||||
FontSize="15"
|
||||
FontWeight="SemiBold"
|
||||
Text="{Binding StatusText}"
|
||||
Text="{Binding StatusText, NotifyOnTargetUpdated=True}"
|
||||
TextWrapping="Wrap" />
|
||||
<StackPanel
|
||||
Margin="0,6,0,0"
|
||||
@@ -203,6 +205,11 @@
|
||||
SelectionMode="Single"
|
||||
VirtualizingPanel.IsVirtualizing="True"
|
||||
VirtualizingPanel.VirtualizationMode="Recycling">
|
||||
<ui:ListView.ItemContainerStyle>
|
||||
<Style BasedOn="{StaticResource {x:Type ui:ListViewItem}}" TargetType="{x:Type ui:ListViewItem}">
|
||||
<Setter Property="AutomationProperties.Name" Value="{Binding AutomationName}" />
|
||||
</Style>
|
||||
</ui:ListView.ItemContainerStyle>
|
||||
<ui:ListView.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type vm:TargetItemViewModel}">
|
||||
<Grid Margin="4,6">
|
||||
|
||||
@@ -86,6 +86,11 @@
|
||||
<ui:VirtualizingWrapPanel ItemSize="232,190" SpacingMode="None" />
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style BasedOn="{StaticResource {x:Type ListBoxItem}}" TargetType="{x:Type ListBoxItem}">
|
||||
<Setter Property="AutomationProperties.Name" Value="{Binding AutomationName}" />
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type vm:CaptureItemViewModel}">
|
||||
<Grid Width="220">
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
x:Class="CaptureImage.UI.Pages.ProfilesPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:a11y="clr-namespace:CaptureImage.UI.Accessibility"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:loc="clr-namespace:CaptureImage.UI.Localization"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
@@ -56,6 +57,11 @@
|
||||
ItemsSource="{Binding Profiles}"
|
||||
SelectedItem="{Binding SelectedProfile}"
|
||||
SelectionMode="Single">
|
||||
<ui:ListView.ItemContainerStyle>
|
||||
<Style BasedOn="{StaticResource {x:Type ui:ListViewItem}}" TargetType="{x:Type ui:ListViewItem}">
|
||||
<Setter Property="AutomationProperties.Name" Value="{Binding AutomationName}" />
|
||||
</Style>
|
||||
</ui:ListView.ItemContainerStyle>
|
||||
<ui:ListView.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type vm:ProfileItemViewModel}">
|
||||
<StackPanel Margin="4,6">
|
||||
@@ -139,6 +145,7 @@
|
||||
<ui:Button
|
||||
Margin="8,0,0,0"
|
||||
AutomationProperties.AutomationId="Profiles_BrowseExecutable"
|
||||
AutomationProperties.HelpText="{loc:Tr Profiles_ExecutablePath}"
|
||||
Command="{Binding BrowseExecutableCommand}"
|
||||
Content="{loc:Tr Common_Browse}" />
|
||||
</StackPanel>
|
||||
@@ -162,6 +169,8 @@
|
||||
<StackPanel>
|
||||
<TextBlock Text="{loc:Tr Profiles_SteamAppId}" />
|
||||
<TextBlock
|
||||
a11y:LiveRegion.IsEnabled="True"
|
||||
AutomationProperties.LiveSetting="Assertive"
|
||||
Style="{StaticResource ErrorText}"
|
||||
Text="{loc:Tr Profiles_SteamAppIdInvalid}"
|
||||
Visibility="{Binding SteamAppIdInvalid, Converter={StaticResource BoolToVisibility}}" />
|
||||
@@ -202,6 +211,7 @@
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ui:Button
|
||||
AutomationProperties.AutomationId="Profiles_BrowseOutput"
|
||||
AutomationProperties.HelpText="{loc:Tr Profiles_OutputFolder}"
|
||||
Command="{Binding BrowseOutputFolderCommand}"
|
||||
Content="{loc:Tr Common_Browse}" />
|
||||
<ui:Button
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
x:Class="CaptureImage.UI.Pages.SettingsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:a11y="clr-namespace:CaptureImage.UI.Accessibility"
|
||||
xmlns:controls="clr-namespace:CaptureImage.UI.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:loc="clr-namespace:CaptureImage.UI.Localization"
|
||||
@@ -35,9 +36,10 @@
|
||||
<TextBlock Style="{StaticResource CaptionText}" Text="{Binding Description}" />
|
||||
<TextBlock
|
||||
Margin="0,2,0,0"
|
||||
a11y:LiveRegion.IsEnabled="True"
|
||||
AutomationProperties.LiveSetting="Assertive"
|
||||
Style="{StaticResource ErrorText}"
|
||||
Text="{Binding Message}"
|
||||
Text="{Binding Message, NotifyOnTargetUpdated=True}"
|
||||
Visibility="{Binding HasError, Converter={StaticResource BoolToVisibility}}" />
|
||||
</StackPanel>
|
||||
</ui:CardControl.Header>
|
||||
@@ -47,7 +49,7 @@
|
||||
controls:HotkeyRecorder.IsEnabled="True"
|
||||
Appearance="{Binding IsRecording, Converter={StaticResource RecordingAppearance}}"
|
||||
AutomationProperties.AutomationId="{Binding Mode, StringFormat=Hotkey_{0}_Record}"
|
||||
AutomationProperties.Name="{Binding ModeName}"
|
||||
AutomationProperties.Name="{Binding AccessibleName}"
|
||||
Command="{Binding StartRecordingCommand}"
|
||||
Content="{Binding DisplayText}"
|
||||
ToolTip="{loc:Tr Settings_HotkeyRecord}">
|
||||
@@ -55,14 +57,14 @@
|
||||
<ui:Button
|
||||
Margin="8,0,0,0"
|
||||
AutomationProperties.AutomationId="{Binding Mode, StringFormat=Hotkey_{0}_Clear}"
|
||||
AutomationProperties.Name="{loc:Tr Settings_HotkeyClear}"
|
||||
AutomationProperties.Name="{Binding ClearName}"
|
||||
Command="{Binding ClearCommand}"
|
||||
Icon="{ui:SymbolIcon Dismiss24}"
|
||||
ToolTip="{loc:Tr Settings_HotkeyClear}" />
|
||||
<ui:Button
|
||||
Margin="8,0,0,0"
|
||||
AutomationProperties.AutomationId="{Binding Mode, StringFormat=Hotkey_{0}_Reset}"
|
||||
AutomationProperties.Name="{loc:Tr Settings_HotkeyReset}"
|
||||
AutomationProperties.Name="{Binding ResetName}"
|
||||
Command="{Binding ResetToDefaultCommand}"
|
||||
Icon="{ui:SymbolIcon ArrowReset24}"
|
||||
ToolTip="{loc:Tr Settings_HotkeyReset}" />
|
||||
@@ -263,11 +265,13 @@
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ui:Button
|
||||
AutomationProperties.AutomationId="Settings_BrowseOutput"
|
||||
AutomationProperties.HelpText="{loc:Tr Settings_OutputFolder}"
|
||||
Command="{Binding BrowseOutputFolderCommand}"
|
||||
Content="{loc:Tr Common_Browse}" />
|
||||
<ui:Button
|
||||
Margin="8,0,0,0"
|
||||
AutomationProperties.AutomationId="Settings_OpenOutput"
|
||||
AutomationProperties.HelpText="{loc:Tr Settings_OutputFolder}"
|
||||
AutomationProperties.Name="{loc:Tr Settings_OpenFolder}"
|
||||
Command="{Binding OpenOutputFolderCommand}"
|
||||
Icon="{ui:SymbolIcon FolderOpen24}"
|
||||
@@ -275,6 +279,7 @@
|
||||
<ui:Button
|
||||
Margin="8,0,0,0"
|
||||
AutomationProperties.AutomationId="Settings_ResetOutput"
|
||||
AutomationProperties.HelpText="{loc:Tr Settings_OutputFolder}"
|
||||
AutomationProperties.Name="{loc:Tr Settings_ResetToDefault}"
|
||||
Command="{Binding ResetOutputFolderCommand}"
|
||||
Icon="{ui:SymbolIcon ArrowReset24}"
|
||||
@@ -307,6 +312,7 @@
|
||||
<ui:Button
|
||||
Margin="8,0,0,0"
|
||||
AutomationProperties.AutomationId="Settings_ResetTemplate"
|
||||
AutomationProperties.HelpText="{loc:Tr Settings_FileNameTemplate}"
|
||||
AutomationProperties.Name="{loc:Tr Settings_ResetToDefault}"
|
||||
Command="{Binding ResetFileNameTemplateCommand}"
|
||||
Icon="{ui:SymbolIcon ArrowReset24}"
|
||||
@@ -458,6 +464,7 @@
|
||||
</ui:CardControl.Header>
|
||||
<ui:Button
|
||||
AutomationProperties.AutomationId="Settings_OpenDataFolder"
|
||||
AutomationProperties.HelpText="{loc:Tr Settings_DataFolder}"
|
||||
Command="{Binding OpenDataFolderCommand}"
|
||||
Content="{loc:Tr Settings_OpenFolder}" />
|
||||
</ui:CardControl>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
x:Class="CaptureImage.UI.Pages.UpdatePage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:a11y="clr-namespace:CaptureImage.UI.Accessibility"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:loc="clr-namespace:CaptureImage.UI.Localization"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
@@ -30,11 +31,12 @@
|
||||
</StackPanel>
|
||||
<TextBlock
|
||||
Margin="0,10,0,0"
|
||||
a11y:LiveRegion.IsEnabled="True"
|
||||
AutomationProperties.AutomationId="Update_Status"
|
||||
AutomationProperties.LiveSetting="Polite"
|
||||
FontSize="15"
|
||||
FontWeight="SemiBold"
|
||||
Text="{Binding StatusText}"
|
||||
Text="{Binding StatusText, NotifyOnTargetUpdated=True}"
|
||||
TextWrapping="Wrap" />
|
||||
<ProgressBar
|
||||
Height="4"
|
||||
|
||||
@@ -6,8 +6,11 @@ using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
using CaptureImage.Core.Abstractions;
|
||||
using CaptureImage.Core.Capture;
|
||||
using CaptureImage.Core.Models;
|
||||
using CaptureImage.UI.Accessibility;
|
||||
using CaptureImage.UI.Imaging;
|
||||
using CaptureImage.UI.Interop;
|
||||
using CaptureImage.UI.Windows;
|
||||
using CaptureImage.ViewModels.Preview;
|
||||
using CaptureImage.ViewModels.Services;
|
||||
@@ -22,6 +25,8 @@ namespace CaptureImage.UI.Services;
|
||||
/// <summary>
|
||||
/// Notifications: a snackbar inside the main window while it has focus, otherwise a small
|
||||
/// non-activating pop-up above the taskbar (never steals focus from a game, never captured).
|
||||
/// Both are read to screen readers and stay up at least as long as Windows' "Dismiss
|
||||
/// notifications after" setting asks.
|
||||
/// </summary>
|
||||
public sealed class ToastService(Dispatcher dispatcher, ShellContext shell, ISnackbarService snackbar) : IToastService
|
||||
{
|
||||
@@ -30,10 +35,14 @@ public sealed class ToastService(Dispatcher dispatcher, ShellContext shell, ISna
|
||||
|
||||
public void Show(ToastKind kind, string title, string message, TimeSpan? duration = null) => dispatcher.BeginInvoke(() =>
|
||||
{
|
||||
var timeout = duration ?? TimeSpan.FromSeconds(kind == ToastKind.Error ? 6 : 3.5);
|
||||
var timeout = duration ?? DefaultTimeout(kind);
|
||||
if (shell.IsMainWindowActive && snackbar.GetSnackbarPresenter() is not null)
|
||||
{
|
||||
snackbar.Show(title, message, Appearance(kind), new SymbolIcon(Symbol(kind)), timeout);
|
||||
if (shell.MainWindow is { } window)
|
||||
{
|
||||
Announcer.Announce(window, Announcer.Compose(title, message), important: kind == ToastKind.Error);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -53,6 +62,12 @@ public sealed class ToastService(Dispatcher dispatcher, ShellContext shell, ISna
|
||||
Arrange();
|
||||
});
|
||||
|
||||
private static TimeSpan DefaultTimeout(ToastKind kind)
|
||||
{
|
||||
var own = TimeSpan.FromSeconds(kind == ToastKind.Error ? 6 : 3.5);
|
||||
return WindowInterop.NotificationDuration() is { } windows && windows > own ? windows : own;
|
||||
}
|
||||
|
||||
/// <summary>Stack the pop-ups upwards from the bottom-right corner of the primary work area.</summary>
|
||||
private void Arrange()
|
||||
{
|
||||
@@ -204,12 +219,13 @@ public sealed class PreviewPresenter(
|
||||
}).Task.Unwrap();
|
||||
}
|
||||
|
||||
/// <summary>Region selection: one frozen full-screen overlay per monitor.</summary>
|
||||
/// <summary>
|
||||
/// Region selection: one frozen full-screen overlay per monitor, driven by the mouse or by the
|
||||
/// keys of <see cref="RegionKeyboard"/>. The keys are registered as temporary hotkeys while the
|
||||
/// overlays are up, so they work even when a full-screen game keeps the keyboard focus.
|
||||
/// </summary>
|
||||
public sealed class RegionSelector(Dispatcher dispatcher, IHotkeyService hotkeys) : IRegionSelector
|
||||
{
|
||||
private static readonly HotkeyBinding EscapeKey = new(HotkeyModifiers.None, 0x1B);
|
||||
private static readonly HotkeyBinding EnterKey = new(HotkeyModifiers.None, 0x0D);
|
||||
|
||||
public Task<RegionSelection?> SelectAsync(IReadOnlyList<MonitorSnapshot> snapshots, CancellationToken cancellationToken = default) =>
|
||||
dispatcher.InvokeAsync(() => RunAsync(snapshots, cancellationToken)).Task.Unwrap();
|
||||
|
||||
@@ -222,37 +238,63 @@ public sealed class RegionSelector(Dispatcher dispatcher, IHotkeyService hotkeys
|
||||
|
||||
var result = new TaskCompletionSource<RegionSelection?>(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
var overlays = snapshots.Select(s => new RegionOverlayWindow(s)).ToList();
|
||||
foreach (var overlay in overlays)
|
||||
var bounds = overlays.Select(o => o.MonitorBounds).ToList();
|
||||
var active = 0;
|
||||
|
||||
void OnKey(HotkeyBinding key)
|
||||
{
|
||||
var overlay = overlays[active];
|
||||
switch (RegionKeyboard.Map(key, overlay.KeyboardStep))
|
||||
{
|
||||
case { Action: RegionKeyAction.Cancel }:
|
||||
result.TrySetResult(null);
|
||||
break;
|
||||
case { Action: RegionKeyAction.Confirm }:
|
||||
result.TrySetResult(overlay.CurrentOrFullSelection());
|
||||
break;
|
||||
case { Action: RegionKeyAction.NextMonitor or RegionKeyAction.PreviousMonitor } command:
|
||||
var next = RegionKeyboard.Cycle(bounds, active, backwards: command.Action == RegionKeyAction.PreviousMonitor);
|
||||
if (next != active)
|
||||
{
|
||||
active = next;
|
||||
overlays[active].Activate();
|
||||
overlays[active].ApplyKeyboard(command with { Action = RegionKeyAction.Move });
|
||||
}
|
||||
break;
|
||||
case { } command:
|
||||
overlay.ApplyKeyboard(command);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < overlays.Count; i++)
|
||||
{
|
||||
var index = i;
|
||||
var overlay = overlays[i];
|
||||
overlay.Completed += (_, selection) => result.TrySetResult(selection);
|
||||
overlay.Cancelled += (_, _) => result.TrySetResult(null);
|
||||
overlay.SelectionStarted += (sender, _) =>
|
||||
overlay.KeyPressed += (_, key) => OnKey(key);
|
||||
overlay.SelectionStarted += (_, _) =>
|
||||
{
|
||||
foreach (var other in overlays.Where(o => !ReferenceEquals(o, sender)))
|
||||
active = index;
|
||||
foreach (var other in overlays.Where(o => !ReferenceEquals(o, overlay)))
|
||||
{
|
||||
other.ClearSelection();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Esc / Enter work even when a full-screen game keeps the keyboard focus.
|
||||
using var keys = hotkeys.RegisterTemporary([EscapeKey, EnterKey], key => dispatcher.BeginInvoke(() =>
|
||||
{
|
||||
if (key == EscapeKey)
|
||||
{
|
||||
result.TrySetResult(null);
|
||||
return;
|
||||
}
|
||||
var active = overlays.FirstOrDefault(o => o.HasSelection) ?? overlays.FirstOrDefault(o => o.IsMouseOver) ?? overlays[0];
|
||||
result.TrySetResult(active.CurrentOrFullSelection());
|
||||
}));
|
||||
void OnHotkey(HotkeyBinding key) => dispatcher.BeginInvoke(() => OnKey(key));
|
||||
using var singleKeys = hotkeys.RegisterTemporary(RegionKeyboard.SingleKeys, OnHotkey);
|
||||
using var repeatingKeys = hotkeys.RegisterTemporary(RegionKeyboard.RepeatingKeys, OnHotkey, repeat: true);
|
||||
await using var cancellation = cancellationToken.Register(() => result.TrySetResult(null));
|
||||
|
||||
foreach (var overlay in overlays)
|
||||
{
|
||||
overlay.Show();
|
||||
}
|
||||
(overlays.FirstOrDefault(o => o.IsMouseOver) ?? overlays[0]).Activate();
|
||||
active = Math.Max(0, overlays.FindIndex(o => o.IsMouseOver));
|
||||
overlays[active].Activate();
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -61,8 +61,7 @@
|
||||
IsPaneToggleVisible="True"
|
||||
OpenPaneLength="230"
|
||||
PaneDisplayMode="Left"
|
||||
TitleBar="{Binding ElementName=TitleBar, Mode=OneWay}"
|
||||
Transition="FadeInWithSlide">
|
||||
TitleBar="{Binding ElementName=TitleBar, Mode=OneWay}">
|
||||
<ui:NavigationView.MenuItems>
|
||||
<ui:NavigationViewItem
|
||||
AutomationProperties.AutomationId="Nav_Dashboard"
|
||||
|
||||
@@ -14,13 +14,15 @@ using CaptureImage.ViewModels.Shell;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Wpf.Ui;
|
||||
using Wpf.Ui.Abstractions;
|
||||
using Wpf.Ui.Animations;
|
||||
using Wpf.Ui.Controls;
|
||||
|
||||
namespace CaptureImage.UI.Shell;
|
||||
|
||||
/// <summary>
|
||||
/// The main window. Closing it hides to the tray (unless that option is off); its placement
|
||||
/// is remembered; only the visible page's view model does background refreshes.
|
||||
/// is remembered; only the visible page's view model does background refreshes. Page
|
||||
/// transitions follow Windows' "Animation effects" setting.
|
||||
/// </summary>
|
||||
public partial class MainWindow : FluentWindow, IRecipient<NavigateMessage>
|
||||
{
|
||||
@@ -63,6 +65,9 @@ public partial class MainWindow : FluentWindow, IRecipient<NavigateMessage>
|
||||
snackbar.SetSnackbarPresenter(SnackbarPresenter);
|
||||
dialogs.SetDialogHost(DialogHost);
|
||||
messenger.Register(this);
|
||||
ApplyMotionPreference();
|
||||
SystemParameters.StaticPropertyChanged += OnSystemParametersChanged;
|
||||
Closed += (_, _) => SystemParameters.StaticPropertyChanged -= OnSystemParametersChanged;
|
||||
|
||||
Loaded += (_, _) => Navigation.Navigate(typeof(DashboardPage));
|
||||
IsVisibleChanged += (_, _) => UpdateActivity();
|
||||
@@ -140,6 +145,18 @@ public partial class MainWindow : FluentWindow, IRecipient<NavigateMessage>
|
||||
UpdateActivity();
|
||||
}
|
||||
|
||||
/// <summary>No sliding pages when the user turned animation effects off in Windows.</summary>
|
||||
private void ApplyMotionPreference() =>
|
||||
Navigation.Transition = SystemParameters.ClientAreaAnimation ? Transition.FadeInWithSlide : Transition.None;
|
||||
|
||||
private void OnSystemParametersChanged(object? sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == nameof(SystemParameters.ClientAreaAnimation))
|
||||
{
|
||||
Dispatcher.BeginInvoke(ApplyMotionPreference);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateActivity()
|
||||
{
|
||||
var onScreen = IsVisible && WindowState != WindowState.Minimized;
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.Windows.Data;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Threading;
|
||||
using CaptureImage.Core.Abstractions;
|
||||
using CaptureImage.UI.Localization;
|
||||
using CaptureImage.ViewModels.Services;
|
||||
@@ -20,8 +21,10 @@ using MenuItem = System.Windows.Controls.MenuItem;
|
||||
namespace CaptureImage.UI.Shell;
|
||||
|
||||
/// <summary>
|
||||
/// The notification-area icon: left click shows the window, right click opens the menu. The
|
||||
/// icon gets a red dot while the hotkeys are armed. H.NotifyIcon re-adds it after Explorer restarts.
|
||||
/// The notification-area icon: left click shows the window, right click opens the menu; from
|
||||
/// the keyboard (Win+B, arrow keys) Enter or Space shows the window and Shift+F10 or the menu
|
||||
/// key opens the menu. The icon gets a red dot while the hotkeys are armed. H.NotifyIcon
|
||||
/// re-adds it after Explorer restarts.
|
||||
/// </summary>
|
||||
public sealed class TrayIcon : IDisposable
|
||||
{
|
||||
@@ -46,6 +49,9 @@ public sealed class TrayIcon : IDisposable
|
||||
ContextMenu = BuildMenu(viewModel),
|
||||
};
|
||||
_icon.SetBinding(TaskbarIcon.ToolTipTextProperty, new Binding(nameof(ShellViewModel.TrayToolTip)) { Source = viewModel, Mode = BindingMode.OneWay });
|
||||
// H.NotifyIcon only reports keyboard use of the icon; it doesn't act on it.
|
||||
_icon.TrayKeyboardKeySelect += OnKeyboardSelect;
|
||||
_icon.TrayKeyboardContextMenu += OnKeyboardContextMenu;
|
||||
LocalizationSource.Apply(_icon.ContextMenu);
|
||||
|
||||
_viewModel.PropertyChanged += OnViewModelChanged;
|
||||
@@ -64,6 +70,8 @@ public sealed class TrayIcon : IDisposable
|
||||
_disposed = true;
|
||||
_viewModel.PropertyChanged -= OnViewModelChanged;
|
||||
_localization.CultureChanged -= OnCultureChanged;
|
||||
_icon.TrayKeyboardKeySelect -= OnKeyboardSelect;
|
||||
_icon.TrayKeyboardContextMenu -= OnKeyboardContextMenu;
|
||||
_icon.Dispose();
|
||||
}
|
||||
|
||||
@@ -105,6 +113,19 @@ public sealed class TrayIcon : IDisposable
|
||||
private static BitmapFrame LoadIcon(string name) =>
|
||||
BitmapFrame.Create(new Uri($"pack://application:,,,/CaptureImage.UI;component/Assets/{name}", UriKind.Absolute));
|
||||
|
||||
private void OnKeyboardSelect(object sender, RoutedEventArgs e) => _viewModel.ShowWindowCommand.Execute(null);
|
||||
|
||||
private void OnKeyboardContextMenu(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_icon.ContextMenu is not { IsOpen: false } menu)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_icon.ShowContextMenu(TaskbarIcon.GetPopupTrayPosition());
|
||||
menu.Dispatcher.BeginInvoke(DispatcherPriority.Input, () => menu.MoveFocus(new TraversalRequest(FocusNavigationDirection.First)));
|
||||
}
|
||||
|
||||
private void OnViewModelChanged(object? sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == nameof(ShellViewModel.IsArmed))
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:CaptureImage.UI.Localization"
|
||||
Title="{loc:Tr Region_Title}"
|
||||
AutomationProperties.AutomationId="RegionOverlay"
|
||||
AutomationProperties.HelpText="{loc:Tr Region_DragHint}"
|
||||
AutomationProperties.Name="{loc:Tr Region_Title}"
|
||||
Background="Black"
|
||||
Cursor="Cross"
|
||||
FlowDirection="LeftToRight"
|
||||
@@ -37,13 +40,15 @@
|
||||
Visibility="Collapsed">
|
||||
<TextBlock
|
||||
x:Name="SizeText"
|
||||
AutomationProperties.LiveSetting="Polite"
|
||||
FontSize="12"
|
||||
Foreground="White" />
|
||||
</Border>
|
||||
</Canvas>
|
||||
<Border
|
||||
x:Name="Hint"
|
||||
Margin="0,32,0,0"
|
||||
MaxWidth="900"
|
||||
Margin="16,32,16,0"
|
||||
Padding="16,8"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"
|
||||
@@ -51,9 +56,12 @@
|
||||
CornerRadius="6"
|
||||
IsHitTestVisible="False">
|
||||
<TextBlock
|
||||
x:Name="HintText"
|
||||
FontSize="14"
|
||||
Foreground="White"
|
||||
Text="{loc:Tr Region_DragHint}" />
|
||||
Text="{loc:Tr Region_DragHint}"
|
||||
TextAlignment="Center"
|
||||
TextWrapping="Wrap" />
|
||||
</Border>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -8,6 +8,9 @@ using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using CaptureImage.Core.Abstractions;
|
||||
using CaptureImage.Core.Capture;
|
||||
using CaptureImage.Core.Models;
|
||||
using CaptureImage.UI.Accessibility;
|
||||
using CaptureImage.UI.Controls;
|
||||
using CaptureImage.UI.Imaging;
|
||||
using CaptureImage.UI.Interop;
|
||||
|
||||
@@ -15,21 +18,26 @@ namespace CaptureImage.UI.Windows;
|
||||
|
||||
/// <summary>
|
||||
/// Covers one monitor with the frozen picture taken when the hotkey was pressed; the user
|
||||
/// drags a rectangle (a plain click takes the whole monitor). The window is placed in physical
|
||||
/// pixels and the picture is shown at the monitor's DPI, so one image pixel is one screen pixel.
|
||||
/// drags a rectangle (a plain click takes the whole monitor) or uses the keys of
|
||||
/// <see cref="RegionKeyboard"/>. The window is placed in physical pixels and the picture is
|
||||
/// shown at the monitor's DPI, so one image pixel is one screen pixel. The selection is kept
|
||||
/// in physical pixels relative to the monitor.
|
||||
/// </summary>
|
||||
public partial class RegionOverlayWindow : Window
|
||||
{
|
||||
private const int MinimumSize = 4;
|
||||
private readonly MonitorSnapshot _snapshot;
|
||||
private Point? _start;
|
||||
private Rect? _selection;
|
||||
private (int X, int Y)? _start;
|
||||
private PixelRect? _selection;
|
||||
|
||||
public RegionOverlayWindow(MonitorSnapshot snapshot)
|
||||
{
|
||||
_snapshot = snapshot;
|
||||
InitializeComponent();
|
||||
Frozen.Source = FrameBitmap.ToBitmapSource(snapshot.DisplayFrame, snapshot.Monitor.Dpi);
|
||||
if (SystemParameters.HighContrast)
|
||||
{
|
||||
UseContrastColors();
|
||||
}
|
||||
|
||||
var bounds = snapshot.Monitor.Bounds;
|
||||
var scale = snapshot.Monitor.Scale;
|
||||
@@ -51,10 +59,22 @@ public partial class RegionOverlayWindow : Window
|
||||
|
||||
public event EventHandler? Cancelled;
|
||||
|
||||
/// <summary>A drag started here; the other overlays clear theirs.</summary>
|
||||
/// <summary>A selection started here; the other overlays clear theirs.</summary>
|
||||
public event EventHandler? SelectionStarted;
|
||||
|
||||
public bool HasSelection => _selection is { Width: > 0, Height: > 0 };
|
||||
/// <summary>
|
||||
/// A key of <see cref="RegionKeyboard"/> reached this window (it wasn't registered as a
|
||||
/// temporary hotkey); the selector handles it like the registered ones.
|
||||
/// </summary>
|
||||
public event EventHandler<HotkeyBinding>? KeyPressed;
|
||||
|
||||
/// <summary>The monitor this overlay covers, in virtual-desktop pixels.</summary>
|
||||
public PixelRect MonitorBounds => _snapshot.Monitor.Bounds;
|
||||
|
||||
/// <summary>A normal keyboard step on this monitor, in physical pixels.</summary>
|
||||
public int KeyboardStep => RegionKeyboard.StepFor(_snapshot.Monitor.Scale);
|
||||
|
||||
public bool HasSelection => _selection is { IsEmpty: false };
|
||||
|
||||
public void ClearSelection()
|
||||
{
|
||||
@@ -63,13 +83,32 @@ public partial class RegionOverlayWindow : Window
|
||||
UpdateVisuals();
|
||||
}
|
||||
|
||||
/// <summary>The dragged rectangle, or the whole monitor when nothing is selected.</summary>
|
||||
public RegionSelection CurrentOrFullSelection()
|
||||
{
|
||||
var area = _selection is { } rect ? ToPixels(rect) : default;
|
||||
return area.Width >= MinimumSize && area.Height >= MinimumSize
|
||||
/// <summary>The selected rectangle, or the whole monitor when nothing (or too little) is selected.</summary>
|
||||
public RegionSelection CurrentOrFullSelection() =>
|
||||
_selection is { Width: >= RegionKeyboard.MinimumSize, Height: >= RegionKeyboard.MinimumSize } area
|
||||
? new RegionSelection(_snapshot.Monitor, area)
|
||||
: FullMonitor();
|
||||
|
||||
/// <summary>Move or resize the selection from the keyboard (creating one first if there is none).</summary>
|
||||
public void ApplyKeyboard(RegionKeyCommand command)
|
||||
{
|
||||
var bounds = _snapshot.Monitor.Bounds;
|
||||
var next = RegionKeyboard.Apply(_selection, command, bounds.Width, bounds.Height);
|
||||
if (next == _selection)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!HasSelection)
|
||||
{
|
||||
SelectionStarted?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
_start = null;
|
||||
_selection = next;
|
||||
Hint.Visibility = Visibility.Collapsed;
|
||||
UpdateVisuals();
|
||||
LiveRegion.Announce(SizeText);
|
||||
}
|
||||
|
||||
protected override void OnDpiChanged(DpiScale oldDpi, DpiScale newDpi)
|
||||
@@ -82,8 +121,9 @@ public partial class RegionOverlayWindow : Window
|
||||
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
|
||||
{
|
||||
base.OnMouseLeftButtonDown(e);
|
||||
_start = e.GetPosition(Root);
|
||||
_selection = new Rect(_start.Value, _start.Value);
|
||||
var start = ToPixels(e.GetPosition(Root));
|
||||
_start = start;
|
||||
_selection = new PixelRect(start.X, start.Y, 0, 0);
|
||||
Hint.Visibility = Visibility.Collapsed;
|
||||
CaptureMouse();
|
||||
SelectionStarted?.Invoke(this, EventArgs.Empty);
|
||||
@@ -95,7 +135,8 @@ public partial class RegionOverlayWindow : Window
|
||||
base.OnMouseMove(e);
|
||||
if (_start is { } start && IsMouseCaptured)
|
||||
{
|
||||
_selection = new Rect(start, Clamp(e.GetPosition(Root)));
|
||||
var (x, y) = ToPixels(e.GetPosition(Root));
|
||||
_selection = new PixelRect(Math.Min(start.X, x), Math.Min(start.Y, y), Math.Abs(x - start.X), Math.Abs(y - start.Y));
|
||||
UpdateVisuals();
|
||||
}
|
||||
}
|
||||
@@ -121,14 +162,10 @@ public partial class RegionOverlayWindow : Window
|
||||
protected override void OnKeyDown(KeyEventArgs e)
|
||||
{
|
||||
base.OnKeyDown(e);
|
||||
if (e.Key == Key.Escape)
|
||||
var key = KeyInput.Binding(e);
|
||||
if (RegionKeyboard.Map(key, KeyboardStep) is not null)
|
||||
{
|
||||
Cancelled?.Invoke(this, EventArgs.Empty);
|
||||
e.Handled = true;
|
||||
}
|
||||
else if (e.Key == Key.Enter)
|
||||
{
|
||||
Completed?.Invoke(this, CurrentOrFullSelection());
|
||||
KeyPressed?.Invoke(this, key);
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
@@ -136,25 +173,42 @@ public partial class RegionOverlayWindow : Window
|
||||
private RegionSelection FullMonitor() =>
|
||||
new(_snapshot.Monitor, new PixelRect(0, 0, _snapshot.Monitor.Bounds.Width, _snapshot.Monitor.Bounds.Height));
|
||||
|
||||
private Point Clamp(Point point) =>
|
||||
new(Math.Clamp(point.X, 0, Root.ActualWidth), Math.Clamp(point.Y, 0, Root.ActualHeight));
|
||||
|
||||
/// <summary>DIP rectangle → physical pixels relative to the monitor, clamped to it.</summary>
|
||||
private PixelRect ToPixels(Rect rect)
|
||||
/// <summary>DIP position → physical pixel relative to the monitor, clamped to it.</summary>
|
||||
private (int X, int Y) ToPixels(Point point)
|
||||
{
|
||||
var dpi = VisualTreeHelper.GetDpi(this);
|
||||
var bounds = _snapshot.Monitor.Bounds;
|
||||
var x = (int)Math.Round(rect.X * dpi.DpiScaleX);
|
||||
var y = (int)Math.Round(rect.Y * dpi.DpiScaleY);
|
||||
var right = (int)Math.Round(rect.Right * dpi.DpiScaleX);
|
||||
var bottom = (int)Math.Round(rect.Bottom * dpi.DpiScaleY);
|
||||
return new PixelRect(x, y, right - x, bottom - y).Intersect(new PixelRect(0, 0, bounds.Width, bounds.Height));
|
||||
return (
|
||||
Math.Clamp((int)Math.Round(point.X * dpi.DpiScaleX), 0, bounds.Width),
|
||||
Math.Clamp((int)Math.Round(point.Y * dpi.DpiScaleY), 0, bounds.Height));
|
||||
}
|
||||
|
||||
/// <summary>Physical pixels relative to the monitor → DIP rectangle for drawing.</summary>
|
||||
private Rect ToDips(PixelRect rect)
|
||||
{
|
||||
var dpi = VisualTreeHelper.GetDpi(this);
|
||||
return new Rect(rect.X / dpi.DpiScaleX, rect.Y / dpi.DpiScaleY, rect.Width / dpi.DpiScaleX, rect.Height / dpi.DpiScaleY);
|
||||
}
|
||||
|
||||
/// <summary>Windows contrast theme: draw the selection and labels with the theme's colours.</summary>
|
||||
private void UseContrastColors()
|
||||
{
|
||||
SelectionBorder.Stroke = SystemColors.HighlightBrush;
|
||||
SelectionBorder.StrokeThickness = 2;
|
||||
foreach (var label in new[] { SizeLabel, Hint })
|
||||
{
|
||||
label.Background = SystemColors.WindowBrush;
|
||||
label.BorderBrush = SystemColors.WindowTextBrush;
|
||||
label.BorderThickness = new Thickness(1);
|
||||
}
|
||||
SizeText.Foreground = SystemColors.WindowTextBrush;
|
||||
HintText.Foreground = SystemColors.WindowTextBrush;
|
||||
}
|
||||
|
||||
private void UpdateVisuals()
|
||||
{
|
||||
var full = new Rect(0, 0, Root.ActualWidth, Root.ActualHeight);
|
||||
if (_selection is not { } rect || rect.Width <= 0 || rect.Height <= 0)
|
||||
if (_selection is not { IsEmpty: false } selection)
|
||||
{
|
||||
Shade.Data = new RectangleGeometry(full);
|
||||
SelectionBorder.Visibility = Visibility.Collapsed;
|
||||
@@ -162,6 +216,7 @@ public partial class RegionOverlayWindow : Window
|
||||
return;
|
||||
}
|
||||
|
||||
var rect = ToDips(selection);
|
||||
Shade.Data = new CombinedGeometry(GeometryCombineMode.Exclude, new RectangleGeometry(full), new RectangleGeometry(rect));
|
||||
SelectionBorder.Visibility = Visibility.Visible;
|
||||
Canvas.SetLeft(SelectionBorder, rect.X);
|
||||
@@ -169,8 +224,7 @@ public partial class RegionOverlayWindow : Window
|
||||
SelectionBorder.Width = rect.Width;
|
||||
SelectionBorder.Height = rect.Height;
|
||||
|
||||
var pixels = ToPixels(rect);
|
||||
SizeText.Text = string.Create(CultureInfo.InvariantCulture, $"{pixels.Width} × {pixels.Height}");
|
||||
SizeText.Text = string.Create(CultureInfo.InvariantCulture, $"{selection.Width} × {selection.Height}");
|
||||
SizeLabel.Visibility = Visibility.Visible;
|
||||
SizeLabel.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
|
||||
var labelTop = rect.Y - SizeLabel.DesiredSize.Height - 6;
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
<TextBlock
|
||||
x:Name="MessageText"
|
||||
Margin="0,2,0,0"
|
||||
AutomationProperties.LiveSetting="Polite"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Automation;
|
||||
using System.Windows.Automation.Peers;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Threading;
|
||||
using CaptureImage.Core.Models;
|
||||
using CaptureImage.UI.Accessibility;
|
||||
using CaptureImage.UI.Interop;
|
||||
using CaptureImage.UI.Localization;
|
||||
using Wpf.Ui.Controls;
|
||||
@@ -16,7 +16,8 @@ namespace CaptureImage.UI.Windows;
|
||||
|
||||
/// <summary>
|
||||
/// A notification pop-up for when the main window isn't in front: never activated (a click
|
||||
/// doesn't steal focus from a game) and excluded from screen capture.
|
||||
/// doesn't steal focus from a game) and excluded from screen capture. Screen readers get the
|
||||
/// text as a UI Automation notification when it appears.
|
||||
/// </summary>
|
||||
public partial class ToastWindow : Window
|
||||
{
|
||||
@@ -40,7 +41,8 @@ public partial class ToastWindow : Window
|
||||
{
|
||||
KindIcon.Foreground = accent;
|
||||
}
|
||||
AutomationProperties.SetName(this, string.IsNullOrEmpty(message) ? title : $"{title}. {message}");
|
||||
var announcement = Announcer.Compose(title, message);
|
||||
AutomationProperties.SetName(this, announcement);
|
||||
|
||||
_timer = new DispatcherTimer { Interval = timeout };
|
||||
_timer.Tick += (_, _) => Close();
|
||||
@@ -52,7 +54,7 @@ public partial class ToastWindow : Window
|
||||
Loaded += (_, _) =>
|
||||
{
|
||||
_timer.Start();
|
||||
UIElementAutomationPeer.FromElement(MessageText)?.RaiseAutomationEvent(AutomationEvents.LiveRegionChanged);
|
||||
Announcer.Announce(this, announcement, important: kind == ToastKind.Error);
|
||||
};
|
||||
Closed += (_, _) => _timer.Stop();
|
||||
}
|
||||
|
||||
@@ -19,27 +19,27 @@
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": {
|
||||
"type": "Direct",
|
||||
"requested": "[10.0.13, )",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "G2GrGWNAPZBsii2F6AU8n+JT2tC1/I0Ml/e9ZyNCgPjf3hZqronP7o0X91aAynCmVeae8KkSIUNXXeXCNRmdVQ=="
|
||||
"requested": "[10.0.14, )",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "QtpQzuSZVyTPCuHW058yCs9Nj0394uUkNyFHS813nOmK9UgUdBdaprJ5PPsBgsQIpxADTsTkbaMMonykem6qdw=="
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Abstractions": {
|
||||
"type": "Direct",
|
||||
"requested": "[10.0.13, )",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "aSZEhEig4fvNiw2zs8Z6NyDlniKtq6YjcF3DyHuqTEHcZ2VKA/6itMPZ+dW+yWABWExlDcQwwdbqX1Rcb7W8WQ==",
|
||||
"requested": "[10.0.14, )",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "SwcbEBtkECq3D2oywvHkm46fyrX9Dd2JPWphDnHUc2+cUWR1Mdo41atAjh/9iZjgQxuvbKfZKXqostT/LZfefA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13"
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14"
|
||||
}
|
||||
},
|
||||
"Microsoft.Windows.CsWin32": {
|
||||
"type": "Direct",
|
||||
"requested": "[0.3.363, )",
|
||||
"resolved": "0.3.363",
|
||||
"contentHash": "Fd1p6Fr5H6A+c4FO033CojR8jKsvYZm6vigrKvB/auI40KXb0Vb+ge0F6baGBZptc1yIKVxmh/Iu8/KvLVQ94A==",
|
||||
"requested": "[0.3.367, )",
|
||||
"resolved": "0.3.367",
|
||||
"contentHash": "C4JVE3wmVjCvzpdBzC+HK/boVU6g4ZRDEZ7uDmMJHCkgjFHhiMb9vhe2+wffzWzyNNObpCsIAW4G1t+1CAIEWw==",
|
||||
"dependencies": {
|
||||
"Microsoft.Windows.SDK.Win32Docs": "0.1.42-alpha",
|
||||
"Microsoft.Windows.SDK.Win32Metadata": "71.0.30-preview",
|
||||
"Microsoft.Windows.SDK.Win32Metadata": "71.0.37-preview",
|
||||
"Microsoft.Windows.WDK.Win32Metadata": "0.13.25-experimental"
|
||||
}
|
||||
},
|
||||
@@ -72,8 +72,8 @@
|
||||
},
|
||||
"Microsoft.Windows.SDK.Win32Metadata": {
|
||||
"type": "Transitive",
|
||||
"resolved": "71.0.30-preview",
|
||||
"contentHash": "h/FD+SrIlxgr+HD/WrJnLvpTdyWFAX7F0FCMPRxPJFTt4Qz70wGXKEBZvvIDX7om4hP0Tb7O0s1ND3aUvigL8g=="
|
||||
"resolved": "71.0.37-preview",
|
||||
"contentHash": "0y4uKnOzE+k2zUCxcTOJTOuRuOFiW01A+j1GpjyN11saEjkESLW9XrWkGYG/zdlAAb8oRk4oLdokkcx0X2z7yA=="
|
||||
},
|
||||
"Microsoft.Windows.WDK.Win32Metadata": {
|
||||
"type": "Transitive",
|
||||
@@ -91,16 +91,16 @@
|
||||
"captureimage.core": {
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Logging.Abstractions": "[10.0.13, )"
|
||||
"Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )"
|
||||
}
|
||||
},
|
||||
"captureimage.viewmodels": {
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"CaptureImage.Core": "[2.0.1, )",
|
||||
"CaptureImage.Core": "[2.1.0, )",
|
||||
"CommunityToolkit.Mvvm": "[8.4.2, )",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "[10.0.13, )",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "[10.0.13, )"
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "[10.0.14, )",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -17,25 +17,21 @@ public sealed record SponsorLink(string Name, Uri Url);
|
||||
/// <summary>
|
||||
/// About page: version, contact, links, sponsors, legal documents and third-party notices.
|
||||
/// </summary>
|
||||
public sealed partial class AboutViewModel : ViewModelBase
|
||||
public sealed partial class AboutViewModel(
|
||||
IShellService shell,
|
||||
ILocalizationService localization,
|
||||
AppInfo appInfo) : ViewModelBase
|
||||
{
|
||||
public const string RepositoryUrl = "https://github.com/poli0981/captureimg";
|
||||
public const string ContactEmail = "contact@poli0981.dev";
|
||||
public const string SponsorEmail = "sponsor@poli0981.dev";
|
||||
public const string LinksPageUrl = "https://poli0981.dev/links";
|
||||
|
||||
private readonly IShellService _shell;
|
||||
private readonly IShellService _shell = shell;
|
||||
|
||||
public AboutViewModel(IShellService shell, ILocalizationService localization, AppInfo appInfo)
|
||||
{
|
||||
_shell = shell;
|
||||
Localization = localization;
|
||||
AppInfo = appInfo;
|
||||
}
|
||||
public ILocalizationService Localization { get; } = localization;
|
||||
|
||||
public ILocalizationService Localization { get; }
|
||||
|
||||
public AppInfo AppInfo { get; }
|
||||
public AppInfo AppInfo { get; } = appInfo;
|
||||
|
||||
public string AppName => "CaptureImage";
|
||||
|
||||
|
||||
@@ -78,30 +78,30 @@ public sealed partial class DashboardViewModel : ViewModelBase, IDisposable
|
||||
public ObservableCollection<HotkeyStatusItem> Hotkeys { get; } = [];
|
||||
|
||||
[ObservableProperty]
|
||||
private string _searchText = string.Empty;
|
||||
public partial string SearchText { get; set; } = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyCanExecuteChangedFor(nameof(CaptureSelectedCommand), nameof(LockSelectedCommand), nameof(CreateProfileCommand))]
|
||||
private TargetItemViewModel? _selectedTarget;
|
||||
public partial TargetItemViewModel? SelectedTarget { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(HasNoTargets))]
|
||||
private bool _isLoading;
|
||||
public partial bool IsLoading { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _isArmed;
|
||||
public partial bool IsArmed { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _isBusy;
|
||||
public partial bool IsBusy { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string _statusText = string.Empty;
|
||||
public partial string StatusText { get; set; } = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string? _lockedTargetName;
|
||||
public partial string? LockedTargetName { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _hasHotkeyProblem;
|
||||
public partial bool HasHotkeyProblem { get; set; }
|
||||
|
||||
public bool HasNoTargets => !IsLoading && Targets.Count == 0;
|
||||
|
||||
|
||||
@@ -8,24 +8,18 @@ using CommunityToolkit.Mvvm.ComponentModel;
|
||||
namespace CaptureImage.ViewModels.Dashboard;
|
||||
|
||||
/// <summary>One capturable window in the Dashboard list. Updated in place on refresh.</summary>
|
||||
public sealed partial class TargetItemViewModel : ViewModelBase
|
||||
public sealed partial class TargetItemViewModel(GameTarget target, ILocalizationService localization) : ViewModelBase
|
||||
{
|
||||
private readonly ILocalizationService _localization;
|
||||
private readonly ILocalizationService _localization = localization;
|
||||
|
||||
[ObservableProperty]
|
||||
private GameTarget _target;
|
||||
public partial GameTarget Target { get; set; } = target;
|
||||
|
||||
[ObservableProperty]
|
||||
private string? _profileName;
|
||||
public partial string? ProfileName { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _isLocked;
|
||||
|
||||
public TargetItemViewModel(GameTarget target, ILocalizationService localization)
|
||||
{
|
||||
_target = target;
|
||||
_localization = localization;
|
||||
}
|
||||
public partial bool IsLocked { get; set; }
|
||||
|
||||
public nint WindowHandle => Target.WindowHandle;
|
||||
|
||||
|
||||
@@ -15,20 +15,14 @@ using Microsoft.Extensions.Logging;
|
||||
namespace CaptureImage.ViewModels.Library;
|
||||
|
||||
/// <summary>One saved capture in the Library grid. The thumbnail loads the first time the view asks for it.</summary>
|
||||
public sealed partial class CaptureItemViewModel : ViewModelBase
|
||||
public sealed partial class CaptureItemViewModel(CaptureRecord record, ICaptureLibrary library) : ViewModelBase
|
||||
{
|
||||
private const int ThumbnailSize = 320;
|
||||
private readonly ICaptureLibrary _library;
|
||||
private readonly ICaptureLibrary _library = library;
|
||||
private bool _thumbnailRequested;
|
||||
private string? _thumbnailPath;
|
||||
|
||||
public CaptureItemViewModel(CaptureRecord record, ICaptureLibrary library)
|
||||
{
|
||||
Record = record;
|
||||
_library = library;
|
||||
}
|
||||
|
||||
public CaptureRecord Record { get; }
|
||||
public CaptureRecord Record { get; } = record;
|
||||
|
||||
public string FileName => Record.FileName;
|
||||
|
||||
@@ -60,6 +54,11 @@ public sealed partial class CaptureItemViewModel : ViewModelBase
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Accessible name: file name, game, date and the HDR badge.</summary>
|
||||
public string AutomationName => string.Join(
|
||||
", ",
|
||||
new[] { FileName, Game, CapturedAtText, HasHdr ? "HDR" : null }.Where(part => !string.IsNullOrEmpty(part)));
|
||||
|
||||
public override string ToString() => FileName;
|
||||
|
||||
private async Task LoadThumbnailAsync()
|
||||
@@ -130,25 +129,25 @@ public sealed partial class LibraryViewModel : ViewModelBase, IDisposable
|
||||
public ObservableCollection<string> Games { get; } = [];
|
||||
|
||||
[ObservableProperty]
|
||||
private string _searchText = string.Empty;
|
||||
public partial string SearchText { get; set; } = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string? _selectedGame;
|
||||
public partial string? SelectedGame { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _hdrOnly;
|
||||
public partial bool HdrOnly { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyCanExecuteChangedFor(nameof(OpenCommand), nameof(RevealCommand), nameof(CopyImageCommand), nameof(CopyPathCommand),
|
||||
nameof(ExtractTextCommand), nameof(PinCommand), nameof(DeleteCommand), nameof(OpenHdrCommand))]
|
||||
private CaptureItemViewModel? _selectedItem;
|
||||
public partial CaptureItemViewModel? SelectedItem { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(IsEmpty))]
|
||||
private bool _isLoading;
|
||||
public partial bool IsLoading { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string _summaryText = string.Empty;
|
||||
public partial string SummaryText { get; set; } = string.Empty;
|
||||
|
||||
public bool IsEmpty => !IsLoading && Items.Count == 0;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace CaptureImage.ViewModels.Localization;
|
||||
/// this assembly. Drives live culture switching: XAML binds to the indexer, and every
|
||||
/// change raises <c>PropertyChanged("Item[]")</c> so all bindings refresh in place.
|
||||
/// </summary>
|
||||
public sealed partial class ResxLocalizationService : ILocalizationService
|
||||
public sealed partial class ResxLocalizationService(ILogger<ResxLocalizationService> logger) : ILocalizationService
|
||||
{
|
||||
private const string ResourceBaseName = "CaptureImage.ViewModels.Resources.Strings.Strings";
|
||||
|
||||
@@ -34,8 +34,8 @@ public sealed partial class ResxLocalizationService : ILocalizationService
|
||||
new("ru-RU"),
|
||||
};
|
||||
|
||||
private readonly ResourceManager _resourceManager;
|
||||
private readonly ILogger<ResxLocalizationService> _logger;
|
||||
private readonly ResourceManager _resourceManager = new(ResourceBaseName, typeof(ResxLocalizationService).Assembly);
|
||||
private readonly ILogger<ResxLocalizationService> _logger = logger;
|
||||
|
||||
/// <summary>
|
||||
/// Tracks <c>(culture, key)</c> pairs we've already logged a "missing string" warning for.
|
||||
@@ -44,14 +44,7 @@ public sealed partial class ResxLocalizationService : ILocalizationService
|
||||
/// </summary>
|
||||
private readonly ConcurrentDictionary<string, byte> _loggedMissingKeys = new();
|
||||
|
||||
private CultureInfo _currentCulture;
|
||||
|
||||
public ResxLocalizationService(ILogger<ResxLocalizationService> logger)
|
||||
{
|
||||
_resourceManager = new ResourceManager(ResourceBaseName, typeof(ResxLocalizationService).Assembly);
|
||||
_currentCulture = CultureInfo.GetCultureInfo("en-US");
|
||||
_logger = logger;
|
||||
}
|
||||
private CultureInfo _currentCulture = CultureInfo.GetCultureInfo("en-US");
|
||||
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
public event EventHandler? CultureChanged;
|
||||
|
||||
@@ -82,17 +82,17 @@ public sealed partial class LogViewerViewModel : ViewModelBase, IDisposable
|
||||
public IReadOnlyList<LocalizedOption<LogEntryLevel>> LevelOptions { get; }
|
||||
|
||||
[ObservableProperty]
|
||||
private LogEntryLevel _minimumLevel = LogEntryLevel.Verbose;
|
||||
public partial LogEntryLevel MinimumLevel { get; set; } = LogEntryLevel.Verbose;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _searchText = string.Empty;
|
||||
public partial string SearchText { get; set; } = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyCanExecuteChangedFor(nameof(CopySelectedCommand))]
|
||||
private LogEntry? _selectedEntry;
|
||||
public partial LogEntry? SelectedEntry { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _isPaused;
|
||||
public partial bool IsPaused { get; set; }
|
||||
|
||||
/// <summary>Set by the view; the list only tracks the buffer while the page is visible.</summary>
|
||||
public bool IsPageActive
|
||||
|
||||
@@ -13,34 +13,24 @@ namespace CaptureImage.ViewModels.Preview;
|
||||
/// "Save this capture?" window. <see cref="Result"/> completes with <c>true</c> (save) or
|
||||
/// <c>false</c> (discard — also when the window is closed).
|
||||
/// </summary>
|
||||
public sealed partial class PreviewViewModel : ViewModelBase
|
||||
public sealed partial class PreviewViewModel(
|
||||
CapturedFrame frame,
|
||||
string title,
|
||||
IOcrService ocr,
|
||||
IClipboardService clipboard,
|
||||
IToastService toasts,
|
||||
ILocalizationService localization) : ViewModelBase
|
||||
{
|
||||
private readonly IOcrService _ocr;
|
||||
private readonly IClipboardService _clipboard;
|
||||
private readonly IToastService _toasts;
|
||||
private readonly IOcrService _ocr = ocr;
|
||||
private readonly IClipboardService _clipboard = clipboard;
|
||||
private readonly IToastService _toasts = toasts;
|
||||
private readonly TaskCompletionSource<bool> _result = new(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
|
||||
public PreviewViewModel(
|
||||
CapturedFrame frame,
|
||||
string title,
|
||||
IOcrService ocr,
|
||||
IClipboardService clipboard,
|
||||
IToastService toasts,
|
||||
ILocalizationService localization)
|
||||
{
|
||||
Frame = frame;
|
||||
Title = title;
|
||||
_ocr = ocr;
|
||||
_clipboard = clipboard;
|
||||
_toasts = toasts;
|
||||
Localization = localization;
|
||||
}
|
||||
public ILocalizationService Localization { get; } = localization;
|
||||
|
||||
public ILocalizationService Localization { get; }
|
||||
public CapturedFrame Frame { get; } = frame;
|
||||
|
||||
public CapturedFrame Frame { get; }
|
||||
|
||||
public string Title { get; }
|
||||
public string Title { get; } = title;
|
||||
|
||||
public string Dimensions => $"{Frame.Width} × {Frame.Height}";
|
||||
|
||||
@@ -48,7 +38,7 @@ public sealed partial class PreviewViewModel : ViewModelBase
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyCanExecuteChangedFor(nameof(ExtractTextCommand))]
|
||||
private bool _isRecognizing;
|
||||
public partial bool IsRecognizing { get; set; }
|
||||
|
||||
[RelayCommand]
|
||||
private void Save() => _result.TrySetResult(true);
|
||||
|
||||
@@ -15,16 +15,13 @@ using CommunityToolkit.Mvvm.Messaging;
|
||||
namespace CaptureImage.ViewModels.Profiles;
|
||||
|
||||
/// <summary>One game profile in the list.</summary>
|
||||
public sealed partial class ProfileItemViewModel : ViewModelBase
|
||||
public sealed partial class ProfileItemViewModel(GameProfile profile, ILocalizationService localization) : ViewModelBase
|
||||
{
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(Name), nameof(MatchSummary), nameof(Enabled), nameof(AutoArm))]
|
||||
private GameProfile _profile;
|
||||
private readonly ILocalizationService _localization = localization;
|
||||
|
||||
public ProfileItemViewModel(GameProfile profile)
|
||||
{
|
||||
_profile = profile;
|
||||
}
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(Name), nameof(MatchSummary), nameof(Enabled), nameof(AutoArm), nameof(AutomationName))]
|
||||
public partial GameProfile Profile { get; set; } = profile;
|
||||
|
||||
public string Id => Profile.Id;
|
||||
|
||||
@@ -43,7 +40,21 @@ public sealed partial class ProfileItemViewModel : ViewModelBase
|
||||
|
||||
public bool AutoArm => Profile.AutoArm;
|
||||
|
||||
/// <summary>Accessible name: the name, what it matches and the badges shown next to it.</summary>
|
||||
public string AutomationName => string.Join(
|
||||
", ",
|
||||
new[]
|
||||
{
|
||||
Name,
|
||||
MatchSummary,
|
||||
AutoArm ? _localization["Profiles_AutoArmBadge"] : null,
|
||||
Enabled ? null : _localization["Profiles_DisabledBadge"],
|
||||
}.Where(part => !string.IsNullOrEmpty(part)));
|
||||
|
||||
public override string ToString() => Name;
|
||||
|
||||
/// <summary>Refresh localized text after a language switch.</summary>
|
||||
public void RefreshText() => OnPropertyChanged(nameof(AutomationName));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -104,43 +115,43 @@ public sealed partial class ProfilesViewModel : ViewModelBase, IRecipient<Create
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(HasSelection))]
|
||||
[NotifyCanExecuteChangedFor(nameof(DeleteCommand), nameof(BrowseExecutableCommand), nameof(BrowseOutputFolderCommand), nameof(ClearOutputFolderCommand))]
|
||||
private ProfileItemViewModel? _selectedProfile;
|
||||
public partial ProfileItemViewModel? SelectedProfile { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string _name = string.Empty;
|
||||
public partial string Name { get; set; } = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _enabled = true;
|
||||
public partial bool Enabled { get; set; } = true;
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(MatchesNothing))]
|
||||
private string _executablePath = string.Empty;
|
||||
public partial string ExecutablePath { get; set; } = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(MatchesNothing))]
|
||||
private string _executableName = string.Empty;
|
||||
public partial string ExecutableName { get; set; } = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(MatchesNothing), nameof(SteamAppIdInvalid))]
|
||||
private string _steamAppId = string.Empty;
|
||||
public partial string SteamAppId { get; set; } = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _outputDirectory = string.Empty;
|
||||
public partial string OutputDirectory { get; set; } = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _format = string.Empty;
|
||||
public partial string Format { get; set; } = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _fileNameTemplate = string.Empty;
|
||||
public partial string FileNameTemplate { get; set; } = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _hdrMode = string.Empty;
|
||||
public partial string HdrMode { get; set; } = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _autoArm;
|
||||
public partial bool AutoArm { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _lockTarget = true;
|
||||
public partial bool LockTarget { get; set; } = true;
|
||||
|
||||
public bool HasSelection => SelectedProfile is not null;
|
||||
|
||||
@@ -288,7 +299,7 @@ public sealed partial class ProfilesViewModel : ViewModelBase, IRecipient<Create
|
||||
|
||||
private void AddProfile(GameProfile profile)
|
||||
{
|
||||
var item = new ProfileItemViewModel(profile);
|
||||
var item = new ProfileItemViewModel(profile, Localization);
|
||||
Profiles.Add(item);
|
||||
Persist();
|
||||
SelectedProfile = item;
|
||||
@@ -321,7 +332,7 @@ public sealed partial class ProfilesViewModel : ViewModelBase, IRecipient<Create
|
||||
Profiles.Clear();
|
||||
foreach (var profile in profiles)
|
||||
{
|
||||
Profiles.Add(new ProfileItemViewModel(profile));
|
||||
Profiles.Add(new ProfileItemViewModel(profile, Localization));
|
||||
}
|
||||
SelectedProfile = Profiles.FirstOrDefault(p => p.Id == selectedId) ?? Profiles.FirstOrDefault();
|
||||
OnPropertyChanged(nameof(HasProfiles));
|
||||
@@ -341,6 +352,10 @@ public sealed partial class ProfilesViewModel : ViewModelBase, IRecipient<Create
|
||||
{
|
||||
LocalizedOption.RefreshAll(FormatOptions);
|
||||
LocalizedOption.RefreshAll(HdrOptions);
|
||||
foreach (var item in Profiles)
|
||||
{
|
||||
item.RefreshText();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
<data name="Error_TargetMinimized" xml:space="preserve"><value>النافذة مصغّرة. استعِدها ثم حاول مجددًا.</value></data>
|
||||
<data name="Error_Unknown" xml:space="preserve"><value>حدث خطأ ما. التفاصيل في السجل.</value></data>
|
||||
|
||||
<data name="Hotkey_AccessibleName" xml:space="preserve"><value>{0}، {1}</value></data>
|
||||
<data name="Hotkey_None" xml:space="preserve"><value>غير معيّن</value></data>
|
||||
<data name="Hotkey_PressKeys" xml:space="preserve"><value>اضغط المفاتيح…</value></data>
|
||||
<data name="Hotkey_ProblemMessage" xml:space="preserve"><value>يستخدم تطبيق آخر أحد مفاتيح اختصار الالتقاط، أو أن المجموعة غير صالحة. اختر مجموعة أخرى في الإعدادات.</value></data>
|
||||
@@ -211,7 +212,8 @@
|
||||
<data name="Profiles_UseGlobal" xml:space="preserve"><value>استخدام الإعداد العام</value></data>
|
||||
<data name="Profiles_UseGlobalButton" xml:space="preserve"><value>استخدام العام</value></data>
|
||||
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>اسحب لتحديد منطقة · انقر لالتقاط الشاشة كاملة · Esc للإلغاء</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>اسحب أو استخدم مفاتيح الأسهم لتحديد منطقة · Shift+الأسهم لتغيير الحجم · Ctrl: خطوات بمقدار بكسل واحد · Tab: الشاشة التالية · Enter للالتقاط · انقر، أو اضغط Enter دون تحديد، لالتقاط الشاشة كاملة · Esc للإلغاء</value></data>
|
||||
<data name="Region_Title" xml:space="preserve"><value>حدد منطقة</value></data>
|
||||
|
||||
<data name="Settings_AdvancedSection" xml:space="preserve"><value>متقدم</value></data>
|
||||
<data name="Settings_AppearanceSection" xml:space="preserve"><value>المظهر</value></data>
|
||||
@@ -248,11 +250,13 @@
|
||||
<data name="Settings_HdrOff" xml:space="preserve"><value>متوقف (SDR دائمًا)</value></data>
|
||||
<data name="Settings_HdrSection" xml:space="preserve"><value>HDR</value></data>
|
||||
<data name="Settings_HotkeyClear" xml:space="preserve"><value>مسح</value></data>
|
||||
<data name="Settings_HotkeyClearNamed" xml:space="preserve"><value>مسح مفتاح اختصار {0}</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>انقر على مفتاح اختصار ثم اضغط المجموعة الجديدة. Esc للإلغاء، وBackspace للمسح. تعمل مفاتيح الاختصار فقط أثناء التفعيل.</value></data>
|
||||
<data name="Settings_HotkeyMonitorDescription" xml:space="preserve"><value>يلتقط الشاشة الموجودة أسفل مؤشر الماوس.</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>تسجيل…</value></data>
|
||||
<data name="Settings_HotkeyRegionDescription" xml:space="preserve"><value>يجمّد كل الشاشات ويتيح لك سحب منطقة.</value></data>
|
||||
<data name="Settings_HotkeyReset" xml:space="preserve"><value>إعادة تعيين</value></data>
|
||||
<data name="Settings_HotkeyResetNamed" xml:space="preserve"><value>إعادة مفتاح اختصار {0} إلى الافتراضي</value></data>
|
||||
<data name="Settings_HotkeysSection" xml:space="preserve"><value>مفاتيح الاختصار</value></data>
|
||||
<data name="Settings_HotkeyWindowDescription" xml:space="preserve"><value>يلتقط النافذة المثبّتة، أو النافذة الموجودة في المقدمة.</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>استيراد…</value></data>
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
<data name="Error_TargetMinimized" xml:space="preserve"><value>Das Fenster ist minimiert. Wiederherstellen und erneut versuchen.</value></data>
|
||||
<data name="Error_Unknown" xml:space="preserve"><value>Etwas ist schiefgelaufen. Details stehen im Protokoll.</value></data>
|
||||
|
||||
<data name="Hotkey_AccessibleName" xml:space="preserve"><value>{0}, {1}</value></data>
|
||||
<data name="Hotkey_None" xml:space="preserve"><value>Nicht festgelegt</value></data>
|
||||
<data name="Hotkey_PressKeys" xml:space="preserve"><value>Tasten drücken…</value></data>
|
||||
<data name="Hotkey_ProblemMessage" xml:space="preserve"><value>Eine andere App verwendet eine der Aufnahme-Tastenkombinationen, oder die Kombination ist ungültig. In den Einstellungen eine andere wählen.</value></data>
|
||||
@@ -211,7 +212,8 @@
|
||||
<data name="Profiles_UseGlobal" xml:space="preserve"><value>Globale Einstellung verwenden</value></data>
|
||||
<data name="Profiles_UseGlobalButton" xml:space="preserve"><value>Global verwenden</value></data>
|
||||
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Ziehen, um einen Bereich auszuwählen · Klicken für den ganzen Bildschirm · Esc zum Abbrechen</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Ziehen oder mit den Pfeiltasten einen Bereich auswählen · Shift+Pfeiltasten ändern die Größe · Ctrl: Schritte von 1 Pixel · Tab: nächster Bildschirm · Enter zum Aufnehmen · Klicken oder Enter ohne Auswahl für den ganzen Bildschirm · Esc zum Abbrechen</value></data>
|
||||
<data name="Region_Title" xml:space="preserve"><value>Bereich auswählen</value></data>
|
||||
|
||||
<data name="Settings_AdvancedSection" xml:space="preserve"><value>Erweitert</value></data>
|
||||
<data name="Settings_AppearanceSection" xml:space="preserve"><value>Darstellung</value></data>
|
||||
@@ -248,11 +250,13 @@
|
||||
<data name="Settings_HdrOff" xml:space="preserve"><value>Aus (immer SDR)</value></data>
|
||||
<data name="Settings_HdrSection" xml:space="preserve"><value>HDR</value></data>
|
||||
<data name="Settings_HotkeyClear" xml:space="preserve"><value>Entfernen</value></data>
|
||||
<data name="Settings_HotkeyClearNamed" xml:space="preserve"><value>Tastenkombination für {0} entfernen</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>Auf eine Tastenkombination klicken und die neue Kombination drücken. Esc bricht ab, Rücktaste löscht. Tastenkombinationen funktionieren nur im scharfgeschalteten Zustand.</value></data>
|
||||
<data name="Settings_HotkeyMonitorDescription" xml:space="preserve"><value>Nimmt den Bildschirm unter dem Mauszeiger auf.</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>Aufzeichnen…</value></data>
|
||||
<data name="Settings_HotkeyRegionDescription" xml:space="preserve"><value>Friert alle Bildschirme ein und lässt Sie einen Bereich aufziehen.</value></data>
|
||||
<data name="Settings_HotkeyReset" xml:space="preserve"><value>Zurücksetzen</value></data>
|
||||
<data name="Settings_HotkeyResetNamed" xml:space="preserve"><value>Tastenkombination für {0} auf Standard zurücksetzen</value></data>
|
||||
<data name="Settings_HotkeysSection" xml:space="preserve"><value>Tastenkombinationen</value></data>
|
||||
<data name="Settings_HotkeyWindowDescription" xml:space="preserve"><value>Nimmt das festgelegte Fenster oder das Fenster im Vordergrund auf.</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>Importieren…</value></data>
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
<data name="Error_TargetMinimized" xml:space="preserve"><value>La ventana está minimizada. Restáurala e inténtalo de nuevo.</value></data>
|
||||
<data name="Error_Unknown" xml:space="preserve"><value>Algo salió mal. Consulta el registro para ver los detalles.</value></data>
|
||||
|
||||
<data name="Hotkey_AccessibleName" xml:space="preserve"><value>{0}, {1}</value></data>
|
||||
<data name="Hotkey_None" xml:space="preserve"><value>Sin asignar</value></data>
|
||||
<data name="Hotkey_PressKeys" xml:space="preserve"><value>Pulsa las teclas…</value></data>
|
||||
<data name="Hotkey_ProblemMessage" xml:space="preserve"><value>Otra aplicación usa una de las teclas rápidas de captura, o la combinación no es válida. Elige otra en Configuración.</value></data>
|
||||
@@ -211,7 +212,8 @@
|
||||
<data name="Profiles_UseGlobal" xml:space="preserve"><value>Usar la configuración general</value></data>
|
||||
<data name="Profiles_UseGlobalButton" xml:space="preserve"><value>Usar general</value></data>
|
||||
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Arrastra para seleccionar un área · Haz clic para toda la pantalla · Esc para cancelar</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Arrastra o usa las teclas de flecha para seleccionar un área · Shift+flechas cambian el tamaño · Ctrl: pasos de 1 píxel · Tab: siguiente pantalla · Enter para capturar · Haz clic, o pulsa Enter sin selección, para toda la pantalla · Esc para cancelar</value></data>
|
||||
<data name="Region_Title" xml:space="preserve"><value>Selecciona un área</value></data>
|
||||
|
||||
<data name="Settings_AdvancedSection" xml:space="preserve"><value>Avanzado</value></data>
|
||||
<data name="Settings_AppearanceSection" xml:space="preserve"><value>Apariencia</value></data>
|
||||
@@ -248,11 +250,13 @@
|
||||
<data name="Settings_HdrOff" xml:space="preserve"><value>Desactivado (siempre SDR)</value></data>
|
||||
<data name="Settings_HdrSection" xml:space="preserve"><value>HDR</value></data>
|
||||
<data name="Settings_HotkeyClear" xml:space="preserve"><value>Borrar</value></data>
|
||||
<data name="Settings_HotkeyClearNamed" xml:space="preserve"><value>Borrar la tecla rápida de {0}</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>Haz clic en una tecla rápida y pulsa la nueva combinación. Esc cancela y Retroceso la borra. Las teclas rápidas solo funcionan mientras están activadas.</value></data>
|
||||
<data name="Settings_HotkeyMonitorDescription" xml:space="preserve"><value>Captura la pantalla donde está el puntero del ratón.</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>Grabar…</value></data>
|
||||
<data name="Settings_HotkeyRegionDescription" xml:space="preserve"><value>Congela todas las pantallas y te deja arrastrar un área.</value></data>
|
||||
<data name="Settings_HotkeyReset" xml:space="preserve"><value>Restablecer</value></data>
|
||||
<data name="Settings_HotkeyResetNamed" xml:space="preserve"><value>Restablecer la tecla rápida de {0} al valor predeterminado</value></data>
|
||||
<data name="Settings_HotkeysSection" xml:space="preserve"><value>Teclas rápidas</value></data>
|
||||
<data name="Settings_HotkeyWindowDescription" xml:space="preserve"><value>Captura la ventana fijada o la que está en primer plano.</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>Importar…</value></data>
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
<data name="Error_TargetMinimized" xml:space="preserve"><value>La fenêtre est réduite. Restaurez-la et réessayez.</value></data>
|
||||
<data name="Error_Unknown" xml:space="preserve"><value>Une erreur s'est produite. Le journal contient les détails.</value></data>
|
||||
|
||||
<data name="Hotkey_AccessibleName" xml:space="preserve"><value>{0}, {1}</value></data>
|
||||
<data name="Hotkey_None" xml:space="preserve"><value>Non défini</value></data>
|
||||
<data name="Hotkey_PressKeys" xml:space="preserve"><value>Appuyez sur les touches…</value></data>
|
||||
<data name="Hotkey_ProblemMessage" xml:space="preserve"><value>Une autre application utilise l'un des raccourcis de capture, ou la combinaison n'est pas valide. Choisissez-en une autre dans les paramètres.</value></data>
|
||||
@@ -211,7 +212,8 @@
|
||||
<data name="Profiles_UseGlobal" xml:space="preserve"><value>Utiliser le paramètre global</value></data>
|
||||
<data name="Profiles_UseGlobalButton" xml:space="preserve"><value>Utiliser le global</value></data>
|
||||
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Faites glisser pour sélectionner une zone · Cliquez pour tout l'écran · Échap pour annuler</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Faites glisser ou utilisez les flèches pour sélectionner une zone · Maj+flèches pour redimensionner · Ctrl : pas de 1 pixel · Tab : écran suivant · Entrée pour capturer · Cliquez, ou appuyez sur Entrée sans sélection, pour tout l'écran · Échap pour annuler</value></data>
|
||||
<data name="Region_Title" xml:space="preserve"><value>Sélectionnez une zone</value></data>
|
||||
|
||||
<data name="Settings_AdvancedSection" xml:space="preserve"><value>Avancé</value></data>
|
||||
<data name="Settings_AppearanceSection" xml:space="preserve"><value>Apparence</value></data>
|
||||
@@ -248,11 +250,13 @@
|
||||
<data name="Settings_HdrOff" xml:space="preserve"><value>Désactivé (toujours SDR)</value></data>
|
||||
<data name="Settings_HdrSection" xml:space="preserve"><value>HDR</value></data>
|
||||
<data name="Settings_HotkeyClear" xml:space="preserve"><value>Effacer</value></data>
|
||||
<data name="Settings_HotkeyClearNamed" xml:space="preserve"><value>Effacer le raccourci « {0} »</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>Cliquez sur un raccourci, puis appuyez sur la nouvelle combinaison. Échap annule, Retour arrière efface. Les raccourcis ne fonctionnent que lorsqu'ils sont armés.</value></data>
|
||||
<data name="Settings_HotkeyMonitorDescription" xml:space="preserve"><value>Capture l'écran sous le pointeur de la souris.</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>Enregistrer…</value></data>
|
||||
<data name="Settings_HotkeyRegionDescription" xml:space="preserve"><value>Fige tous les écrans et vous laisse faire glisser une zone.</value></data>
|
||||
<data name="Settings_HotkeyReset" xml:space="preserve"><value>Réinitialiser</value></data>
|
||||
<data name="Settings_HotkeyResetNamed" xml:space="preserve"><value>Rétablir le raccourci « {0} » par défaut</value></data>
|
||||
<data name="Settings_HotkeysSection" xml:space="preserve"><value>Raccourcis</value></data>
|
||||
<data name="Settings_HotkeyWindowDescription" xml:space="preserve"><value>Capture la fenêtre verrouillée ou celle au premier plan.</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>Importer…</value></data>
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
<data name="Error_TargetMinimized" xml:space="preserve"><value>ウィンドウが最小化されています。元に戻してからもう一度お試しください。</value></data>
|
||||
<data name="Error_Unknown" xml:space="preserve"><value>問題が発生しました。詳細はログを確認してください。</value></data>
|
||||
|
||||
<data name="Hotkey_AccessibleName" xml:space="preserve"><value>{0}、{1}</value></data>
|
||||
<data name="Hotkey_None" xml:space="preserve"><value>未設定</value></data>
|
||||
<data name="Hotkey_PressKeys" xml:space="preserve"><value>キーを押してください…</value></data>
|
||||
<data name="Hotkey_ProblemMessage" xml:space="preserve"><value>別のアプリがキャプチャ用ホットキーを使用しているか、組み合わせが無効です。設定で別の組み合わせを選んでください。</value></data>
|
||||
@@ -211,7 +212,8 @@
|
||||
<data name="Profiles_UseGlobal" xml:space="preserve"><value>全体の設定を使用</value></data>
|
||||
<data name="Profiles_UseGlobalButton" xml:space="preserve"><value>全体設定に戻す</value></data>
|
||||
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>ドラッグで範囲を選択 · クリックで画面全体 · Esc でキャンセル</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>ドラッグまたは矢印キーで範囲を選択 · Shift+矢印でサイズ変更 · Ctrl で 1 ピクセルずつ · Tab で次の画面 · Enter でキャプチャ · クリック、または未選択で Enter を押すと画面全体 · Esc でキャンセル</value></data>
|
||||
<data name="Region_Title" xml:space="preserve"><value>範囲を選択</value></data>
|
||||
|
||||
<data name="Settings_AdvancedSection" xml:space="preserve"><value>詳細設定</value></data>
|
||||
<data name="Settings_AppearanceSection" xml:space="preserve"><value>外観</value></data>
|
||||
@@ -248,11 +250,13 @@
|
||||
<data name="Settings_HdrOff" xml:space="preserve"><value>オフ(常に SDR)</value></data>
|
||||
<data name="Settings_HdrSection" xml:space="preserve"><value>HDR</value></data>
|
||||
<data name="Settings_HotkeyClear" xml:space="preserve"><value>解除</value></data>
|
||||
<data name="Settings_HotkeyClearNamed" xml:space="preserve"><value>{0} のホットキーを解除</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>ホットキーをクリックして、新しい組み合わせを押します。Esc でキャンセル、Backspace で解除します。ホットキーは起動中のみ機能します。</value></data>
|
||||
<data name="Settings_HotkeyMonitorDescription" xml:space="preserve"><value>マウスポインターがある画面をキャプチャします。</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>録音…</value></data>
|
||||
<data name="Settings_HotkeyRegionDescription" xml:space="preserve"><value>すべての画面を静止させ、範囲をドラッグして選択できます。</value></data>
|
||||
<data name="Settings_HotkeyReset" xml:space="preserve"><value>リセット</value></data>
|
||||
<data name="Settings_HotkeyResetNamed" xml:space="preserve"><value>{0} のホットキーを既定に戻す</value></data>
|
||||
<data name="Settings_HotkeysSection" xml:space="preserve"><value>ホットキー</value></data>
|
||||
<data name="Settings_HotkeyWindowDescription" xml:space="preserve"><value>固定したウィンドウ、または前面のウィンドウをキャプチャします。</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>インポート…</value></data>
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
<data name="Error_TargetMinimized" xml:space="preserve"><value>창이 최소화되어 있습니다. 창을 복원한 후 다시 시도하세요.</value></data>
|
||||
<data name="Error_Unknown" xml:space="preserve"><value>문제가 발생했습니다. 자세한 내용은 로그를 확인하세요.</value></data>
|
||||
|
||||
<data name="Hotkey_AccessibleName" xml:space="preserve"><value>{0}, {1}</value></data>
|
||||
<data name="Hotkey_None" xml:space="preserve"><value>설정 안 됨</value></data>
|
||||
<data name="Hotkey_PressKeys" xml:space="preserve"><value>키를 누르세요…</value></data>
|
||||
<data name="Hotkey_ProblemMessage" xml:space="preserve"><value>다른 앱이 캡처 단축키를 사용 중이거나 키 조합이 올바르지 않습니다. 설정에서 다른 조합을 선택하세요.</value></data>
|
||||
@@ -211,7 +212,8 @@
|
||||
<data name="Profiles_UseGlobal" xml:space="preserve"><value>전체 설정 사용</value></data>
|
||||
<data name="Profiles_UseGlobalButton" xml:space="preserve"><value>전체 설정으로</value></data>
|
||||
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>드래그하여 영역 선택 · 클릭하면 전체 화면 · Esc로 취소</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>드래그하거나 화살표 키로 영역 선택 · Shift+화살표로 크기 조정 · Ctrl: 1픽셀씩 · Tab: 다음 화면 · Enter로 캡처 · 클릭하거나 선택 없이 Enter를 누르면 전체 화면 · Esc로 취소</value></data>
|
||||
<data name="Region_Title" xml:space="preserve"><value>영역 선택</value></data>
|
||||
|
||||
<data name="Settings_AdvancedSection" xml:space="preserve"><value>고급</value></data>
|
||||
<data name="Settings_AppearanceSection" xml:space="preserve"><value>모양</value></data>
|
||||
@@ -248,11 +250,13 @@
|
||||
<data name="Settings_HdrOff" xml:space="preserve"><value>끔(항상 SDR)</value></data>
|
||||
<data name="Settings_HdrSection" xml:space="preserve"><value>HDR</value></data>
|
||||
<data name="Settings_HotkeyClear" xml:space="preserve"><value>지우기</value></data>
|
||||
<data name="Settings_HotkeyClearNamed" xml:space="preserve"><value>{0} 단축키 지우기</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>단축키를 클릭한 다음 새 조합을 누르세요. Esc는 취소, Backspace는 지우기입니다. 단축키는 활성화된 동안에만 작동합니다.</value></data>
|
||||
<data name="Settings_HotkeyMonitorDescription" xml:space="preserve"><value>마우스 포인터가 있는 화면을 캡처합니다.</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>녹화…</value></data>
|
||||
<data name="Settings_HotkeyRegionDescription" xml:space="preserve"><value>모든 화면을 정지시키고 영역을 드래그해 선택할 수 있습니다.</value></data>
|
||||
<data name="Settings_HotkeyReset" xml:space="preserve"><value>재설정</value></data>
|
||||
<data name="Settings_HotkeyResetNamed" xml:space="preserve"><value>{0} 단축키를 기본값으로 재설정</value></data>
|
||||
<data name="Settings_HotkeysSection" xml:space="preserve"><value>단축키</value></data>
|
||||
<data name="Settings_HotkeyWindowDescription" xml:space="preserve"><value>고정한 창 또는 맨 앞의 창을 캡처합니다.</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>가져오기…</value></data>
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
<data name="Error_TargetMinimized" xml:space="preserve"><value>A janela está minimizada. Restaure-a e tente novamente.</value></data>
|
||||
<data name="Error_Unknown" xml:space="preserve"><value>Algo deu errado. Os detalhes estão no log.</value></data>
|
||||
|
||||
<data name="Hotkey_AccessibleName" xml:space="preserve"><value>{0}, {1}</value></data>
|
||||
<data name="Hotkey_None" xml:space="preserve"><value>Não definido</value></data>
|
||||
<data name="Hotkey_PressKeys" xml:space="preserve"><value>Pressione as teclas…</value></data>
|
||||
<data name="Hotkey_ProblemMessage" xml:space="preserve"><value>Outro aplicativo está usando um dos atalhos de captura, ou a combinação é inválida. Escolha outra em Configurações.</value></data>
|
||||
@@ -211,7 +212,8 @@
|
||||
<data name="Profiles_UseGlobal" xml:space="preserve"><value>Usar a configuração geral</value></data>
|
||||
<data name="Profiles_UseGlobalButton" xml:space="preserve"><value>Usar geral</value></data>
|
||||
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Arraste para selecionar uma área · Clique para a tela inteira · Esc para cancelar</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Arraste ou use as setas para selecionar uma área · Shift+setas redimensionam · Ctrl: passos de 1 pixel · Tab: próxima tela · Enter para capturar · Clique, ou pressione Enter sem seleção, para a tela inteira · Esc para cancelar</value></data>
|
||||
<data name="Region_Title" xml:space="preserve"><value>Selecione uma área</value></data>
|
||||
|
||||
<data name="Settings_AdvancedSection" xml:space="preserve"><value>Avançado</value></data>
|
||||
<data name="Settings_AppearanceSection" xml:space="preserve"><value>Aparência</value></data>
|
||||
@@ -248,11 +250,13 @@
|
||||
<data name="Settings_HdrOff" xml:space="preserve"><value>Desligado (sempre SDR)</value></data>
|
||||
<data name="Settings_HdrSection" xml:space="preserve"><value>HDR</value></data>
|
||||
<data name="Settings_HotkeyClear" xml:space="preserve"><value>Limpar</value></data>
|
||||
<data name="Settings_HotkeyClearNamed" xml:space="preserve"><value>Limpar o atalho de {0}</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>Clique em um atalho e pressione a nova combinação. Esc cancela e Backspace apaga. Os atalhos só funcionam enquanto estiverem armados.</value></data>
|
||||
<data name="Settings_HotkeyMonitorDescription" xml:space="preserve"><value>Captura a tela onde está o ponteiro do mouse.</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>Gravar…</value></data>
|
||||
<data name="Settings_HotkeyRegionDescription" xml:space="preserve"><value>Congela todas as telas e permite arrastar uma área.</value></data>
|
||||
<data name="Settings_HotkeyReset" xml:space="preserve"><value>Redefinir</value></data>
|
||||
<data name="Settings_HotkeyResetNamed" xml:space="preserve"><value>Restaurar o atalho de {0} para o padrão</value></data>
|
||||
<data name="Settings_HotkeysSection" xml:space="preserve"><value>Atalhos</value></data>
|
||||
<data name="Settings_HotkeyWindowDescription" xml:space="preserve"><value>Captura a janela fixada ou a que está na frente.</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>Importar…</value></data>
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
<data name="Error_TargetMinimized" xml:space="preserve"><value>The window is minimized. Restore it and try again.</value></data>
|
||||
<data name="Error_Unknown" xml:space="preserve"><value>Something went wrong. The log has the details.</value></data>
|
||||
|
||||
<data name="Hotkey_AccessibleName" xml:space="preserve"><value>{0}, {1}</value></data>
|
||||
<data name="Hotkey_None" xml:space="preserve"><value>Not set</value></data>
|
||||
<data name="Hotkey_PressKeys" xml:space="preserve"><value>Press keys…</value></data>
|
||||
<data name="Hotkey_ProblemMessage" xml:space="preserve"><value>Another app is using one of the capture hotkeys, or a combination is invalid. Pick a different one in Settings.</value></data>
|
||||
@@ -211,7 +212,8 @@
|
||||
<data name="Profiles_UseGlobal" xml:space="preserve"><value>Use the global setting</value></data>
|
||||
<data name="Profiles_UseGlobalButton" xml:space="preserve"><value>Use global</value></data>
|
||||
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Drag to select an area · Click for the whole screen · Esc to cancel</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Drag or use the arrow keys to select an area · Shift+arrows resize · Ctrl: 1-pixel steps · Tab: next screen · Enter to capture · Click, or Enter with nothing selected, for the whole screen · Esc to cancel</value></data>
|
||||
<data name="Region_Title" xml:space="preserve"><value>Select an area</value></data>
|
||||
|
||||
<data name="Settings_AdvancedSection" xml:space="preserve"><value>Advanced</value></data>
|
||||
<data name="Settings_AppearanceSection" xml:space="preserve"><value>Appearance</value></data>
|
||||
@@ -248,11 +250,13 @@
|
||||
<data name="Settings_HdrOff" xml:space="preserve"><value>Off (always SDR)</value></data>
|
||||
<data name="Settings_HdrSection" xml:space="preserve"><value>HDR</value></data>
|
||||
<data name="Settings_HotkeyClear" xml:space="preserve"><value>Clear</value></data>
|
||||
<data name="Settings_HotkeyClearNamed" xml:space="preserve"><value>Clear the {0} hotkey</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>Click a hotkey, then press the new combination. Esc cancels, Backspace clears. Hotkeys only work while armed.</value></data>
|
||||
<data name="Settings_HotkeyMonitorDescription" xml:space="preserve"><value>Captures the screen under the mouse pointer.</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>Record…</value></data>
|
||||
<data name="Settings_HotkeyRegionDescription" xml:space="preserve"><value>Freezes every screen and lets you drag an area.</value></data>
|
||||
<data name="Settings_HotkeyReset" xml:space="preserve"><value>Reset</value></data>
|
||||
<data name="Settings_HotkeyResetNamed" xml:space="preserve"><value>Reset the {0} hotkey to its default</value></data>
|
||||
<data name="Settings_HotkeysSection" xml:space="preserve"><value>Hotkeys</value></data>
|
||||
<data name="Settings_HotkeyWindowDescription" xml:space="preserve"><value>Captures the locked window, or the window in front.</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>Import…</value></data>
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
<data name="Error_TargetMinimized" xml:space="preserve"><value>Окно свёрнуто. Разверните его и повторите попытку.</value></data>
|
||||
<data name="Error_Unknown" xml:space="preserve"><value>Что-то пошло не так. Подробности в журнале.</value></data>
|
||||
|
||||
<data name="Hotkey_AccessibleName" xml:space="preserve"><value>{0}, {1}</value></data>
|
||||
<data name="Hotkey_None" xml:space="preserve"><value>Не задано</value></data>
|
||||
<data name="Hotkey_PressKeys" xml:space="preserve"><value>Нажмите клавиши…</value></data>
|
||||
<data name="Hotkey_ProblemMessage" xml:space="preserve"><value>Другое приложение использует одну из горячих клавиш снимков, или сочетание недопустимо. Выберите другое в настройках.</value></data>
|
||||
@@ -211,7 +212,8 @@
|
||||
<data name="Profiles_UseGlobal" xml:space="preserve"><value>Использовать общую настройку</value></data>
|
||||
<data name="Profiles_UseGlobalButton" xml:space="preserve"><value>Общая</value></data>
|
||||
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Выделите область · Щелчок — весь экран · Esc — отмена</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Выделите область мышью или клавишами со стрелками · Shift+стрелки — размер · Ctrl — шаг 1 пиксель · Tab — следующий экран · Enter — снимок · Щелчок или Enter без выделения — весь экран · Esc — отмена</value></data>
|
||||
<data name="Region_Title" xml:space="preserve"><value>Выделите область</value></data>
|
||||
|
||||
<data name="Settings_AdvancedSection" xml:space="preserve"><value>Дополнительно</value></data>
|
||||
<data name="Settings_AppearanceSection" xml:space="preserve"><value>Оформление</value></data>
|
||||
@@ -248,11 +250,13 @@
|
||||
<data name="Settings_HdrOff" xml:space="preserve"><value>Выкл. (всегда SDR)</value></data>
|
||||
<data name="Settings_HdrSection" xml:space="preserve"><value>HDR</value></data>
|
||||
<data name="Settings_HotkeyClear" xml:space="preserve"><value>Очистить</value></data>
|
||||
<data name="Settings_HotkeyClearNamed" xml:space="preserve"><value>Очистить горячую клавишу режима «{0}»</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>Нажмите на горячую клавишу, затем введите новое сочетание. Esc — отмена, Backspace — очистить. Горячие клавиши работают только после активации.</value></data>
|
||||
<data name="Settings_HotkeyMonitorDescription" xml:space="preserve"><value>Снимает экран, на котором находится указатель мыши.</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>Записать…</value></data>
|
||||
<data name="Settings_HotkeyRegionDescription" xml:space="preserve"><value>Замораживает все экраны и позволяет выделить область.</value></data>
|
||||
<data name="Settings_HotkeyReset" xml:space="preserve"><value>Сброс</value></data>
|
||||
<data name="Settings_HotkeyResetNamed" xml:space="preserve"><value>Вернуть горячую клавишу режима «{0}» по умолчанию</value></data>
|
||||
<data name="Settings_HotkeysSection" xml:space="preserve"><value>Горячие клавиши</value></data>
|
||||
<data name="Settings_HotkeyWindowDescription" xml:space="preserve"><value>Снимает закреплённое окно или окно на переднем плане.</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>Импорт…</value></data>
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
<data name="Error_TargetMinimized" xml:space="preserve"><value>Cửa sổ đang thu nhỏ. Hãy mở lại cửa sổ rồi thử lại.</value></data>
|
||||
<data name="Error_Unknown" xml:space="preserve"><value>Đã xảy ra lỗi. Xem chi tiết trong nhật ký.</value></data>
|
||||
|
||||
<data name="Hotkey_AccessibleName" xml:space="preserve"><value>{0}, {1}</value></data>
|
||||
<data name="Hotkey_None" xml:space="preserve"><value>Chưa đặt</value></data>
|
||||
<data name="Hotkey_PressKeys" xml:space="preserve"><value>Nhấn phím…</value></data>
|
||||
<data name="Hotkey_ProblemMessage" xml:space="preserve"><value>Một ứng dụng khác đang dùng hotkey chụp, hoặc tổ hợp phím không hợp lệ. Hãy chọn tổ hợp khác trong Cài đặt.</value></data>
|
||||
@@ -211,7 +212,8 @@
|
||||
<data name="Profiles_UseGlobal" xml:space="preserve"><value>Dùng cài đặt chung</value></data>
|
||||
<data name="Profiles_UseGlobalButton" xml:space="preserve"><value>Dùng chung</value></data>
|
||||
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Kéo để chọn vùng · Nhấp để chụp toàn màn hình · Esc để huỷ</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>Kéo hoặc dùng phím mũi tên để chọn vùng · Shift+mũi tên để đổi kích thước · Ctrl: bước 1 điểm ảnh · Tab: màn hình kế tiếp · Enter để chụp · Nhấp, hoặc Enter khi chưa chọn, để chụp toàn màn hình · Esc để huỷ</value></data>
|
||||
<data name="Region_Title" xml:space="preserve"><value>Chọn vùng</value></data>
|
||||
|
||||
<data name="Settings_AdvancedSection" xml:space="preserve"><value>Nâng cao</value></data>
|
||||
<data name="Settings_AppearanceSection" xml:space="preserve"><value>Hiển thị</value></data>
|
||||
@@ -248,11 +250,13 @@
|
||||
<data name="Settings_HdrOff" xml:space="preserve"><value>Tắt (luôn SDR)</value></data>
|
||||
<data name="Settings_HdrSection" xml:space="preserve"><value>HDR</value></data>
|
||||
<data name="Settings_HotkeyClear" xml:space="preserve"><value>Xoá</value></data>
|
||||
<data name="Settings_HotkeyClearNamed" xml:space="preserve"><value>Xoá hotkey {0}</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>Nhấn vào một hotkey rồi nhấn tổ hợp phím mới. Esc để huỷ, Backspace để xoá. Hotkey chỉ hoạt động khi đang sẵn sàng.</value></data>
|
||||
<data name="Settings_HotkeyMonitorDescription" xml:space="preserve"><value>Chụp màn hình đang có con trỏ chuột.</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>Ghi…</value></data>
|
||||
<data name="Settings_HotkeyRegionDescription" xml:space="preserve"><value>Đóng băng mọi màn hình để bạn kéo chọn một vùng.</value></data>
|
||||
<data name="Settings_HotkeyReset" xml:space="preserve"><value>Đặt lại</value></data>
|
||||
<data name="Settings_HotkeyResetNamed" xml:space="preserve"><value>Đặt hotkey {0} về mặc định</value></data>
|
||||
<data name="Settings_HotkeysSection" xml:space="preserve"><value>Hotkey</value></data>
|
||||
<data name="Settings_HotkeyWindowDescription" xml:space="preserve"><value>Chụp cửa sổ đã khoá, hoặc cửa sổ đang ở phía trước.</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>Nhập…</value></data>
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
<data name="Error_TargetMinimized" xml:space="preserve"><value>窗口已最小化。请还原后重试。</value></data>
|
||||
<data name="Error_Unknown" xml:space="preserve"><value>出现问题。详情请查看日志。</value></data>
|
||||
|
||||
<data name="Hotkey_AccessibleName" xml:space="preserve"><value>{0},{1}</value></data>
|
||||
<data name="Hotkey_None" xml:space="preserve"><value>未设置</value></data>
|
||||
<data name="Hotkey_PressKeys" xml:space="preserve"><value>请按键…</value></data>
|
||||
<data name="Hotkey_ProblemMessage" xml:space="preserve"><value>其他应用正在使用某个截图热键,或组合键无效。请在设置中选择其他组合键。</value></data>
|
||||
@@ -211,7 +212,8 @@
|
||||
<data name="Profiles_UseGlobal" xml:space="preserve"><value>使用全局设置</value></data>
|
||||
<data name="Profiles_UseGlobalButton" xml:space="preserve"><value>使用全局</value></data>
|
||||
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>拖动选择区域 · 单击截取整个屏幕 · Esc 取消</value></data>
|
||||
<data name="Region_DragHint" xml:space="preserve"><value>拖动或使用方向键选择区域 · Shift+方向键调整大小 · Ctrl:每次移动 1 像素 · Tab:下一个屏幕 · Enter 截取 · 单击,或未选择时按 Enter,截取整个屏幕 · Esc 取消</value></data>
|
||||
<data name="Region_Title" xml:space="preserve"><value>选择区域</value></data>
|
||||
|
||||
<data name="Settings_AdvancedSection" xml:space="preserve"><value>高级</value></data>
|
||||
<data name="Settings_AppearanceSection" xml:space="preserve"><value>外观</value></data>
|
||||
@@ -248,11 +250,13 @@
|
||||
<data name="Settings_HdrOff" xml:space="preserve"><value>关闭(始终 SDR)</value></data>
|
||||
<data name="Settings_HdrSection" xml:space="preserve"><value>HDR</value></data>
|
||||
<data name="Settings_HotkeyClear" xml:space="preserve"><value>清除</value></data>
|
||||
<data name="Settings_HotkeyClearNamed" xml:space="preserve"><value>清除{0}热键</value></data>
|
||||
<data name="Settings_HotkeyHint" xml:space="preserve"><value>单击某个热键,然后按下新的组合键。Esc 取消,Backspace 清除。热键仅在启动状态下生效。</value></data>
|
||||
<data name="Settings_HotkeyMonitorDescription" xml:space="preserve"><value>截取鼠标指针所在的屏幕。</value></data>
|
||||
<data name="Settings_HotkeyRecord" xml:space="preserve"><value>录制…</value></data>
|
||||
<data name="Settings_HotkeyRegionDescription" xml:space="preserve"><value>冻结所有屏幕,让你拖动选择一个区域。</value></data>
|
||||
<data name="Settings_HotkeyReset" xml:space="preserve"><value>重置</value></data>
|
||||
<data name="Settings_HotkeyResetNamed" xml:space="preserve"><value>将{0}热键恢复默认</value></data>
|
||||
<data name="Settings_HotkeysSection" xml:space="preserve"><value>热键</value></data>
|
||||
<data name="Settings_HotkeyWindowDescription" xml:space="preserve"><value>截取已锁定的窗口,或前台窗口。</value></data>
|
||||
<data name="Settings_Import" xml:space="preserve"><value>导入…</value></data>
|
||||
|
||||
@@ -15,54 +15,54 @@ namespace CaptureImage.ViewModels.Settings;
|
||||
/// capture hotkeys are released while recording so the combination reaches the recorder),
|
||||
/// and rejects invalid, duplicate or already-taken combinations with a message.
|
||||
/// </summary>
|
||||
public sealed partial class HotkeyBindingViewModel : ViewModelBase
|
||||
public sealed partial class HotkeyBindingViewModel(
|
||||
CaptureMode mode,
|
||||
ISettingsStore settings,
|
||||
CaptureCoordinator coordinator,
|
||||
IHotkeyService hotkeys,
|
||||
ILocalizationService localization) : ViewModelBase
|
||||
{
|
||||
private readonly ISettingsStore _settings;
|
||||
private readonly CaptureCoordinator _coordinator;
|
||||
private readonly IHotkeyService _hotkeys;
|
||||
private const uint VkTab = 0x09;
|
||||
private readonly ISettingsStore _settings = settings;
|
||||
private readonly CaptureCoordinator _coordinator = coordinator;
|
||||
private readonly IHotkeyService _hotkeys = hotkeys;
|
||||
private IDisposable? _suspension;
|
||||
|
||||
public HotkeyBindingViewModel(
|
||||
CaptureMode mode,
|
||||
ISettingsStore settings,
|
||||
CaptureCoordinator coordinator,
|
||||
IHotkeyService hotkeys,
|
||||
ILocalizationService localization)
|
||||
{
|
||||
Mode = mode;
|
||||
_settings = settings;
|
||||
_coordinator = coordinator;
|
||||
_hotkeys = hotkeys;
|
||||
Localization = localization;
|
||||
_binding = settings.Current.Hotkeys.Get(mode);
|
||||
}
|
||||
public ILocalizationService Localization { get; } = localization;
|
||||
|
||||
public ILocalizationService Localization { get; }
|
||||
|
||||
public CaptureMode Mode { get; }
|
||||
public CaptureMode Mode { get; } = mode;
|
||||
|
||||
public string ModeName => Localization[$"Mode_{Mode}"];
|
||||
|
||||
public string Description => Localization[$"Settings_Hotkey{Mode}Description"];
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(DisplayText), nameof(IsDefault))]
|
||||
private HotkeyBinding _binding;
|
||||
[NotifyPropertyChangedFor(nameof(DisplayText), nameof(AccessibleName), nameof(IsDefault))]
|
||||
public partial HotkeyBinding Binding { get; set; } = settings.Current.Hotkeys.Get(mode);
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(DisplayText))]
|
||||
private bool _isRecording;
|
||||
[NotifyPropertyChangedFor(nameof(DisplayText), nameof(AccessibleName))]
|
||||
public partial bool IsRecording { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string _message = string.Empty;
|
||||
public partial string Message { get; set; } = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _hasError;
|
||||
public partial bool HasError { get; set; }
|
||||
|
||||
public string DisplayText => IsRecording
|
||||
? Localization["Hotkey_PressKeys"]
|
||||
: Binding.IsUnbound ? Localization["Hotkey_None"] : Binding.ToString();
|
||||
|
||||
/// <summary>What a screen reader announces for the record button: the mode and its binding.</summary>
|
||||
public string AccessibleName => Localization.Format("Hotkey_AccessibleName", ModeName, DisplayText);
|
||||
|
||||
/// <summary>Accessible name of this row's Clear button (one per mode, so they differ).</summary>
|
||||
public string ClearName => Localization.Format("Settings_HotkeyClearNamed", ModeName);
|
||||
|
||||
/// <summary>Accessible name of this row's Reset button.</summary>
|
||||
public string ResetName => Localization.Format("Settings_HotkeyResetNamed", ModeName);
|
||||
|
||||
public bool IsDefault => Binding == HotkeyBinding.DefaultFor(Mode);
|
||||
|
||||
[RelayCommand]
|
||||
@@ -129,6 +129,22 @@ public sealed partial class HotkeyBindingViewModel : ViewModelBase
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tab and Shift+Tab move the keyboard focus instead of being recorded: recording is
|
||||
/// cancelled and <c>true</c> tells the recorder to let the key through. Without this a
|
||||
/// keyboard user would be stuck on the button, and Shift+Tab would become the hotkey.
|
||||
/// </summary>
|
||||
public bool ReleaseFocus(HotkeyModifiers modifiers, uint virtualKey)
|
||||
{
|
||||
if (!IsRecording || virtualKey != VkTab || (modifiers & ~HotkeyModifiers.Shift) != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
StopRecording();
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>Show the registration result while armed (conflicts appear after arming).</summary>
|
||||
public void ApplyRegistration(HotkeyRegistration? registration)
|
||||
{
|
||||
@@ -169,6 +185,9 @@ public sealed partial class HotkeyBindingViewModel : ViewModelBase
|
||||
OnPropertyChanged(nameof(ModeName));
|
||||
OnPropertyChanged(nameof(Description));
|
||||
OnPropertyChanged(nameof(DisplayText));
|
||||
OnPropertyChanged(nameof(AccessibleName));
|
||||
OnPropertyChanged(nameof(ClearName));
|
||||
OnPropertyChanged(nameof(ResetName));
|
||||
}
|
||||
|
||||
private bool TryCommit(HotkeyBinding candidate)
|
||||
|
||||
@@ -136,46 +136,46 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(IsJpeg), nameof(IsWebp), nameof(IsPng), nameof(FileNamePreview))]
|
||||
private ImageFormat _defaultFormat;
|
||||
public partial ImageFormat DefaultFormat { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private int _jpegQuality;
|
||||
public partial int JpegQuality { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private int _webpQuality;
|
||||
public partial int WebpQuality { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string _pngCompression = "Balanced";
|
||||
public partial string PngCompression { get; set; } = "Balanced";
|
||||
|
||||
/// <summary>Configured folder; empty means <see cref="DefaultOutputDirectory"/>.</summary>
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(EffectiveOutputDirectory), nameof(HasCustomOutputDirectory))]
|
||||
private string _outputDirectory = string.Empty;
|
||||
public partial string OutputDirectory { get; set; } = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(FileNamePreview))]
|
||||
private string _fileNameTemplate = FileNameStrategy.DefaultTemplate;
|
||||
public partial string FileNameTemplate { get; set; } = FileNameStrategy.DefaultTemplate;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _previewBeforeSave;
|
||||
public partial bool PreviewBeforeSave { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private int _countdownSeconds;
|
||||
public partial int CountdownSeconds { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string _clipboardMode = "None";
|
||||
public partial string ClipboardMode { get; set; } = "None";
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _includeCursor;
|
||||
public partial bool IncludeCursor { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _includeWindowFrame;
|
||||
public partial bool IncludeWindowFrame { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string _hdrMode = "Auto";
|
||||
public partial string HdrMode { get; set; } = "Auto";
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _saveHdrSidecar;
|
||||
public partial bool SaveHdrSidecar { get; set; }
|
||||
|
||||
public bool IsJpeg => DefaultFormat == ImageFormat.Jpeg;
|
||||
|
||||
@@ -202,37 +202,37 @@ public sealed partial class SettingsViewModel : ViewModelBase, IDisposable
|
||||
// ---- Behaviour, startup, appearance ---------------------------------------------
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _minimizeToTray;
|
||||
public partial bool MinimizeToTray { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _startMinimized;
|
||||
public partial bool StartMinimized { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _soundEnabled;
|
||||
public partial bool SoundEnabled { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _openFolderAfterSave;
|
||||
public partial bool OpenFolderAfterSave { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _autoPinAfterCapture;
|
||||
public partial bool AutoPinAfterCapture { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _showNotifications;
|
||||
public partial bool ShowNotifications { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _armOnStartup;
|
||||
public partial bool ArmOnStartup { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _startWithWindows;
|
||||
public partial bool StartWithWindows { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string _theme = "System";
|
||||
public partial string Theme { get; set; } = "System";
|
||||
|
||||
[ObservableProperty]
|
||||
private string _language = "en-US";
|
||||
public partial string Language { get; set; } = "en-US";
|
||||
|
||||
[ObservableProperty]
|
||||
private string _logLevel = "Information";
|
||||
public partial string LogLevel { get; set; } = "Information";
|
||||
|
||||
// ---- Commands ---------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -59,13 +59,13 @@ public sealed partial class ShellViewModel : ViewModelBase, IDisposable
|
||||
public string Subtitle => AppInfo.DisplayVersion;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _isArmed;
|
||||
public partial bool IsArmed { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _isBusy;
|
||||
public partial bool IsBusy { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string _trayToolTip = "CaptureImage";
|
||||
public partial string TrayToolTip { get; set; } = "CaptureImage";
|
||||
|
||||
public string ArmMenuText => IsArmed ? Localization["Tray_Disarm"] : Localization["Tray_Arm"];
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public sealed partial class UpdateViewModel : ViewModelBase, IDisposable
|
||||
Localization = localization;
|
||||
AppInfo = appInfo;
|
||||
_logger = logger;
|
||||
_status = updates.IsAvailable ? UpdateStatus.Idle : UpdateStatus.Unavailable;
|
||||
Status = updates.IsAvailable ? UpdateStatus.Idle : UpdateStatus.Unavailable;
|
||||
|
||||
_updates.LogEmitted += OnLogEmitted;
|
||||
Localization.PropertyChanged += OnLocalizationChanged;
|
||||
@@ -61,19 +61,19 @@ public sealed partial class UpdateViewModel : ViewModelBase, IDisposable
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(StatusText), nameof(IsWorking), nameof(ShowProgress), nameof(IsUpdateAvailable), nameof(IsReady), nameof(HasFailed))]
|
||||
[NotifyCanExecuteChangedFor(nameof(CheckCommand), nameof(DownloadCommand), nameof(InstallAndRestartCommand), nameof(CancelCommand))]
|
||||
private UpdateStatus _status;
|
||||
public partial UpdateStatus Status { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(StatusText))]
|
||||
private string? _availableVersion;
|
||||
public partial string? AvailableVersion { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(HasReleaseNotes))]
|
||||
private string? _releaseNotes;
|
||||
public partial string? ReleaseNotes { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(IsProgressIndeterminate))]
|
||||
private int _progress;
|
||||
public partial int Progress { get; set; }
|
||||
|
||||
public string StatusText => Status == UpdateStatus.UpdateAvailable
|
||||
? Localization.Format("Update_Status_UpdateAvailable", AvailableVersion ?? "?")
|
||||
|
||||
@@ -10,23 +10,23 @@
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": {
|
||||
"type": "Direct",
|
||||
"requested": "[10.0.13, )",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "G2GrGWNAPZBsii2F6AU8n+JT2tC1/I0Ml/e9ZyNCgPjf3hZqronP7o0X91aAynCmVeae8KkSIUNXXeXCNRmdVQ=="
|
||||
"requested": "[10.0.14, )",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "QtpQzuSZVyTPCuHW058yCs9Nj0394uUkNyFHS813nOmK9UgUdBdaprJ5PPsBgsQIpxADTsTkbaMMonykem6qdw=="
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Abstractions": {
|
||||
"type": "Direct",
|
||||
"requested": "[10.0.13, )",
|
||||
"resolved": "10.0.13",
|
||||
"contentHash": "aSZEhEig4fvNiw2zs8Z6NyDlniKtq6YjcF3DyHuqTEHcZ2VKA/6itMPZ+dW+yWABWExlDcQwwdbqX1Rcb7W8WQ==",
|
||||
"requested": "[10.0.14, )",
|
||||
"resolved": "10.0.14",
|
||||
"contentHash": "SwcbEBtkECq3D2oywvHkm46fyrX9Dd2JPWphDnHUc2+cUWR1Mdo41atAjh/9iZjgQxuvbKfZKXqostT/LZfefA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.13"
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14"
|
||||
}
|
||||
},
|
||||
"captureimage.core": {
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Logging.Abstractions": "[10.0.13, )"
|
||||
"Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
using System.Diagnostics;
|
||||
using AwesomeAssertions;
|
||||
using FlaUI.Core.AutomationElements;
|
||||
using FlaUI.Core.Definitions;
|
||||
using FlaUI.Core.Input;
|
||||
using FlaUI.Core.Tools;
|
||||
using FlaUI.Core.WindowsAPI;
|
||||
@@ -15,6 +16,7 @@ namespace CaptureImage.App.UiTests;
|
||||
public sealed class AppTests
|
||||
{
|
||||
private static readonly string[] Pages = ["Dashboard", "Library", "Profiles", "Settings", "Logs", "Update", "About"];
|
||||
private static readonly string[] CaptureModes = ["Window", "Region", "Monitor"];
|
||||
|
||||
[Fact]
|
||||
public void Starts_WithTheMainWindowAndDashboard()
|
||||
@@ -53,6 +55,56 @@ public sealed class AppTests
|
||||
Retry.WhileTrue(() => status.Name == idle, TimeSpan.FromSeconds(5)).Success.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Arm_AnnouncesTheNewStatusToScreenReaders()
|
||||
{
|
||||
using var session = AppSession.Start();
|
||||
var window = session.MainWindow();
|
||||
var status = AppSession.Find(window, "Dashboard_Status");
|
||||
using var announced = new ManualResetEventSlim();
|
||||
using var handler = window.RegisterAutomationEvent(
|
||||
session.Automation.EventLibrary.Element.LiveRegionChangedEvent,
|
||||
TreeScope.Subtree,
|
||||
(element, _) =>
|
||||
{
|
||||
if (element.Properties.AutomationId.ValueOrDefault == "Dashboard_Status")
|
||||
{
|
||||
announced.Set();
|
||||
}
|
||||
});
|
||||
|
||||
AppSession.Find(window, "Dashboard_ToggleArm").AsButton().Invoke();
|
||||
|
||||
announced.Wait(TimeSpan.FromSeconds(5), TestContext.Current.CancellationToken).Should().BeTrue("the status text is a live region");
|
||||
status.Name.Should().NotBeNullOrEmpty();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void HotkeyButtons_HaveDistinctNames_AndTabLeavesTheRecorder()
|
||||
{
|
||||
using var session = AppSession.Start("""{ "version": 3, "culture": "en-US" }""");
|
||||
var window = session.MainWindow();
|
||||
AppSession.Find(window, "Nav_Settings").Click();
|
||||
var record = AppSession.Find(window, "Hotkey_Window_Record").AsButton();
|
||||
|
||||
record.Name.Should().Contain("Ctrl+Shift+F12", "the name carries the current binding");
|
||||
var names = new List<string>();
|
||||
foreach (var mode in CaptureModes)
|
||||
{
|
||||
names.Add(AppSession.Find(window, $"Hotkey_{mode}_Clear").Name);
|
||||
names.Add(AppSession.Find(window, $"Hotkey_{mode}_Reset").Name);
|
||||
}
|
||||
names.Should().OnlyHaveUniqueItems();
|
||||
|
||||
record.Click();
|
||||
Keyboard.TypeSimultaneously(VirtualKeyShort.SHIFT, VirtualKeyShort.TAB);
|
||||
|
||||
Retry.WhileFalse(() => record.Name.Contains("Ctrl+Shift+F12", StringComparison.Ordinal), TimeSpan.FromSeconds(5))
|
||||
.Success.Should().BeTrue("Shift+Tab ends recording without changing the hotkey");
|
||||
record.Properties.HasKeyboardFocus.ValueOrDefault.Should().BeFalse("Shift+Tab moves the focus on");
|
||||
ReadSettings(session).Should().NotMatchRegex("\"virtualKey\": 9\\b", "Shift+Tab is never saved as a hotkey");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Language_SwitchesTheWholeUi()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,226 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Copyright (c) CaptureImage Contributors
|
||||
|
||||
using AwesomeAssertions;
|
||||
using CaptureImage.Core.Capture;
|
||||
using CaptureImage.Core.Models;
|
||||
using Xunit;
|
||||
|
||||
namespace CaptureImage.Core.Tests.Capture;
|
||||
|
||||
public class RegionKeyboardTests
|
||||
{
|
||||
private const uint Tab = 0x09;
|
||||
private const uint Enter = 0x0D;
|
||||
private const uint Escape = 0x1B;
|
||||
private const uint Left = 0x25;
|
||||
private const uint Up = 0x26;
|
||||
private const uint Right = 0x27;
|
||||
private const uint Down = 0x28;
|
||||
|
||||
private static readonly HotkeyModifiers CtrlShift = HotkeyModifiers.Control | HotkeyModifiers.Shift;
|
||||
|
||||
[Fact]
|
||||
public void SingleKeys_AreEscEnterTabAndShiftTab()
|
||||
{
|
||||
RegionKeyboard.SingleKeys.Should().Equal(
|
||||
new HotkeyBinding(HotkeyModifiers.None, Escape),
|
||||
new HotkeyBinding(HotkeyModifiers.None, Enter),
|
||||
new HotkeyBinding(HotkeyModifiers.None, Tab),
|
||||
new HotkeyBinding(HotkeyModifiers.Shift, Tab));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RepeatingKeys_AreTheArrowsWithEveryModifierCombination()
|
||||
{
|
||||
RegionKeyboard.RepeatingKeys.Should().HaveCount(16).And.OnlyHaveUniqueItems();
|
||||
RegionKeyboard.RepeatingKeys.Select(k => k.VirtualKey).Distinct().Should().BeEquivalentTo(new[] { Left, Up, Right, Down });
|
||||
RegionKeyboard.RepeatingKeys.Select(k => k.Modifiers).Distinct().Should().BeEquivalentTo(
|
||||
new[] { HotkeyModifiers.None, HotkeyModifiers.Shift, HotkeyModifiers.Control, CtrlShift });
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EveryRegisteredKey_MapsToACommand()
|
||||
{
|
||||
RegionKeyboard.SingleKeys.Concat(RegionKeyboard.RepeatingKeys)
|
||||
.Should().OnlyContain(key => RegionKeyboard.Map(key, 10) != null);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(HotkeyModifiers.None, Escape, RegionKeyAction.Cancel)]
|
||||
[InlineData(HotkeyModifiers.None, Enter, RegionKeyAction.Confirm)]
|
||||
[InlineData(HotkeyModifiers.None, Tab, RegionKeyAction.NextMonitor)]
|
||||
[InlineData(HotkeyModifiers.Shift, Tab, RegionKeyAction.PreviousMonitor)]
|
||||
public void Map_SingleKeys(HotkeyModifiers modifiers, uint key, RegionKeyAction expected)
|
||||
{
|
||||
RegionKeyboard.Map(new HotkeyBinding(modifiers, key), 10).Should().Be(new RegionKeyCommand(expected));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(HotkeyModifiers.None, Left, RegionKeyAction.Move, -10, 0)]
|
||||
[InlineData(HotkeyModifiers.None, Right, RegionKeyAction.Move, 10, 0)]
|
||||
[InlineData(HotkeyModifiers.None, Up, RegionKeyAction.Move, 0, -10)]
|
||||
[InlineData(HotkeyModifiers.None, Down, RegionKeyAction.Move, 0, 10)]
|
||||
[InlineData(HotkeyModifiers.Control, Left, RegionKeyAction.Move, -1, 0)]
|
||||
[InlineData(HotkeyModifiers.Shift, Right, RegionKeyAction.Resize, 10, 0)]
|
||||
[InlineData(HotkeyModifiers.Shift, Up, RegionKeyAction.Resize, 0, -10)]
|
||||
[InlineData(HotkeyModifiers.Control | HotkeyModifiers.Shift, Down, RegionKeyAction.Resize, 0, 1)]
|
||||
public void Map_Arrows(HotkeyModifiers modifiers, uint key, RegionKeyAction action, int dx, int dy)
|
||||
{
|
||||
RegionKeyboard.Map(new HotkeyBinding(modifiers, key), 10).Should().Be(new RegionKeyCommand(action, dx, dy));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Map_StepIsAtLeastOnePixel()
|
||||
{
|
||||
RegionKeyboard.Map(new HotkeyBinding(HotkeyModifiers.None, Right), 0).Should().Be(new RegionKeyCommand(RegionKeyAction.Move, 1, 0));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(HotkeyModifiers.Alt, Left)]
|
||||
[InlineData(HotkeyModifiers.Win, Up)]
|
||||
[InlineData(HotkeyModifiers.Control, Tab)]
|
||||
[InlineData(HotkeyModifiers.Shift, Escape)]
|
||||
[InlineData(HotkeyModifiers.Control, Enter)]
|
||||
[InlineData(HotkeyModifiers.None, 0x41u)] // A
|
||||
public void Map_OtherKeys_AreIgnored(HotkeyModifiers modifiers, uint key)
|
||||
{
|
||||
RegionKeyboard.Map(new HotkeyBinding(modifiers, key), 10).Should().BeNull();
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(1.0, 10)]
|
||||
[InlineData(1.5, 15)]
|
||||
[InlineData(1.25, 13)]
|
||||
[InlineData(0.01, 1)]
|
||||
public void StepFor_ScalesWithTheMonitor(double scale, int expected)
|
||||
{
|
||||
RegionKeyboard.StepFor(scale).Should().Be(expected);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Initial_IsHalfTheMonitorCentred()
|
||||
{
|
||||
RegionKeyboard.Initial(1920, 1080).Should().Be(new PixelRect(480, 270, 960, 540));
|
||||
RegionKeyboard.Initial(1, 1).Should().Be(new PixelRect(0, 0, 1, 1));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(RegionKeyAction.Move)]
|
||||
[InlineData(RegionKeyAction.Resize)]
|
||||
public void Apply_WithoutASelection_CreatesTheInitialOne(RegionKeyAction action)
|
||||
{
|
||||
var command = new RegionKeyCommand(action, 10, 0);
|
||||
|
||||
RegionKeyboard.Apply(null, command, 1920, 1080).Should().Be(new PixelRect(480, 270, 960, 540));
|
||||
RegionKeyboard.Apply(default(PixelRect), command, 1920, 1080).Should().Be(new PixelRect(480, 270, 960, 540));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(RegionKeyAction.Cancel)]
|
||||
[InlineData(RegionKeyAction.Confirm)]
|
||||
[InlineData(RegionKeyAction.NextMonitor)]
|
||||
[InlineData(RegionKeyAction.PreviousMonitor)]
|
||||
public void Apply_OtherCommands_KeepTheSelection(RegionKeyAction action)
|
||||
{
|
||||
var rect = new PixelRect(10, 20, 30, 40);
|
||||
|
||||
RegionKeyboard.Apply(rect, new RegionKeyCommand(action), 100, 100).Should().Be(rect);
|
||||
RegionKeyboard.Apply(null, new RegionKeyCommand(action), 100, 100).Should().BeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Apply_Move_ShiftsTheSelection()
|
||||
{
|
||||
RegionKeyboard.Apply(new PixelRect(10, 20, 30, 40), new RegionKeyCommand(RegionKeyAction.Move, 5, -5), 100, 100)
|
||||
.Should().Be(new PixelRect(15, 15, 30, 40));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-50, 0, 0, 20)]
|
||||
[InlineData(100, 0, 70, 20)]
|
||||
[InlineData(0, -50, 10, 0)]
|
||||
[InlineData(0, 100, 10, 60)]
|
||||
public void Apply_Move_StopsAtTheEdges(int dx, int dy, int x, int y)
|
||||
{
|
||||
RegionKeyboard.Apply(new PixelRect(10, 20, 30, 40), new RegionKeyCommand(RegionKeyAction.Move, dx, dy), 100, 100)
|
||||
.Should().Be(new PixelRect(x, y, 30, 40));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Apply_Move_OfAFullWidthSelection_KeepsItInPlace()
|
||||
{
|
||||
RegionKeyboard.Apply(new PixelRect(0, 0, 100, 100), new RegionKeyCommand(RegionKeyAction.Move, 10, 10), 100, 100)
|
||||
.Should().Be(new PixelRect(0, 0, 100, 100));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Apply_Resize_KeepsTheTopLeftCorner()
|
||||
{
|
||||
RegionKeyboard.Apply(new PixelRect(10, 20, 30, 40), new RegionKeyCommand(RegionKeyAction.Resize, 10, -10), 100, 100)
|
||||
.Should().Be(new PixelRect(10, 20, 40, 30));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(500, 500, 90, 80)]
|
||||
[InlineData(-500, -500, RegionKeyboard.MinimumSize, RegionKeyboard.MinimumSize)]
|
||||
public void Apply_Resize_StaysBetweenTheMinimumAndTheEdges(int dx, int dy, int width, int height)
|
||||
{
|
||||
RegionKeyboard.Apply(new PixelRect(10, 20, 30, 40), new RegionKeyCommand(RegionKeyAction.Resize, dx, dy), 100, 100)
|
||||
.Should().Be(new PixelRect(10, 20, width, height));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Apply_Resize_NextToTheEdge_NeverExceedsTheMonitor()
|
||||
{
|
||||
RegionKeyboard.Apply(new PixelRect(98, 98, 2, 2), new RegionKeyCommand(RegionKeyAction.Resize, -1, 5), 100, 100)
|
||||
.Should().Be(new PixelRect(98, 98, 2, 2));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Cycle_OrdersMonitorsLeftToRightThenTopToBottom()
|
||||
{
|
||||
// Enumeration order: centre, left, right-bottom, right-top.
|
||||
PixelRect[] monitors =
|
||||
[
|
||||
new(0, 0, 1920, 1080),
|
||||
new(-1920, 0, 1920, 1080),
|
||||
new(1920, 1080, 1920, 1080),
|
||||
new(1920, 0, 1920, 1080),
|
||||
];
|
||||
|
||||
RegionKeyboard.Cycle(monitors, 1, backwards: false).Should().Be(0);
|
||||
RegionKeyboard.Cycle(monitors, 0, backwards: false).Should().Be(3);
|
||||
RegionKeyboard.Cycle(monitors, 3, backwards: false).Should().Be(2);
|
||||
RegionKeyboard.Cycle(monitors, 2, backwards: false).Should().Be(1);
|
||||
RegionKeyboard.Cycle(monitors, 1, backwards: true).Should().Be(2);
|
||||
RegionKeyboard.Cycle(monitors, 0, backwards: true).Should().Be(1);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Cycle_WithOneMonitor_StaysThere()
|
||||
{
|
||||
RegionKeyboard.Cycle([new PixelRect(0, 0, 10, 10)], 0, backwards: false).Should().Be(0);
|
||||
RegionKeyboard.Cycle([new PixelRect(0, 0, 10, 10)], 0, backwards: true).Should().Be(0);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Cycle_UnknownIndex_StartsAtTheFirstMonitor()
|
||||
{
|
||||
RegionKeyboard.Cycle([new PixelRect(100, 0, 10, 10), new PixelRect(0, 0, 10, 10)], 7, backwards: false).Should().Be(1);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Cycle_NoMonitors_ReturnsTheCurrentIndex()
|
||||
{
|
||||
RegionKeyboard.Cycle([], 2, backwards: false).Should().Be(2);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Cycle_Null_Throws()
|
||||
{
|
||||
var act = () => RegionKeyboard.Cycle(null!, 0, backwards: false);
|
||||
|
||||
act.Should().Throw<ArgumentNullException>();
|
||||
}
|
||||
}
|
||||
@@ -20,16 +20,13 @@ internal sealed record EncodeCall(CapturedFrame Frame, ImageFormat Format, Encod
|
||||
/// two halves with <see cref="Midway"/> in between, so a failure there leaves a partially
|
||||
/// written file behind — exactly what the writer has to clean up.
|
||||
/// </summary>
|
||||
internal sealed class FakeImageEncoder : IImageEncoder
|
||||
/// <param name="supported">Format/pixel-format pairs to accept; empty means <see cref="DefaultSupport"/>.</param>
|
||||
internal sealed class FakeImageEncoder(
|
||||
params (ImageFormat Format, FramePixelFormat PixelFormat)[] supported) : IImageEncoder
|
||||
{
|
||||
private readonly ConcurrentQueue<EncodeCall> _calls = new();
|
||||
private readonly HashSet<(ImageFormat, FramePixelFormat)> _supported;
|
||||
|
||||
/// <param name="supported">Format/pixel-format pairs to accept; empty means <see cref="DefaultSupport"/>.</param>
|
||||
public FakeImageEncoder(params (ImageFormat Format, FramePixelFormat PixelFormat)[] supported)
|
||||
{
|
||||
_supported = supported.Length > 0 ? [.. supported] : [.. DefaultSupport];
|
||||
}
|
||||
private readonly HashSet<(ImageFormat, FramePixelFormat)> _supported =
|
||||
supported.Length > 0 ? [.. supported] : [.. DefaultSupport];
|
||||
|
||||
/// <summary>Every 8-bit output format, plus the JPEG XR sidecar from FP16.</summary>
|
||||
public static IReadOnlyList<(ImageFormat Format, FramePixelFormat PixelFormat)> DefaultSupport { get; } =
|
||||
|
||||
@@ -10,16 +10,11 @@ namespace CaptureImage.Core.Tests.TestSupport;
|
||||
/// wait until code under test is really blocked on <c>Task.Delay(…, timeProvider, …)</c>
|
||||
/// before advancing the clock, so no advance is ever lost to a race.
|
||||
/// </summary>
|
||||
internal sealed class SignalingTimeProvider : TimeProvider, IDisposable
|
||||
internal sealed class SignalingTimeProvider(DateTimeOffset start) : TimeProvider, IDisposable
|
||||
{
|
||||
private readonly SemaphoreSlim _timerCreated = new(0);
|
||||
|
||||
public SignalingTimeProvider(DateTimeOffset start)
|
||||
{
|
||||
Fake = new FakeTimeProvider(start);
|
||||
}
|
||||
|
||||
public FakeTimeProvider Fake { get; }
|
||||
public FakeTimeProvider Fake { get; } = new(start);
|
||||
|
||||
public override TimeZoneInfo LocalTimeZone => Fake.LocalTimeZone;
|
||||
|
||||
|
||||
Loaded 100 of 117 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user