2 Commits
Author SHA1 Message Date
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
33 changed files with 878 additions and 236 deletions

No files matched your search

+57 -15
View File
@@ -2,19 +2,50 @@
Alle noemenswaardige wijzigingen in kniip staan in dit bestand. De nieuwste versie staat bovenaan. Alle noemenswaardige wijzigingen in kniip staan in dit bestand. De nieuwste versie staat bovenaan.
## 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 ## 1.1.5 - 2026-11-09
### Nieuw ### Nieuw
- **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**. - **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. - In beide werkbalken kun je knoppen verslepen (na ontgrendelen) en verbergen, net als bij één werkbalk. Beide indelingen onthouden hun eigen volgorde.
- Split-weergave is de nieuwe standaard. Wil je de vertrouwde indeling terug, kies dan **Eén werkbalk**. - 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. - **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. - 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 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. - 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. - **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. - **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. - **Afbeeldingsgeschiedenis...** opent hetzelfde venster met miniaturen. Ook een knipsel dat je alleen hebt geüpload heeft een miniatuur.
@@ -26,14 +57,17 @@ Alle noemenswaardige wijzigingen in kniip staan in dit bestand. De nieuwste vers
### Nieuw ### 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. - **Melding bij een nieuwe versie.**\
- **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. 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**. - **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. - **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. - **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). - **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. - **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. - Dubbelklik op een buigpunt om het weer te verwijderen.
- Bij een pijl draait de punt mee met de richting van het laatste stuk. - 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. - Met Shift springen begin- en eindpunt in stappen van 45°, gemeten vanaf het buigpunt ernaast.
@@ -44,26 +78,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. - 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. - **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. - 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 ## 1.1.3 - 2026-11-09
### Nieuw ### 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. - **Sneltoets voor het klembord.**\
- **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. 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 ## 1.1.2 - 2026-11-09
### Opgelost ### 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 ## 1.1.1 - 2026-11-09
### Gewijzigd ### 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 ### Opgelost
@@ -73,11 +112,13 @@ Alle noemenswaardige wijzigingen in kniip staan in dit bestand. De nieuwste vers
### Nieuw ### 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. - 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. - 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. - 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`) - `%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` - `%V` de naam van het programma waarvan je een knipsel of opname maakt, bijvoorbeeld `chrome`
- `%R6` zes willekeurige letters en cijfers - `%R6` zes willekeurige letters en cijfers
@@ -85,7 +126,8 @@ Alle noemenswaardige wijzigingen in kniip staan in dit bestand. De nieuwste vers
- `/` maakt een submap; kniip maakt die mappen zelf aan. - `/` 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. 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 ### Gewijzigd
+2 -2
View File
@@ -34,7 +34,7 @@ kniip is een annotatie-editor die naast het Windows Knipprogramma werkt. Maak ee
| Versie | Installer | | 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.7 | [Kniip-Setup-1.1.7.exe](https://git.hibbit.net/rogier/kniip/releases/download/1.1.7/Kniip-Setup-1.1.7.exe) |
Oudere versies vind je bij [alle releases](https://git.hibbit.net/rogier/kniip/releases). Oudere versies vind je bij [alle releases](https://git.hibbit.net/rogier/kniip/releases).
@@ -80,7 +80,7 @@ Vereisten:
Bouwen: Bouwen:
```powershell ```powershell
.\build.ps1 # versie 1.1.5 .\build.ps1 # versie 1.1.7
.\build.ps1 -Version 1.2.0 # andere versie .\build.ps1 -Version 1.2.0 # andere versie
``` ```
+1 -1
View File
@@ -12,7 +12,7 @@
# .\build.ps1 -SkipTest -> zonder testexe # .\build.ps1 -SkipTest -> zonder testexe
param( param(
[string]$Version = "1.1.5", [string]$Version = "1.1.7",
[string]$Runtime = "win-x64", [string]$Runtime = "win-x64",
[switch]$SkipTest [switch]$SkipTest
) )
+1 -1
View File
@@ -5,7 +5,7 @@
#define AppName "kniip" #define AppName "kniip"
#define AppExe "Kniip.exe" #define AppExe "Kniip.exe"
#ifndef AppVersion #ifndef AppVersion
#define AppVersion "1.1.5" #define AppVersion "1.1.7"
#endif #endif
#ifndef PublishDir #ifndef PublishDir
#define PublishDir "..\artifacts\publish" #define PublishDir "..\artifacts\publish"
+130 -55
View File
@@ -3,17 +3,11 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
ShutdownMode="OnExplicitShutdown"> ShutdownMode="OnExplicitShutdown">
<Application.Resources> <Application.Resources>
<SolidColorBrush x:Key="AccentBrush" Color="#0067C0" /> <ResourceDictionary>
<SolidColorBrush x:Key="AccentHoverBrush" Color="#1975C5" /> <!-- Kleuren: ThemeManager wisselt deze tussen Themes/Light.xaml en Themes/Dark.xaml; gebruik ze via DynamicResource -->
<SolidColorBrush x:Key="AccentPressedBrush" Color="#3183CA" /> <ResourceDictionary.MergedDictionaries>
<SolidColorBrush x:Key="WindowBrush" Color="#F3F3F3" /> <ResourceDictionary Source="Themes/Light.xaml" />
<SolidColorBrush x:Key="ToolbarBrush" Color="#F9F9F9" /> </ResourceDictionary.MergedDictionaries>
<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> <FontFamily x:Key="IconFont">Segoe Fluent Icons, Segoe MDL2 Assets</FontFamily>
<Style TargetType="ToolTip"> <Style TargetType="ToolTip">
@@ -24,7 +18,7 @@
<Setter Property="Background" Value="Transparent" /> <Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="1" /> <Setter Property="BorderThickness" Value="1" />
<Setter Property="Foreground" Value="{StaticResource InkBrush}" /> <Setter Property="Foreground" Value="{DynamicResource InkBrush}" />
<Setter Property="Padding" Value="8,5" /> <Setter Property="Padding" Value="8,5" />
<Setter Property="MinWidth" Value="36" /> <Setter Property="MinWidth" Value="36" />
<Setter Property="MinHeight" Value="34" /> <Setter Property="MinHeight" Value="34" />
@@ -42,10 +36,10 @@
</Border> </Border>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True"> <Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{StaticResource HoverBrush}" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource HoverBrush}" />
</Trigger> </Trigger>
<Trigger Property="IsPressed" Value="True"> <Trigger Property="IsPressed" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{StaticResource PressedBrush}" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource PressedBrush}" />
</Trigger> </Trigger>
<Trigger Property="IsEnabled" Value="False"> <Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.35" /> <Setter Property="Opacity" Value="0.35" />
@@ -57,7 +51,7 @@
</Style> </Style>
<Style x:Key="ProminentButton" TargetType="Button" BasedOn="{StaticResource FlatButton}"> <Style x:Key="ProminentButton" TargetType="Button" BasedOn="{StaticResource FlatButton}">
<Setter Property="Background" Value="#ECECEC" /> <Setter Property="Background" Value="{DynamicResource ProminentBrush}" />
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="Button"> <ControlTemplate TargetType="Button">
@@ -68,10 +62,10 @@
</Border> </Border>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True"> <Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#E0E0E0" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource ProminentHoverBrush}" />
</Trigger> </Trigger>
<Trigger Property="IsPressed" Value="True"> <Trigger Property="IsPressed" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#D4D4D4" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource ProminentPressedBrush}" />
</Trigger> </Trigger>
<Trigger Property="IsEnabled" Value="False"> <Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.35" /> <Setter Property="Opacity" Value="0.35" />
@@ -93,20 +87,20 @@
BorderThickness="1" CornerRadius="4" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True"> BorderThickness="1" CornerRadius="4" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" /> <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border> </Border>
<Border x:Name="Indicator" Height="3" Width="16" CornerRadius="1.5" Background="{StaticResource AccentBrush}" <Border x:Name="Indicator" Height="3" Width="16" CornerRadius="1.5" Background="{DynamicResource AccentBrush}"
VerticalAlignment="Bottom" Margin="0,0,0,2" Visibility="Collapsed" /> VerticalAlignment="Bottom" Margin="0,0,0,2" Visibility="Collapsed" />
</Grid> </Grid>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True"> <Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{StaticResource HoverBrush}" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource HoverBrush}" />
</Trigger> </Trigger>
<Trigger Property="IsChecked" Value="True"> <Trigger Property="IsChecked" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{StaticResource CheckedBrush}" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource CheckedBrush}" />
<Setter TargetName="Bd" Property="BorderBrush" Value="#E0E0E0" /> <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource ControlBorderBrush}" />
<Setter TargetName="Indicator" Property="Visibility" Value="Visible" /> <Setter TargetName="Indicator" Property="Visibility" Value="Visible" />
</Trigger> </Trigger>
<Trigger Property="IsPressed" Value="True"> <Trigger Property="IsPressed" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{StaticResource PressedBrush}" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource PressedBrush}" />
</Trigger> </Trigger>
<Trigger Property="IsEnabled" Value="False"> <Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.35" /> <Setter Property="Opacity" Value="0.35" />
@@ -119,7 +113,7 @@
<Style x:Key="AccentButton" TargetType="Button"> <Style x:Key="AccentButton" TargetType="Button">
<Setter Property="Foreground" Value="White" /> <Setter Property="Foreground" Value="White" />
<Setter Property="Background" Value="{StaticResource AccentBrush}" /> <Setter Property="Background" Value="{DynamicResource AccentBrush}" />
<Setter Property="Padding" Value="14,6" /> <Setter Property="Padding" Value="14,6" />
<Setter Property="MinHeight" Value="32" /> <Setter Property="MinHeight" Value="32" />
<Setter Property="FontFamily" Value="Segoe UI" /> <Setter Property="FontFamily" Value="Segoe UI" />
@@ -134,10 +128,10 @@
</Border> </Border>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True"> <Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{StaticResource AccentHoverBrush}" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource AccentHoverBrush}" />
</Trigger> </Trigger>
<Trigger Property="IsPressed" Value="True"> <Trigger Property="IsPressed" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{StaticResource AccentPressedBrush}" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource AccentPressedBrush}" />
</Trigger> </Trigger>
<Trigger Property="IsEnabled" Value="False"> <Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.45" /> <Setter Property="Opacity" Value="0.45" />
@@ -149,8 +143,8 @@
</Style> </Style>
<Style x:Key="SecondaryButton" TargetType="Button" BasedOn="{StaticResource FlatButton}"> <Style x:Key="SecondaryButton" TargetType="Button" BasedOn="{StaticResource FlatButton}">
<Setter Property="Background" Value="White" /> <Setter Property="Background" Value="{DynamicResource ControlBrush}" />
<Setter Property="BorderBrush" Value="#D6D6D6" /> <Setter Property="BorderBrush" Value="{DynamicResource ControlStrongBorderBrush}" />
<Setter Property="Padding" Value="12,5" /> <Setter Property="Padding" Value="12,5" />
<Setter Property="MinHeight" Value="32" /> <Setter Property="MinHeight" Value="32" />
<Setter Property="Margin" Value="4,0" /> <Setter Property="Margin" Value="4,0" />
@@ -164,7 +158,7 @@
</Style> </Style>
<Style x:Key="IconPath" TargetType="Path"> <Style x:Key="IconPath" TargetType="Path">
<Setter Property="Stroke" Value="{StaticResource InkBrush}" /> <Setter Property="Stroke" Value="{DynamicResource InkBrush}" />
<Setter Property="StrokeThickness" Value="1" /> <Setter Property="StrokeThickness" Value="1" />
<Setter Property="StrokeLineJoin" Value="Round" /> <Setter Property="StrokeLineJoin" Value="Round" />
<Setter Property="StrokeStartLineCap" Value="Round" /> <Setter Property="StrokeStartLineCap" Value="Round" />
@@ -175,7 +169,7 @@
</Style> </Style>
<Style x:Key="PropLabel" TargetType="TextBlock"> <Style x:Key="PropLabel" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource SubtleTextBrush}" /> <Setter Property="Foreground" Value="{DynamicResource SubtleTextBrush}" />
<Setter Property="FontSize" Value="12" /> <Setter Property="FontSize" Value="12" />
<Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Margin" Value="0,0,6,0" /> <Setter Property="Margin" Value="0,0,6,0" />
@@ -199,10 +193,10 @@
</Border> </Border>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True"> <Trigger Property="IsSelected" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#1A0067C0" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource SelectedBrush}" />
</Trigger> </Trigger>
<Trigger Property="IsHighlighted" Value="True"> <Trigger Property="IsHighlighted" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{StaticResource HoverBrush}" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource HoverBrush}" />
</Trigger> </Trigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>
</ControlTemplate> </ControlTemplate>
@@ -226,28 +220,30 @@
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"> IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
<ToggleButton.Template> <ToggleButton.Template>
<ControlTemplate TargetType="ToggleButton"> <ControlTemplate TargetType="ToggleButton">
<Border x:Name="Bd" Background="White" BorderBrush="#E0E0E0" BorderThickness="1" CornerRadius="4" /> <Border x:Name="Bd" Background="{DynamicResource ControlBrush}"
BorderBrush="{DynamicResource ControlBorderBrush}" BorderThickness="1" CornerRadius="4" />
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True"> <Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#F5F5F5" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlHoverBrush}" />
</Trigger> </Trigger>
<Trigger Property="IsChecked" Value="True"> <Trigger Property="IsChecked" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#EBEBEB" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlPressedBrush}" />
</Trigger> </Trigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>
</ControlTemplate> </ControlTemplate>
</ToggleButton.Template> </ToggleButton.Template>
</ToggleButton> </ToggleButton>
<StackPanel Orientation="Horizontal" IsHitTestVisible="False" Margin="8,0,6,0" VerticalAlignment="Center"> <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}" <ContentPresenter Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
VerticalAlignment="Center" /> VerticalAlignment="Center" />
<TextBlock Text="&#xE70D;" FontFamily="{StaticResource IconFont}" FontSize="8" Margin="6,1,0,0" </DockPanel>
VerticalAlignment="Center" Foreground="#5C5C5C" />
</StackPanel>
<Popup x:Name="PART_Popup" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" <Popup x:Name="PART_Popup" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}"
Placement="Bottom" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade"> Placement="Bottom" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade">
<Border Background="White" BorderBrush="#D6D6D6" BorderThickness="1" CornerRadius="6" Padding="3" <Border Background="{DynamicResource CardBrush}" BorderBrush="{DynamicResource ControlStrongBorderBrush}"
BorderThickness="1" CornerRadius="6" Padding="3"
Margin="0,4,10,10" MinWidth="{TemplateBinding ActualWidth}"> Margin="0,4,10,10" MinWidth="{TemplateBinding ActualWidth}">
<Border.Effect> <Border.Effect>
<DropShadowEffect BlurRadius="10" ShadowDepth="2" Opacity="0.18" /> <DropShadowEffect BlurRadius="10" ShadowDepth="2" Opacity="0.18" />
@@ -269,23 +265,23 @@
<Setter Property="MinWidth" Value="30" /> <Setter Property="MinWidth" Value="30" />
<Setter Property="Margin" Value="2,0" /> <Setter Property="Margin" Value="2,0" />
<Setter Property="Padding" Value="6,0" /> <Setter Property="Padding" Value="6,0" />
<Setter Property="Foreground" Value="{StaticResource InkBrush}" /> <Setter Property="Foreground" Value="{DynamicResource InkBrush}" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" /> <Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="ToggleButton"> <ControlTemplate TargetType="ToggleButton">
<Border x:Name="Bd" Background="White" BorderBrush="#E0E0E0" BorderThickness="1" CornerRadius="4" <Border x:Name="Bd" Background="{DynamicResource ControlBrush}" BorderBrush="{DynamicResource ControlBorderBrush}"
Padding="{TemplateBinding Padding}"> BorderThickness="1" CornerRadius="4" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" /> <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border> </Border>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True"> <Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#F5F5F5" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlHoverBrush}" />
</Trigger> </Trigger>
<Trigger Property="IsChecked" Value="True"> <Trigger Property="IsChecked" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#1A0067C0" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource SelectedBrush}" />
<Setter TargetName="Bd" Property="BorderBrush" Value="{StaticResource AccentBrush}" /> <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource AccentBrush}" />
</Trigger> </Trigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>
</ControlTemplate> </ControlTemplate>
@@ -297,13 +293,13 @@
<Style TargetType="ContextMenu"> <Style TargetType="ContextMenu">
<Setter Property="FontFamily" Value="Segoe UI" /> <Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="FontSize" Value="13" /> <Setter Property="FontSize" Value="13" />
<Setter Property="Foreground" Value="{StaticResource InkBrush}" /> <Setter Property="Foreground" Value="{DynamicResource InkBrush}" />
<Setter Property="HasDropShadow" Value="False" /> <Setter Property="HasDropShadow" Value="False" />
<Setter Property="Grid.IsSharedSizeScope" Value="True" /> <Setter Property="Grid.IsSharedSizeScope" Value="True" />
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="ContextMenu"> <ControlTemplate TargetType="ContextMenu">
<Border Background="{StaticResource ToolbarBrush}" BorderBrush="#D6D6D6" BorderThickness="1" CornerRadius="8" <Border Background="{DynamicResource ToolbarBrush}" BorderBrush="{DynamicResource ControlStrongBorderBrush}" BorderThickness="1" CornerRadius="8"
Padding="4" Margin="0,0,10,10" MinWidth="220"> Padding="4" Margin="0,0,10,10" MinWidth="220">
<Border.Effect> <Border.Effect>
<DropShadowEffect BlurRadius="12" ShadowDepth="2" Opacity="0.18" /> <DropShadowEffect BlurRadius="12" ShadowDepth="2" Opacity="0.18" />
@@ -319,14 +315,14 @@
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="Separator"> <ControlTemplate TargetType="Separator">
<Border Height="1" Margin="6,4" Background="{StaticResource DividerBrush}" /> <Border Height="1" Margin="6,4" Background="{DynamicResource DividerBrush}" />
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
</Setter> </Setter>
</Style> </Style>
<Style TargetType="MenuItem"> <Style TargetType="MenuItem">
<Setter Property="Foreground" Value="{StaticResource InkBrush}" /> <Setter Property="Foreground" Value="{DynamicResource InkBrush}" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" /> <Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
@@ -344,12 +340,12 @@
VerticalAlignment="Center" HorizontalAlignment="Left" Visibility="Collapsed" /> VerticalAlignment="Center" HorizontalAlignment="Left" Visibility="Collapsed" />
<ContentPresenter Grid.Column="1" ContentSource="Header" RecognizesAccessKey="True" VerticalAlignment="Center" /> <ContentPresenter Grid.Column="1" ContentSource="Header" RecognizesAccessKey="True" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{TemplateBinding InputGestureText}" Margin="24,0,0,0" <TextBlock Grid.Column="2" Text="{TemplateBinding InputGestureText}" Margin="24,0,0,0"
Foreground="{StaticResource SubtleTextBrush}" VerticalAlignment="Center" HorizontalAlignment="Right" /> Foreground="{DynamicResource SubtleTextBrush}" VerticalAlignment="Center" HorizontalAlignment="Right" />
<TextBlock x:Name="Arrow" Grid.Column="3" Text="&#xE76C;" FontFamily="{StaticResource IconFont}" FontSize="10" <TextBlock x:Name="Arrow" Grid.Column="3" Text="&#xE76C;" FontFamily="{StaticResource IconFont}" FontSize="10"
VerticalAlignment="Center" HorizontalAlignment="Right" Visibility="Collapsed" /> VerticalAlignment="Center" HorizontalAlignment="Right" Visibility="Collapsed" />
<Popup x:Name="PART_Popup" Placement="Right" HorizontalOffset="6" VerticalOffset="-6" AllowsTransparency="True" <Popup x:Name="PART_Popup" Placement="Right" HorizontalOffset="6" VerticalOffset="-6" AllowsTransparency="True"
Focusable="False" PopupAnimation="Fade" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"> Focusable="False" PopupAnimation="Fade" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}">
<Border Background="{StaticResource ToolbarBrush}" BorderBrush="#D6D6D6" BorderThickness="1" CornerRadius="8" <Border Background="{DynamicResource ToolbarBrush}" BorderBrush="{DynamicResource ControlStrongBorderBrush}" BorderThickness="1" CornerRadius="8"
Padding="4" Margin="0,0,10,10" MinWidth="180" Grid.IsSharedSizeScope="True"> Padding="4" Margin="0,0,10,10" MinWidth="180" Grid.IsSharedSizeScope="True">
<Border.Effect> <Border.Effect>
<DropShadowEffect BlurRadius="12" ShadowDepth="2" Opacity="0.18" /> <DropShadowEffect BlurRadius="12" ShadowDepth="2" Opacity="0.18" />
@@ -368,7 +364,7 @@
<Setter TargetName="Arrow" Property="Visibility" Value="Visible" /> <Setter TargetName="Arrow" Property="Visibility" Value="Visible" />
</Trigger> </Trigger>
<Trigger Property="IsHighlighted" Value="True"> <Trigger Property="IsHighlighted" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{StaticResource HoverBrush}" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource HoverBrush}" />
</Trigger> </Trigger>
<Trigger Property="IsEnabled" Value="False"> <Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.4" /> <Setter Property="Opacity" Value="0.4" />
@@ -379,11 +375,90 @@
</Setter> </Setter>
</Style> </Style>
<Style x:Key="PropCombo" TargetType="ComboBox"> <Style x:Key="PropCombo" TargetType="ComboBox" BasedOn="{StaticResource MiniCombo}">
<Setter Property="MinWidth" Value="80" /> <Setter Property="MinWidth" Value="80" />
<Setter Property="Height" Value="28" /> <Setter Property="Height" Value="28" />
<Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="Margin" Value="0" />
<Setter Property="FontSize" Value="12" />
</Style> </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.Resources>
</Application> </Application>
+4
View File
@@ -77,6 +77,7 @@ public partial class App : Application
} }
Settings = SettingsStore.Load(); Settings = SettingsStore.Load();
ThemeManager.Apply(Settings.ColorMode);
Capture = new CaptureCoordinator(Dispatcher); Capture = new CaptureCoordinator(Dispatcher);
Capture.ApplySettings(Settings); Capture.ApplySettings(Settings);
@@ -116,6 +117,8 @@ public partial class App : Application
_tray.FoldersProvider = TrayFolders; _tray.FoldersProvider = TrayFolders;
_tray.ExitRequested += ExitApplication; _tray.ExitRequested += ExitApplication;
_tray.PauseChanged += _ => UpdateCapturePaused(); _tray.PauseChanged += _ => UpdateCapturePaused();
_tray.ApplyTheme(ThemeManager.IsDark);
ThemeManager.Changed += () => _tray?.ApplyTheme(ThemeManager.IsDark);
HotkeyHook = new GlobalHotkeyHook(Dispatcher); HotkeyHook = new GlobalHotkeyHook(Dispatcher);
ApplyHotkeys(); ApplyHotkeys();
@@ -529,6 +532,7 @@ public partial class App : Application
public void SaveSettings() public void SaveSettings()
{ {
SettingsStore.Save(Settings); SettingsStore.Save(Settings);
ThemeManager.Apply(Settings.ColorMode);
Capture.ApplySettings(Settings); Capture.ApplySettings(Settings);
ApplyHotkeys(); ApplyHotkeys();
Updates.Apply(Settings.CheckForUpdates); Updates.Apply(Settings.CheckForUpdates);
+4 -4
View File
@@ -3,18 +3,18 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="kniip" WindowStyle="None" AllowsTransparency="True" Background="Transparent" Title="kniip" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
Topmost="True" ShowInTaskbar="False" ShowActivated="False" ResizeMode="NoResize" Topmost="True" ShowInTaskbar="False" ShowActivated="False" ResizeMode="NoResize"
SizeToContent="WidthAndHeight" FontFamily="Segoe UI" UseLayoutRounding="True"> SizeToContent="WidthAndHeight" FontFamily="Segoe UI" Foreground="{DynamicResource InkBrush}" UseLayoutRounding="True">
<Border Margin="10" Background="#FCFCFC" CornerRadius="8" BorderBrush="#DADADA" BorderThickness="1" <Border Margin="10" Background="{DynamicResource ToastBrush}" CornerRadius="8" BorderBrush="{DynamicResource ToastBorderBrush}" BorderThickness="1"
Cursor="Hand" MouseLeftButtonUp="Border_Click" ToolTip="Klik om te annuleren"> Cursor="Hand" MouseLeftButtonUp="Border_Click" ToolTip="Klik om te annuleren">
<Border.Effect> <Border.Effect>
<DropShadowEffect BlurRadius="14" ShadowDepth="2" Opacity="0.22" /> <DropShadowEffect BlurRadius="14" ShadowDepth="2" Opacity="0.22" />
</Border.Effect> </Border.Effect>
<StackPanel Orientation="Horizontal" Margin="12,8,14,8"> <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" /> MinWidth="34" TextAlignment="Center" VerticalAlignment="Center" />
<StackPanel Margin="10,0,0,0" VerticalAlignment="Center"> <StackPanel Margin="10,0,0,0" VerticalAlignment="Center">
<TextBlock Text="Knipsel over" FontSize="12" FontWeight="SemiBold" /> <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>
</StackPanel> </StackPanel>
</Border> </Border>
+2 -2
View File
@@ -28,8 +28,8 @@
</DrawingBrush> </DrawingBrush>
</Rectangle.Fill> </Rectangle.Fill>
</Rectangle> </Rectangle>
<Rectangle Height="8" VerticalAlignment="Top" Margin="0,56,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="{StaticResource 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" <Rectangle Width="10" Height="10" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="55,55,0,0"
Stroke="White" StrokeThickness="1" /> Stroke="White" StrokeThickness="1" />
<Rectangle Width="8" Height="8" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="56,56,0,0" <Rectangle Width="8" Height="8" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="56,56,0,0"
+4 -4
View File
@@ -8,21 +8,21 @@
<Grid> <Grid>
<Image x:Name="Frozen" Stretch="Fill" RenderOptions.BitmapScalingMode="NearestNeighbor" /> <Image x:Name="Frozen" Stretch="Fill" RenderOptions.BitmapScalingMode="NearestNeighbor" />
<Path x:Name="Dim" Fill="#73000000" /> <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" /> HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="Collapsed" IsHitTestVisible="False" />
<Border x:Name="SizeBadge" HorizontalAlignment="Left" VerticalAlignment="Top" Background="#E6202020" <Border x:Name="SizeBadge" HorizontalAlignment="Left" VerticalAlignment="Top" Background="#E6202020"
CornerRadius="4" Padding="6,2" Visibility="Collapsed" IsHitTestVisible="False"> CornerRadius="4" Padding="6,2" Visibility="Collapsed" IsHitTestVisible="False">
<TextBlock x:Name="SizeText" Foreground="White" FontSize="12" /> <TextBlock x:Name="SizeText" Foreground="White" FontSize="12" />
</Border> </Border>
<local:MagnifierControl x:Name="Magnifier" /> <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"> CornerRadius="6" Padding="16,9" IsHitTestVisible="False">
<Border.Effect> <Border.Effect>
<DropShadowEffect BlurRadius="12" ShadowDepth="2" Opacity="0.25" /> <DropShadowEffect BlurRadius="12" ShadowDepth="2" Opacity="0.25" />
</Border.Effect> </Border.Effect>
<StackPanel> <StackPanel>
<TextBlock x:Name="HintTitle" Text="Knipsel: sleep een rechthoek" FontWeight="SemiBold" Foreground="{StaticResource InkBrush}" /> <TextBlock x:Name="HintTitle" Text="Knipsel: sleep een rechthoek" FontWeight="SemiBold" Foreground="{DynamicResource InkBrush}" />
<TextBlock Foreground="{StaticResource SubtleTextBrush}" FontSize="12" Margin="0,2,0,0" <TextBlock Foreground="{DynamicResource SubtleTextBrush}" FontSize="12" Margin="0,2,0,0"
Text="Enter = heel scherm · Esc of rechtermuisknop = annuleren" /> Text="Enter = heel scherm · Esc of rechtermuisknop = annuleren" />
</StackPanel> </StackPanel>
</Border> </Border>
+6 -6
View File
@@ -14,25 +14,25 @@
</UserControl.Resources> </UserControl.Resources>
<Grid> <Grid>
<ToggleButton x:Name="Toggle" Style="{StaticResource FlatButton}" Padding="6,4" MinWidth="0" MinHeight="30" <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"> <StackPanel Orientation="Horizontal">
<Grid Width="20" Height="20"> <Grid Width="20" Height="20">
<Border x:Name="CheckerBack" CornerRadius="4" Background="{StaticResource Checker}" Visibility="Collapsed" /> <Border x:Name="CheckerBack" CornerRadius="4" Background="{StaticResource Checker}" Visibility="Collapsed" />
<Border x:Name="Swatch" CornerRadius="4" BorderThickness="0" /> <Border x:Name="Swatch" CornerRadius="4" BorderThickness="0" />
<Border x:Name="OutlineHole" CornerRadius="1.5" Margin="5" Background="White" Visibility="Collapsed" /> <Border x:Name="OutlineHole" CornerRadius="1.5" Margin="5" Background="{DynamicResource ControlBrush}" Visibility="Collapsed" />
<Grid x:Name="TextGlyph" Background="White" Visibility="Collapsed"> <Grid x:Name="TextGlyph" Background="{DynamicResource ControlBrush}" Visibility="Collapsed">
<TextBlock Text="A" FontSize="14" HorizontalAlignment="Center" Margin="0,-1,0,0" <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" /> <Border x:Name="TextBar" Height="4" CornerRadius="1" VerticalAlignment="Bottom" Margin="2,0" />
</Grid> </Grid>
</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> </StackPanel>
</ToggleButton> </ToggleButton>
<Popup x:Name="PopupPanel" PlacementTarget="{Binding ElementName=Toggle}" Placement="Bottom" StaysOpen="False" <Popup x:Name="PopupPanel" PlacementTarget="{Binding ElementName=Toggle}" Placement="Bottom" StaysOpen="False"
AllowsTransparency="True" PopupAnimation="Fade" AllowsTransparency="True" PopupAnimation="Fade"
IsOpen="{Binding IsChecked, ElementName=Toggle, Mode=TwoWay}"> 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> <Border.Effect>
<DropShadowEffect BlurRadius="10" ShadowDepth="2" Opacity="0.18" /> <DropShadowEffect BlurRadius="10" ShadowDepth="2" Opacity="0.18" />
</Border.Effect> </Border.Effect>
+30 -30
View File
@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Kniip.Editor" xmlns:local="clr-namespace:Kniip.Editor"
Title="kniip" Width="1180" Height="780" MinWidth="760" MinHeight="420" 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" FontFamily="Segoe UI" FontSize="13" UseLayoutRounding="True"
Icon="pack://application:,,,/AppIcon.ico" Icon="pack://application:,,,/AppIcon.ico"
AllowDrop="True" PreviewDragEnter="Window_PreviewDragOver" PreviewDragOver="Window_PreviewDragOver" PreviewDrop="Window_PreviewDrop"> AllowDrop="True" PreviewDragEnter="Window_PreviewDragOver" PreviewDragOver="Window_PreviewDragOver" PreviewDrop="Window_PreviewDrop">
@@ -15,7 +15,7 @@
<DataTemplate x:Key="ThicknessTemplate"> <DataTemplate x:Key="ThicknessTemplate">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Grid Width="16" Height="16" VerticalAlignment="Center"> <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" MinWidth="2" MinHeight="2" MaxWidth="15" MaxHeight="15"
HorizontalAlignment="Center" VerticalAlignment="Center" /> HorizontalAlignment="Center" VerticalAlignment="Center" />
<Line x:Name="NoneLine" X1="3" Y1="13" X2="13" Y2="3" Stroke="#E81123" StrokeThickness="1.5" Visibility="Collapsed" /> <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 --> <!-- Lijnstijl: voorbeeldlijn -->
<DataTemplate x:Key="DashTemplate"> <DataTemplate x:Key="DashTemplate">
<StackPanel Orientation="Horizontal"> <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" /> StrokeThickness="2" VerticalAlignment="Center" />
<TextBlock x:Name="Label" Text="Doorgetrokken" Margin="8,0,0,0" VerticalAlignment="Center" FontSize="12" /> <TextBlock x:Name="Label" Text="Doorgetrokken" Margin="8,0,0,0" VerticalAlignment="Center" FontSize="12" />
</StackPanel> </StackPanel>
@@ -65,7 +65,7 @@
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Grid Width="18" Height="18" VerticalAlignment="Center" ClipToBounds="True"> <Grid Width="18" Height="18" VerticalAlignment="Center" ClipToBounds="True">
<Border Width="26" Height="26" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="2,2,0,0" <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}}" /> CornerRadius="{Binding Converter={StaticResource CornerPreview}}" />
</Grid> </Grid>
<TextBlock x:Name="Label" Text="{Binding StringFormat={}{0} px}" Margin="8,0,0,0" VerticalAlignment="Center" FontSize="12" /> <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"> <DataTemplate x:Key="FontSizeTemplate">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="A" FontSize="15" VerticalAlignment="Center" /> <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> </StackPanel>
</DataTemplate> </DataTemplate>
@@ -92,10 +92,10 @@
<DataTemplate x:Key="SizeTemplate"> <DataTemplate x:Key="SizeTemplate">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Grid Width="16" Height="16" VerticalAlignment="Center"> <Grid Width="16" Height="16" VerticalAlignment="Center">
<Ellipse Stroke="{StaticResource InkBrush}" StrokeThickness="1" /> <Ellipse Stroke="{DynamicResource InkBrush}" StrokeThickness="1" />
<Path Data="M5,8 H11 M8,5 V11" Stroke="{StaticResource InkBrush}" StrokeThickness="1" /> <Path Data="M5,8 H11 M8,5 V11" Stroke="{DynamicResource InkBrush}" StrokeThickness="1" />
</Grid> </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> </StackPanel>
</DataTemplate> </DataTemplate>
@@ -131,7 +131,7 @@
<!-- Soort cursor: het cursoricoon zelf --> <!-- Soort cursor: het cursoricoon zelf -->
<DataTemplate x:Key="CursorKindTemplate"> <DataTemplate x:Key="CursorKindTemplate">
<StackPanel Orientation="Horizontal"> <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" /> 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" /> <TextBlock x:Name="Label" Text="Pijl" Margin="8,0,0,0" VerticalAlignment="Center" FontSize="12" />
</StackPanel> </StackPanel>
@@ -152,16 +152,16 @@
<DataTemplate x:Key="BlurModeTemplate"> <DataTemplate x:Key="BlurModeTemplate">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Grid Width="16" Height="16" VerticalAlignment="Center"> <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" /> 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 x:Name="BlurIcon" Visibility="Collapsed" Fill="{DynamicResource InkBrush}">
<Ellipse.Fill> <Ellipse.OpacityMask>
<RadialGradientBrush> <RadialGradientBrush>
<GradientStop Color="#FF1A1A1A" Offset="0" /> <GradientStop Color="#FF000000" Offset="0" />
<GradientStop Color="#801A1A1A" Offset="0.5" /> <GradientStop Color="#80000000" Offset="0.5" />
<GradientStop Color="#001A1A1A" Offset="1" /> <GradientStop Color="#00000000" Offset="1" />
</RadialGradientBrush> </RadialGradientBrush>
</Ellipse.Fill> </Ellipse.OpacityMask>
</Ellipse> </Ellipse>
</Grid> </Grid>
<TextBlock x:Name="Label" Text="Pixeleren" Margin="8,0,0,0" VerticalAlignment="Center" FontSize="12" /> <TextBlock x:Name="Label" Text="Pixeleren" Margin="8,0,0,0" VerticalAlignment="Center" FontSize="12" />
@@ -180,16 +180,16 @@
</Window.Resources> </Window.Resources>
<DockPanel> <DockPanel>
<!-- Statusbalk --> <!-- 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"> BorderThickness="0,1,0,0" Padding="12,4">
<DockPanel> <DockPanel>
<TextBlock x:Name="InfoText" DockPanel.Dock="Right" Foreground="{StaticResource SubtleTextBrush}" FontSize="12" /> <TextBlock x:Name="InfoText" DockPanel.Dock="Right" Foreground="{DynamicResource SubtleTextBrush}" FontSize="12" />
<TextBlock x:Name="HintText" Foreground="{StaticResource SubtleTextBrush}" FontSize="12" TextTrimming="CharacterEllipsis" /> <TextBlock x:Name="HintText" Foreground="{DynamicResource SubtleTextBrush}" FontSize="12" TextTrimming="CharacterEllipsis" />
</DockPanel> </DockPanel>
</Border> </Border>
<!-- Onderste werkbalk in de gesplitste indeling; de code verplaatst de acties hierheen --> <!-- 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" BorderThickness="0,1,0,0" Padding="8,6" Visibility="Collapsed"
SizeChanged="Toolbar_SizeChanged" ContextMenuOpening="Toolbar_ContextMenuOpening"> SizeChanged="Toolbar_SizeChanged" ContextMenuOpening="Toolbar_ContextMenuOpening">
<Border.ContextMenu> <Border.ContextMenu>
@@ -199,7 +199,7 @@
</Border> </Border>
<!-- Gereedschappen en acties; rechtsklik voor vergrendelen, positie en zichtbare knoppen --> <!-- 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"> BorderThickness="0,0,0,1" Padding="8,6" SizeChanged="Toolbar_SizeChanged" ContextMenuOpening="Toolbar_ContextMenuOpening">
<Border.ContextMenu> <Border.ContextMenu>
<ContextMenu x:Name="ToolbarMenu" /> <ContextMenu x:Name="ToolbarMenu" />
@@ -246,7 +246,7 @@
</RadioButton> </RadioButton>
<RadioButton GroupName="Tools" Tag="Cursor" local:ToolbarPanel.ItemId="Cursor" local:ToolbarPanel.Title="Cursor" <RadioButton GroupName="Tools" Tag="Cursor" local:ToolbarPanel.ItemId="Cursor" local:ToolbarPanel.Title="Cursor"
Style="{StaticResource ToolToggle}" ToolTip="Cursor plaatsen (C)" Checked="Tool_Checked"> 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" /> 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>
<RadioButton GroupName="Tools" Tag="Emoji" local:ToolbarPanel.ItemId="Emoji" local:ToolbarPanel.Title="Emoji" <RadioButton GroupName="Tools" Tag="Emoji" local:ToolbarPanel.ItemId="Emoji" local:ToolbarPanel.Title="Emoji"
@@ -262,7 +262,7 @@
</RadioButton> </RadioButton>
<RadioButton GroupName="Tools" Tag="Blur" local:ToolbarPanel.ItemId="Blur" local:ToolbarPanel.Title="Vervagen / pixeleren" <RadioButton GroupName="Tools" Tag="Blur" local:ToolbarPanel.ItemId="Blur" local:ToolbarPanel.Title="Vervagen / pixeleren"
Style="{StaticResource ToolToggle}" ToolTip="Vervagen / pixeleren (B)" Checked="Tool_Checked"> 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" /> 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> </RadioButton>
<local:ToolbarSeparator local:ToolbarPanel.ItemId="Sep2" /> <local:ToolbarSeparator local:ToolbarPanel.ItemId="Sep2" />
@@ -329,7 +329,7 @@
Style="{StaticResource FlatButton}" ToolTip="Instellingen" Click="Settings_Click"> Style="{StaticResource FlatButton}" ToolTip="Instellingen" Click="Settings_Click">
<Grid> <Grid>
<TextBlock Text="&#xE713;" Style="{StaticResource IconText}" /> <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" StrokeThickness="1" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,-2,-3,0"
IsHitTestVisible="False" Visibility="Collapsed" /> IsHitTestVisible="False" Visibility="Collapsed" />
</Grid> </Grid>
@@ -363,7 +363,7 @@
</Border> </Border>
<!-- Eigenschappen van het actieve gereedschap of het geselecteerde object --> <!-- 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"> Padding="12,4" MinHeight="42">
<WrapPanel x:Name="PropsPanel" VerticalAlignment="Center" HorizontalAlignment="Center"> <WrapPanel x:Name="PropsPanel" VerticalAlignment="Center" HorizontalAlignment="Center">
<StackPanel x:Name="StrokeGroup" Style="{StaticResource PropGroup}"> <StackPanel x:Name="StrokeGroup" Style="{StaticResource PropGroup}">
@@ -412,7 +412,7 @@
<StackPanel x:Name="BlurGroup" Style="{StaticResource PropGroup}"> <StackPanel x:Name="BlurGroup" Style="{StaticResource PropGroup}">
<ComboBox x:Name="BlurModeCombo" Style="{StaticResource MiniCombo}" ItemTemplate="{StaticResource BlurModeTemplate}" <ComboBox x:Name="BlurModeCombo" Style="{StaticResource MiniCombo}" ItemTemplate="{StaticResource BlurModeTemplate}"
ToolTip="Effect" SelectionChanged="BlurMode_Changed" /> 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"> ToolTip="Sterkte">
<Slider x:Name="BlurStrengthSlider" Width="90" Minimum="1" Maximum="20" IsSnapToTickEnabled="True" TickFrequency="1" <Slider x:Name="BlurStrengthSlider" Width="90" Minimum="1" Maximum="20" IsSnapToTickEnabled="True" TickFrequency="1"
VerticalAlignment="Center" ValueChanged="BlurStrength_Changed" /> VerticalAlignment="Center" ValueChanged="BlurStrength_Changed" />
@@ -421,7 +421,7 @@
<StackPanel x:Name="StraightGroup" Style="{StaticResource PropGroup}"> <StackPanel x:Name="StraightGroup" Style="{StaticResource PropGroup}">
<ToggleButton x:Name="StraightCheck" Style="{StaticResource MiniToggle}" ToolTip="Rechte horizontale streep (Shift wisselt)" <ToggleButton x:Name="StraightCheck" Style="{StaticResource MiniToggle}" ToolTip="Rechte horizontale streep (Shift wisselt)"
Checked="Straight_Changed" Unchecked="Straight_Changed"> 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" /> StrokeStartLineCap="Round" StrokeEndLineCap="Round" Width="18" Height="18" />
</ToggleButton> </ToggleButton>
</StackPanel> </StackPanel>
@@ -431,7 +431,7 @@
<Grid Width="18" Height="18"> <Grid Width="18" Height="18">
<Rectangle Width="11" Height="11" RadiusX="2" RadiusY="2" Fill="#9A9A9A" Margin="5,5,0,0" <Rectangle Width="11" Height="11" RadiusX="2" RadiusY="2" Fill="#9A9A9A" Margin="5,5,0,0"
HorizontalAlignment="Left" VerticalAlignment="Top" /> 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" /> StrokeThickness="1" Margin="2,2,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
</Grid> </Grid>
</ToggleButton> </ToggleButton>
@@ -442,9 +442,9 @@
<!-- Canvas --> <!-- Canvas -->
<ScrollViewer x:Name="Scroller" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" <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"> <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 x:Name="CanvasHost">
<Grid.LayoutTransform> <Grid.LayoutTransform>
<ScaleTransform x:Name="ZoomTransform" /> <ScaleTransform x:Name="ZoomTransform" />
+4 -3
View File
@@ -97,6 +97,7 @@ public partial class EditorWindow : Window
public EditorWindow(BitmapSource image, AppSettings settings, bool isBlank = false, string? windowName = null) public EditorWindow(BitmapSource image, AppSettings settings, bool isBlank = false, string? windowName = null)
{ {
InitializeComponent(); InitializeComponent();
ThemeManager.Attach(this);
_settings = settings; _settings = settings;
_windowName = windowName; _windowName = windowName;
_doc = new EditorDocument(image); _doc = new EditorDocument(image);
@@ -244,11 +245,11 @@ public partial class EditorWindow : Window
private void ApplyToolbarLock() private void ApplyToolbarLock()
{ {
bool locked = _settings.ToolbarLocked; 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; ToolbarItems.IsLocked = locked;
ActionItems.IsLocked = locked; ActionItems.IsLocked = locked;
Toolbar.Background = background; Toolbar.SetResourceReference(Border.BackgroundProperty, background);
ActionBar.Background = background; ActionBar.SetResourceReference(Border.BackgroundProperty, background);
UpdateHint(); UpdateHint();
} }
+8 -8
View File
@@ -5,20 +5,20 @@
VerticalAlignment="Center"> VerticalAlignment="Center">
<Grid> <Grid>
<ToggleButton x:Name="Toggle" Style="{StaticResource FlatButton}" Padding="6,4" MinWidth="0" MinHeight="30" <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"> <StackPanel Orientation="Horizontal">
<Image x:Name="Face" Width="20" Height="20" RenderOptions.BitmapScalingMode="HighQuality" /> <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> </StackPanel>
</ToggleButton> </ToggleButton>
<Popup x:Name="PopupPanel" PlacementTarget="{Binding ElementName=Toggle}" Placement="Bottom" StaysOpen="False" <Popup x:Name="PopupPanel" PlacementTarget="{Binding ElementName=Toggle}" Placement="Bottom" StaysOpen="False"
AllowsTransparency="True" PopupAnimation="Fade" Opened="Popup_Opened" AllowsTransparency="True" PopupAnimation="Fade" Opened="Popup_Opened"
IsOpen="{Binding IsChecked, ElementName=Toggle, Mode=TwoWay}"> 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"> PreviewKeyDown="Popup_PreviewKeyDown">
<Border.Resources> <Border.Resources>
<DataTemplate DataType="{x:Type local:EmojiHeaderRow}"> <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" /> Margin="4,8,0,4" />
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type local:EmojiCellRow}"> <DataTemplate DataType="{x:Type local:EmojiCellRow}">
@@ -46,7 +46,7 @@
<!-- Zoeken --> <!-- Zoeken -->
<Grid DockPanel.Dock="Top" Margin="0,0,0,6"> <Grid DockPanel.Dock="Top" Margin="0,0,0,6">
<TextBox x:Name="SearchBox" Height="30" Padding="28,0,6,0" VerticalContentAlignment="Center" FontSize="13" <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" <TextBlock Text="&#xE721;" Style="{StaticResource IconText}" FontSize="12" Foreground="#8A8A8A"
HorizontalAlignment="Left" Margin="9,0,0,0" IsHitTestVisible="False" /> HorizontalAlignment="Left" Margin="9,0,0,0" IsHitTestVisible="False" />
<TextBlock x:Name="SearchPlaceholder" Text="Zoeken (Nederlands of Engels)" Foreground="#8A8A8A" FontSize="13" <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" /> <StackPanel x:Name="TabPanel" DockPanel.Dock="Top" Orientation="Horizontal" Margin="0,0,0,4" />
<!-- Voorbeeld en huidskleur --> <!-- 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"> Margin="0,4,0,0">
<DockPanel> <DockPanel>
<StackPanel x:Name="TonePanel" DockPanel.Dock="Right" Orientation="Horizontal" VerticalAlignment="Center" /> <StackPanel x:Name="TonePanel" DockPanel.Dock="Right" Orientation="Horizontal" VerticalAlignment="Center" />
<Image x:Name="PreviewImage" Width="36" Height="36" RenderOptions.BitmapScalingMode="HighQuality" /> <Image x:Name="PreviewImage" Width="36" Height="36" RenderOptions.BitmapScalingMode="HighQuality" />
<StackPanel VerticalAlignment="Center" Margin="8,0,6,0"> <StackPanel VerticalAlignment="Center" Margin="8,0,6,0">
<TextBlock x:Name="PreviewName" FontSize="13" TextTrimming="CharacterEllipsis" /> <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" /> TextTrimming="CharacterEllipsis" />
</StackPanel> </StackPanel>
</DockPanel> </DockPanel>
@@ -89,7 +89,7 @@
</ControlTemplate> </ControlTemplate>
</ItemsControl.Template> </ItemsControl.Template>
</ItemsControl> </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" /> HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed" />
</Grid> </Grid>
</DockPanel> </DockPanel>
+9 -1
View File
@@ -477,6 +477,14 @@ public sealed class ToolbarSeparator : FrameworkElement
{ {
private const double Thickness = 13; 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 }; private bool Vertical => VisualTreeHelper.GetParent(this) is ToolbarPanel { Orientation: Orientation.Vertical };
protected override Size MeasureOverride(Size availableSize) => protected override Size MeasureOverride(Size availableSize) =>
@@ -489,7 +497,7 @@ public sealed class ToolbarSeparator : FrameworkElement
return; return;
} }
Brush brush = TryFindResource("DividerBrush") as Brush ?? Brushes.LightGray; Brush brush = LineBrush;
Rect line = Vertical Rect line = Vertical
? new Rect(6, Math.Floor(RenderSize.Height / 2), Math.Max(0, RenderSize.Width - 12), 1) ? 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)); : 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="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="kniip geschiedenis" Width="980" Height="620" MinWidth="560" MinHeight="360" 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"> FontFamily="Segoe UI" FontSize="13" Icon="pack://application:,,,/AppIcon.ico">
<Window.Resources> <Window.Resources>
<Style x:Key="ViewToggle" TargetType="RadioButton" BasedOn="{StaticResource ToolToggle}"> <Style x:Key="ViewToggle" TargetType="RadioButton" BasedOn="{StaticResource ToolToggle}">
@@ -24,16 +24,16 @@
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="ListBoxItem"> <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 /> <ContentPresenter />
</Border> </Border>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True"> <Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#F5F5F5" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlHoverBrush}" />
</Trigger> </Trigger>
<Trigger Property="IsSelected" Value="True"> <Trigger Property="IsSelected" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#1A0067C0" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource SelectedBrush}" />
<Setter TargetName="Bd" Property="BorderBrush" Value="{StaticResource AccentBrush}" /> <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource AccentBrush}" />
</Trigger> </Trigger>
<DataTrigger Binding="{Binding IsAvailable}" Value="False"> <DataTrigger Binding="{Binding IsAvailable}" Value="False">
<Setter Property="Opacity" Value="0.5" /> <Setter Property="Opacity" Value="0.5" />
@@ -46,7 +46,7 @@
<DataTemplate x:Key="SmallThumb"> <DataTemplate x:Key="SmallThumb">
<Grid Width="40" Height="28"> <Grid Width="40" Height="28">
<Image Source="{Binding Thumbnail}" Stretch="Uniform" RenderOptions.BitmapScalingMode="HighQuality" /> <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}" /> Visibility="{Binding NoThumbnailVisibility}" />
</Grid> </Grid>
</DataTemplate> </DataTemplate>
@@ -70,14 +70,14 @@
<TextBox x:Name="SearchBox" Height="30" Padding="26,0,6,0" VerticalContentAlignment="Center" <TextBox x:Name="SearchBox" Height="30" Padding="26,0,6,0" VerticalContentAlignment="Center"
TextChanged="SearchBox_TextChanged" /> TextChanged="SearchBox_TextChanged" />
<TextBlock Text="&#xE721;" Style="{StaticResource IconText}" FontSize="13" HorizontalAlignment="Left" Margin="8,0,0,0" <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" <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> </Grid>
</DockPanel> </DockPanel>
<DockPanel DockPanel.Dock="Bottom" Margin="0,10,0,0" LastChildFill="False"> <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 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}" <Button x:Name="ClearButton" DockPanel.Dock="Right" Content="Geschiedenis wissen..." Style="{StaticResource SecondaryButton}"
Click="Clear_Click" /> Click="Clear_Click" />
@@ -85,7 +85,8 @@
<Grid> <Grid>
<ListView x:Name="ListItems" ItemContainerStyle="{StaticResource RowStyle}" SelectionMode="Single" <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> <ListView.ContextMenu>
<ContextMenu /> <ContextMenu />
</ListView.ContextMenu> </ListView.ContextMenu>
@@ -115,20 +116,20 @@
<ListBox.ItemTemplate> <ListBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<StackPanel Width="180" ToolTip="{Binding ToolTip}"> <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" /> <Image Source="{Binding Thumbnail}" Stretch="Uniform" RenderOptions.BitmapScalingMode="HighQuality" />
<TextBlock Text="&#xE714;" Style="{StaticResource IconText}" FontSize="32" <TextBlock Text="&#xE714;" Style="{StaticResource IconText}" FontSize="32"
Foreground="{StaticResource SubtleTextBrush}" Visibility="{Binding NoThumbnailVisibility}" /> Foreground="{DynamicResource SubtleTextBrush}" Visibility="{Binding NoThumbnailVisibility}" />
</Grid> </Grid>
<TextBlock Text="{Binding Entry.Name}" Margin="0,6,0,0" TextTrimming="CharacterEllipsis" /> <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> </StackPanel>
</DataTemplate> </DataTemplate>
</ListBox.ItemTemplate> </ListBox.ItemTemplate>
</ListBox> </ListBox>
<TextBlock x:Name="EmptyText" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" <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." /> Text="Nog niets in de geschiedenis.&#x0a;Wat je in kniip opslaat of uploadt, komt hier te staan." />
</Grid> </Grid>
</DockPanel> </DockPanel>
+1
View File
@@ -19,6 +19,7 @@ public partial class HistoryWindow : Window
public HistoryWindow(bool images) public HistoryWindow(bool images)
{ {
InitializeComponent(); InitializeComponent();
Infrastructure.ThemeManager.Attach(this);
Reload(); Reload();
ShowImages(images); ShowImages(images);
HistoryStore.Changed += Reload; 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 _foldersItem;
private readonly ToolStripMenuItem _recentItem; private readonly ToolStripMenuItem _recentItem;
private readonly ToolStripMenuItem _delayItem; private readonly ToolStripMenuItem _delayItem;
private Panel _delayPanel = null!;
private TrackBar _delaySlider = null!; private TrackBar _delaySlider = null!;
private NumericUpDown _delayNumber = null!; private NumericUpDown _delayNumber = null!;
private Label _delayUnit = null!;
private int _delaySeconds; private int _delaySeconds;
private int _savedDelaySeconds; private int _savedDelaySeconds;
@@ -152,7 +154,7 @@ internal sealed class TrayIcon : IDisposable
Location = new Point(_delaySlider.Right + 6, 10), Location = new Point(_delaySlider.Right + 6, 10),
TextAlign = HorizontalAlignment.Right TextAlign = HorizontalAlignment.Right
}; };
var unit = new Label _delayUnit = new Label
{ {
Text = "seconden", Text = "seconden",
AutoSize = true, AutoSize = true,
@@ -160,11 +162,12 @@ internal sealed class TrayIcon : IDisposable
}; };
var panel = new Panel 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 BackColor = ProfessionalColors.ToolStripDropDownBackground
}; };
_delayPanel = panel;
_delaySlider.BackColor = panel.BackColor; _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); _delaySlider.ValueChanged += (_, _) => ShowCaptureDelay(_delaySlider.Value);
_delayNumber.ValueChanged += (_, _) => ShowCaptureDelay((int)_delayNumber.Value); _delayNumber.ValueChanged += (_, _) => ShowCaptureDelay((int)_delayNumber.Value);
@@ -207,9 +210,22 @@ internal sealed class TrayIcon : IDisposable
_delayItem.Text = $"Schermafdruk vertraging: {seconds}s"; _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 private static string IdleText => AppIdentity.IsTest
? $"{AppIdentity.DisplayName} {Kniip.Update.UpdateChecker.CurrentVersion}" ? $"{AppIdentity.DisplayName} {Kniip.Update.UpdateChecker.CurrentVersion}"
: "kniip - annotaties voor het Knipprogramma"; : AppIdentity.DisplayName;
private void BuildFolders() private void BuildFolders()
{ {
@@ -300,7 +316,8 @@ internal sealed class TrayIcon : IDisposable
private static Icon LoadIcon() 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) if (info == null)
{ {
return SystemIcons.Application; return SystemIcons.Application;
@@ -315,4 +332,68 @@ internal sealed class TrayIcon : IDisposable
_icon.Visible = false; _icon.Visible = false;
_icon.Dispose(); _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")] [DllImport("dwmapi.dll")]
private static extern int DwmGetWindowAttribute(IntPtr hwnd, int attribute, out int value, int size); 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) public static void AddExtendedStyle(IntPtr hwnd, int style)
{ {
long current = GetWindowLongPtr(hwnd, GWL_EXSTYLE).ToInt64(); long current = GetWindowLongPtr(hwnd, GWL_EXSTYLE).ToInt64();
+2 -1
View File
@@ -18,7 +18,7 @@
<ApplicationManifest>app.manifest</ApplicationManifest> <ApplicationManifest>app.manifest</ApplicationManifest>
<Product>kniip</Product> <Product>kniip</Product>
<Description>Annotatie-editor naast het Windows Knipprogramma</Description> <Description>Annotatie-editor naast het Windows Knipprogramma</Description>
<Version>1.1.5</Version> <Version>1.1.7</Version>
<SatelliteResourceLanguages>nl;en</SatelliteResourceLanguages> <SatelliteResourceLanguages>nl;en</SatelliteResourceLanguages>
<!-- WPF regelt DPI via app.manifest; de WinForms-analyzer is hier niet van toepassing. --> <!-- WPF regelt DPI via app.manifest; de WinForms-analyzer is hier niet van toepassing. -->
<NoWarn>$(NoWarn);WFAC010</NoWarn> <NoWarn>$(NoWarn);WFAC010</NoWarn>
@@ -34,6 +34,7 @@
<ItemGroup> <ItemGroup>
<Resource Include="AppIcon.ico" /> <Resource Include="AppIcon.ico" />
<Resource Include="TrayIcon.ico" />
<Resource Include="Assets\Emoji\emoji.json;Assets\Emoji\twemoji-64.png" /> <Resource Include="Assets\Emoji\emoji.json;Assets\Emoji\twemoji-64.png" />
</ItemGroup> </ItemGroup>
+6 -6
View File
@@ -3,8 +3,8 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="kniip" WindowStyle="None" AllowsTransparency="True" Background="Transparent" Title="kniip" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
Topmost="True" ShowInTaskbar="False" ShowActivated="False" ResizeMode="NoResize" Topmost="True" ShowInTaskbar="False" ShowActivated="False" ResizeMode="NoResize"
SizeToContent="WidthAndHeight" FontFamily="Segoe UI" UseLayoutRounding="True"> SizeToContent="WidthAndHeight" FontFamily="Segoe UI" Foreground="{DynamicResource InkBrush}" UseLayoutRounding="True">
<Border Margin="16" Background="#FCFCFC" CornerRadius="8" BorderBrush="#DADADA" BorderThickness="1"> <Border Margin="16" Background="{DynamicResource ToastBrush}" CornerRadius="8" BorderBrush="{DynamicResource ToastBorderBrush}" BorderThickness="1">
<Border.Effect> <Border.Effect>
<DropShadowEffect BlurRadius="18" ShadowDepth="3" Opacity="0.22" /> <DropShadowEffect BlurRadius="18" ShadowDepth="3" Opacity="0.22" />
</Border.Effect> </Border.Effect>
@@ -21,20 +21,20 @@
<StackPanel Grid.ColumnSpan="2" Orientation="Horizontal" Margin="0,0,0,10"> <StackPanel Grid.ColumnSpan="2" Orientation="Horizontal" Margin="0,0,0,10">
<Image Source="pack://application:,,,/AppIcon.ico" Width="16" Height="16" /> <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> </StackPanel>
<Button Grid.Column="2" Style="{StaticResource FlatButton}" MinWidth="28" MinHeight="24" Padding="4,2" <Button Grid.Column="2" Style="{StaticResource FlatButton}" MinWidth="28" MinHeight="24" Padding="4,2"
VerticalAlignment="Top" Click="Close_Click" ToolTip="Sluiten"> VerticalAlignment="Top" Click="Close_Click" ToolTip="Sluiten">
<TextBlock Text="&#xE711;" Style="{StaticResource IconText}" FontSize="10" /> <TextBlock Text="&#xE711;" Style="{StaticResource IconText}" FontSize="10" />
</Button> </Button>
<Border Grid.Row="1" Width="110" Height="72" CornerRadius="4" BorderBrush="#E0E0E0" BorderThickness="1" <Border Grid.Row="1" Width="110" Height="72" CornerRadius="4" BorderBrush="{DynamicResource ControlBorderBrush}" BorderThickness="1"
Background="#EBEBEB" Cursor="Hand" MouseLeftButtonUp="Thumbnail_Click" ClipToBounds="True"> Background="{DynamicResource ControlPressedBrush}" Cursor="Hand" MouseLeftButtonUp="Thumbnail_Click" ClipToBounds="True">
<Image x:Name="Thumbnail" Stretch="Uniform" RenderOptions.BitmapScalingMode="HighQuality" /> <Image x:Name="Thumbnail" Stretch="Uniform" RenderOptions.BitmapScalingMode="HighQuality" />
</Border> </Border>
<StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Margin="12,0,4,0" VerticalAlignment="Center"> <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 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"> <StackPanel Orientation="Horizontal">
<Button Style="{StaticResource AccentButton}" Margin="0,0,6,0" Click="Edit_Click"> <Button Style="{StaticResource AccentButton}" Margin="0,0,6,0" Click="Edit_Click">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
+4 -4
View File
@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="kniip opname" WindowStyle="None" AllowsTransparency="True" Background="Transparent" Title="kniip opname" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
ResizeMode="NoResize" SizeToContent="WidthAndHeight" ShowInTaskbar="False" Topmost="True" ResizeMode="NoResize" SizeToContent="WidthAndHeight" ShowInTaskbar="False" Topmost="True"
FontFamily="Segoe UI" FontSize="13"> FontFamily="Segoe UI" FontSize="13" Foreground="{DynamicResource InkBrush}">
<Window.Resources> <Window.Resources>
<Style x:Key="RecordStyle" TargetType="Button" BasedOn="{StaticResource AccentButton}"> <Style x:Key="RecordStyle" TargetType="Button" BasedOn="{StaticResource AccentButton}">
<Setter Property="Template"> <Setter Property="Template">
@@ -25,7 +25,7 @@
</Setter> </Setter>
</Style> </Style>
</Window.Resources> </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"> MouseLeftButtonDown="Background_MouseLeftButtonDown">
<Border.Effect> <Border.Effect>
<DropShadowEffect BlurRadius="14" ShadowDepth="2" Opacity="0.25" /> <DropShadowEffect BlurRadius="14" ShadowDepth="2" Opacity="0.25" />
@@ -33,7 +33,7 @@
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<StackPanel x:Name="TimePanel" Orientation="Horizontal" VerticalAlignment="Center" Margin="6,0,8,0" Visibility="Collapsed"> <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" /> <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> </StackPanel>
<ToggleButton x:Name="SystemAudioToggle" Style="{StaticResource MiniToggle}" Height="34" MinWidth="34" <ToggleButton x:Name="SystemAudioToggle" Style="{StaticResource MiniToggle}" Height="34" MinWidth="34"
@@ -66,7 +66,7 @@
</Button> </Button>
<TextBlock x:Name="BusyText" Text="Opname afronden..." VerticalAlignment="Center" Margin="8,0" Visibility="Collapsed" <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)"> <Button x:Name="CancelButton" Style="{StaticResource FlatButton}" Click="Cancel_Click" ToolTip="Annuleren (opname weggooien)">
<TextBlock Text="&#xE711;" Style="{StaticResource IconText}" FontSize="14" /> <TextBlock Text="&#xE711;" Style="{StaticResource IconText}" FontSize="14" />
@@ -7,21 +7,21 @@
Background="#01000000"> Background="#01000000">
<Grid> <Grid>
<Path x:Name="Dim" Fill="#73000000" /> <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" /> HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="Collapsed" IsHitTestVisible="False" />
<Border x:Name="SizeBadge" HorizontalAlignment="Left" VerticalAlignment="Top" Background="#E6202020" <Border x:Name="SizeBadge" HorizontalAlignment="Left" VerticalAlignment="Top" Background="#E6202020"
CornerRadius="4" Padding="6,2" Visibility="Collapsed" IsHitTestVisible="False"> CornerRadius="4" Padding="6,2" Visibility="Collapsed" IsHitTestVisible="False">
<TextBlock x:Name="SizeText" Foreground="White" FontSize="12" /> <TextBlock x:Name="SizeText" Foreground="White" FontSize="12" />
</Border> </Border>
<capture:MagnifierControl x:Name="Magnifier" /> <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"> CornerRadius="6" Padding="16,9" IsHitTestVisible="False">
<Border.Effect> <Border.Effect>
<DropShadowEffect BlurRadius="12" ShadowDepth="2" Opacity="0.25" /> <DropShadowEffect BlurRadius="12" ShadowDepth="2" Opacity="0.25" />
</Border.Effect> </Border.Effect>
<StackPanel> <StackPanel>
<TextBlock Text="Screencast: kies wat je wilt opnemen" FontWeight="SemiBold" Foreground="{StaticResource InkBrush}" /> <TextBlock Text="Screencast: kies wat je wilt opnemen" FontWeight="SemiBold" Foreground="{DynamicResource InkBrush}" />
<TextBlock Foreground="{StaticResource SubtleTextBrush}" FontSize="12" Margin="0,2,0,0" <TextBlock Foreground="{DynamicResource SubtleTextBrush}" FontSize="12" Margin="0,2,0,0"
Text="Sleep een gebied · klik op een venster · Enter = heel scherm · Esc = annuleren" /> Text="Sleep een gebied · klik op een venster · Enter = heel scherm · Esc = annuleren" />
</StackPanel> </StackPanel>
</Border> </Border>
+9 -9
View File
@@ -2,12 +2,12 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="kniip screencast" Width="980" Height="720" MinWidth="680" MinHeight="500" 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"> FontFamily="Segoe UI" FontSize="13" Icon="pack://application:,,,/AppIcon.ico">
<Window.Resources> <Window.Resources>
<Style x:Key="Handle" TargetType="Border"> <Style x:Key="Handle" TargetType="Border">
<Setter Property="Width" Value="12" /> <Setter Property="Width" Value="12" />
<Setter Property="Background" Value="{StaticResource AccentBrush}" /> <Setter Property="Background" Value="{DynamicResource AccentBrush}" />
<Setter Property="Cursor" Value="SizeWE" /> <Setter Property="Cursor" Value="SizeWE" />
</Style> </Style>
<Style x:Key="Grip" TargetType="Rectangle"> <Style x:Key="Grip" TargetType="Rectangle">
@@ -43,10 +43,10 @@
MouseLeftButtonDown="TrimArea_MouseLeftButtonDown" MouseMove="TrimArea_MouseMove" MouseLeftButtonDown="TrimArea_MouseLeftButtonDown" MouseMove="TrimArea_MouseMove"
MouseLeftButtonUp="TrimArea_MouseLeftButtonUp" SizeChanged="TrimArea_SizeChanged"> MouseLeftButtonUp="TrimArea_MouseLeftButtonUp" SizeChanged="TrimArea_SizeChanged">
<Canvas x:Name="TrimCanvas"> <Canvas x:Name="TrimCanvas">
<Border x:Name="TrackBorder" Background="#DADADA" CornerRadius="5" Height="44" /> <Border x:Name="TrackBorder" Background="{DynamicResource TrackBrush}" CornerRadius="5" Height="44" />
<Border x:Name="SelectionBorder" Background="#330067C0" BorderBrush="{StaticResource AccentBrush}" <Border x:Name="SelectionBorder" Background="#330067C0" BorderBrush="{DynamicResource AccentBrush}"
BorderThickness="0,2" Height="44" /> 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" <Border x:Name="StartHandle" Style="{StaticResource Handle}" CornerRadius="5,0,0,5" Height="44"
ToolTip="Begin van de selectie"> ToolTip="Begin van de selectie">
<Rectangle Style="{StaticResource Grip}" /> <Rectangle Style="{StaticResource Grip}" />
@@ -64,7 +64,7 @@
<TextBlock x:Name="PlayIcon" Text="&#xE768;" Style="{StaticResource IconText}" /> <TextBlock x:Name="PlayIcon" Text="&#xE768;" Style="{StaticResource IconText}" />
</Button> </Button>
<TextBlock x:Name="PositionText" DockPanel.Dock="Left" VerticalAlignment="Center" Margin="6,0,0,0" <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" <Button DockPanel.Dock="Right" Style="{StaticResource FlatButton}" Click="SetEnd_Click"
ToolTip="Einde van de selectie op de huidige positie zetten"> ToolTip="Einde van de selectie op de huidige positie zetten">
@@ -81,10 +81,10 @@
</StackPanel> </StackPanel>
</Button> </Button>
<TextBlock x:Name="SelectionText" DockPanel.Dock="Right" VerticalAlignment="Center" Margin="0,0,10,0" <TextBlock x:Name="SelectionText" DockPanel.Dock="Right" VerticalAlignment="Center" Margin="0,0,10,0"
Foreground="{StaticResource SubtleTextBrush}" /> Foreground="{DynamicResource SubtleTextBrush}" />
</DockPanel> </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"> CornerRadius="6" Padding="14,10">
<DockPanel LastChildFill="True"> <DockPanel LastChildFill="True">
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" VerticalAlignment="Center"> <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" VerticalAlignment="Center">
@@ -132,7 +132,7 @@
</StackPanel> </StackPanel>
<TextBlock x:Name="InfoText" Style="{StaticResource PropLabel}" Margin="0,6,0,0" TextWrapping="Wrap" /> <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"> <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> <Hyperlink Click="OpenFolder_Click"><Run x:Name="OpenRun" Text="Map openen" /></Hyperlink>
</TextBlock> </TextBlock>
</StackPanel> </StackPanel>
@@ -50,6 +50,7 @@ public partial class ScreencastWindow : Window
internal ScreencastWindow(string path, AppSettings settings, ScreencastFormat? format = null, string? windowName = null) internal ScreencastWindow(string path, AppSettings settings, ScreencastFormat? format = null, string? windowName = null)
{ {
InitializeComponent(); InitializeComponent();
Infrastructure.ThemeManager.Attach(this);
_path = path; _path = path;
_settings = settings; _settings = settings;
_windowName = windowName; _windowName = windowName;
+12
View File
@@ -42,6 +42,15 @@ public enum EditorLayout
Split Split
} }
public enum ColorMode
{
Light,
Dark,
/// <summary>De app-modus van Windows volgen (licht of donker).</summary>
System
}
public sealed class AppSettings public sealed class AppSettings
{ {
public bool WatchClipboard { get; set; } = true; public bool WatchClipboard { get; set; } = true;
@@ -104,6 +113,9 @@ public sealed class AppSettings
/// <summary>Volgorde van de werkbalkitems (ItemId's); leeg betekent de standaardvolgorde.</summary> /// <summary>Volgorde van de werkbalkitems (ItemId's); leeg betekent de standaardvolgorde.</summary>
public List<string> ToolbarOrder { get; set; } = new(); 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> /// <summary>Indeling van de werkbalk(en) in de editor.</summary>
public EditorLayout EditorLayout { get; set; } = EditorLayout.Split; public EditorLayout EditorLayout { get; set; } = EditorLayout.Split;
+55 -50
View File
@@ -2,28 +2,35 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="kniip instellingen" Width="720" Height="600" ResizeMode="NoResize" 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"> FontFamily="Segoe UI" FontSize="13" Icon="pack://application:,,,/AppIcon.ico">
<Window.Resources> <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"> <Style x:Key="CardTitle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{DynamicResource AccentTextBrush}" />
<Setter Property="FontWeight" Value="SemiBold" /> <Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="FontSize" Value="14" /> <Setter Property="FontSize" Value="14" />
<Setter Property="Margin" Value="0,0,0,8" /> <Setter Property="Margin" Value="0,0,0,8" />
</Style> </Style>
<Style TargetType="CheckBox"> <Style TargetType="CheckBox" BasedOn="{StaticResource {x:Type CheckBox}}">
<Setter Property="Margin" Value="0,4" /> <Setter Property="Margin" Value="0,4" />
</Style> </Style>
<Style TargetType="RadioButton"> <Style TargetType="RadioButton" BasedOn="{StaticResource {x:Type RadioButton}}">
<Setter Property="Margin" Value="0,4" /> <Setter Property="Margin" Value="0,4" />
</Style> </Style>
<Style x:Key="Hint" TargetType="TextBlock"> <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="FontSize" Value="12" />
<Setter Property="TextWrapping" Value="Wrap" /> <Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="Margin" Value="22,0,0,4" /> <Setter Property="Margin" Value="22,0,0,4" />
</Style> </Style>
<Style x:Key="SettingsTabItem" TargetType="TabItem"> <Style x:Key="SettingsTabItem" TargetType="TabItem">
<Setter Property="FocusVisualStyle" Value="{x:Null}" /> <Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Foreground" Value="{DynamicResource InkBrush}" />
<Setter Property="HorizontalAlignment" Value="Stretch" /> <Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="HorizontalContentAlignment" Value="Left" /> <Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="Padding" Value="12,9" /> <Setter Property="Padding" Value="12,9" />
@@ -42,12 +49,12 @@
<Condition Property="IsMouseOver" Value="True" /> <Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsSelected" Value="False" /> <Condition Property="IsSelected" Value="False" />
</MultiTrigger.Conditions> </MultiTrigger.Conditions>
<Setter TargetName="Bd" Property="Background" Value="{StaticResource HoverBrush}" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource HoverBrush}" />
</MultiTrigger> </MultiTrigger>
<Trigger Property="IsSelected" Value="True"> <Trigger Property="IsSelected" Value="True">
<Setter TargetName="Bd" Property="Background" Value="White" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource CardBrush}" />
<Setter TargetName="Bd" Property="BorderBrush" Value="{StaticResource AccentBrush}" /> <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource AccentBrush}" />
<Setter Property="Foreground" Value="{StaticResource AccentBrush}" /> <Setter Property="Foreground" Value="{DynamicResource AccentTextBrush}" />
<Setter Property="FontWeight" Value="SemiBold" /> <Setter Property="FontWeight" Value="SemiBold" />
</Trigger> </Trigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>
@@ -69,7 +76,7 @@
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TabPanel Grid.Column="0" IsItemsHost="True" VerticalAlignment="Top" Background="Transparent" /> <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"> CornerRadius="6" SnapsToDevicePixels="True" Padding="16,14">
<ContentPresenter ContentSource="SelectedContent" /> <ContentPresenter ContentSource="SelectedContent" />
</Border> </Border>
@@ -93,18 +100,8 @@
</DockPanel> </DockPanel>
<TabControl Style="{StaticResource SettingsTabs}" SelectionChanged="Tabs_SelectionChanged"> <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"> <TabItem Header="Sneltoetsen">
<StackPanel> <StackPanel Style="{StaticResource TabPage}">
<TextBlock Text="Sneltoetsen" Style="{StaticResource CardTitle}" /> <TextBlock Text="Sneltoetsen" Style="{StaticResource CardTitle}" />
<StackPanel Orientation="Horizontal" Margin="0,2,0,4"> <StackPanel Orientation="Horizontal" Margin="0,2,0,4">
<TextBlock Text="Rechthoek" VerticalAlignment="Center" Width="150" /> <TextBlock Text="Rechthoek" VerticalAlignment="Center" Width="150" />
@@ -147,19 +144,8 @@
</StackPanel> </StackPanel>
</TabItem> </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"> <TabItem Header="Opslaan">
<StackPanel> <StackPanel Style="{StaticResource TabPage}">
<TextBlock Text="Opslaan" Style="{StaticResource CardTitle}" /> <TextBlock Text="Opslaan" Style="{StaticResource CardTitle}" />
<DockPanel Margin="0,2,0,4"> <DockPanel Margin="0,2,0,4">
<TextBlock Text="Knipsels" VerticalAlignment="Center" Width="110" /> <TextBlock Text="Knipsels" VerticalAlignment="Center" Width="110" />
@@ -200,7 +186,7 @@
</TabItem> </TabItem>
<TabItem Header="Uploaden"> <TabItem Header="Uploaden">
<StackPanel> <StackPanel Style="{StaticResource TabPage}">
<TextBlock Text="Uploaden naar Zipline" Style="{StaticResource CardTitle}" /> <TextBlock Text="Uploaden naar Zipline" Style="{StaticResource CardTitle}" />
<DockPanel Margin="0,2,0,4"> <DockPanel Margin="0,2,0,4">
<TextBlock Text="Server" VerticalAlignment="Center" Width="110" /> <TextBlock Text="Server" VerticalAlignment="Center" Width="110" />
@@ -221,7 +207,7 @@
</TabItem> </TabItem>
<TabItem Header="Screencasts"> <TabItem Header="Screencasts">
<StackPanel> <StackPanel Style="{StaticResource TabPage}">
<TextBlock Text="Screencasts" Style="{StaticResource CardTitle}" /> <TextBlock Text="Screencasts" Style="{StaticResource CardTitle}" />
<TextBlock Style="{StaticResource Hint}" Margin="0,0,0,6" <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." /> Text="Sneltoets: eerste keer gebied kiezen, tweede keer opname starten, derde keer stoppen. De nabewerking staat daarna op MP4 of GIF." />
@@ -241,19 +227,15 @@
</StackPanel> </StackPanel>
</TabItem> </TabItem>
<TabItem Header="Windows"> <TabItem Header="Weergave">
<StackPanel> <StackPanel Style="{StaticResource TabPage}">
<TextBlock Text="Windows-integratie" Style="{StaticResource CardTitle}" /> <TextBlock Text="Kleurmodus" Style="{StaticResource CardTitle}" />
<CheckBox x:Name="AutostartBox" Content="kniip starten met Windows" /> <RadioButton x:Name="ColorModeLightRadio" GroupName="ColorMode" Content="Licht" />
<CheckBox x:Name="OpenWithBox" Content="kniip tonen in 'Openen met' (ook in het Knipprogramma: ... → Openen met)" /> <RadioButton x:Name="ColorModeDarkRadio" GroupName="ColorMode" Content="Donker" />
<RadioButton x:Name="ColorModeSystemRadio" GroupName="ColorMode" Content="Systeem" />
<TextBlock Style="{StaticResource Hint}" <TextBlock Style="{StaticResource Hint}"
Text="Alleen voor jouw gebruikersaccount; er is geen beheerder nodig en het Knipprogramma zelf wordt niet aangepast." /> Text="Systeem volgt de app-modus van Windows (Instellingen > Persoonlijke instellingen > Kleuren) en wisselt mee als je die verandert." />
</StackPanel> <TextBlock Text="Editor" Style="{StaticResource CardTitle}" Margin="0,16,0,6" />
</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)" /> <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" /> <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="LayoutSplitRadio" GroupName="EditorLayout" Content="Split-weergave: gereedschappen boven, opslaan onder" />
@@ -263,16 +245,39 @@
</StackPanel> </StackPanel>
</TabItem> </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}"
Text="Alleen voor jouw gebruikersaccount; er is geen beheerder nodig en het Knipprogramma zelf wordt niet aangepast." />
</StackPanel>
</TabItem>
<TabItem x:Name="UpdateTab"> <TabItem x:Name="UpdateTab">
<TabItem.Header> <TabItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="Update" /> <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" StrokeThickness="1" Margin="6,0,0,0" VerticalAlignment="Center" Visibility="Collapsed"
ToolTip="Er is een nieuwe versie beschikbaar" /> ToolTip="Er is een nieuwe versie beschikbaar" />
</StackPanel> </StackPanel>
</TabItem.Header> </TabItem.Header>
<StackPanel> <StackPanel Style="{StaticResource TabPage}">
<TextBlock Text="Update" Style="{StaticResource CardTitle}" /> <TextBlock Text="Update" Style="{StaticResource CardTitle}" />
<TextBlock x:Name="CurrentVersionText" Margin="0,0,0,2" /> <TextBlock x:Name="CurrentVersionText" Margin="0,0,0,2" />
<CheckBox x:Name="AutoUpdateCheckBox" Content="Automatisch controleren op nieuwe versies (bij starten en dagelijks)" /> <CheckBox x:Name="AutoUpdateCheckBox" Content="Automatisch controleren op nieuwe versies (bij starten en dagelijks)" />
@@ -286,8 +291,8 @@
ToolTip="https://git.hibbit.net/rogier/kniip/releases" /> ToolTip="https://git.hibbit.net/rogier/kniip/releases" />
</StackPanel> </StackPanel>
<ProgressBar x:Name="DownloadProgress" Height="4" Minimum="0" Maximum="1" Margin="0,0,0,8" <ProgressBar x:Name="DownloadProgress" Height="4" Minimum="0" Maximum="1" Margin="0,0,0,8"
Foreground="{StaticResource AccentBrush}" Visibility="Collapsed" /> Foreground="{DynamicResource AccentBrush}" Visibility="Collapsed" />
<Border BorderBrush="{StaticResource DividerBrush}" BorderThickness="1" CornerRadius="4" Height="300"> <Border BorderBrush="{DynamicResource DividerBrush}" BorderThickness="1" CornerRadius="4" Height="300">
<FlowDocumentScrollViewer x:Name="ChangelogViewer" VerticalScrollBarVisibility="Auto" <FlowDocumentScrollViewer x:Name="ChangelogViewer" VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled" IsToolBarVisible="False" HorizontalScrollBarVisibility="Disabled" IsToolBarVisible="False"
Zoom="100" MinZoom="100" MaxZoom="100" Focusable="False" /> Zoom="100" MinZoom="100" MaxZoom="100" Focusable="False" />
+9 -2
View File
@@ -44,6 +44,7 @@ public partial class SettingsWindow : Window
public SettingsWindow(AppSettings settings) public SettingsWindow(AppSettings settings)
{ {
InitializeComponent(); InitializeComponent();
ThemeManager.Attach(this);
_settings = settings; _settings = settings;
Title = $"{AppIdentity.DisplayName} instellingen"; Title = $"{AppIdentity.DisplayName} instellingen";
@@ -97,6 +98,9 @@ public partial class SettingsWindow : Window
ActionOpenRadio.IsChecked = settings.Action == CaptureAction.OpenEditor; ActionOpenRadio.IsChecked = settings.Action == CaptureAction.OpenEditor;
ActionNothingRadio.IsChecked = settings.Action == CaptureAction.Nothing; ActionNothingRadio.IsChecked = settings.Action == CaptureAction.Nothing;
StraightHighlightBox.IsChecked = settings.StraightHighlight; 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; LayoutSplitRadio.IsChecked = settings.EditorLayout == EditorLayout.Split;
LayoutSingleRadio.IsChecked = settings.EditorLayout != EditorLayout.Split; LayoutSingleRadio.IsChecked = settings.EditorLayout != EditorLayout.Split;
AutoUpdateCheckBox.IsChecked = settings.CheckForUpdates; AutoUpdateCheckBox.IsChecked = settings.CheckForUpdates;
@@ -253,7 +257,7 @@ public partial class SettingsWindow : Window
{ {
text.Text = string.IsNullOrEmpty(folder) ? "Elke keer vragen" : folder; text.Text = string.IsNullOrEmpty(folder) ? "Elke keer vragen" : folder;
text.ToolTip = 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(); private void Template_TextChanged(object sender, TextChangedEventArgs e) => ShowTemplatePreviews();
@@ -316,7 +320,7 @@ public partial class SettingsWindow : Window
bool configured = _uploader is { IsConfigured: true }; bool configured = _uploader is { IsConfigured: true };
UploaderText.Text = configured ? _uploader!.DisplayName : "Niet ingesteld"; UploaderText.Text = configured ? _uploader!.DisplayName : "Niet ingesteld";
UploaderText.ToolTip = configured ? _uploader!.RequestUrl : null; 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; TestUploaderButton.IsEnabled = configured;
RemoveUploaderButton.IsEnabled = configured; RemoveUploaderButton.IsEnabled = configured;
} }
@@ -444,6 +448,9 @@ public partial class SettingsWindow : Window
: ActionNothingRadio.IsChecked == true ? CaptureAction.Nothing : ActionNothingRadio.IsChecked == true ? CaptureAction.Nothing
: CaptureAction.Notify; : CaptureAction.Notify;
_settings.StraightHighlight = StraightHighlightBox.IsChecked == true; _settings.StraightHighlight = StraightHighlightBox.IsChecked == true;
_settings.ColorMode = ColorModeDarkRadio.IsChecked == true ? ColorMode.Dark
: ColorModeSystemRadio.IsChecked == true ? ColorMode.System
: ColorMode.Light;
_settings.EditorLayout = LayoutSplitRadio.IsChecked == true ? EditorLayout.Split : EditorLayout.Single; _settings.EditorLayout = LayoutSplitRadio.IsChecked == true ? EditorLayout.Split : EditorLayout.Single;
_settings.CheckForUpdates = AutoUpdateCheckBox.IsChecked == true; _settings.CheckForUpdates = AutoUpdateCheckBox.IsChecked == true;
_settings.ShowMagnifier = MagnifierBox.IsChecked == true; _settings.ShowMagnifier = MagnifierBox.IsChecked == true;
+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(); .Build();
private static readonly FontFamily CodeFont = new("Cascadia Mono, Consolas"); private static readonly FontFamily CodeFont = new("Cascadia Mono, Consolas");
private static readonly Brush CodeBackground = Freeze(new SolidColorBrush(Color.FromRgb(0xF3, 0xF3, 0xF3))); private static Brush CodeBackground => Resource("CodeBrush", Brushes.WhiteSmoke);
private static readonly Brush QuoteBorder = Freeze(new SolidColorBrush(Color.FromRgb(0xD0, 0xD0, 0xD0))); private static Brush QuoteBorder => Resource("QuoteBorderBrush", Brushes.LightGray);
private static Brush Accent => Resource("AccentBrush", Brushes.SteelBlue); private static Brush Accent => Resource("AccentBrush", Brushes.SteelBlue);
@@ -38,7 +38,7 @@ public static class MarkdownRenderer
FontSize = 13, FontSize = 13,
PagePadding = new Thickness(14, 10, 14, 10), PagePadding = new Thickness(14, 10, 14, 10),
TextAlignment = TextAlignment.Left, 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> /// <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) => private static Brush Resource(string key, Brush fallback) =>
Application.Current?.TryFindResource(key) as 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"