5 Commits
Author SHA1 Message Date
rogierandCursor 36c55c034c 1.1.8
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-10 10:36:25 +01:00
rogier 136eda40ba systeemvak + icoon grootte 2026-11-09 22:42:35 +01:00
rogier 465ec9837b 1.1.6 2026-11-09 20:23:46 +01:00
rogier 2f5c434623 Update README.md 2026-11-09 18:14:33 +01:00
rogier 89b84d8479 1.1.5 2026-11-09 17:57:31 +01:00
37 changed files with 1342 additions and 577 deletions

No files matched your search

@@ -19,7 +19,7 @@ todos:
status: completed
- id: release
content: CHANGELOG 1.1.5-item, build.ps1 draaien, commit/tag 1.1.5 en pushen
status: in_progress
status: completed
isProject: false
---
+67 -16
View File
@@ -2,19 +2,59 @@
Alle noemenswaardige wijzigingen in kniip staan in dit bestand. De nieuwste versie staat bovenaan.
## 1.1.8 - 2026-11-10
### Nieuw
- **Drie-split-weergave.**\
Een derde indeling voor de editor: de gereedschappen staan boven, **Opslaan**, **Uploaden**, **Kopiëren** en de zoomknoppen onder, en **Nieuw** en **Screencast** in een smalle zijbalk naast het canvas. Kies de indeling in de instellingen onder **Weergave** > **Werkbalk**, of klik met rechts op een werkbalk en kies **Indeling**.
- De zijbalk staat links of rechts van het canvas. Kies de kant in de instellingen of via rechtsklik > **Zijbalk**.
- In de zijbalk staan alleen de iconen. Ctrl+H verbergt ook de zijbalk, en **Standaard herstellen** zet hem weer links.
## 1.1.7 - 2026-11-09
### Gewijzigd
- Het icoon in het systeemvak is groter en sluit aan bij de andere systeemvakpictogrammen.
- De tekst bij het icoon is nu **kniip**. Tijdens een opname staat daar **kniip - opname loopt**.
## 1.1.6 - 2026-11-09
### Nieuw
- **Donkere modus.**\
Kies in de instellingen onder **Weergave** > **Kleurmodus** tussen **Licht**, **Donker** en **Systeem**. Bij **Systeem** volgt kniip de app-modus van Windows (Instellingen > Persoonlijke instellingen > Kleuren) en wisselt mee zodra je die verandert.
- De kleurmodus geldt voor alle vensters: de editor, de instellingen, de geschiedenis, de screencastvensters, de meldingen en het systeemvakmenu. Ook de titelbalk wordt donker.
- Na **Opslaan** wisselen open vensters meteen mee. Je knipsel zelf verandert niet van kleur.
- **Licht** is de standaard, dus na de update ziet kniip er hetzelfde uit tot je iets anders kiest.
### Gewijzigd
- De tab **Editor** in de instellingen heet nu **Weergave**. Daar staan nu de kleurmodus, de markeerstift en de werkbalkindeling.
- De tab **Windows** heet nu **Systeem** en staat onder **Weergave**. De tabs **Knipsels** en **Nieuw knipsel** zijn opgegaan in de tab **Systeem**. Bovenaan staat de sectie **Knipprogramma** (klembord en map Schermafbeeldingen bewaken), daaronder **Bij een nieuw knipsel** en daarna **Windows-integratie**. De instellingen openen nu op de tab **Sneltoetsen**.
- Vinkjes en keuzerondjes in de instellingen hebben een nieuwe, rustigere stijl in de kleur van kniip.
### Opgelost
- De tekst in een tab van de instellingen was helemaal blauw en vet, net als de naam van de tab. Nu is alleen de tabnaam zo opgemaakt. De changelog in de tab **Update** volgt weer de markdown: gewone tekst normaal, koppen en **vet** alleen waar dat in de tekst staat.
## 1.1.5 - 2026-11-09
### Nieuw
- **Werkbalkindeling zoals ShareX.** De editor kan nu ook twee werkbalken tonen: bovenaan de gereedschappen met daaronder de eigenschappen (kleur, dikte, lijnstijl), en onderaan een balk met **Nieuw** en **Screencast** links, de zoomknoppen in het midden en **Instellingen**, **Opslaan**, **Uploaden** en **Kopiëren** rechts. Kies de indeling in de instellingen onder **Editor** > **Werkbalk**, of klik met rechts op een werkbalk en kies **Indeling**.
- **Split-weergave.**\
De editor kan nu ook twee werkbalken tonen. Bovenaan staan de gereedschappen in het midden, met **Instellingen** rechts en daaronder de eigenschappen (kleur, dikte, lijnstijl). Onderaan staan **Nieuw** en **Screencast** links, **Opslaan**, **Uploaden** en **Kopiëren** in het midden en de zoomknoppen rechts. Kies de indeling in de instellingen onder **Editor** > **Werkbalk**, of klik met rechts op een werkbalk en kies **Indeling**.
- In beide werkbalken kun je knoppen verslepen (na ontgrendelen) en verbergen, net als bij één werkbalk. Beide indelingen onthouden hun eigen volgorde.
- De standaardindeling blijft één werkbalk.
- **Vergrootglas bij het kiezen van een gebied.** Bij het knippen van een rechthoek en bij het kiezen van een opnamegebied voor een screencast loopt naast de muisaanwijzer een rond vergrootglas mee. Je ziet de pixels rond de aanwijzer vergroot met een raster en een blauwe kruisdraad, en daaronder de schermcoördinaten (X en Y). Zo zet je een hoek precies op de goede pixel. Bij **Venster knippen** verschijnt het vergrootglas niet.
- Split-weergave is de nieuwe standaard. Wil je de vertrouwde indeling terug, kies dan **Eén werkbalk**.
- **Vergrootglas bij het kiezen van een gebied.**\
Bij het knippen van een rechthoek en bij het kiezen van een opnamegebied voor een screencast loopt naast de muisaanwijzer een rond vergrootglas mee. Je ziet de pixels rond de aanwijzer vergroot met een raster en een blauwe kruisdraad, en daaronder de schermcoördinaten (X en Y). Zo zet je een hoek precies op de goede pixel. Bij **Venster knippen** verschijnt het vergrootglas niet.
- Het vergrootglas staat standaard aan. Wil je het niet, zet dan in de instellingen onder **Sneltoetsen** > **Gebied kiezen** het vinkje **Vergrootglas tonen bij het kiezen van een gebied** uit.
- **Schermafdruk vertraging.** In het systeemvakmenu staat **Schermafdruk vertraging: 0s**. Stel daar met de schuifbalk of het getalveld 0 tot 60 seconden in. **Rechthoek knippen** en **Venster knippen** wachten dan zo lang voordat het scherm bevriest, ook via de sneltoets. Zo kun je eerst een menu openklappen of een tooltip laten verschijnen.
- **Schermafdruk vertraging.**\
In het systeemvakmenu staat **Schermafdruk vertraging: 0s**. Stel daar met de schuifbalk of het getalveld 0 tot 60 seconden in. **Rechthoek knippen** en **Venster knippen** wachten dan zo lang voordat het scherm bevriest, ook via de sneltoets. Zo kun je eerst een menu openklappen of een tooltip laten verschijnen.
- Bij de muis telt een klein venster af. Dat venster komt zelf niet in het knipsel. Druk op Esc of klik op het venster om te annuleren.
- Bij 0 seconden knip je direct, zoals voorheen. Screencasts en de knop **Nieuw** in de editor wachten niet.
- **Geschiedenis.** kniip houdt nu bij wat je opslaat en uploadt: knipsels en screencasts, met het bestand en de link. Knipsels die je alleen kopieert of niet bewaart, komen er niet in. Het systeemvakmenu heeft vier nieuwe items:
- **Geschiedenis.**\
kniip houdt nu bij wat je opslaat en uploadt: knipsels en screencasts, met het bestand en de link. Knipsels die je alleen kopieert of niet bewaart, komen er niet in. Het systeemvakmenu heeft vier nieuwe items:
- **Map openen**, met de map Schermafbeeldingen, je knipselmap en je screencastmap.
- **Geschiedenis...** opent een lijst met datum, soort, naam, map en link. Je kunt zoeken op naam of link.
- **Afbeeldingsgeschiedenis...** opent hetzelfde venster met miniaturen. Ook een knipsel dat je alleen hebt geüpload heeft een miniatuur.
@@ -26,14 +66,17 @@ Alle noemenswaardige wijzigingen in kniip staan in dit bestand. De nieuwste vers
### Nieuw
- **Melding bij een nieuwe versie.** kniip kijkt bij het starten en daarna elke dag of er een nieuwere versie is. Is die er, dan staat er een blauwe stip op de knop **Instellingen** in de editor en op de tab **Update** in de instellingen. Wil je dat niet, zet dan in de tab **Update** het vinkje **Automatisch controleren op nieuwe versies** uit.
- **Uitgebreid rechtermuisknopmenu in de editor.** Klik met rechts op het canvas, ook op een leeg stuk, voor een menu met iconen en sneltoetsen. Wat op dat moment niet kan, staat grijs.
- **Melding bij een nieuwe versie.**\
kniip kijkt bij het starten en daarna elke dag of er een nieuwere versie is. Is die er, dan staat er een blauwe stip op de knop **Instellingen** in de editor en op de tab **Update** in de instellingen. Wil je dat niet, zet dan in de tab **Update** het vinkje **Automatisch controleren op nieuwe versies** uit.
- **Uitgebreid rechtermuisknopmenu in de editor.**\
Klik met rechts op het canvas, ook op een leeg stuk, voor een menu met iconen en sneltoetsen. Wat op dat moment niet kan, staat grijs.
- **Ongedaan maken** en **Opnieuw**.
- **Verwijder**, **Verwijder alles** (Shift+Delete, de afbeelding blijft staan) en **Samenvoegen** (Ctrl+Shift+F). Samenvoegen maakt de annotaties deel van de afbeelding en kun je ongedaan maken.
- **Knip** (Ctrl+X), **Kopieer** (Ctrl+Shift+C), **Plak** (Ctrl+V) en **Dupliceren** (Ctrl+D). Plak via het menu zet de annotatie op de plek waar je rechts klikte. Kopiëren en plakken werkt ook tussen twee editorvensters.
- **Naar voorgrond** (Home), **Naar voren** (PageUp), **Naar achteren** (PageDown) en **Naar achtergrond** (End).
- **Werkbalken verbergen** (Ctrl+H). Via hetzelfde menu of Ctrl+H haal je ze terug. Bij een nieuwe start zijn ze er altijd weer.
- **Lijnen en pijlen buigen.** Selecteer een lijn of pijl. Midden op elk stuk staat dan een klein rondje. Sleep dat rondje en het wordt een buigpunt. De lijn loopt daarna als vloeiende kromme door alle punten. Zo kun je zoveel buigpunten toevoegen als je wilt.
- **Lijnen en pijlen buigen.**\
Selecteer een lijn of pijl. Midden op elk stuk staat dan een klein rondje. Sleep dat rondje en het wordt een buigpunt. De lijn loopt daarna als vloeiende kromme door alle punten. Zo kun je zoveel buigpunten toevoegen als je wilt.
- Dubbelklik op een buigpunt om het weer te verwijderen.
- Bij een pijl draait de punt mee met de richting van het laatste stuk.
- Met Shift springen begin- en eindpunt in stappen van 45°, gemeten vanaf het buigpunt ernaast.
@@ -44,26 +87,31 @@ Alle noemenswaardige wijzigingen in kniip staan in dit bestand. De nieuwste vers
- kniip zoekt nu standaard zelf op de achtergrond naar updates. Tot nu toe gebeurde dat alleen als je de tab **Update** opende of op **Opnieuw controleren** klikte. Een mislukte controle, bijvoorbeeld zonder internet, geeft geen foutmelding.
- **Ctrl+V** plakt nu eerst een gekopieerde annotatie. Heb je daarna iets anders gekopieerd, dan opent Ctrl+V zoals voorheen de afbeelding van het klembord.
- Het rechtermuisknopmenu van de werkbalk heeft dezelfde nieuwe stijl gekregen.
- **Testversie naast kniip.** `build.ps1` maakt nu ook `KniipTest-<versie>.exe`. Die testversie heeft eigen instellingen en registervermeldingen, zodat hij naast de geïnstalleerde kniip kan draaien zonder die te raken. De testversie werkt zichzelf niet bij. Met `-SkipTest` sla je hem over.
- **Testversie naast kniip.**\
`build.ps1` maakt nu ook `KniipTest-<versie>.exe`. Die testversie heeft eigen instellingen en registervermeldingen, zodat hij naast de geïnstalleerde kniip kan draaien zonder die te raken. De testversie werkt zichzelf niet bij. Met `-SkipTest` sla je hem over.
## 1.1.3 - 2026-11-09
### Nieuw
- **Sneltoets voor het klembord.** In de tab **Sneltoetsen** kun je een combinatie zetten op **Vanaf klembord**. Die opent de afbeelding op het klembord in de editor. Standaard is er geen sneltoets. De gekozen combinatie staat ook bij **Bewerken vanaf klembord** in het systeemvakmenu.
- **Afbeelding naar de editor slepen.** Sleep een afbeeldingsbestand, of een afbeelding uit een ander programma, naar het kniip-venster. kniip vraagt daarna of je die afbeelding wilt openen, zodat een lopende bewerking niet zomaar verdwijnt.
- **Sneltoets voor het klembord.**\
In de tab **Sneltoetsen** kun je een combinatie zetten op **Vanaf klembord**. Die opent de afbeelding op het klembord in de editor. Standaard is er geen sneltoets. De gekozen combinatie staat ook bij **Bewerken vanaf klembord** in het systeemvakmenu.
- **Afbeelding naar de editor slepen.**\
Sleep een afbeeldingsbestand, of een afbeelding uit een ander programma, naar het kniip-venster. kniip vraagt daarna of je die afbeelding wilt openen, zodat een lopende bewerking niet zomaar verdwijnt.
## 1.1.2 - 2026-11-09
### Opgelost
- **Link kopiëren na uploaden.** Na het uploaden kon kniip de link soms niet op het klembord zetten en meldde dan dat het klembord bezet was. Dat gebeurde vooral als de klembordgeschiedenis van Windows (Win+V) of een ander klembordprogramma actief is. kniip zet de link nu op een directere manier op het klembord en probeert het langer opnieuw. Dit geldt ook voor het uploaden van screencasts en de test-upload in de instellingen.
- **Link kopiëren na uploaden.**\
Na het uploaden kon kniip de link soms niet op het klembord zetten en meldde dan dat het klembord bezet was. Dat gebeurde vooral als de klembordgeschiedenis van Windows (Win+V) of een ander klembordprogramma actief is. kniip zet de link nu op een directere manier op het klembord en probeert het langer opnieuw. Dit geldt ook voor het uploaden van screencasts en de test-upload in de instellingen.
## 1.1.1 - 2026-11-09
### Gewijzigd
- **Instellingen zonder scrollbalk.** Het instellingenvenster is iets hoger geworden, zodat elke tab, ook **Opslaan** met de nieuwe naamvelden, in één keer past. De changelog in de tab **Update** heeft daardoor ook meer ruimte.
- **Instellingen zonder scrollbalk.**\
Het instellingenvenster is iets hoger geworden, zodat elke tab, ook **Opslaan** met de nieuwe naamvelden, in één keer past. De changelog in de tab **Update** heeft daardoor ook meer ruimte.
### Opgelost
@@ -73,11 +121,13 @@ Alle noemenswaardige wijzigingen in kniip staan in dit bestand. De nieuwste vers
### Nieuw
- **Updaten vanuit kniip.** In de instellingen staat een nieuwe tab **Update**. kniip kijkt op git.hibbit.net of er een nieuwere versie is en toont de wijzigingen van alle nieuwere versies, netjes opgemaakt. Met **Updaten** downloadt kniip de installer, sluit zichzelf af, installeert de nieuwe versie op de achtergrond en start daarna opnieuw. Je eerder gekozen instellingen, zoals starten met Windows en 'Openen met', blijven staan.
- **Updaten vanuit kniip.**\
In de instellingen staat een nieuwe tab **Update**. kniip kijkt op git.hibbit.net of er een nieuwere versie is en toont de wijzigingen van alle nieuwere versies, netjes opgemaakt. Met **Updaten** downloadt kniip de installer, sluit zichzelf af, installeert de nieuwe versie op de achtergrond en start daarna opnieuw. Je eerder gekozen instellingen, zoals starten met Windows en 'Openen met', blijven staan.
- Na een update meldt kniip in het systeemvak naar welke versie het is bijgewerkt.
- Er wordt alleen gecontroleerd als je de tab opent of op **Opnieuw controleren** klikt; kniip zoekt niet zelf op de achtergrond naar updates.
- Loopt er nog een screencast, of wil je een open knipsel eerst opslaan, dan wacht de update tot dat klaar is.
- **Naamsjabloon voor opslaan.** In de tab **Opslaan** stel je per soort (knipsels en screencasts) zelf in hoe bestanden heten. Je kunt deze codes gebruiken:
- **Naamsjabloon voor opslaan.**\
In de tab **Opslaan** stel je per soort (knipsels en screencasts) zelf in hoe bestanden heten. Je kunt deze codes gebruiken:
- `%J` jaar, `%M` maand en `%D` dag (bijvoorbeeld `2026`, `11`, `09`)
- `%V` de naam van het programma waarvan je een knipsel of opname maakt, bijvoorbeeld `chrome`
- `%R6` zes willekeurige letters en cijfers
@@ -85,7 +135,8 @@ Alle noemenswaardige wijzigingen in kniip staan in dit bestand. De nieuwste vers
- `/` maakt een submap; kniip maakt die mappen zelf aan.
Zo wordt `%J/%M-%D/%V_%N3` bijvoorbeeld `2026/11-09/chrome_001.png`. Onder het veld zie je meteen een voorbeeld. De extensie (`.png`, `.mp4` of `.gif`) zet kniip er zelf achter. Laat je het veld leeg, dan blijft de vertrouwde naam staan: `Knipsel` of `Screencast` met datum en tijd.
- **Autostart-vermelding opruimen.** Heb je kniip ooit als losse exe gestart, dan kan er een vermelding in **Instellingen > Apps > Opstarten** achterblijven. Met `tools\remove-autostart.cmd` haal je die weg. Beheerdersrechten zijn daarvoor niet nodig.
- **Autostart-vermelding opruimen.**\
Heb je kniip ooit als losse exe gestart, dan kan er een vermelding in **Instellingen > Apps > Opstarten** achterblijven. Met `tools\remove-autostart.cmd` haal je die weg. Beheerdersrechten zijn daarvoor niet nodig.
### Gewijzigd
+15 -5
View File
@@ -5,11 +5,11 @@
<h1 align="center">kniip</h1>
<p align="center">
Annotatie-editor naast het Windows Knipprogramma
<b>kniip</b> is een uitgebreide annotatie-editor voor Windows. Leg iets op je scherm vast, maak het duidelijk met annotaties en deel het als afbeelding, video, GIF of link.
</p>
<p align="center">
<a href="https://git.hibbit.net/rogier/kniip/releases"><strong>Download de installer</strong></a>
<a href="https://git.hibbit.net/rogier/kniip/releases"><strong>Download: kniip</strong></a>
</p>
---
@@ -17,14 +17,24 @@
kniip is een annotatie-editor die naast het Windows Knipprogramma werkt. Maak een schermafbeelding, voeg pijlen, tekst, markeringen, stappen, emoji of vervaging toe en sla het resultaat op, kopieer het of upload het. kniip kan ook schermopnames maken en die exporteren als video of GIF.
<p align="center">
<a href="screenshot/knipp.png"><img src="screenshot/knipp.png" alt="Screenshot van de kniip-editor" width="720"></a>
<a href="screenshot/kniip.png"><img src="screenshot/kniip.png" alt="Screenshot van de kniip-editor" width="720"></a>
</p>
## Wat kan kniip?
- **Knippen tot op de pixel.** Rechthoek of venster, met een vergrootglas voor precieze hoeken en een instelbare vertraging om eerst een menu of tooltip te openen.
- **Aantekenen.** Pijlen en lijnen die je kunt buigen, tekst, vormen, genummerde stappen, markeerstift, emoji en vervaging.
- **Screencasts.** Neem een deel van je scherm op en exporteer als video of GIF.
- **Delen.** Opslaan, kopiëren naar het klembord of uploaden en de link meteen delen.
- **Geschiedenis.** Vind eerdere knipsels en uploads terug, met miniaturen en zoeken.
- **Jouw werkbalk.** Kies een of twee werkbalken, versleep knoppen en verberg wat je niet gebruikt.
- **Altijd bij.** kniip meldt zelf wanneer er een nieuwe versie is en werkt zichzelf bij met een klik.
## Downloaden
| Versie | Installer |
| ------ | --------- |
| 1.1.5 | [Kniip-Setup-1.1.5.exe](https://git.hibbit.net/rogier/kniip/releases/download/1.1.5/Kniip-Setup-1.1.5.exe) |
| 1.1.8 | [Kniip-Setup-1.1.8.exe](https://git.hibbit.net/rogier/kniip/releases/download/1.1.8/Kniip-Setup-1.1.8.exe) |
Oudere versies vind je bij [alle releases](https://git.hibbit.net/rogier/kniip/releases).
@@ -70,7 +80,7 @@ Vereisten:
Bouwen:
```powershell
.\build.ps1 # versie 1.1.5
.\build.ps1 # versie 1.1.8
.\build.ps1 -Version 1.2.0 # andere versie
```
+1 -1
View File
@@ -12,7 +12,7 @@
# .\build.ps1 -SkipTest -> zonder testexe
param(
[string]$Version = "1.1.5",
[string]$Version = "1.1.8",
[string]$Runtime = "win-x64",
[switch]$SkipTest
)
+1 -1
View File
@@ -5,7 +5,7 @@
#define AppName "kniip"
#define AppExe "Kniip.exe"
#ifndef AppVersion
#define AppVersion "1.1.5"
#define AppVersion "1.1.8"
#endif
#ifndef PublishDir
#define PublishDir "..\artifacts\publish"
Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

+443 -368
View File
@@ -3,387 +3,462 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
ShutdownMode="OnExplicitShutdown">
<Application.Resources>
<SolidColorBrush x:Key="AccentBrush" Color="#0067C0" />
<SolidColorBrush x:Key="AccentHoverBrush" Color="#1975C5" />
<SolidColorBrush x:Key="AccentPressedBrush" Color="#3183CA" />
<SolidColorBrush x:Key="WindowBrush" Color="#F3F3F3" />
<SolidColorBrush x:Key="ToolbarBrush" Color="#F9F9F9" />
<SolidColorBrush x:Key="HoverBrush" Color="#0F000000" />
<SolidColorBrush x:Key="PressedBrush" Color="#18000000" />
<SolidColorBrush x:Key="CheckedBrush" Color="#FFFFFF" />
<SolidColorBrush x:Key="DividerBrush" Color="#E5E5E5" />
<SolidColorBrush x:Key="InkBrush" Color="#1A1A1A" />
<SolidColorBrush x:Key="SubtleTextBrush" Color="#5C5C5C" />
<FontFamily x:Key="IconFont">Segoe Fluent Icons, Segoe MDL2 Assets</FontFamily>
<ResourceDictionary>
<!-- Kleuren: ThemeManager wisselt deze tussen Themes/Light.xaml en Themes/Dark.xaml; gebruik ze via DynamicResource -->
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Themes/Light.xaml" />
</ResourceDictionary.MergedDictionaries>
<FontFamily x:Key="IconFont">Segoe Fluent Icons, Segoe MDL2 Assets</FontFamily>
<Style TargetType="ToolTip">
<Setter Property="FontFamily" Value="Segoe UI" />
</Style>
<Style TargetType="ToolTip">
<Setter Property="FontFamily" Value="Segoe UI" />
</Style>
<Style x:Key="FlatButton" TargetType="ButtonBase">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Foreground" Value="{StaticResource InkBrush}" />
<Setter Property="Padding" Value="8,5" />
<Setter Property="MinWidth" Value="36" />
<Setter Property="MinHeight" Value="34" />
<Setter Property="Margin" Value="1,0" />
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="FontSize" Value="13" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ButtonBase">
<Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4" Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="True">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{StaticResource HoverBrush}" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{StaticResource PressedBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.35" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ProminentButton" TargetType="Button" BasedOn="{StaticResource FlatButton}">
<Setter Property="Background" Value="#ECECEC" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4" Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="True">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#E0E0E0" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#D4D4D4" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.35" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ToolToggle" TargetType="ToggleButton" BasedOn="{StaticResource FlatButton}">
<Setter Property="Padding" Value="6,4" />
<Setter Property="MinWidth" Value="38" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Grid>
<Style x:Key="FlatButton" TargetType="ButtonBase">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Foreground" Value="{DynamicResource InkBrush}" />
<Setter Property="Padding" Value="8,5" />
<Setter Property="MinWidth" Value="36" />
<Setter Property="MinHeight" Value="34" />
<Setter Property="Margin" Value="1,0" />
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="FontSize" Value="13" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ButtonBase">
<Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1" CornerRadius="4" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4" Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="True">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<Border x:Name="Indicator" Height="3" Width="16" CornerRadius="1.5" Background="{StaticResource AccentBrush}"
VerticalAlignment="Bottom" Margin="0,0,0,2" Visibility="Collapsed" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{StaticResource HoverBrush}" />
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{StaticResource CheckedBrush}" />
<Setter TargetName="Bd" Property="BorderBrush" Value="#E0E0E0" />
<Setter TargetName="Indicator" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{StaticResource PressedBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.35" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource HoverBrush}" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource PressedBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.35" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="AccentButton" TargetType="Button">
<Setter Property="Foreground" Value="White" />
<Setter Property="Background" Value="{StaticResource AccentBrush}" />
<Setter Property="Padding" Value="14,6" />
<Setter Property="MinHeight" Value="32" />
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="FontSize" Value="13" />
<Setter Property="Margin" Value="4,0" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Bd" Background="{TemplateBinding Background}" CornerRadius="4" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{StaticResource AccentHoverBrush}" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{StaticResource AccentPressedBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.45" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ProminentButton" TargetType="Button" BasedOn="{StaticResource FlatButton}">
<Setter Property="Background" Value="{DynamicResource ProminentBrush}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4" Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="True">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ProminentHoverBrush}" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ProminentPressedBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.35" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SecondaryButton" TargetType="Button" BasedOn="{StaticResource FlatButton}">
<Setter Property="Background" Value="White" />
<Setter Property="BorderBrush" Value="#D6D6D6" />
<Setter Property="Padding" Value="12,5" />
<Setter Property="MinHeight" Value="32" />
<Setter Property="Margin" Value="4,0" />
</Style>
<Style x:Key="IconText" TargetType="TextBlock">
<Setter Property="FontFamily" Value="{StaticResource IconFont}" />
<Setter Property="FontSize" Value="16" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>
<Style x:Key="IconPath" TargetType="Path">
<Setter Property="Stroke" Value="{StaticResource InkBrush}" />
<Setter Property="StrokeThickness" Value="1" />
<Setter Property="StrokeLineJoin" Value="Round" />
<Setter Property="StrokeStartLineCap" Value="Round" />
<Setter Property="StrokeEndLineCap" Value="Round" />
<Setter Property="Width" Value="20" />
<Setter Property="Height" Value="20" />
<Setter Property="Stretch" Value="None" />
</Style>
<Style x:Key="PropLabel" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource SubtleTextBrush}" />
<Setter Property="FontSize" Value="12" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Margin" Value="0,0,6,0" />
</Style>
<Style x:Key="PropGroup" TargetType="StackPanel">
<Setter Property="Orientation" Value="Horizontal" />
<Setter Property="Margin" Value="0,2,4,2" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<!-- Minimalistische keuzeknop: dicht = alleen icoon + pijltje, open = icoon + naam -->
<Style x:Key="MiniComboItem" TargetType="ComboBoxItem">
<Setter Property="Padding" Value="8,5" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBoxItem">
<Border x:Name="Bd" Background="Transparent" CornerRadius="4" Padding="{TemplateBinding Padding}" Margin="1">
<ContentPresenter VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#1A0067C0" />
</Trigger>
<Trigger Property="IsHighlighted" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{StaticResource HoverBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="MiniCombo" TargetType="ComboBox">
<Setter Property="ItemContainerStyle" Value="{StaticResource MiniComboItem}" />
<Setter Property="Height" Value="30" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="Margin" Value="2,0" />
<Setter Property="FontSize" Value="12" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid>
<ToggleButton Focusable="False" ClickMode="Press"
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
<ToggleButton.Template>
<ControlTemplate TargetType="ToggleButton">
<Border x:Name="Bd" Background="White" BorderBrush="#E0E0E0" BorderThickness="1" CornerRadius="4" />
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#F5F5F5" />
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#EBEBEB" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ToggleButton.Template>
</ToggleButton>
<StackPanel Orientation="Horizontal" IsHitTestVisible="False" Margin="8,0,6,0" VerticalAlignment="Center">
<ContentPresenter Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
VerticalAlignment="Center" />
<TextBlock Text="&#xE70D;" FontFamily="{StaticResource IconFont}" FontSize="8" Margin="6,1,0,0"
VerticalAlignment="Center" Foreground="#5C5C5C" />
</StackPanel>
<Popup x:Name="PART_Popup" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}"
Placement="Bottom" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade">
<Border Background="White" BorderBrush="#D6D6D6" BorderThickness="1" CornerRadius="6" Padding="3"
Margin="0,4,10,10" MinWidth="{TemplateBinding ActualWidth}">
<Border.Effect>
<DropShadowEffect BlurRadius="10" ShadowDepth="2" Opacity="0.18" />
</Border.Effect>
<ScrollViewer MaxHeight="360" VerticalScrollBarVisibility="Auto">
<ItemsPresenter KeyboardNavigation.DirectionalNavigation="Contained" />
</ScrollViewer>
</Border>
</Popup>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Aan/uit-knop met alleen een icoon (schaduw, vet, recht) -->
<Style x:Key="MiniToggle" TargetType="ToggleButton">
<Setter Property="Height" Value="30" />
<Setter Property="MinWidth" Value="30" />
<Setter Property="Margin" Value="2,0" />
<Setter Property="Padding" Value="6,0" />
<Setter Property="Foreground" Value="{StaticResource InkBrush}" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Border x:Name="Bd" Background="White" BorderBrush="#E0E0E0" BorderThickness="1" CornerRadius="4"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#F5F5F5" />
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#1A0067C0" />
<Setter TargetName="Bd" Property="BorderBrush" Value="{StaticResource AccentBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Contextmenu's: icoon, tekst, sneltoets en eventueel een submenu -->
<Style TargetType="ContextMenu">
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="FontSize" Value="13" />
<Setter Property="Foreground" Value="{StaticResource InkBrush}" />
<Setter Property="HasDropShadow" Value="False" />
<Setter Property="Grid.IsSharedSizeScope" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContextMenu">
<Border Background="{StaticResource ToolbarBrush}" BorderBrush="#D6D6D6" BorderThickness="1" CornerRadius="8"
Padding="4" Margin="0,0,10,10" MinWidth="220">
<Border.Effect>
<DropShadowEffect BlurRadius="12" ShadowDepth="2" Opacity="0.18" />
</Border.Effect>
<ItemsPresenter KeyboardNavigation.DirectionalNavigation="Cycle" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="Separator">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Separator">
<Border Height="1" Margin="6,4" Background="{StaticResource DividerBrush}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="MenuItem">
<Setter Property="Foreground" Value="{StaticResource InkBrush}" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="MenuItem">
<Border x:Name="Bd" Background="Transparent" CornerRadius="4" Padding="8,6" SnapsToDevicePixels="True">
<Style x:Key="ToolToggle" TargetType="ToggleButton" BasedOn="{StaticResource FlatButton}">
<Setter Property="Padding" Value="6,4" />
<Setter Property="MinWidth" Value="38" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="28" />
<ColumnDefinition Width="*" SharedSizeGroup="MenuHeader" />
<ColumnDefinition Width="Auto" SharedSizeGroup="MenuGesture" />
<ColumnDefinition Width="16" />
</Grid.ColumnDefinitions>
<ContentPresenter x:Name="IconHost" ContentSource="Icon" VerticalAlignment="Center" HorizontalAlignment="Left" />
<TextBlock x:Name="Check" Text="&#xE73E;" FontFamily="{StaticResource IconFont}" FontSize="12"
VerticalAlignment="Center" HorizontalAlignment="Left" Visibility="Collapsed" />
<ContentPresenter Grid.Column="1" ContentSource="Header" RecognizesAccessKey="True" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{TemplateBinding InputGestureText}" Margin="24,0,0,0"
Foreground="{StaticResource SubtleTextBrush}" VerticalAlignment="Center" HorizontalAlignment="Right" />
<TextBlock x:Name="Arrow" Grid.Column="3" Text="&#xE76C;" FontFamily="{StaticResource IconFont}" FontSize="10"
VerticalAlignment="Center" HorizontalAlignment="Right" Visibility="Collapsed" />
<Popup x:Name="PART_Popup" Placement="Right" HorizontalOffset="6" VerticalOffset="-6" AllowsTransparency="True"
Focusable="False" PopupAnimation="Fade" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}">
<Border Background="{StaticResource ToolbarBrush}" BorderBrush="#D6D6D6" BorderThickness="1" CornerRadius="8"
Padding="4" Margin="0,0,10,10" MinWidth="180" Grid.IsSharedSizeScope="True">
<Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1" CornerRadius="4" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<Border x:Name="Indicator" Height="3" Width="16" CornerRadius="1.5" Background="{DynamicResource AccentBrush}"
VerticalAlignment="Bottom" Margin="0,0,0,2" Visibility="Collapsed" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource HoverBrush}" />
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource CheckedBrush}" />
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource ControlBorderBrush}" />
<Setter TargetName="Indicator" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource PressedBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.35" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="AccentButton" TargetType="Button">
<Setter Property="Foreground" Value="White" />
<Setter Property="Background" Value="{DynamicResource AccentBrush}" />
<Setter Property="Padding" Value="14,6" />
<Setter Property="MinHeight" Value="32" />
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="FontSize" Value="13" />
<Setter Property="Margin" Value="4,0" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Bd" Background="{TemplateBinding Background}" CornerRadius="4" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource AccentHoverBrush}" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource AccentPressedBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.45" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SecondaryButton" TargetType="Button" BasedOn="{StaticResource FlatButton}">
<Setter Property="Background" Value="{DynamicResource ControlBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource ControlStrongBorderBrush}" />
<Setter Property="Padding" Value="12,5" />
<Setter Property="MinHeight" Value="32" />
<Setter Property="Margin" Value="4,0" />
</Style>
<Style x:Key="IconText" TargetType="TextBlock">
<Setter Property="FontFamily" Value="{StaticResource IconFont}" />
<Setter Property="FontSize" Value="16" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>
<Style x:Key="IconPath" TargetType="Path">
<Setter Property="Stroke" Value="{DynamicResource InkBrush}" />
<Setter Property="StrokeThickness" Value="1" />
<Setter Property="StrokeLineJoin" Value="Round" />
<Setter Property="StrokeStartLineCap" Value="Round" />
<Setter Property="StrokeEndLineCap" Value="Round" />
<Setter Property="Width" Value="20" />
<Setter Property="Height" Value="20" />
<Setter Property="Stretch" Value="None" />
</Style>
<Style x:Key="PropLabel" TargetType="TextBlock">
<Setter Property="Foreground" Value="{DynamicResource SubtleTextBrush}" />
<Setter Property="FontSize" Value="12" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Margin" Value="0,0,6,0" />
</Style>
<Style x:Key="PropGroup" TargetType="StackPanel">
<Setter Property="Orientation" Value="Horizontal" />
<Setter Property="Margin" Value="0,2,4,2" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<!-- Minimalistische keuzeknop: dicht = alleen icoon + pijltje, open = icoon + naam -->
<Style x:Key="MiniComboItem" TargetType="ComboBoxItem">
<Setter Property="Padding" Value="8,5" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBoxItem">
<Border x:Name="Bd" Background="Transparent" CornerRadius="4" Padding="{TemplateBinding Padding}" Margin="1">
<ContentPresenter VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource SelectedBrush}" />
</Trigger>
<Trigger Property="IsHighlighted" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource HoverBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="MiniCombo" TargetType="ComboBox">
<Setter Property="ItemContainerStyle" Value="{StaticResource MiniComboItem}" />
<Setter Property="Height" Value="30" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="Margin" Value="2,0" />
<Setter Property="FontSize" Value="12" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid>
<ToggleButton Focusable="False" ClickMode="Press"
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
<ToggleButton.Template>
<ControlTemplate TargetType="ToggleButton">
<Border x:Name="Bd" Background="{DynamicResource ControlBrush}"
BorderBrush="{DynamicResource ControlBorderBrush}" BorderThickness="1" CornerRadius="4" />
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlHoverBrush}" />
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlPressedBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ToggleButton.Template>
</ToggleButton>
<DockPanel IsHitTestVisible="False" Margin="8,0,6,0" VerticalAlignment="Center">
<TextBlock DockPanel.Dock="Right" Text="&#xE70D;" FontFamily="{StaticResource IconFont}" FontSize="8" Margin="6,1,0,0"
VerticalAlignment="Center" Foreground="{DynamicResource SubtleTextBrush}" />
<ContentPresenter Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
VerticalAlignment="Center" />
</DockPanel>
<Popup x:Name="PART_Popup" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}"
Placement="Bottom" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade">
<Border Background="{DynamicResource CardBrush}" BorderBrush="{DynamicResource ControlStrongBorderBrush}"
BorderThickness="1" CornerRadius="6" Padding="3"
Margin="0,4,10,10" MinWidth="{TemplateBinding ActualWidth}">
<Border.Effect>
<DropShadowEffect BlurRadius="12" ShadowDepth="2" Opacity="0.18" />
<DropShadowEffect BlurRadius="10" ShadowDepth="2" Opacity="0.18" />
</Border.Effect>
<ItemsPresenter KeyboardNavigation.DirectionalNavigation="Cycle" />
<ScrollViewer MaxHeight="360" VerticalScrollBarVisibility="Auto">
<ItemsPresenter KeyboardNavigation.DirectionalNavigation="Contained" />
</ScrollViewer>
</Border>
</Popup>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Check" Property="Visibility" Value="Visible" />
<Setter TargetName="IconHost" Property="Visibility" Value="Collapsed" />
</Trigger>
<Trigger Property="HasItems" Value="True">
<Setter TargetName="Arrow" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="IsHighlighted" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{StaticResource HoverBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.4" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="PropCombo" TargetType="ComboBox">
<Setter Property="MinWidth" Value="80" />
<Setter Property="Height" Value="28" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="FontSize" Value="12" />
</Style>
<!-- Aan/uit-knop met alleen een icoon (schaduw, vet, recht) -->
<Style x:Key="MiniToggle" TargetType="ToggleButton">
<Setter Property="Height" Value="30" />
<Setter Property="MinWidth" Value="30" />
<Setter Property="Margin" Value="2,0" />
<Setter Property="Padding" Value="6,0" />
<Setter Property="Foreground" Value="{DynamicResource InkBrush}" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Border x:Name="Bd" Background="{DynamicResource ControlBrush}" BorderBrush="{DynamicResource ControlBorderBrush}"
BorderThickness="1" CornerRadius="4" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlHoverBrush}" />
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource SelectedBrush}" />
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource AccentBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Contextmenu's: icoon, tekst, sneltoets en eventueel een submenu -->
<Style TargetType="ContextMenu">
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="FontSize" Value="13" />
<Setter Property="Foreground" Value="{DynamicResource InkBrush}" />
<Setter Property="HasDropShadow" Value="False" />
<Setter Property="Grid.IsSharedSizeScope" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContextMenu">
<Border Background="{DynamicResource ToolbarBrush}" BorderBrush="{DynamicResource ControlStrongBorderBrush}" BorderThickness="1" CornerRadius="8"
Padding="4" Margin="0,0,10,10" MinWidth="220">
<Border.Effect>
<DropShadowEffect BlurRadius="12" ShadowDepth="2" Opacity="0.18" />
</Border.Effect>
<ItemsPresenter KeyboardNavigation.DirectionalNavigation="Cycle" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="Separator">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Separator">
<Border Height="1" Margin="6,4" Background="{DynamicResource DividerBrush}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="MenuItem">
<Setter Property="Foreground" Value="{DynamicResource InkBrush}" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="MenuItem">
<Border x:Name="Bd" Background="Transparent" CornerRadius="4" Padding="8,6" SnapsToDevicePixels="True">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="28" />
<ColumnDefinition Width="*" SharedSizeGroup="MenuHeader" />
<ColumnDefinition Width="Auto" SharedSizeGroup="MenuGesture" />
<ColumnDefinition Width="16" />
</Grid.ColumnDefinitions>
<ContentPresenter x:Name="IconHost" ContentSource="Icon" VerticalAlignment="Center" HorizontalAlignment="Left" />
<TextBlock x:Name="Check" Text="&#xE73E;" FontFamily="{StaticResource IconFont}" FontSize="12"
VerticalAlignment="Center" HorizontalAlignment="Left" Visibility="Collapsed" />
<ContentPresenter Grid.Column="1" ContentSource="Header" RecognizesAccessKey="True" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{TemplateBinding InputGestureText}" Margin="24,0,0,0"
Foreground="{DynamicResource SubtleTextBrush}" VerticalAlignment="Center" HorizontalAlignment="Right" />
<TextBlock x:Name="Arrow" Grid.Column="3" Text="&#xE76C;" FontFamily="{StaticResource IconFont}" FontSize="10"
VerticalAlignment="Center" HorizontalAlignment="Right" Visibility="Collapsed" />
<Popup x:Name="PART_Popup" Placement="Right" HorizontalOffset="6" VerticalOffset="-6" AllowsTransparency="True"
Focusable="False" PopupAnimation="Fade" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}">
<Border Background="{DynamicResource ToolbarBrush}" BorderBrush="{DynamicResource ControlStrongBorderBrush}" BorderThickness="1" CornerRadius="8"
Padding="4" Margin="0,0,10,10" MinWidth="180" Grid.IsSharedSizeScope="True">
<Border.Effect>
<DropShadowEffect BlurRadius="12" ShadowDepth="2" Opacity="0.18" />
</Border.Effect>
<ItemsPresenter KeyboardNavigation.DirectionalNavigation="Cycle" />
</Border>
</Popup>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Check" Property="Visibility" Value="Visible" />
<Setter TargetName="IconHost" Property="Visibility" Value="Collapsed" />
</Trigger>
<Trigger Property="HasItems" Value="True">
<Setter TargetName="Arrow" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="IsHighlighted" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource HoverBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.4" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="PropCombo" TargetType="ComboBox" BasedOn="{StaticResource MiniCombo}">
<Setter Property="MinWidth" Value="80" />
<Setter Property="Height" Value="28" />
<Setter Property="Margin" Value="0" />
</Style>
<Style TargetType="CheckBox">
<Setter Property="Foreground" Value="{DynamicResource InkBrush}" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<Grid Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border x:Name="Box" Width="16" Height="16" CornerRadius="3" BorderThickness="1" VerticalAlignment="Center"
Background="{DynamicResource ControlBrush}" BorderBrush="{DynamicResource CheckBoxBorderBrush}">
<TextBlock x:Name="Mark" Text="&#xE73E;" FontFamily="{StaticResource IconFont}" FontSize="11" Foreground="White"
HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed" />
</Border>
<ContentPresenter Grid.Column="1" Margin="6,0,0,0" VerticalAlignment="Center" RecognizesAccessKey="True" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Box" Property="Background" Value="{DynamicResource ControlHoverBrush}" />
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Box" Property="Background" Value="{DynamicResource AccentBrush}" />
<Setter TargetName="Box" Property="BorderBrush" Value="{DynamicResource AccentBrush}" />
<Setter TargetName="Mark" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.45" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="RadioButton">
<Setter Property="Foreground" Value="{DynamicResource InkBrush}" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid Width="16" Height="16" VerticalAlignment="Center">
<Ellipse x:Name="Ring" Fill="{DynamicResource ControlBrush}" Stroke="{DynamicResource CheckBoxBorderBrush}"
StrokeThickness="1" />
<Ellipse x:Name="Dot" Width="6" Height="6" Fill="White" Visibility="Collapsed" />
</Grid>
<ContentPresenter Grid.Column="1" Margin="6,0,0,0" VerticalAlignment="Center" RecognizesAccessKey="True" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Ring" Property="Fill" Value="{DynamicResource ControlHoverBrush}" />
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Ring" Property="Fill" Value="{DynamicResource AccentBrush}" />
<Setter TargetName="Ring" Property="Stroke" Value="{DynamicResource AccentBrush}" />
<Setter TargetName="Dot" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.45" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="TextBox">
<Setter Property="Background" Value="{DynamicResource ControlBrush}" />
<Setter Property="Foreground" Value="{DynamicResource InkBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource ControlStrongBorderBrush}" />
<Setter Property="CaretBrush" Value="{DynamicResource InkBrush}" />
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>
+4
View File
@@ -77,6 +77,7 @@ public partial class App : Application
}
Settings = SettingsStore.Load();
ThemeManager.Apply(Settings.ColorMode);
Capture = new CaptureCoordinator(Dispatcher);
Capture.ApplySettings(Settings);
@@ -116,6 +117,8 @@ public partial class App : Application
_tray.FoldersProvider = TrayFolders;
_tray.ExitRequested += ExitApplication;
_tray.PauseChanged += _ => UpdateCapturePaused();
_tray.ApplyTheme(ThemeManager.IsDark);
ThemeManager.Changed += () => _tray?.ApplyTheme(ThemeManager.IsDark);
HotkeyHook = new GlobalHotkeyHook(Dispatcher);
ApplyHotkeys();
@@ -529,6 +532,7 @@ public partial class App : Application
public void SaveSettings()
{
SettingsStore.Save(Settings);
ThemeManager.Apply(Settings.ColorMode);
Capture.ApplySettings(Settings);
ApplyHotkeys();
Updates.Apply(Settings.CheckForUpdates);
+4 -4
View File
@@ -3,18 +3,18 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="kniip" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
Topmost="True" ShowInTaskbar="False" ShowActivated="False" ResizeMode="NoResize"
SizeToContent="WidthAndHeight" FontFamily="Segoe UI" UseLayoutRounding="True">
<Border Margin="10" Background="#FCFCFC" CornerRadius="8" BorderBrush="#DADADA" BorderThickness="1"
SizeToContent="WidthAndHeight" FontFamily="Segoe UI" Foreground="{DynamicResource InkBrush}" UseLayoutRounding="True">
<Border Margin="10" Background="{DynamicResource ToastBrush}" CornerRadius="8" BorderBrush="{DynamicResource ToastBorderBrush}" BorderThickness="1"
Cursor="Hand" MouseLeftButtonUp="Border_Click" ToolTip="Klik om te annuleren">
<Border.Effect>
<DropShadowEffect BlurRadius="14" ShadowDepth="2" Opacity="0.22" />
</Border.Effect>
<StackPanel Orientation="Horizontal" Margin="12,8,14,8">
<TextBlock x:Name="SecondsText" FontSize="28" FontWeight="SemiBold" Foreground="#0067C0"
<TextBlock x:Name="SecondsText" FontSize="28" FontWeight="SemiBold" Foreground="{DynamicResource AccentTextBrush}"
MinWidth="34" TextAlignment="Center" VerticalAlignment="Center" />
<StackPanel Margin="10,0,0,0" VerticalAlignment="Center">
<TextBlock Text="Knipsel over" FontSize="12" FontWeight="SemiBold" />
<TextBlock Text="Esc om te annuleren" FontSize="11" Foreground="#5C5C5C" />
<TextBlock Text="Esc om te annuleren" FontSize="11" Foreground="{DynamicResource SubtleTextBrush}" />
</StackPanel>
</StackPanel>
</Border>
+2 -2
View File
@@ -28,8 +28,8 @@
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>
<Rectangle Height="8" VerticalAlignment="Top" Margin="0,56,0,0" Fill="{StaticResource AccentBrush}" Opacity="0.55" />
<Rectangle Width="8" HorizontalAlignment="Left" Margin="56,0,0,0" Fill="{StaticResource AccentBrush}" Opacity="0.55" />
<Rectangle Height="8" VerticalAlignment="Top" Margin="0,56,0,0" Fill="{DynamicResource AccentBrush}" Opacity="0.55" />
<Rectangle Width="8" HorizontalAlignment="Left" Margin="56,0,0,0" Fill="{DynamicResource AccentBrush}" Opacity="0.55" />
<Rectangle Width="10" Height="10" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="55,55,0,0"
Stroke="White" StrokeThickness="1" />
<Rectangle Width="8" Height="8" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="56,56,0,0"
+28 -2
View File
@@ -12,14 +12,19 @@ public partial class MagnifierControl : UserControl
private const int Pixels = 15;
private const double CursorOffset = 20;
private static MagnifierControl? _visible;
private readonly WriteableBitmap _zoom = new(Pixels, Pixels, 96, 96, PixelFormats.Bgra32, null);
private readonly byte[] _buffer = new byte[Pixels * Pixels * 4];
private readonly TranslateTransform _offset = new();
public MagnifierControl()
{
InitializeComponent();
Zoom.Source = _zoom;
RenderTransform = _offset;
Visibility = Visibility.Collapsed;
Unloaded += (_, _) => Hide();
}
/// <param name="frozen">Vastgelegd beeld van het scherm.</param>
@@ -29,6 +34,19 @@ public partial class MagnifierControl : UserControl
/// <param name="area">Grootte van het venster (DIP).</param>
public void Show(BitmapSource frozen, System.Drawing.Point relative, System.Drawing.Point screen, Point cursor, Size area)
{
// Elk scherm heeft een eigen overlay; een overlay krijgt soms muisbewegingen terwijl de aanwijzer op een ander scherm staat.
if (relative.X < 0 || relative.Y < 0 || relative.X >= frozen.PixelWidth || relative.Y >= frozen.PixelHeight)
{
Hide();
return;
}
if (_visible != this)
{
_visible?.Hide();
_visible = this;
}
CopyPixels(frozen, relative);
CoordinateText.Text = $"X: {screen.X} Y: {screen.Y}";
Visibility = Visibility.Visible;
@@ -47,10 +65,18 @@ public partial class MagnifierControl : UserControl
top = cursor.Y - CursorOffset - size.Height;
}
Margin = new Thickness(Math.Max(0, left), Math.Max(0, top), 0, 0);
_offset.X = Math.Max(0, left);
_offset.Y = Math.Max(0, top);
}
public void Hide() => Visibility = Visibility.Collapsed;
public void Hide()
{
Visibility = Visibility.Collapsed;
if (_visible == this)
{
_visible = null;
}
}
private void CopyPixels(BitmapSource frozen, System.Drawing.Point center)
{
+4 -4
View File
@@ -8,21 +8,21 @@
<Grid>
<Image x:Name="Frozen" Stretch="Fill" RenderOptions.BitmapScalingMode="NearestNeighbor" />
<Path x:Name="Dim" Fill="#73000000" />
<Rectangle x:Name="SelectionRect" Stroke="{StaticResource AccentBrush}" StrokeThickness="2"
<Rectangle x:Name="SelectionRect" Stroke="{DynamicResource AccentBrush}" StrokeThickness="2"
HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="Collapsed" IsHitTestVisible="False" />
<Border x:Name="SizeBadge" HorizontalAlignment="Left" VerticalAlignment="Top" Background="#E6202020"
CornerRadius="4" Padding="6,2" Visibility="Collapsed" IsHitTestVisible="False">
<TextBlock x:Name="SizeText" Foreground="White" FontSize="12" />
</Border>
<local:MagnifierControl x:Name="Magnifier" />
<Border x:Name="Hint" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,28,0,0" Background="#F2FFFFFF"
<Border x:Name="Hint" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,28,0,0" Background="{DynamicResource ToastBrush}"
CornerRadius="6" Padding="16,9" IsHitTestVisible="False">
<Border.Effect>
<DropShadowEffect BlurRadius="12" ShadowDepth="2" Opacity="0.25" />
</Border.Effect>
<StackPanel>
<TextBlock x:Name="HintTitle" Text="Knipsel: sleep een rechthoek" FontWeight="SemiBold" Foreground="{StaticResource InkBrush}" />
<TextBlock Foreground="{StaticResource SubtleTextBrush}" FontSize="12" Margin="0,2,0,0"
<TextBlock x:Name="HintTitle" Text="Knipsel: sleep een rechthoek" FontWeight="SemiBold" Foreground="{DynamicResource InkBrush}" />
<TextBlock Foreground="{DynamicResource SubtleTextBrush}" FontSize="12" Margin="0,2,0,0"
Text="Enter = heel scherm · Esc of rechtermuisknop = annuleren" />
</StackPanel>
</Border>
+6 -6
View File
@@ -14,25 +14,25 @@
</UserControl.Resources>
<Grid>
<ToggleButton x:Name="Toggle" Style="{StaticResource FlatButton}" Padding="6,4" MinWidth="0" MinHeight="30"
BorderBrush="#E0E0E0" Background="White">
BorderBrush="{DynamicResource ControlBorderBrush}" Background="{DynamicResource ControlBrush}">
<StackPanel Orientation="Horizontal">
<Grid Width="20" Height="20">
<Border x:Name="CheckerBack" CornerRadius="4" Background="{StaticResource Checker}" Visibility="Collapsed" />
<Border x:Name="Swatch" CornerRadius="4" BorderThickness="0" />
<Border x:Name="OutlineHole" CornerRadius="1.5" Margin="5" Background="White" Visibility="Collapsed" />
<Grid x:Name="TextGlyph" Background="White" Visibility="Collapsed">
<Border x:Name="OutlineHole" CornerRadius="1.5" Margin="5" Background="{DynamicResource ControlBrush}" Visibility="Collapsed" />
<Grid x:Name="TextGlyph" Background="{DynamicResource ControlBrush}" Visibility="Collapsed">
<TextBlock Text="A" FontSize="14" HorizontalAlignment="Center" Margin="0,-1,0,0"
Foreground="{StaticResource InkBrush}" />
Foreground="{DynamicResource InkBrush}" />
<Border x:Name="TextBar" Height="4" CornerRadius="1" VerticalAlignment="Bottom" Margin="2,0" />
</Grid>
</Grid>
<TextBlock Text="&#xE70D;" Style="{StaticResource IconText}" FontSize="9" Margin="5,0,1,0" Foreground="#5C5C5C" />
<TextBlock Text="&#xE70D;" Style="{StaticResource IconText}" FontSize="9" Margin="5,0,1,0" Foreground="{DynamicResource SubtleTextBrush}" />
</StackPanel>
</ToggleButton>
<Popup x:Name="PopupPanel" PlacementTarget="{Binding ElementName=Toggle}" Placement="Bottom" StaysOpen="False"
AllowsTransparency="True" PopupAnimation="Fade"
IsOpen="{Binding IsChecked, ElementName=Toggle, Mode=TwoWay}">
<Border Background="White" BorderBrush="#D6D6D6" BorderThickness="1" CornerRadius="6" Padding="8" Margin="0,4,10,10">
<Border Background="{DynamicResource CardBrush}" BorderBrush="{DynamicResource ControlStrongBorderBrush}" BorderThickness="1" CornerRadius="6" Padding="8" Margin="0,4,10,10">
<Border.Effect>
<DropShadowEffect BlurRadius="10" ShadowDepth="2" Opacity="0.18" />
</Border.Effect>
+43 -30
View File
@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Kniip.Editor"
Title="kniip" Width="1180" Height="780" MinWidth="760" MinHeight="420"
WindowStartupLocation="CenterScreen" Background="{StaticResource WindowBrush}"
WindowStartupLocation="CenterScreen" Background="{DynamicResource WindowBrush}" Foreground="{DynamicResource InkBrush}"
FontFamily="Segoe UI" FontSize="13" UseLayoutRounding="True"
Icon="pack://application:,,,/AppIcon.ico"
AllowDrop="True" PreviewDragEnter="Window_PreviewDragOver" PreviewDragOver="Window_PreviewDragOver" PreviewDrop="Window_PreviewDrop">
@@ -15,7 +15,7 @@
<DataTemplate x:Key="ThicknessTemplate">
<StackPanel Orientation="Horizontal">
<Grid Width="16" Height="16" VerticalAlignment="Center">
<Ellipse x:Name="Dot" Fill="{StaticResource InkBrush}" Width="{Binding}" Height="{Binding}"
<Ellipse x:Name="Dot" Fill="{DynamicResource InkBrush}" Width="{Binding}" Height="{Binding}"
MinWidth="2" MinHeight="2" MaxWidth="15" MaxHeight="15"
HorizontalAlignment="Center" VerticalAlignment="Center" />
<Line x:Name="NoneLine" X1="3" Y1="13" X2="13" Y2="3" Stroke="#E81123" StrokeThickness="1.5" Visibility="Collapsed" />
@@ -37,7 +37,7 @@
<!-- Lijnstijl: voorbeeldlijn -->
<DataTemplate x:Key="DashTemplate">
<StackPanel Orientation="Horizontal">
<Line x:Name="Sample" X1="1" Y1="8" X2="35" Y2="8" Width="36" Height="16" Stroke="{StaticResource InkBrush}"
<Line x:Name="Sample" X1="1" Y1="8" X2="35" Y2="8" Width="36" Height="16" Stroke="{DynamicResource InkBrush}"
StrokeThickness="2" VerticalAlignment="Center" />
<TextBlock x:Name="Label" Text="Doorgetrokken" Margin="8,0,0,0" VerticalAlignment="Center" FontSize="12" />
</StackPanel>
@@ -65,7 +65,7 @@
<StackPanel Orientation="Horizontal">
<Grid Width="18" Height="18" VerticalAlignment="Center" ClipToBounds="True">
<Border Width="26" Height="26" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="2,2,0,0"
BorderBrush="{StaticResource InkBrush}" BorderThickness="2,2,0,0"
BorderBrush="{DynamicResource InkBrush}" BorderThickness="2,2,0,0"
CornerRadius="{Binding Converter={StaticResource CornerPreview}}" />
</Grid>
<TextBlock x:Name="Label" Text="{Binding StringFormat={}{0} px}" Margin="8,0,0,0" VerticalAlignment="Center" FontSize="12" />
@@ -84,7 +84,7 @@
<DataTemplate x:Key="FontSizeTemplate">
<StackPanel Orientation="Horizontal">
<TextBlock Text="A" FontSize="15" VerticalAlignment="Center" />
<TextBlock Text="{Binding}" FontSize="11" Margin="3,4,0,0" VerticalAlignment="Center" Foreground="{StaticResource SubtleTextBrush}" />
<TextBlock Text="{Binding}" FontSize="11" Margin="3,4,0,0" VerticalAlignment="Center" Foreground="{DynamicResource SubtleTextBrush}" />
</StackPanel>
</DataTemplate>
@@ -92,10 +92,10 @@
<DataTemplate x:Key="SizeTemplate">
<StackPanel Orientation="Horizontal">
<Grid Width="16" Height="16" VerticalAlignment="Center">
<Ellipse Stroke="{StaticResource InkBrush}" StrokeThickness="1" />
<Path Data="M5,8 H11 M8,5 V11" Stroke="{StaticResource InkBrush}" StrokeThickness="1" />
<Ellipse Stroke="{DynamicResource InkBrush}" StrokeThickness="1" />
<Path Data="M5,8 H11 M8,5 V11" Stroke="{DynamicResource InkBrush}" StrokeThickness="1" />
</Grid>
<TextBlock Text="{Binding}" FontSize="11" Margin="4,0,0,0" VerticalAlignment="Center" Foreground="{StaticResource SubtleTextBrush}" />
<TextBlock Text="{Binding}" FontSize="11" Margin="4,0,0,0" VerticalAlignment="Center" Foreground="{DynamicResource SubtleTextBrush}" />
</StackPanel>
</DataTemplate>
@@ -131,7 +131,7 @@
<!-- Soort cursor: het cursoricoon zelf -->
<DataTemplate x:Key="CursorKindTemplate">
<StackPanel Orientation="Horizontal">
<Path Data="{Binding Converter={StaticResource CursorIcon}}" Fill="White" Stroke="{StaticResource InkBrush}"
<Path Data="{Binding Converter={StaticResource CursorIcon}}" Fill="{DynamicResource ControlBrush}" Stroke="{DynamicResource InkBrush}"
StrokeThickness="1" StrokeLineJoin="Round" Stretch="Uniform" Width="16" Height="18" VerticalAlignment="Center" />
<TextBlock x:Name="Label" Text="Pijl" Margin="8,0,0,0" VerticalAlignment="Center" FontSize="12" />
</StackPanel>
@@ -152,16 +152,16 @@
<DataTemplate x:Key="BlurModeTemplate">
<StackPanel Orientation="Horizontal">
<Grid Width="16" Height="16" VerticalAlignment="Center">
<Path x:Name="PixelIcon" Fill="{StaticResource InkBrush}"
<Path x:Name="PixelIcon" Fill="{DynamicResource InkBrush}"
Data="M1,1 h4.5 v4.5 h-4.5 z M10.5,1 h4.5 v4.5 h-4.5 z M5.75,5.75 h4.5 v4.5 h-4.5 z M1,10.5 h4.5 v4.5 h-4.5 z M10.5,10.5 h4.5 v4.5 h-4.5 z" />
<Ellipse x:Name="BlurIcon" Visibility="Collapsed">
<Ellipse.Fill>
<Ellipse x:Name="BlurIcon" Visibility="Collapsed" Fill="{DynamicResource InkBrush}">
<Ellipse.OpacityMask>
<RadialGradientBrush>
<GradientStop Color="#FF1A1A1A" Offset="0" />
<GradientStop Color="#801A1A1A" Offset="0.5" />
<GradientStop Color="#001A1A1A" Offset="1" />
<GradientStop Color="#FF000000" Offset="0" />
<GradientStop Color="#80000000" Offset="0.5" />
<GradientStop Color="#00000000" Offset="1" />
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse.OpacityMask>
</Ellipse>
</Grid>
<TextBlock x:Name="Label" Text="Pixeleren" Margin="8,0,0,0" VerticalAlignment="Center" FontSize="12" />
@@ -180,16 +180,16 @@
</Window.Resources>
<DockPanel>
<!-- Statusbalk -->
<Border DockPanel.Dock="Bottom" Background="{StaticResource ToolbarBrush}" BorderBrush="{StaticResource DividerBrush}"
<Border DockPanel.Dock="Bottom" Background="{DynamicResource ToolbarBrush}" BorderBrush="{DynamicResource DividerBrush}"
BorderThickness="0,1,0,0" Padding="12,4">
<DockPanel>
<TextBlock x:Name="InfoText" DockPanel.Dock="Right" Foreground="{StaticResource SubtleTextBrush}" FontSize="12" />
<TextBlock x:Name="HintText" Foreground="{StaticResource SubtleTextBrush}" FontSize="12" TextTrimming="CharacterEllipsis" />
<TextBlock x:Name="InfoText" DockPanel.Dock="Right" Foreground="{DynamicResource SubtleTextBrush}" FontSize="12" />
<TextBlock x:Name="HintText" Foreground="{DynamicResource SubtleTextBrush}" FontSize="12" TextTrimming="CharacterEllipsis" />
</DockPanel>
</Border>
<!-- Onderste werkbalk in de gesplitste indeling; de code verplaatst de acties hierheen -->
<Border x:Name="ActionBar" DockPanel.Dock="Bottom" Background="{StaticResource ToolbarBrush}" BorderBrush="{StaticResource DividerBrush}"
<Border x:Name="ActionBar" DockPanel.Dock="Bottom" Background="{DynamicResource ToolbarBrush}" BorderBrush="{DynamicResource DividerBrush}"
BorderThickness="0,1,0,0" Padding="8,6" Visibility="Collapsed"
SizeChanged="Toolbar_SizeChanged" ContextMenuOpening="Toolbar_ContextMenuOpening">
<Border.ContextMenu>
@@ -199,7 +199,7 @@
</Border>
<!-- Gereedschappen en acties; rechtsklik voor vergrendelen, positie en zichtbare knoppen -->
<Border x:Name="Toolbar" DockPanel.Dock="Top" Background="{StaticResource ToolbarBrush}" BorderBrush="{StaticResource DividerBrush}"
<Border x:Name="Toolbar" DockPanel.Dock="Top" Background="{DynamicResource ToolbarBrush}" BorderBrush="{DynamicResource DividerBrush}"
BorderThickness="0,0,0,1" Padding="8,6" SizeChanged="Toolbar_SizeChanged" ContextMenuOpening="Toolbar_ContextMenuOpening">
<Border.ContextMenu>
<ContextMenu x:Name="ToolbarMenu" />
@@ -246,7 +246,7 @@
</RadioButton>
<RadioButton GroupName="Tools" Tag="Cursor" local:ToolbarPanel.ItemId="Cursor" local:ToolbarPanel.Title="Cursor"
Style="{StaticResource ToolToggle}" ToolTip="Cursor plaatsen (C)" Checked="Tool_Checked">
<Path Style="{StaticResource IconPath}" Fill="White"
<Path Style="{StaticResource IconPath}" Fill="{DynamicResource ControlBrush}"
Data="M7,4 L7,16 L9.8,13.4 L11.7,17.6 L13.6,16.8 L11.8,12.6 L15.4,12.6 Z M4,4 L2.5,2.5 M7,1 L7,0 M4,7 L2,7" />
</RadioButton>
<RadioButton GroupName="Tools" Tag="Emoji" local:ToolbarPanel.ItemId="Emoji" local:ToolbarPanel.Title="Emoji"
@@ -262,7 +262,7 @@
</RadioButton>
<RadioButton GroupName="Tools" Tag="Blur" local:ToolbarPanel.ItemId="Blur" local:ToolbarPanel.Title="Vervagen / pixeleren"
Style="{StaticResource ToolToggle}" ToolTip="Vervagen / pixeleren (B)" Checked="Tool_Checked">
<Path Style="{StaticResource IconPath}" Fill="#1A1A1A" StrokeThickness="0"
<Path Style="{StaticResource IconPath}" Fill="{DynamicResource InkBrush}" StrokeThickness="0"
Data="M3,3 h4.5 v4.5 h-4.5 z M12.5,3 h4.5 v4.5 h-4.5 z M7.75,7.75 h4.5 v4.5 h-4.5 z M3,12.5 h4.5 v4.5 h-4.5 z M12.5,12.5 h4.5 v4.5 h-4.5 z" />
</RadioButton>
<local:ToolbarSeparator local:ToolbarPanel.ItemId="Sep2" />
@@ -329,7 +329,7 @@
Style="{StaticResource FlatButton}" ToolTip="Instellingen" Click="Settings_Click">
<Grid>
<TextBlock Text="&#xE713;" Style="{StaticResource IconText}" />
<Ellipse x:Name="SettingsBadge" Width="8" Height="8" Fill="{StaticResource AccentBrush}" Stroke="White"
<Ellipse x:Name="SettingsBadge" Width="8" Height="8" Fill="{DynamicResource AccentBrush}" Stroke="{DynamicResource ToolbarBrush}"
StrokeThickness="1" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,-2,-3,0"
IsHitTestVisible="False" Visibility="Collapsed" />
</Grid>
@@ -355,11 +355,15 @@
<TextBlock x:Name="CopyLabel" Text="Kopiëren" Margin="6,0,0,0" />
</StackPanel>
</Button>
<!-- Alleen in de gesplitste indeling: gereedschappen in het midden, Instellingen rechts -->
<local:ToolbarSpacer local:ToolbarPanel.ItemId="SplitSpacer1" />
<local:ToolbarSpacer local:ToolbarPanel.ItemId="SplitSpacer2" />
</local:ToolbarPanel>
</Border>
<!-- Eigenschappen van het actieve gereedschap of het geselecteerde object -->
<Border x:Name="PropsBar" DockPanel.Dock="Top" Background="White" BorderBrush="{StaticResource DividerBrush}" BorderThickness="0,0,0,1"
<Border x:Name="PropsBar" DockPanel.Dock="Top" Background="{DynamicResource CardBrush}" BorderBrush="{DynamicResource DividerBrush}" BorderThickness="0,0,0,1"
Padding="12,4" MinHeight="42">
<WrapPanel x:Name="PropsPanel" VerticalAlignment="Center" HorizontalAlignment="Center">
<StackPanel x:Name="StrokeGroup" Style="{StaticResource PropGroup}">
@@ -408,7 +412,7 @@
<StackPanel x:Name="BlurGroup" Style="{StaticResource PropGroup}">
<ComboBox x:Name="BlurModeCombo" Style="{StaticResource MiniCombo}" ItemTemplate="{StaticResource BlurModeTemplate}"
ToolTip="Effect" SelectionChanged="BlurMode_Changed" />
<Border Background="White" BorderBrush="#E0E0E0" BorderThickness="1" CornerRadius="4" Height="30" Margin="2,0" Padding="8,0"
<Border Background="{DynamicResource ControlBrush}" BorderBrush="{DynamicResource ControlBorderBrush}" BorderThickness="1" CornerRadius="4" Height="30" Margin="2,0" Padding="8,0"
ToolTip="Sterkte">
<Slider x:Name="BlurStrengthSlider" Width="90" Minimum="1" Maximum="20" IsSnapToTickEnabled="True" TickFrequency="1"
VerticalAlignment="Center" ValueChanged="BlurStrength_Changed" />
@@ -417,7 +421,7 @@
<StackPanel x:Name="StraightGroup" Style="{StaticResource PropGroup}">
<ToggleButton x:Name="StraightCheck" Style="{StaticResource MiniToggle}" ToolTip="Rechte horizontale streep (Shift wisselt)"
Checked="Straight_Changed" Unchecked="Straight_Changed">
<Path Data="M2,9 H16 M2,5 V13 M16,5 V13" Stroke="{StaticResource InkBrush}" StrokeThickness="1.5"
<Path Data="M2,9 H16 M2,5 V13 M16,5 V13" Stroke="{DynamicResource InkBrush}" StrokeThickness="1.5"
StrokeStartLineCap="Round" StrokeEndLineCap="Round" Width="18" Height="18" />
</ToggleButton>
</StackPanel>
@@ -427,7 +431,7 @@
<Grid Width="18" Height="18">
<Rectangle Width="11" Height="11" RadiusX="2" RadiusY="2" Fill="#9A9A9A" Margin="5,5,0,0"
HorizontalAlignment="Left" VerticalAlignment="Top" />
<Rectangle Width="11" Height="11" RadiusX="2" RadiusY="2" Fill="White" Stroke="{StaticResource InkBrush}"
<Rectangle Width="11" Height="11" RadiusX="2" RadiusY="2" Fill="{DynamicResource ControlBrush}" Stroke="{DynamicResource InkBrush}"
StrokeThickness="1" Margin="2,2,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
</Grid>
</ToggleButton>
@@ -436,11 +440,20 @@
</WrapPanel>
</Border>
<!-- Zijbalk in de drie-split-indeling; de code verplaatst Nieuw en Screencast hierheen -->
<Border x:Name="CaptureBar" DockPanel.Dock="Left" Background="{DynamicResource ToolbarBrush}" BorderBrush="{DynamicResource DividerBrush}"
BorderThickness="0,0,1,0" Padding="6,8" Visibility="Collapsed" ContextMenuOpening="Toolbar_ContextMenuOpening">
<Border.ContextMenu>
<ContextMenu x:Name="CaptureBarMenu" />
</Border.ContextMenu>
<local:ToolbarPanel x:Name="CaptureItems" Orientation="Vertical" OrderChanged="ToolbarItems_OrderChanged" />
</Border>
<!-- Canvas -->
<ScrollViewer x:Name="Scroller" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
Background="#E9E9E9" PreviewMouseWheel="Scroller_PreviewMouseWheel" Focusable="False">
Background="{DynamicResource CanvasBrush}" PreviewMouseWheel="Scroller_PreviewMouseWheel" Focusable="False">
<Grid HorizontalAlignment="Center" VerticalAlignment="Center" Margin="24">
<Border BorderBrush="#C8C8C8" BorderThickness="1" Margin="-1" SnapsToDevicePixels="True" />
<Border BorderBrush="{DynamicResource CanvasBorderBrush}" BorderThickness="1" Margin="-1" SnapsToDevicePixels="True" />
<Grid x:Name="CanvasHost">
<Grid.LayoutTransform>
<ScaleTransform x:Name="ZoomTransform" />
+65 -16
View File
@@ -38,17 +38,23 @@ public partial class EditorWindow : Window
/// <summary>Standaardvolgorde in de gesplitste indeling: eerst de bovenste werkbalk, dan de onderste.</summary>
private static readonly string[] DefaultSplitOrder =
{
"Select", "Sep1", "Rectangle", "Ellipse", "Line", "Arrow", "Text", "Step", "Cursor", "Emoji", "Highlight", "Blur",
"Sep2", "Crop", "Sep3", "Undo", "Redo", "Delete", "Sep4", "Clear",
"New", "Screencast", "Spacer", "ZoomOut", "Zoom", "ZoomIn", "Spacer2", "Settings", "Sep5", "Save", "Upload", "Copy"
"SplitSpacer1", "Select", "Sep1", "Rectangle", "Ellipse", "Line", "Arrow", "Text", "Step", "Cursor", "Emoji", "Highlight", "Blur",
"Sep2", "Crop", "Sep3", "Undo", "Redo", "Delete", "Sep4", "Clear", "SplitSpacer2", "Settings",
"New", "Screencast", "Spacer", "Save", "Upload", "Copy", "Sep5", "Spacer2", "ZoomOut", "Zoom", "ZoomIn"
};
/// <summary>Items die in de gesplitste indeling op de onderste werkbalk staan.</summary>
private static readonly HashSet<string> SplitBottomIds = new()
{
"New", "Screencast", "Spacer", "ZoomOut", "Zoom", "ZoomIn", "Spacer2", "Settings", "Sep5", "Save", "Upload", "Copy"
"New", "Screencast", "Spacer", "Save", "Upload", "Copy", "Sep5", "Spacer2", "ZoomOut", "Zoom", "ZoomIn"
};
/// <summary>Items die alleen in de gesplitste indeling op een werkbalk staan.</summary>
private static readonly HashSet<string> SplitOnlyIds = new() { "SplitSpacer1", "SplitSpacer2" };
/// <summary>Items die in de drie-split-indeling in de zijbalk staan in plaats van de onderste werkbalk.</summary>
private static readonly HashSet<string> CaptureBarIds = new() { "New", "Screencast" };
private readonly EditorDocument _doc;
private readonly UndoStack _undo = new();
private readonly AppSettings _settings;
@@ -94,6 +100,7 @@ public partial class EditorWindow : Window
public EditorWindow(BitmapSource image, AppSettings settings, bool isBlank = false, string? windowName = null)
{
InitializeComponent();
ThemeManager.Attach(this);
_settings = settings;
_windowName = windowName;
_doc = new EditorDocument(image);
@@ -160,7 +167,10 @@ public partial class EditorWindow : Window
foreach (UIElement item in ToolbarItems.Items)
{
_toolbarItems[ItemId(item)] = item;
_defaultToolbarOrder.Add(ItemId(item));
if (!SplitOnlyIds.Contains(ItemId(item)))
{
_defaultToolbarOrder.Add(ItemId(item));
}
}
_defaultSplitOrder.AddRange(DefaultSplitOrder.Where(_toolbarItems.ContainsKey));
@@ -177,14 +187,17 @@ public partial class EditorWindow : Window
private static string ItemId(UIElement item) => ToolbarPanel.GetItemId(item) ?? string.Empty;
private bool IsSplitLayout => _settings.EditorLayout == EditorLayout.Split;
private bool IsSplitLayout => _settings.EditorLayout is EditorLayout.Split or EditorLayout.ThreeSplit;
private IEnumerable<UIElement> AllToolbarItems => ToolbarItems.Items.Concat(ActionItems.Items);
private bool IsThreeSplit => _settings.EditorLayout == EditorLayout.ThreeSplit;
private IEnumerable<UIElement> AllToolbarItems => ToolbarItems.Items.Concat(ActionItems.Items).Concat(CaptureItems.Items);
/// <summary>Items volgens de opgeslagen volgorde van de huidige indeling over de bovenste en onderste werkbalk verdelen.</summary>
private void ApplyToolbarLayout()
{
bool split = IsSplitLayout;
bool threeSplit = IsThreeSplit;
_appliedLayout = _settings.EditorLayout;
List<string> order = split
? MergeToolbarOrder(_settings.SplitToolbarOrder, _defaultSplitOrder)
@@ -192,16 +205,28 @@ public partial class EditorWindow : Window
ToolbarItems.Children.Clear();
ActionItems.Children.Clear();
foreach (string id in order)
CaptureItems.Children.Clear();
foreach (string id in order.Where(id => split || !SplitOnlyIds.Contains(id)))
{
(split && SplitBottomIds.Contains(id) ? ActionItems : ToolbarItems).Children.Add(_toolbarItems[id]);
ToolbarPanel panel = threeSplit && CaptureBarIds.Contains(id) ? CaptureItems
: split && SplitBottomIds.Contains(id) ? ActionItems
: ToolbarItems;
panel.Children.Add(_toolbarItems[id]);
}
ToolbarItems.HorizontalAlignment = split ? HorizontalAlignment.Center : HorizontalAlignment.Stretch;
ActionBar.Visibility = split && !_toolbarsHidden ? Visibility.Visible : Visibility.Collapsed;
CaptureBar.Visibility = threeSplit && !_toolbarsHidden ? Visibility.Visible : Visibility.Collapsed;
ApplyCaptureBarPosition();
ApplyToolbarPosition();
}
private void ApplyCaptureBarPosition()
{
bool right = _settings.CaptureBarPosition == Dock.Right;
DockPanel.SetDock(CaptureBar, right ? Dock.Right : Dock.Left);
CaptureBar.BorderThickness = right ? new Thickness(1, 0, 0, 0) : new Thickness(0, 0, 1, 0);
}
private List<string> MergeToolbarOrder(IReadOnlyList<string> saved, IReadOnlyList<string> defaults)
{
List<string> order = saved.Where(_toolbarItems.ContainsKey).Distinct().ToList();
@@ -239,11 +264,13 @@ public partial class EditorWindow : Window
private void ApplyToolbarLock()
{
bool locked = _settings.ToolbarLocked;
Brush background = locked ? (Brush)FindResource("ToolbarBrush") : new SolidColorBrush(Color.FromRgb(0xEA, 0xF2, 0xFB));
string background = locked ? "ToolbarBrush" : "UnlockedToolbarBrush";
ToolbarItems.IsLocked = locked;
ActionItems.IsLocked = locked;
Toolbar.Background = background;
ActionBar.Background = background;
CaptureItems.IsLocked = locked;
Toolbar.SetResourceReference(Border.BackgroundProperty, background);
ActionBar.SetResourceReference(Border.BackgroundProperty, background);
CaptureBar.SetResourceReference(Border.BackgroundProperty, background);
UpdateHint();
}
@@ -259,6 +286,7 @@ public partial class EditorWindow : Window
{
UpdateActionLabels(Toolbar, ToolbarItems);
UpdateActionLabels(ActionBar, ActionItems);
UpdateActionLabels(CaptureBar, CaptureItems);
}
// Labels alleen tonen als alles op één regel past; staat de werkbalk opzij, dan altijd alleen iconen.
@@ -337,7 +365,7 @@ public partial class EditorWindow : Window
private void Toolbar_ContextMenuOpening(object sender, ContextMenuEventArgs e)
{
var bar = (Border)sender;
ToolbarPanel panel = bar == ActionBar ? ActionItems : ToolbarItems;
ToolbarPanel panel = bar == ActionBar ? ActionItems : bar == CaptureBar ? CaptureItems : ToolbarItems;
ContextMenu menu = bar.ContextMenu;
menu.Items.Clear();
@@ -348,8 +376,9 @@ public partial class EditorWindow : Window
var layout = new MenuItem { Header = "Indeling" };
foreach ((EditorLayout value, string label) in new[]
{
(EditorLayout.Single, "Eén werkbalk"),
(EditorLayout.Split, "Gesplitst: gereedschappen boven, opslaan onder (zoals ShareX)")
(EditorLayout.Split, "Split-weergave: gereedschappen boven, opslaan onder"),
(EditorLayout.ThreeSplit, "Drie-split: Nieuw en Screencast in een zijbalk"),
(EditorLayout.Single, "Eén werkbalk")
})
{
var item = new MenuItem { Header = label, IsCheckable = true, IsChecked = _settings.EditorLayout == value };
@@ -359,6 +388,23 @@ public partial class EditorWindow : Window
menu.Items.Add(layout);
if (IsThreeSplit)
{
var side = new MenuItem { Header = "Zijbalk" };
foreach ((Dock dock, string label) in new[] { (Dock.Left, "Links"), (Dock.Right, "Rechts") })
{
var item = new MenuItem { Header = label, IsCheckable = true, IsChecked = _settings.CaptureBarPosition == dock };
item.Click += (_, _) =>
{
_settings.CaptureBarPosition = dock;
ApplyCaptureBarPosition();
};
side.Items.Add(item);
}
menu.Items.Add(side);
}
if (!IsSplitLayout)
{
var position = new MenuItem { Header = "Positie" };
@@ -460,6 +506,7 @@ public partial class EditorWindow : Window
_settings.SplitToolbarOrder = new List<string>();
_settings.ToolbarHidden = new List<string>();
_settings.ToolbarPosition = Dock.Top;
_settings.CaptureBarPosition = Dock.Left;
_settings.ToolbarLocked = true;
ApplyToolbarLayout();
foreach (UIElement item in _toolbarItems.Values)
@@ -1045,6 +1092,7 @@ public partial class EditorWindow : Window
Toolbar.Visibility = visibility;
PropsBar.Visibility = visibility;
ActionBar.Visibility = IsSplitLayout ? visibility : Visibility.Collapsed;
CaptureBar.Visibility = IsThreeSplit ? visibility : Visibility.Collapsed;
if (_toolbarsHidden)
{
ShowTemporaryHint("Werkbalken verborgen. Ctrl+H of rechtsklik op het canvas om ze terug te halen.");
@@ -1624,6 +1672,7 @@ public partial class EditorWindow : Window
ApplyToolbarLayout();
}
ApplyCaptureBarPosition();
ApplySaveButton();
ApplyUploadButton();
}
+8 -8
View File
@@ -5,20 +5,20 @@
VerticalAlignment="Center">
<Grid>
<ToggleButton x:Name="Toggle" Style="{StaticResource FlatButton}" Padding="6,4" MinWidth="0" MinHeight="30"
BorderBrush="#E0E0E0" Background="White" ToolTip="Emoji kiezen">
BorderBrush="{DynamicResource ControlBorderBrush}" Background="{DynamicResource ControlBrush}" ToolTip="Emoji kiezen">
<StackPanel Orientation="Horizontal">
<Image x:Name="Face" Width="20" Height="20" RenderOptions.BitmapScalingMode="HighQuality" />
<TextBlock Text="&#xE70D;" Style="{StaticResource IconText}" FontSize="9" Margin="5,0,1,0" Foreground="#5C5C5C" />
<TextBlock Text="&#xE70D;" Style="{StaticResource IconText}" FontSize="9" Margin="5,0,1,0" Foreground="{DynamicResource SubtleTextBrush}" />
</StackPanel>
</ToggleButton>
<Popup x:Name="PopupPanel" PlacementTarget="{Binding ElementName=Toggle}" Placement="Bottom" StaysOpen="False"
AllowsTransparency="True" PopupAnimation="Fade" Opened="Popup_Opened"
IsOpen="{Binding IsChecked, ElementName=Toggle, Mode=TwoWay}">
<Border Background="White" BorderBrush="#D6D6D6" BorderThickness="1" CornerRadius="6" Padding="8" Margin="0,4,10,10"
<Border Background="{DynamicResource CardBrush}" BorderBrush="{DynamicResource ControlStrongBorderBrush}" BorderThickness="1" CornerRadius="6" Padding="8" Margin="0,4,10,10"
PreviewKeyDown="Popup_PreviewKeyDown">
<Border.Resources>
<DataTemplate DataType="{x:Type local:EmojiHeaderRow}">
<TextBlock Text="{Binding Title}" FontSize="12" FontWeight="SemiBold" Foreground="{StaticResource SubtleTextBrush}"
<TextBlock Text="{Binding Title}" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SubtleTextBrush}"
Margin="4,8,0,4" />
</DataTemplate>
<DataTemplate DataType="{x:Type local:EmojiCellRow}">
@@ -46,7 +46,7 @@
<!-- Zoeken -->
<Grid DockPanel.Dock="Top" Margin="0,0,0,6">
<TextBox x:Name="SearchBox" Height="30" Padding="28,0,6,0" VerticalContentAlignment="Center" FontSize="13"
BorderBrush="#D6D6D6" TextChanged="SearchBox_TextChanged" />
TextChanged="SearchBox_TextChanged" />
<TextBlock Text="&#xE721;" Style="{StaticResource IconText}" FontSize="12" Foreground="#8A8A8A"
HorizontalAlignment="Left" Margin="9,0,0,0" IsHitTestVisible="False" />
<TextBlock x:Name="SearchPlaceholder" Text="Zoeken (Nederlands of Engels)" Foreground="#8A8A8A" FontSize="13"
@@ -57,14 +57,14 @@
<StackPanel x:Name="TabPanel" DockPanel.Dock="Top" Orientation="Horizontal" Margin="0,0,0,4" />
<!-- Voorbeeld en huidskleur -->
<Border DockPanel.Dock="Bottom" BorderBrush="{StaticResource DividerBrush}" BorderThickness="0,1,0,0" Padding="2,8,0,0"
<Border DockPanel.Dock="Bottom" BorderBrush="{DynamicResource DividerBrush}" BorderThickness="0,1,0,0" Padding="2,8,0,0"
Margin="0,4,0,0">
<DockPanel>
<StackPanel x:Name="TonePanel" DockPanel.Dock="Right" Orientation="Horizontal" VerticalAlignment="Center" />
<Image x:Name="PreviewImage" Width="36" Height="36" RenderOptions.BitmapScalingMode="HighQuality" />
<StackPanel VerticalAlignment="Center" Margin="8,0,6,0">
<TextBlock x:Name="PreviewName" FontSize="13" TextTrimming="CharacterEllipsis" />
<TextBlock x:Name="PreviewCode" FontSize="11" Foreground="{StaticResource SubtleTextBrush}"
<TextBlock x:Name="PreviewCode" FontSize="11" Foreground="{DynamicResource SubtleTextBrush}"
TextTrimming="CharacterEllipsis" />
</StackPanel>
</DockPanel>
@@ -89,7 +89,7 @@
</ControlTemplate>
</ItemsControl.Template>
</ItemsControl>
<TextBlock x:Name="NoResultsText" Text="Geen emoji gevonden" Foreground="{StaticResource SubtleTextBrush}"
<TextBlock x:Name="NoResultsText" Text="Geen emoji gevonden" Foreground="{DynamicResource SubtleTextBrush}"
HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed" />
</Grid>
</DockPanel>
+9 -1
View File
@@ -477,6 +477,14 @@ public sealed class ToolbarSeparator : FrameworkElement
{
private const double Thickness = 13;
private static readonly DependencyProperty LineBrushProperty = DependencyProperty.Register(
nameof(LineBrush), typeof(Brush), typeof(ToolbarSeparator),
new FrameworkPropertyMetadata(Brushes.LightGray, FrameworkPropertyMetadataOptions.AffectsRender));
public ToolbarSeparator() => SetResourceReference(LineBrushProperty, "DividerBrush");
private Brush LineBrush => (Brush)GetValue(LineBrushProperty);
private bool Vertical => VisualTreeHelper.GetParent(this) is ToolbarPanel { Orientation: Orientation.Vertical };
protected override Size MeasureOverride(Size availableSize) =>
@@ -489,7 +497,7 @@ public sealed class ToolbarSeparator : FrameworkElement
return;
}
Brush brush = TryFindResource("DividerBrush") as Brush ?? Brushes.LightGray;
Brush brush = LineBrush;
Rect line = Vertical
? new Rect(6, Math.Floor(RenderSize.Height / 2), Math.Max(0, RenderSize.Width - 12), 1)
: new Rect(Math.Floor(RenderSize.Width / 2), 6, 1, Math.Max(0, RenderSize.Height - 12));
+15 -14
View File
@@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="kniip geschiedenis" Width="980" Height="620" MinWidth="560" MinHeight="360"
WindowStartupLocation="CenterScreen" Background="{StaticResource WindowBrush}"
WindowStartupLocation="CenterScreen" Background="{DynamicResource WindowBrush}" Foreground="{DynamicResource InkBrush}"
FontFamily="Segoe UI" FontSize="13" Icon="pack://application:,,,/AppIcon.ico">
<Window.Resources>
<Style x:Key="ViewToggle" TargetType="RadioButton" BasedOn="{StaticResource ToolToggle}">
@@ -24,16 +24,16 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border x:Name="Bd" Background="White" BorderBrush="#E0E0E0" BorderThickness="1" CornerRadius="6" Padding="6">
<Border x:Name="Bd" Background="{DynamicResource CardBrush}" BorderBrush="{DynamicResource ControlBorderBrush}" BorderThickness="1" CornerRadius="6" Padding="6">
<ContentPresenter />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#F5F5F5" />
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlHoverBrush}" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#1A0067C0" />
<Setter TargetName="Bd" Property="BorderBrush" Value="{StaticResource AccentBrush}" />
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource SelectedBrush}" />
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource AccentBrush}" />
</Trigger>
<DataTrigger Binding="{Binding IsAvailable}" Value="False">
<Setter Property="Opacity" Value="0.5" />
@@ -46,7 +46,7 @@
<DataTemplate x:Key="SmallThumb">
<Grid Width="40" Height="28">
<Image Source="{Binding Thumbnail}" Stretch="Uniform" RenderOptions.BitmapScalingMode="HighQuality" />
<TextBlock Text="&#xE714;" Style="{StaticResource IconText}" Foreground="{StaticResource SubtleTextBrush}"
<TextBlock Text="&#xE714;" Style="{StaticResource IconText}" Foreground="{DynamicResource SubtleTextBrush}"
Visibility="{Binding NoThumbnailVisibility}" />
</Grid>
</DataTemplate>
@@ -70,14 +70,14 @@
<TextBox x:Name="SearchBox" Height="30" Padding="26,0,6,0" VerticalContentAlignment="Center"
TextChanged="SearchBox_TextChanged" />
<TextBlock Text="&#xE721;" Style="{StaticResource IconText}" FontSize="13" HorizontalAlignment="Left" Margin="8,0,0,0"
Foreground="{StaticResource SubtleTextBrush}" IsHitTestVisible="False" />
Foreground="{DynamicResource SubtleTextBrush}" IsHitTestVisible="False" />
<TextBlock x:Name="SearchHint" Text="Zoeken op naam of link" Margin="27,0,0,0" VerticalAlignment="Center"
Foreground="{StaticResource SubtleTextBrush}" IsHitTestVisible="False" />
Foreground="{DynamicResource SubtleTextBrush}" IsHitTestVisible="False" />
</Grid>
</DockPanel>
<DockPanel DockPanel.Dock="Bottom" Margin="0,10,0,0" LastChildFill="False">
<TextBlock x:Name="CountText" VerticalAlignment="Center" Foreground="{StaticResource SubtleTextBrush}" />
<TextBlock x:Name="CountText" VerticalAlignment="Center" Foreground="{DynamicResource SubtleTextBrush}" />
<Button DockPanel.Dock="Right" Content="Sluiten" Style="{StaticResource SecondaryButton}" IsCancel="True" Click="Close_Click" />
<Button x:Name="ClearButton" DockPanel.Dock="Right" Content="Geschiedenis wissen..." Style="{StaticResource SecondaryButton}"
Click="Clear_Click" />
@@ -85,7 +85,8 @@
<Grid>
<ListView x:Name="ListItems" ItemContainerStyle="{StaticResource RowStyle}" SelectionMode="Single"
BorderBrush="#E0E0E0" ContextMenuOpening="Items_ContextMenuOpening">
Background="{DynamicResource CardBrush}" Foreground="{DynamicResource InkBrush}"
BorderBrush="{DynamicResource ControlBorderBrush}" ContextMenuOpening="Items_ContextMenuOpening">
<ListView.ContextMenu>
<ContextMenu />
</ListView.ContextMenu>
@@ -115,20 +116,20 @@
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Width="180" ToolTip="{Binding ToolTip}">
<Grid Height="120" Background="#F3F3F3">
<Grid Height="120" Background="{DynamicResource WindowBrush}">
<Image Source="{Binding Thumbnail}" Stretch="Uniform" RenderOptions.BitmapScalingMode="HighQuality" />
<TextBlock Text="&#xE714;" Style="{StaticResource IconText}" FontSize="32"
Foreground="{StaticResource SubtleTextBrush}" Visibility="{Binding NoThumbnailVisibility}" />
Foreground="{DynamicResource SubtleTextBrush}" Visibility="{Binding NoThumbnailVisibility}" />
</Grid>
<TextBlock Text="{Binding Entry.Name}" Margin="0,6,0,0" TextTrimming="CharacterEllipsis" />
<TextBlock Text="{Binding TimeText}" FontSize="12" Foreground="{StaticResource SubtleTextBrush}" />
<TextBlock Text="{Binding TimeText}" FontSize="12" Foreground="{DynamicResource SubtleTextBrush}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBlock x:Name="EmptyText" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center"
Foreground="{StaticResource SubtleTextBrush}" Visibility="Collapsed"
Foreground="{DynamicResource SubtleTextBrush}" Visibility="Collapsed"
Text="Nog niets in de geschiedenis.&#x0a;Wat je in kniip opslaat of uploadt, komt hier te staan." />
</Grid>
</DockPanel>
+1
View File
@@ -19,6 +19,7 @@ public partial class HistoryWindow : Window
public HistoryWindow(bool images)
{
InitializeComponent();
Infrastructure.ThemeManager.Attach(this);
Reload();
ShowImages(images);
HistoryStore.Changed += Reload;
+121
View File
@@ -0,0 +1,121 @@
using System;
using System.Windows;
using System.Windows.Interop;
using Kniip.Interop;
using Kniip.Settings;
using Microsoft.Win32;
namespace Kniip.Infrastructure;
/// <summary>Wisselt de kleuren van alle vensters tussen licht en donker (Themes/Light.xaml en Themes/Dark.xaml).</summary>
internal static class ThemeManager
{
private const string PersonalizeKey = @"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize";
private static readonly Uri LightUri = new("pack://application:,,,/Themes/Light.xaml");
private static readonly Uri DarkUri = new("pack://application:,,,/Themes/Dark.xaml");
private static ResourceDictionary? _light;
private static ResourceDictionary? _dark;
private static ColorMode _mode;
private static bool _listening;
public static bool IsDark { get; private set; }
/// <summary>Na elke wissel tussen licht en donker.</summary>
public static event Action? Changed;
public static void Apply(ColorMode mode)
{
_mode = mode;
if (mode == ColorMode.System && !_listening)
{
_listening = true;
SystemEvents.UserPreferenceChanged += OnUserPreferenceChanged;
}
Refresh();
}
/// <summary>Geeft het venster een titelbalk in de huidige kleurmodus, ook na een latere wissel.</summary>
public static void Attach(Window window) =>
window.SourceInitialized += (_, _) => NativeMethods.SetDarkTitleBar(new WindowInteropHelper(window).Handle, IsDark);
private static void Refresh()
{
bool dark = _mode switch
{
ColorMode.Dark => true,
ColorMode.System => IsSystemDark(),
_ => false
};
if (dark == IsDark && _light != null)
{
return;
}
IsDark = dark;
_light ??= new ResourceDictionary { Source = LightUri };
_dark ??= new ResourceDictionary { Source = DarkUri };
var merged = Application.Current.Resources.MergedDictionaries;
int index = -1;
for (int i = 0; i < merged.Count; i++)
{
if (merged[i].Source is { } source && (source.OriginalString.EndsWith("Light.xaml", StringComparison.OrdinalIgnoreCase)
|| source.OriginalString.EndsWith("Dark.xaml", StringComparison.OrdinalIgnoreCase)))
{
index = i;
break;
}
}
ResourceDictionary theme = dark ? _dark : _light;
if (index < 0)
{
merged.Insert(0, theme);
}
else if (merged[index] != theme)
{
merged[index] = theme;
}
foreach (Window window in Application.Current.Windows)
{
IntPtr hwnd = new WindowInteropHelper(window).Handle;
if (hwnd != IntPtr.Zero && window.WindowStyle != WindowStyle.None)
{
NativeMethods.SetDarkTitleBar(hwnd, dark);
}
}
Changed?.Invoke();
}
private static void OnUserPreferenceChanged(object? sender, UserPreferenceChangedEventArgs e)
{
if (e.Category == UserPreferenceCategory.General)
{
Application.Current?.Dispatcher.BeginInvoke(() =>
{
if (_mode == ColorMode.System)
{
Refresh();
}
});
}
}
private static bool IsSystemDark()
{
try
{
using RegistryKey? key = Registry.CurrentUser.OpenSubKey(PersonalizeKey);
return key?.GetValue("AppsUseLightTheme") is int light && light == 0;
}
catch (Exception)
{
return false;
}
}
}
+86 -5
View File
@@ -22,8 +22,10 @@ internal sealed class TrayIcon : IDisposable
private readonly ToolStripMenuItem _foldersItem;
private readonly ToolStripMenuItem _recentItem;
private readonly ToolStripMenuItem _delayItem;
private Panel _delayPanel = null!;
private TrackBar _delaySlider = null!;
private NumericUpDown _delayNumber = null!;
private Label _delayUnit = null!;
private int _delaySeconds;
private int _savedDelaySeconds;
@@ -152,7 +154,7 @@ internal sealed class TrayIcon : IDisposable
Location = new Point(_delaySlider.Right + 6, 10),
TextAlign = HorizontalAlignment.Right
};
var unit = new Label
_delayUnit = new Label
{
Text = "seconden",
AutoSize = true,
@@ -160,11 +162,12 @@ internal sealed class TrayIcon : IDisposable
};
var panel = new Panel
{
Size = new Size(unit.Left + unit.PreferredWidth + 10, 44),
Size = new Size(_delayUnit.Left + _delayUnit.PreferredWidth + 10, 44),
BackColor = ProfessionalColors.ToolStripDropDownBackground
};
_delayPanel = panel;
_delaySlider.BackColor = panel.BackColor;
panel.Controls.AddRange(new Control[] { _delaySlider, _delayNumber, unit });
panel.Controls.AddRange(new Control[] { _delaySlider, _delayNumber, _delayUnit });
_delaySlider.ValueChanged += (_, _) => ShowCaptureDelay(_delaySlider.Value);
_delayNumber.ValueChanged += (_, _) => ShowCaptureDelay((int)_delayNumber.Value);
@@ -207,9 +210,22 @@ internal sealed class TrayIcon : IDisposable
_delayItem.Text = $"Schermafdruk vertraging: {seconds}s";
}
/// <summary>Menu in de kleurmodus van kniip.</summary>
public void ApplyTheme(bool dark)
{
ToolStripManager.Renderer = dark ? new DarkMenuRenderer() : new ToolStripProfessionalRenderer();
Color back = dark ? DarkMenuColors.Background : ProfessionalColors.ToolStripDropDownBackground;
Color fore = dark ? DarkMenuColors.Text : SystemColors.ControlText;
_delayPanel.BackColor = back;
_delaySlider.BackColor = back;
_delayUnit.ForeColor = fore;
_delayNumber.BackColor = dark ? DarkMenuColors.Input : SystemColors.Window;
_delayNumber.ForeColor = dark ? DarkMenuColors.Text : SystemColors.WindowText;
}
private static string IdleText => AppIdentity.IsTest
? $"{AppIdentity.DisplayName} {Kniip.Update.UpdateChecker.CurrentVersion}"
: "kniip - annotaties voor het Knipprogramma";
: AppIdentity.DisplayName;
private void BuildFolders()
{
@@ -300,7 +316,8 @@ internal sealed class TrayIcon : IDisposable
private static Icon LoadIcon()
{
var info = System.Windows.Application.GetResourceStream(new Uri("pack://application:,,,/AppIcon.ico"));
// Uitsnede van AppIcon.ico zonder snijlijnen (tools\make-tray-icon.ps1): op 16px vult het kader zo het vak.
var info = System.Windows.Application.GetResourceStream(new Uri("pack://application:,,,/TrayIcon.ico"));
if (info == null)
{
return SystemIcons.Application;
@@ -315,4 +332,68 @@ internal sealed class TrayIcon : IDisposable
_icon.Visible = false;
_icon.Dispose();
}
private sealed class DarkMenuColors : ProfessionalColorTable
{
public static readonly Color Background = Color.FromArgb(0x2B, 0x2B, 0x2B);
public static readonly Color Highlight = Color.FromArgb(0x3D, 0x3D, 0x3D);
public static readonly Color Border = Color.FromArgb(0x45, 0x45, 0x45);
public static readonly Color Input = Color.FromArgb(0x2D, 0x2D, 0x2D);
public static readonly Color Text = Color.FromArgb(0xF2, 0xF2, 0xF2);
public override Color ToolStripDropDownBackground => Background;
public override Color ImageMarginGradientBegin => Background;
public override Color ImageMarginGradientMiddle => Background;
public override Color ImageMarginGradientEnd => Background;
public override Color MenuBorder => Border;
public override Color MenuItemBorder => Highlight;
public override Color MenuItemSelected => Highlight;
public override Color MenuItemSelectedGradientBegin => Highlight;
public override Color MenuItemSelectedGradientEnd => Highlight;
public override Color MenuItemPressedGradientBegin => Highlight;
public override Color MenuItemPressedGradientEnd => Highlight;
public override Color SeparatorDark => Border;
public override Color SeparatorLight => Background;
public override Color CheckBackground => Highlight;
public override Color CheckSelectedBackground => Highlight;
public override Color CheckPressedBackground => Highlight;
}
private sealed class DarkMenuRenderer : ToolStripProfessionalRenderer
{
public DarkMenuRenderer() : base(new DarkMenuColors())
{
RoundedEdges = false;
}
protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e)
{
e.TextColor = e.Item.Enabled ? DarkMenuColors.Text : Color.FromArgb(0x80, 0x80, 0x80);
base.OnRenderItemText(e);
}
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
{
e.ArrowColor = DarkMenuColors.Text;
base.OnRenderArrow(e);
}
protected override void OnRenderItemCheck(ToolStripItemImageRenderEventArgs e)
{
// Het standaardvinkje is zwart en valt weg op de donkere achtergrond.
Rectangle r = e.ImageRectangle;
using var background = new SolidBrush(DarkMenuColors.Highlight);
e.Graphics.FillRectangle(background, r);
using var pen = new Pen(DarkMenuColors.Text, 1.6f);
System.Drawing.Drawing2D.SmoothingMode smoothing = e.Graphics.SmoothingMode;
e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
e.Graphics.DrawLines(pen, new[]
{
new PointF(r.Left + r.Width * 0.22f, r.Top + r.Height * 0.52f),
new PointF(r.Left + r.Width * 0.42f, r.Top + r.Height * 0.72f),
new PointF(r.Left + r.Width * 0.78f, r.Top + r.Height * 0.30f)
});
e.Graphics.SmoothingMode = smoothing;
}
}
}
+16
View File
@@ -224,6 +224,22 @@ internal static class NativeMethods
[DllImport("dwmapi.dll")]
private static extern int DwmGetWindowAttribute(IntPtr hwnd, int attribute, out int value, int size);
[DllImport("dwmapi.dll")]
private static extern int DwmSetWindowAttribute(IntPtr hwnd, int attribute, ref int value, int size);
private const int DWMWA_USE_IMMERSIVE_DARK_MODE = 20;
private const int DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1 = 19;
/// <summary>Donkere of lichte titelbalk; doet niets op Windows-versies die dat niet kennen.</summary>
public static void SetDarkTitleBar(IntPtr hwnd, bool dark)
{
int value = dark ? 1 : 0;
if (DwmSetWindowAttribute(hwnd, DWMWA_USE_IMMERSIVE_DARK_MODE, ref value, sizeof(int)) != 0)
{
DwmSetWindowAttribute(hwnd, DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1, ref value, sizeof(int));
}
}
public static void AddExtendedStyle(IntPtr hwnd, int style)
{
long current = GetWindowLongPtr(hwnd, GWL_EXSTYLE).ToInt64();
+2 -1
View File
@@ -18,7 +18,7 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
<Product>kniip</Product>
<Description>Annotatie-editor naast het Windows Knipprogramma</Description>
<Version>1.1.5</Version>
<Version>1.1.8</Version>
<SatelliteResourceLanguages>nl;en</SatelliteResourceLanguages>
<!-- WPF regelt DPI via app.manifest; de WinForms-analyzer is hier niet van toepassing. -->
<NoWarn>$(NoWarn);WFAC010</NoWarn>
@@ -34,6 +34,7 @@
<ItemGroup>
<Resource Include="AppIcon.ico" />
<Resource Include="TrayIcon.ico" />
<Resource Include="Assets\Emoji\emoji.json;Assets\Emoji\twemoji-64.png" />
</ItemGroup>
+6 -6
View File
@@ -3,8 +3,8 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="kniip" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
Topmost="True" ShowInTaskbar="False" ShowActivated="False" ResizeMode="NoResize"
SizeToContent="WidthAndHeight" FontFamily="Segoe UI" UseLayoutRounding="True">
<Border Margin="16" Background="#FCFCFC" CornerRadius="8" BorderBrush="#DADADA" BorderThickness="1">
SizeToContent="WidthAndHeight" FontFamily="Segoe UI" Foreground="{DynamicResource InkBrush}" UseLayoutRounding="True">
<Border Margin="16" Background="{DynamicResource ToastBrush}" CornerRadius="8" BorderBrush="{DynamicResource ToastBorderBrush}" BorderThickness="1">
<Border.Effect>
<DropShadowEffect BlurRadius="18" ShadowDepth="3" Opacity="0.22" />
</Border.Effect>
@@ -21,20 +21,20 @@
<StackPanel Grid.ColumnSpan="2" Orientation="Horizontal" Margin="0,0,0,10">
<Image Source="pack://application:,,,/AppIcon.ico" Width="16" Height="16" />
<TextBlock Text="kniip" Margin="6,0,0,0" FontSize="12" Foreground="#5C5C5C" VerticalAlignment="Center" />
<TextBlock Text="kniip" Margin="6,0,0,0" FontSize="12" Foreground="{DynamicResource SubtleTextBrush}" VerticalAlignment="Center" />
</StackPanel>
<Button Grid.Column="2" Style="{StaticResource FlatButton}" MinWidth="28" MinHeight="24" Padding="4,2"
VerticalAlignment="Top" Click="Close_Click" ToolTip="Sluiten">
<TextBlock Text="&#xE711;" Style="{StaticResource IconText}" FontSize="10" />
</Button>
<Border Grid.Row="1" Width="110" Height="72" CornerRadius="4" BorderBrush="#E0E0E0" BorderThickness="1"
Background="#EBEBEB" Cursor="Hand" MouseLeftButtonUp="Thumbnail_Click" ClipToBounds="True">
<Border Grid.Row="1" Width="110" Height="72" CornerRadius="4" BorderBrush="{DynamicResource ControlBorderBrush}" BorderThickness="1"
Background="{DynamicResource ControlPressedBrush}" Cursor="Hand" MouseLeftButtonUp="Thumbnail_Click" ClipToBounds="True">
<Image x:Name="Thumbnail" Stretch="Uniform" RenderOptions.BitmapScalingMode="HighQuality" />
</Border>
<StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Margin="12,0,4,0" VerticalAlignment="Center">
<TextBlock Text="Nieuw knipsel" FontWeight="SemiBold" FontSize="14" />
<TextBlock x:Name="DetailText" Foreground="#5C5C5C" FontSize="12" Margin="0,2,0,8" />
<TextBlock x:Name="DetailText" Foreground="{DynamicResource SubtleTextBrush}" FontSize="12" Margin="0,2,0,8" />
<StackPanel Orientation="Horizontal">
<Button Style="{StaticResource AccentButton}" Margin="0,0,6,0" Click="Edit_Click">
<StackPanel Orientation="Horizontal">
+4 -4
View File
@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="kniip opname" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
ResizeMode="NoResize" SizeToContent="WidthAndHeight" ShowInTaskbar="False" Topmost="True"
FontFamily="Segoe UI" FontSize="13">
FontFamily="Segoe UI" FontSize="13" Foreground="{DynamicResource InkBrush}">
<Window.Resources>
<Style x:Key="RecordStyle" TargetType="Button" BasedOn="{StaticResource AccentButton}">
<Setter Property="Template">
@@ -25,7 +25,7 @@
</Setter>
</Style>
</Window.Resources>
<Border Margin="10" Background="White" BorderBrush="#D6D6D6" BorderThickness="1" CornerRadius="8" Padding="6"
<Border Margin="10" Background="{DynamicResource CardBrush}" BorderBrush="{DynamicResource ControlStrongBorderBrush}" BorderThickness="1" CornerRadius="8" Padding="6"
MouseLeftButtonDown="Background_MouseLeftButtonDown">
<Border.Effect>
<DropShadowEffect BlurRadius="14" ShadowDepth="2" Opacity="0.25" />
@@ -33,7 +33,7 @@
<StackPanel Orientation="Horizontal">
<StackPanel x:Name="TimePanel" Orientation="Horizontal" VerticalAlignment="Center" Margin="6,0,8,0" Visibility="Collapsed">
<Ellipse x:Name="RecordDot" Width="10" Height="10" Fill="#E81123" Margin="0,0,6,0" />
<TextBlock x:Name="TimeText" Text="0:00" FontWeight="SemiBold" MinWidth="40" Foreground="{StaticResource InkBrush}" />
<TextBlock x:Name="TimeText" Text="0:00" FontWeight="SemiBold" MinWidth="40" Foreground="{DynamicResource InkBrush}" />
</StackPanel>
<ToggleButton x:Name="SystemAudioToggle" Style="{StaticResource MiniToggle}" Height="34" MinWidth="34"
@@ -66,7 +66,7 @@
</Button>
<TextBlock x:Name="BusyText" Text="Opname afronden..." VerticalAlignment="Center" Margin="8,0" Visibility="Collapsed"
Foreground="{StaticResource SubtleTextBrush}" />
Foreground="{DynamicResource SubtleTextBrush}" />
<Button x:Name="CancelButton" Style="{StaticResource FlatButton}" Click="Cancel_Click" ToolTip="Annuleren (opname weggooien)">
<TextBlock Text="&#xE711;" Style="{StaticResource IconText}" FontSize="14" />
@@ -7,21 +7,21 @@
Background="#01000000">
<Grid>
<Path x:Name="Dim" Fill="#73000000" />
<Rectangle x:Name="SelectionRect" Stroke="{StaticResource AccentBrush}" StrokeThickness="2"
<Rectangle x:Name="SelectionRect" Stroke="{DynamicResource AccentBrush}" StrokeThickness="2"
HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="Collapsed" IsHitTestVisible="False" />
<Border x:Name="SizeBadge" HorizontalAlignment="Left" VerticalAlignment="Top" Background="#E6202020"
CornerRadius="4" Padding="6,2" Visibility="Collapsed" IsHitTestVisible="False">
<TextBlock x:Name="SizeText" Foreground="White" FontSize="12" />
</Border>
<capture:MagnifierControl x:Name="Magnifier" />
<Border x:Name="Hint" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,28,0,0" Background="#F2FFFFFF"
<Border x:Name="Hint" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,28,0,0" Background="{DynamicResource ToastBrush}"
CornerRadius="6" Padding="16,9" IsHitTestVisible="False">
<Border.Effect>
<DropShadowEffect BlurRadius="12" ShadowDepth="2" Opacity="0.25" />
</Border.Effect>
<StackPanel>
<TextBlock Text="Screencast: kies wat je wilt opnemen" FontWeight="SemiBold" Foreground="{StaticResource InkBrush}" />
<TextBlock Foreground="{StaticResource SubtleTextBrush}" FontSize="12" Margin="0,2,0,0"
<TextBlock Text="Screencast: kies wat je wilt opnemen" FontWeight="SemiBold" Foreground="{DynamicResource InkBrush}" />
<TextBlock Foreground="{DynamicResource SubtleTextBrush}" FontSize="12" Margin="0,2,0,0"
Text="Sleep een gebied · klik op een venster · Enter = heel scherm · Esc = annuleren" />
</StackPanel>
</Border>
+9 -9
View File
@@ -2,12 +2,12 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="kniip screencast" Width="980" Height="720" MinWidth="680" MinHeight="500"
WindowStartupLocation="CenterScreen" Background="{StaticResource WindowBrush}"
WindowStartupLocation="CenterScreen" Background="{DynamicResource WindowBrush}" Foreground="{DynamicResource InkBrush}"
FontFamily="Segoe UI" FontSize="13" Icon="pack://application:,,,/AppIcon.ico">
<Window.Resources>
<Style x:Key="Handle" TargetType="Border">
<Setter Property="Width" Value="12" />
<Setter Property="Background" Value="{StaticResource AccentBrush}" />
<Setter Property="Background" Value="{DynamicResource AccentBrush}" />
<Setter Property="Cursor" Value="SizeWE" />
</Style>
<Style x:Key="Grip" TargetType="Rectangle">
@@ -43,10 +43,10 @@
MouseLeftButtonDown="TrimArea_MouseLeftButtonDown" MouseMove="TrimArea_MouseMove"
MouseLeftButtonUp="TrimArea_MouseLeftButtonUp" SizeChanged="TrimArea_SizeChanged">
<Canvas x:Name="TrimCanvas">
<Border x:Name="TrackBorder" Background="#DADADA" CornerRadius="5" Height="44" />
<Border x:Name="SelectionBorder" Background="#330067C0" BorderBrush="{StaticResource AccentBrush}"
<Border x:Name="TrackBorder" Background="{DynamicResource TrackBrush}" CornerRadius="5" Height="44" />
<Border x:Name="SelectionBorder" Background="#330067C0" BorderBrush="{DynamicResource AccentBrush}"
BorderThickness="0,2" Height="44" />
<Rectangle x:Name="Playhead" Width="2" Height="52" Fill="{StaticResource InkBrush}" Canvas.Top="-4" />
<Rectangle x:Name="Playhead" Width="2" Height="52" Fill="{DynamicResource InkBrush}" Canvas.Top="-4" />
<Border x:Name="StartHandle" Style="{StaticResource Handle}" CornerRadius="5,0,0,5" Height="44"
ToolTip="Begin van de selectie">
<Rectangle Style="{StaticResource Grip}" />
@@ -64,7 +64,7 @@
<TextBlock x:Name="PlayIcon" Text="&#xE768;" Style="{StaticResource IconText}" />
</Button>
<TextBlock x:Name="PositionText" DockPanel.Dock="Left" VerticalAlignment="Center" Margin="6,0,0,0"
Foreground="{StaticResource InkBrush}" Text="0:00.0 / 0:00.0" />
Foreground="{DynamicResource InkBrush}" Text="0:00.0 / 0:00.0" />
<Button DockPanel.Dock="Right" Style="{StaticResource FlatButton}" Click="SetEnd_Click"
ToolTip="Einde van de selectie op de huidige positie zetten">
@@ -81,10 +81,10 @@
</StackPanel>
</Button>
<TextBlock x:Name="SelectionText" DockPanel.Dock="Right" VerticalAlignment="Center" Margin="0,0,10,0"
Foreground="{StaticResource SubtleTextBrush}" />
Foreground="{DynamicResource SubtleTextBrush}" />
</DockPanel>
<Border Grid.Row="3" Margin="0,12,0,0" Background="White" BorderBrush="#E5E5E5" BorderThickness="1"
<Border Grid.Row="3" Margin="0,12,0,0" Background="{DynamicResource CardBrush}" BorderBrush="{DynamicResource CardBorderBrush}" BorderThickness="1"
CornerRadius="6" Padding="14,10">
<DockPanel LastChildFill="True">
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" VerticalAlignment="Center">
@@ -132,7 +132,7 @@
</StackPanel>
<TextBlock x:Name="InfoText" Style="{StaticResource PropLabel}" Margin="0,6,0,0" TextWrapping="Wrap" />
<TextBlock x:Name="SavedText" Margin="0,4,0,0" Visibility="Collapsed" FontSize="12" TextWrapping="Wrap">
<Run x:Name="SavedRun" Foreground="{StaticResource InkBrush}" />
<Run x:Name="SavedRun" Foreground="{DynamicResource InkBrush}" />
<Hyperlink Click="OpenFolder_Click"><Run x:Name="OpenRun" Text="Map openen" /></Hyperlink>
</TextBlock>
</StackPanel>
@@ -50,6 +50,7 @@ public partial class ScreencastWindow : Window
internal ScreencastWindow(string path, AppSettings settings, ScreencastFormat? format = null, string? windowName = null)
{
InitializeComponent();
Infrastructure.ThemeManager.Attach(this);
_path = path;
_settings = settings;
_windowName = windowName;
+21 -3
View File
@@ -38,8 +38,20 @@ public enum EditorLayout
/// <summary>Eén werkbalk met gereedschappen en acties.</summary>
Single,
/// <summary>Gereedschappen boven, opslaan/kopiëren en zoom onder (zoals ShareX).</summary>
Split
/// <summary>Split-weergave: gereedschappen boven, opslaan/kopiëren en zoom onder.</summary>
Split,
/// <summary>Als Split, met Nieuw en Screencast in een zijbalk naast het canvas.</summary>
ThreeSplit
}
public enum ColorMode
{
Light,
Dark,
/// <summary>De app-modus van Windows volgen (licht of donker).</summary>
System
}
public sealed class AppSettings
@@ -104,12 +116,18 @@ public sealed class AppSettings
/// <summary>Volgorde van de werkbalkitems (ItemId's); leeg betekent de standaardvolgorde.</summary>
public List<string> ToolbarOrder { get; set; } = new();
/// <summary>Kleurmodus van alle vensters van kniip.</summary>
public ColorMode ColorMode { get; set; } = ColorMode.Light;
/// <summary>Indeling van de werkbalk(en) in de editor.</summary>
public EditorLayout EditorLayout { get; set; } = EditorLayout.Single;
public EditorLayout EditorLayout { get; set; } = EditorLayout.Split;
/// <summary>Volgorde van de werkbalkitems in de gesplitste indeling (boven, dan onder); leeg betekent de standaardvolgorde.</summary>
public List<string> SplitToolbarOrder { get; set; } = new();
/// <summary>Kant van het canvas (Left of Right) waar de zijbalk van de drie-split-indeling staat.</summary>
public Dock CaptureBarPosition { get; set; } = Dock.Left;
public List<string> ToolbarHidden { get; set; } = new();
/// <summary>Zipline-server waar Uploaden naartoe gaat; leeg betekent geen uploadknop.</summary>
+63 -53
View File
@@ -2,28 +2,35 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="kniip instellingen" Width="720" Height="600" ResizeMode="NoResize"
WindowStartupLocation="CenterScreen" Background="{StaticResource WindowBrush}"
WindowStartupLocation="CenterScreen" Background="{DynamicResource WindowBrush}" Foreground="{DynamicResource InkBrush}"
FontFamily="Segoe UI" FontSize="13" Icon="pack://application:,,,/AppIcon.ico">
<Window.Resources>
<!-- Inhoud van een tab erft anders de blauwe, vette tekst van de geselecteerde tabkop -->
<Style x:Key="TabPage" TargetType="StackPanel">
<Setter Property="TextElement.Foreground" Value="{DynamicResource InkBrush}" />
<Setter Property="TextElement.FontWeight" Value="Normal" />
</Style>
<Style x:Key="CardTitle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{DynamicResource AccentTextBrush}" />
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="FontSize" Value="14" />
<Setter Property="Margin" Value="0,0,0,8" />
</Style>
<Style TargetType="CheckBox">
<Style TargetType="CheckBox" BasedOn="{StaticResource {x:Type CheckBox}}">
<Setter Property="Margin" Value="0,4" />
</Style>
<Style TargetType="RadioButton">
<Style TargetType="RadioButton" BasedOn="{StaticResource {x:Type RadioButton}}">
<Setter Property="Margin" Value="0,4" />
</Style>
<Style x:Key="Hint" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource SubtleTextBrush}" />
<Setter Property="Foreground" Value="{DynamicResource SubtleTextBrush}" />
<Setter Property="FontSize" Value="12" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="Margin" Value="22,0,0,4" />
</Style>
<Style x:Key="SettingsTabItem" TargetType="TabItem">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Foreground" Value="{DynamicResource InkBrush}" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="Padding" Value="12,9" />
@@ -42,12 +49,12 @@
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsSelected" Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="Bd" Property="Background" Value="{StaticResource HoverBrush}" />
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource HoverBrush}" />
</MultiTrigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Bd" Property="Background" Value="White" />
<Setter TargetName="Bd" Property="BorderBrush" Value="{StaticResource AccentBrush}" />
<Setter Property="Foreground" Value="{StaticResource AccentBrush}" />
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource CardBrush}" />
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource AccentBrush}" />
<Setter Property="Foreground" Value="{DynamicResource AccentTextBrush}" />
<Setter Property="FontWeight" Value="SemiBold" />
</Trigger>
</ControlTemplate.Triggers>
@@ -69,7 +76,7 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TabPanel Grid.Column="0" IsItemsHost="True" VerticalAlignment="Top" Background="Transparent" />
<Border Grid.Column="1" Background="White" BorderBrush="#E5E5E5" BorderThickness="1"
<Border Grid.Column="1" Background="{DynamicResource CardBrush}" BorderBrush="{DynamicResource CardBorderBrush}" BorderThickness="1"
CornerRadius="6" SnapsToDevicePixels="True" Padding="16,14">
<ContentPresenter ContentSource="SelectedContent" />
</Border>
@@ -93,18 +100,8 @@
</DockPanel>
<TabControl Style="{StaticResource SettingsTabs}" SelectionChanged="Tabs_SelectionChanged">
<TabItem Header="Knipsels">
<StackPanel>
<TextBlock Text="Knipsels oppikken" Style="{StaticResource CardTitle}" />
<CheckBox x:Name="WatchClipboardBox" Content="Klembord bewaken" />
<CheckBox x:Name="OnlySnippingToolBox" Content="Alleen afbeeldingen van het Knipprogramma" Margin="22,2,0,4" />
<CheckBox x:Name="WatchFolderBox" Content="Map Schermafbeeldingen bewaken" />
<TextBlock x:Name="FolderText" Style="{StaticResource Hint}" />
</StackPanel>
</TabItem>
<TabItem Header="Sneltoetsen">
<StackPanel>
<StackPanel Style="{StaticResource TabPage}">
<TextBlock Text="Sneltoetsen" Style="{StaticResource CardTitle}" />
<StackPanel Orientation="Horizontal" Margin="0,2,0,4">
<TextBlock Text="Rechthoek" VerticalAlignment="Center" Width="150" />
@@ -147,19 +144,8 @@
</StackPanel>
</TabItem>
<TabItem Header="Nieuw knipsel">
<StackPanel>
<TextBlock Text="Bij een nieuw knipsel" Style="{StaticResource CardTitle}" />
<RadioButton x:Name="ActionNotifyRadio" GroupName="Action" Content="Melding tonen (klik om te bewerken)" />
<RadioButton x:Name="ActionOpenRadio" GroupName="Action" Content="Editor meteen openen" />
<RadioButton x:Name="ActionNothingRadio" GroupName="Action" Content="Niets doen (openen via systeemvak of 'Openen met')" />
<TextBlock Style="{StaticResource Hint}" Margin="0,8,0,0"
Text="Tip: zet in het Knipprogramma 'Wijzigingen automatisch kopiëren' uit, anders ziet kniip elke pennenstreek in het Knipprogramma als nieuw knipsel." />
</StackPanel>
</TabItem>
<TabItem Header="Opslaan">
<StackPanel>
<StackPanel Style="{StaticResource TabPage}">
<TextBlock Text="Opslaan" Style="{StaticResource CardTitle}" />
<DockPanel Margin="0,2,0,4">
<TextBlock Text="Knipsels" VerticalAlignment="Center" Width="110" />
@@ -200,7 +186,7 @@
</TabItem>
<TabItem Header="Uploaden">
<StackPanel>
<StackPanel Style="{StaticResource TabPage}">
<TextBlock Text="Uploaden naar Zipline" Style="{StaticResource CardTitle}" />
<DockPanel Margin="0,2,0,4">
<TextBlock Text="Server" VerticalAlignment="Center" Width="110" />
@@ -221,7 +207,7 @@
</TabItem>
<TabItem Header="Screencasts">
<StackPanel>
<StackPanel Style="{StaticResource TabPage}">
<TextBlock Text="Screencasts" Style="{StaticResource CardTitle}" />
<TextBlock Style="{StaticResource Hint}" Margin="0,0,0,6"
Text="Sneltoets: eerste keer gebied kiezen, tweede keer opname starten, derde keer stoppen. De nabewerking staat daarna op MP4 of GIF." />
@@ -241,9 +227,45 @@
</StackPanel>
</TabItem>
<TabItem Header="Windows">
<StackPanel>
<TextBlock Text="Windows-integratie" Style="{StaticResource CardTitle}" />
<TabItem Header="Weergave">
<StackPanel Style="{StaticResource TabPage}">
<TextBlock Text="Kleurmodus" Style="{StaticResource CardTitle}" />
<RadioButton x:Name="ColorModeLightRadio" GroupName="ColorMode" Content="Licht" />
<RadioButton x:Name="ColorModeDarkRadio" GroupName="ColorMode" Content="Donker" />
<RadioButton x:Name="ColorModeSystemRadio" GroupName="ColorMode" Content="Systeem" />
<TextBlock Style="{StaticResource Hint}"
Text="Systeem volgt de app-modus van Windows (Instellingen > Persoonlijke instellingen > Kleuren) en wisselt mee als je die verandert." />
<TextBlock Text="Editor" Style="{StaticResource CardTitle}" Margin="0,16,0,6" />
<CheckBox x:Name="StraightHighlightBox" Content="Markeerstift trekt standaard een rechte horizontale streep (Shift wisselt)" />
<TextBlock Text="Werkbalk" Style="{StaticResource CardTitle}" Margin="0,16,0,6" />
<RadioButton x:Name="LayoutSplitRadio" GroupName="EditorLayout" Content="Split-weergave: gereedschappen boven, opslaan onder" />
<RadioButton x:Name="LayoutThreeSplitRadio" GroupName="EditorLayout" Content="Drie-split: gereedschappen boven, opslaan onder, Nieuw en Screencast opzij" />
<StackPanel Orientation="Horizontal" Margin="22,2,0,4" IsEnabled="{Binding IsChecked, ElementName=LayoutThreeSplitRadio}">
<RadioButton x:Name="CaptureBarLeftRadio" GroupName="CaptureBarPosition" Content="Links" Margin="0,0,16,0" />
<RadioButton x:Name="CaptureBarRightRadio" GroupName="CaptureBarPosition" Content="Rechts" />
</StackPanel>
<RadioButton x:Name="LayoutSingleRadio" GroupName="EditorLayout" Content="Eén werkbalk met gereedschappen en acties" />
<TextBlock Style="{StaticResource Hint}"
Text="Ook te wisselen via rechtsklik op de werkbalk in de editor. Daar kun je knoppen ook verslepen of verbergen." />
</StackPanel>
</TabItem>
<TabItem Header="Systeem">
<StackPanel Style="{StaticResource TabPage}">
<TextBlock Text="Knipprogramma" Style="{StaticResource CardTitle}" />
<CheckBox x:Name="WatchClipboardBox" Content="Klembord bewaken" />
<CheckBox x:Name="OnlySnippingToolBox" Content="Alleen afbeeldingen van het Knipprogramma" Margin="22,2,0,4" />
<CheckBox x:Name="WatchFolderBox" Content="Map Schermafbeeldingen bewaken" />
<TextBlock x:Name="FolderText" Style="{StaticResource Hint}" />
<TextBlock Text="Bij een nieuw knipsel" Style="{StaticResource CardTitle}" Margin="0,16,0,6" />
<RadioButton x:Name="ActionNotifyRadio" GroupName="Action" Content="Melding tonen (klik om te bewerken)" />
<RadioButton x:Name="ActionOpenRadio" GroupName="Action" Content="Editor meteen openen" />
<RadioButton x:Name="ActionNothingRadio" GroupName="Action" Content="Niets doen (openen via systeemvak of 'Openen met')" />
<TextBlock Style="{StaticResource Hint}" Margin="0,8,0,0"
Text="Tip: zet in het Knipprogramma 'Wijzigingen automatisch kopiëren' uit, anders ziet kniip elke pennenstreek in het Knipprogramma als nieuw knipsel." />
<TextBlock Text="Windows-integratie" Style="{StaticResource CardTitle}" Margin="0,16,0,6" />
<CheckBox x:Name="AutostartBox" Content="kniip starten met Windows" />
<CheckBox x:Name="OpenWithBox" Content="kniip tonen in 'Openen met' (ook in het Knipprogramma: ... → Openen met)" />
<TextBlock Style="{StaticResource Hint}"
@@ -251,28 +273,16 @@
</StackPanel>
</TabItem>
<TabItem Header="Editor">
<StackPanel>
<TextBlock Text="Editor" Style="{StaticResource CardTitle}" />
<CheckBox x:Name="StraightHighlightBox" Content="Markeerstift trekt standaard een rechte horizontale streep (Shift wisselt)" />
<TextBlock Text="Werkbalk" Style="{StaticResource CardTitle}" Margin="0,16,0,6" />
<RadioButton x:Name="LayoutSingleRadio" GroupName="EditorLayout" Content="Eén werkbalk met gereedschappen en acties" />
<RadioButton x:Name="LayoutSplitRadio" GroupName="EditorLayout" Content="Gesplitst zoals ShareX: gereedschappen boven, opslaan onder" />
<TextBlock Style="{StaticResource Hint}"
Text="Ook te wisselen via rechtsklik op de werkbalk in de editor. Daar kun je knoppen ook verslepen of verbergen." />
</StackPanel>
</TabItem>
<TabItem x:Name="UpdateTab">
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Update" />
<Ellipse x:Name="UpdateTabBadge" Width="8" Height="8" Fill="{StaticResource AccentBrush}" Stroke="White"
<Ellipse x:Name="UpdateTabBadge" Width="8" Height="8" Fill="{DynamicResource AccentBrush}" Stroke="{DynamicResource WindowBrush}"
StrokeThickness="1" Margin="6,0,0,0" VerticalAlignment="Center" Visibility="Collapsed"
ToolTip="Er is een nieuwe versie beschikbaar" />
</StackPanel>
</TabItem.Header>
<StackPanel>
<StackPanel Style="{StaticResource TabPage}">
<TextBlock Text="Update" Style="{StaticResource CardTitle}" />
<TextBlock x:Name="CurrentVersionText" Margin="0,0,0,2" />
<CheckBox x:Name="AutoUpdateCheckBox" Content="Automatisch controleren op nieuwe versies (bij starten en dagelijks)" />
@@ -286,8 +296,8 @@
ToolTip="https://git.hibbit.net/rogier/kniip/releases" />
</StackPanel>
<ProgressBar x:Name="DownloadProgress" Height="4" Minimum="0" Maximum="1" Margin="0,0,0,8"
Foreground="{StaticResource AccentBrush}" Visibility="Collapsed" />
<Border BorderBrush="{StaticResource DividerBrush}" BorderThickness="1" CornerRadius="4" Height="300">
Foreground="{DynamicResource AccentBrush}" Visibility="Collapsed" />
<Border BorderBrush="{DynamicResource DividerBrush}" BorderThickness="1" CornerRadius="4" Height="300">
<FlowDocumentScrollViewer x:Name="ChangelogViewer" VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled" IsToolBarVisible="False"
Zoom="100" MinZoom="100" MaxZoom="100" Focusable="False" />
+17 -4
View File
@@ -44,6 +44,7 @@ public partial class SettingsWindow : Window
public SettingsWindow(AppSettings settings)
{
InitializeComponent();
ThemeManager.Attach(this);
_settings = settings;
Title = $"{AppIdentity.DisplayName} instellingen";
@@ -97,8 +98,14 @@ public partial class SettingsWindow : Window
ActionOpenRadio.IsChecked = settings.Action == CaptureAction.OpenEditor;
ActionNothingRadio.IsChecked = settings.Action == CaptureAction.Nothing;
StraightHighlightBox.IsChecked = settings.StraightHighlight;
ColorModeLightRadio.IsChecked = settings.ColorMode == ColorMode.Light;
ColorModeDarkRadio.IsChecked = settings.ColorMode == ColorMode.Dark;
ColorModeSystemRadio.IsChecked = settings.ColorMode == ColorMode.System;
LayoutSplitRadio.IsChecked = settings.EditorLayout == EditorLayout.Split;
LayoutSingleRadio.IsChecked = settings.EditorLayout != EditorLayout.Split;
LayoutThreeSplitRadio.IsChecked = settings.EditorLayout == EditorLayout.ThreeSplit;
LayoutSingleRadio.IsChecked = settings.EditorLayout == EditorLayout.Single;
CaptureBarRightRadio.IsChecked = settings.CaptureBarPosition == Dock.Right;
CaptureBarLeftRadio.IsChecked = settings.CaptureBarPosition != Dock.Right;
AutoUpdateCheckBox.IsChecked = settings.CheckForUpdates;
MagnifierBox.IsChecked = settings.ShowMagnifier;
@@ -253,7 +260,7 @@ public partial class SettingsWindow : Window
{
text.Text = string.IsNullOrEmpty(folder) ? "Elke keer vragen" : folder;
text.ToolTip = folder;
text.Foreground = string.IsNullOrEmpty(folder) ? (Brush)Application.Current.Resources["SubtleTextBrush"] : SystemColors.ControlTextBrush;
text.SetResourceReference(TextBlock.ForegroundProperty, string.IsNullOrEmpty(folder) ? "SubtleTextBrush" : "InkBrush");
}
private void Template_TextChanged(object sender, TextChangedEventArgs e) => ShowTemplatePreviews();
@@ -316,7 +323,7 @@ public partial class SettingsWindow : Window
bool configured = _uploader is { IsConfigured: true };
UploaderText.Text = configured ? _uploader!.DisplayName : "Niet ingesteld";
UploaderText.ToolTip = configured ? _uploader!.RequestUrl : null;
UploaderText.Foreground = configured ? SystemColors.ControlTextBrush : (Brush)Application.Current.Resources["SubtleTextBrush"];
UploaderText.SetResourceReference(TextBlock.ForegroundProperty, configured ? "InkBrush" : "SubtleTextBrush");
TestUploaderButton.IsEnabled = configured;
RemoveUploaderButton.IsEnabled = configured;
}
@@ -444,7 +451,13 @@ public partial class SettingsWindow : Window
: ActionNothingRadio.IsChecked == true ? CaptureAction.Nothing
: CaptureAction.Notify;
_settings.StraightHighlight = StraightHighlightBox.IsChecked == true;
_settings.EditorLayout = LayoutSplitRadio.IsChecked == true ? EditorLayout.Split : EditorLayout.Single;
_settings.ColorMode = ColorModeDarkRadio.IsChecked == true ? ColorMode.Dark
: ColorModeSystemRadio.IsChecked == true ? ColorMode.System
: ColorMode.Light;
_settings.EditorLayout = LayoutSplitRadio.IsChecked == true ? EditorLayout.Split
: LayoutThreeSplitRadio.IsChecked == true ? EditorLayout.ThreeSplit
: EditorLayout.Single;
_settings.CaptureBarPosition = CaptureBarRightRadio.IsChecked == true ? Dock.Right : Dock.Left;
_settings.CheckForUpdates = AutoUpdateCheckBox.IsChecked == true;
_settings.ShowMagnifier = MagnifierBox.IsChecked == true;
StopListening();
+165
View File
@@ -0,0 +1,165 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="AccentBrush" Color="#0067C0" />
<SolidColorBrush x:Key="AccentHoverBrush" Color="#1975C5" />
<SolidColorBrush x:Key="AccentPressedBrush" Color="#3183CA" />
<SolidColorBrush x:Key="AccentTextBrush" Color="#4CC2FF" />
<SolidColorBrush x:Key="SelectedBrush" Color="#334CC2FF" />
<SolidColorBrush x:Key="WindowBrush" Color="#202020" />
<SolidColorBrush x:Key="ToolbarBrush" Color="#2B2B2B" />
<SolidColorBrush x:Key="UnlockedToolbarBrush" Color="#1F3347" />
<SolidColorBrush x:Key="CardBrush" Color="#2B2B2B" />
<SolidColorBrush x:Key="CardBorderBrush" Color="#3A3A3A" />
<SolidColorBrush x:Key="ToastBrush" Color="#2B2B2B" />
<SolidColorBrush x:Key="ToastBorderBrush" Color="#454545" />
<SolidColorBrush x:Key="HoverBrush" Color="#14FFFFFF" />
<SolidColorBrush x:Key="PressedBrush" Color="#1FFFFFFF" />
<SolidColorBrush x:Key="CheckedBrush" Color="#3A3A3A" />
<SolidColorBrush x:Key="DividerBrush" Color="#3A3A3A" />
<SolidColorBrush x:Key="InkBrush" Color="#F2F2F2" />
<SolidColorBrush x:Key="SubtleTextBrush" Color="#A8A8A8" />
<SolidColorBrush x:Key="ControlBrush" Color="#2D2D2D" />
<SolidColorBrush x:Key="ControlHoverBrush" Color="#353535" />
<SolidColorBrush x:Key="ControlPressedBrush" Color="#3D3D3D" />
<SolidColorBrush x:Key="ControlBorderBrush" Color="#3F3F3F" />
<SolidColorBrush x:Key="ControlStrongBorderBrush" Color="#4A4A4A" />
<SolidColorBrush x:Key="CheckBoxBorderBrush" Color="#9A9A9A" />
<SolidColorBrush x:Key="ProminentBrush" Color="#383838" />
<SolidColorBrush x:Key="ProminentHoverBrush" Color="#424242" />
<SolidColorBrush x:Key="ProminentPressedBrush" Color="#303030" />
<SolidColorBrush x:Key="CanvasBrush" Color="#1C1C1C" />
<SolidColorBrush x:Key="CanvasBorderBrush" Color="#3A3A3A" />
<SolidColorBrush x:Key="TrackBrush" Color="#3A3A3A" />
<SolidColorBrush x:Key="CodeBrush" Color="#333333" />
<SolidColorBrush x:Key="QuoteBorderBrush" Color="#505050" />
<!-- Standaardbesturingselementen van WPF lezen deze systeemkleuren -->
<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="#F2F2F2" />
<SolidColorBrush x:Key="{x:Static SystemColors.WindowTextBrushKey}" Color="#F2F2F2" />
<SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="#2D2D2D" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="#202020" />
<SolidColorBrush x:Key="{x:Static SystemColors.GrayTextBrushKey}" Color="#8A8A8A" />
<SolidColorBrush x:Key="{x:Static SystemColors.HotTrackBrushKey}" Color="#4CC2FF" />
<Style TargetType="ProgressBar">
<Setter Property="Background" Value="#3A3A3A" />
<Setter Property="BorderBrush" Value="#3A3A3A" />
</Style>
<Style x:Key="ScrollPageButton" TargetType="RepeatButton">
<Setter Property="Focusable" Value="False" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RepeatButton">
<Border Background="Transparent" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ScrollThumb" TargetType="Thumb">
<Setter Property="Focusable" Value="False" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Thumb">
<Border x:Name="Bd" Background="#5C5C5C" CornerRadius="3" Margin="3" />
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#7A7A7A" />
</Trigger>
<Trigger Property="IsDragging" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#8E8E8E" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ScrollBar">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Width" Value="12" />
<Setter Property="MinWidth" Value="12" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ScrollBar">
<Grid Background="{TemplateBinding Background}">
<Track x:Name="PART_Track" IsDirectionReversed="True">
<Track.DecreaseRepeatButton>
<RepeatButton Style="{StaticResource ScrollPageButton}" Command="ScrollBar.PageUpCommand" />
</Track.DecreaseRepeatButton>
<Track.IncreaseRepeatButton>
<RepeatButton Style="{StaticResource ScrollPageButton}" Command="ScrollBar.PageDownCommand" />
</Track.IncreaseRepeatButton>
<Track.Thumb>
<Thumb Style="{StaticResource ScrollThumb}" />
</Track.Thumb>
</Track>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="Orientation" Value="Horizontal">
<Setter Property="Width" Value="Auto" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="Height" Value="12" />
<Setter Property="MinHeight" Value="12" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ScrollBar">
<Grid Background="{TemplateBinding Background}">
<Track x:Name="PART_Track">
<Track.DecreaseRepeatButton>
<RepeatButton Style="{StaticResource ScrollPageButton}" Command="ScrollBar.PageLeftCommand" />
</Track.DecreaseRepeatButton>
<Track.IncreaseRepeatButton>
<RepeatButton Style="{StaticResource ScrollPageButton}" Command="ScrollBar.PageRightCommand" />
</Track.IncreaseRepeatButton>
<Track.Thumb>
<Thumb Style="{StaticResource ScrollThumb}" />
</Track.Thumb>
</Track>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="GridViewColumnHeader">
<Setter Property="Foreground" Value="#F2F2F2" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="GridViewColumnHeader">
<Grid>
<Border x:Name="Bd" Background="#2B2B2B" BorderBrush="#3A3A3A" BorderThickness="0,0,1,1" Padding="6,4">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="Center" RecognizesAccessKey="True" />
</Border>
<Thumb x:Name="PART_HeaderGripper" HorizontalAlignment="Right" Width="8" Margin="0,0,-4,0" Cursor="SizeWE">
<Thumb.Template>
<ControlTemplate TargetType="Thumb">
<Border Background="Transparent" />
</ControlTemplate>
</Thumb.Template>
</Thumb>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#333333" />
</Trigger>
<Trigger Property="Role" Value="Padding">
<Setter TargetName="PART_HeaderGripper" Property="Visibility" Value="Collapsed" />
<Setter TargetName="Bd" Property="BorderThickness" Value="0,0,0,1" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
+35
View File
@@ -0,0 +1,35 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="AccentBrush" Color="#0067C0" />
<SolidColorBrush x:Key="AccentHoverBrush" Color="#1975C5" />
<SolidColorBrush x:Key="AccentPressedBrush" Color="#3183CA" />
<SolidColorBrush x:Key="AccentTextBrush" Color="#0067C0" />
<SolidColorBrush x:Key="SelectedBrush" Color="#1A0067C0" />
<SolidColorBrush x:Key="WindowBrush" Color="#F3F3F3" />
<SolidColorBrush x:Key="ToolbarBrush" Color="#F9F9F9" />
<SolidColorBrush x:Key="UnlockedToolbarBrush" Color="#EAF2FB" />
<SolidColorBrush x:Key="CardBrush" Color="#FFFFFF" />
<SolidColorBrush x:Key="CardBorderBrush" Color="#E5E5E5" />
<SolidColorBrush x:Key="ToastBrush" Color="#FCFCFC" />
<SolidColorBrush x:Key="ToastBorderBrush" Color="#DADADA" />
<SolidColorBrush x:Key="HoverBrush" Color="#0F000000" />
<SolidColorBrush x:Key="PressedBrush" Color="#18000000" />
<SolidColorBrush x:Key="CheckedBrush" Color="#FFFFFF" />
<SolidColorBrush x:Key="DividerBrush" Color="#E5E5E5" />
<SolidColorBrush x:Key="InkBrush" Color="#1A1A1A" />
<SolidColorBrush x:Key="SubtleTextBrush" Color="#5C5C5C" />
<SolidColorBrush x:Key="ControlBrush" Color="#FFFFFF" />
<SolidColorBrush x:Key="ControlHoverBrush" Color="#F5F5F5" />
<SolidColorBrush x:Key="ControlPressedBrush" Color="#EBEBEB" />
<SolidColorBrush x:Key="ControlBorderBrush" Color="#E0E0E0" />
<SolidColorBrush x:Key="ControlStrongBorderBrush" Color="#D6D6D6" />
<SolidColorBrush x:Key="CheckBoxBorderBrush" Color="#8A8A8A" />
<SolidColorBrush x:Key="ProminentBrush" Color="#ECECEC" />
<SolidColorBrush x:Key="ProminentHoverBrush" Color="#E0E0E0" />
<SolidColorBrush x:Key="ProminentPressedBrush" Color="#D4D4D4" />
<SolidColorBrush x:Key="CanvasBrush" Color="#E9E9E9" />
<SolidColorBrush x:Key="CanvasBorderBrush" Color="#C8C8C8" />
<SolidColorBrush x:Key="TrackBrush" Color="#DADADA" />
<SolidColorBrush x:Key="CodeBrush" Color="#F3F3F3" />
<SolidColorBrush x:Key="QuoteBorderBrush" Color="#D0D0D0" />
</ResourceDictionary>
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

+3 -9
View File
@@ -25,8 +25,8 @@ public static class MarkdownRenderer
.Build();
private static readonly FontFamily CodeFont = new("Cascadia Mono, Consolas");
private static readonly Brush CodeBackground = Freeze(new SolidColorBrush(Color.FromRgb(0xF3, 0xF3, 0xF3)));
private static readonly Brush QuoteBorder = Freeze(new SolidColorBrush(Color.FromRgb(0xD0, 0xD0, 0xD0)));
private static Brush CodeBackground => Resource("CodeBrush", Brushes.WhiteSmoke);
private static Brush QuoteBorder => Resource("QuoteBorderBrush", Brushes.LightGray);
private static Brush Accent => Resource("AccentBrush", Brushes.SteelBlue);
@@ -38,7 +38,7 @@ public static class MarkdownRenderer
FontSize = 13,
PagePadding = new Thickness(14, 10, 14, 10),
TextAlignment = TextAlignment.Left,
Background = Brushes.White,
Background = Resource("CardBrush", Brushes.White),
};
/// <summary>Voegt de blokken van <paramref name="markdown"/> toe; relatieve links wijzen naar <paramref name="baseUri"/>.</summary>
@@ -342,10 +342,4 @@ public static class MarkdownRenderer
private static Brush Resource(string key, Brush fallback) =>
Application.Current?.TryFindResource(key) as Brush ?? fallback;
private static Brush Freeze(SolidColorBrush brush)
{
brush.Freeze();
return brush;
}
}
+72
View File
@@ -0,0 +1,72 @@
# Maakt src/Kniip/TrayIcon.ico uit de 256px-afbeelding in AppIcon.ico. Het systeemvak tekent op 16px;
# daar zijn de snijlijnen en de zwarte rand op een donkere taakbalk onzichtbaar en lijkt het icoon klein.
# Dit snijdt alleen het fotokader uit, zodat dat het hele vak vult. Opnieuw draaien als AppIcon.ico wijzigt.
$ErrorActionPreference = 'Stop'
Add-Type -AssemblyName System.Drawing
$root = Split-Path -Parent $PSScriptRoot
$source = Join-Path $root 'src\Kniip\AppIcon.ico'
$target = Join-Path $root 'src\Kniip\TrayIcon.ico'
# Kader in de 256px-afbeelding, inclusief de zwarte rand.
$crop = New-Object System.Drawing.Rectangle 42, 42, 172, 172
$sizes = 16, 20, 24, 32, 40, 48, 64
function Get-IcoPng([byte[]]$ico, [int]$size) {
$count = [BitConverter]::ToUInt16($ico, 4)
for ($i = 0; $i -lt $count; $i++) {
$entry = 6 + $i * 16
$width = if ($ico[$entry] -eq 0) { 256 } else { $ico[$entry] }
if ($width -eq $size) {
$length = [BitConverter]::ToUInt32($ico, $entry + 8)
$offset = [BitConverter]::ToUInt32($ico, $entry + 12)
$data = New-Object byte[] $length
[Array]::Copy($ico, $offset, $data, 0, $length)
return $data
}
}
throw "Geen ${size}px-afbeelding in $source"
}
$png = Get-IcoPng ([IO.File]::ReadAllBytes($source)) 256
$master = [System.Drawing.Bitmap]::FromStream((New-Object IO.MemoryStream (, $png)))
$images = foreach ($size in $sizes) {
$bitmap = New-Object System.Drawing.Bitmap $size, $size, ([System.Drawing.Imaging.PixelFormat]::Format32bppArgb)
$g = [System.Drawing.Graphics]::FromImage($bitmap)
$g.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic
$g.PixelOffsetMode = [System.Drawing.Drawing2D.PixelOffsetMode]::HighQuality
$g.CompositingQuality = [System.Drawing.Drawing2D.CompositingQuality]::HighQuality
$g.DrawImage($master, (New-Object System.Drawing.Rectangle 0, 0, $size, $size), $crop, [System.Drawing.GraphicsUnit]::Pixel)
$g.Dispose()
$stream = New-Object IO.MemoryStream
$bitmap.Save($stream, [System.Drawing.Imaging.ImageFormat]::Png)
$bitmap.Dispose()
, $stream.ToArray()
}
$master.Dispose()
$out = New-Object IO.MemoryStream
$writer = New-Object IO.BinaryWriter $out
$writer.Write([UInt16]0)
$writer.Write([UInt16]1)
$writer.Write([UInt16]$sizes.Count)
$offset = 6 + 16 * $sizes.Count
for ($i = 0; $i -lt $sizes.Count; $i++) {
$writer.Write([byte]$sizes[$i])
$writer.Write([byte]$sizes[$i])
$writer.Write([byte]0)
$writer.Write([byte]0)
$writer.Write([UInt16]1)
$writer.Write([UInt16]32)
$writer.Write([UInt32]$images[$i].Length)
$writer.Write([UInt32]$offset)
$offset += $images[$i].Length
}
foreach ($image in $images) {
$writer.Write($image)
}
$writer.Flush()
[IO.File]::WriteAllBytes($target, $out.ToArray())
Write-Host "Geschreven: $target"