27a7a322d6
Not the desktop's slate any more: a blue gradient behind, blocks that are only translucent white laid over it, no borders at all, wide radii, white text. Depth comes from transparency, which is why the frames are gone - a hairline reads as a desktop application immediately. There is no coloured accent in the reference either: primary and secondary differ by how much white they carry, 30 against 18 per cent. The 2FA code goes white, carried by its size. Nothing is uppercase - the second plane is marked by colour and size alone. Three compiler traps on the way, all worth knowing: TBrush needs FMX.Graphics in the INTERFACE clause, a fresh TGradient already runs top to bottom, and TForm already owns a parameterless PaintBackground that shadowed the unit's. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
59 lines
2.6 KiB
PowerShell
59 lines
2.6 KiB
PowerShell
# Fabrique pm-dark.style depuis le Dark.style livre avec Delphi, en recolorant
|
|
# les deux controles dont le fond reste visible.
|
|
#
|
|
# POURQUOI PATCHER PLUTOT QUE RENDRE TRANSPARENT : Dark.style ne contient aucun
|
|
# gabarit 'transparentedit' ni 'transparentmemostyle' - un StyleLookup vers eux
|
|
# retombe silencieusement sur le gabarit normal, avec son fond gris. Le champ
|
|
# de recherche et le journal juraient donc avec le reste de l'interface, qui
|
|
# est peint.
|
|
#
|
|
# Tout le reste de l'application ne depend plus d'aucun gabarit : ce style ne
|
|
# sert qu'aux controles natifs qu'on ne reecrit pas.
|
|
#
|
|
# A relancer si la palette de PMA.Theme change, puis recompiler la ressource :
|
|
# brcc32 theme.rc -fotheme.res
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
$src = 'C:\Program Files (x86)\Embarcadero\Studio\23.0\Redist\styles\Fmx\Dark.style'
|
|
$dst = Join-Path $PSScriptRoot 'pm-dark.style'
|
|
|
|
# Doivent suivre les constantes de PMA.Theme.
|
|
$surface = 'x2EFFFFFF' # COL_RAISED : blanc translucide, sans bordure
|
|
$border = 'x00000000' # plus de filet : la reference n'en a aucun
|
|
$text = 'xFFFFFFFF' # COL_TEXT
|
|
|
|
$lines = Get-Content $src
|
|
$patched = 0
|
|
|
|
foreach ($style in 'editstyle', 'memostyle') {
|
|
$at = ($lines | Select-String -Pattern "StyleName = '$style'" | Select-Object -First 1).LineNumber
|
|
if (-not $at) { Write-Warning "$style introuvable"; continue }
|
|
|
|
# Un champ de saisie prend la forme d'une pilule, comme la barre de
|
|
# recherche d'Android ; un memo garde ses coins sobres.
|
|
if ($style -eq 'editstyle') { $radius = '24.000000000000000000' }
|
|
else { $radius = '10.000000000000000000' }
|
|
|
|
# La fenetre couvre le bloc 'background' qui suit immediatement le nom.
|
|
for ($i = $at; $i -lt [Math]::Min($at + 24, $lines.Count); $i++) {
|
|
switch -Regex ($lines[$i]) {
|
|
'Fill\.Color = x' { $lines[$i] = $lines[$i] -replace 'x[0-9A-Fa-f]{8}', $surface; $patched++ }
|
|
'Stroke\.Color = x' { $lines[$i] = $lines[$i] -replace 'x[0-9A-Fa-f]{8}', $border; $patched++ }
|
|
'XRadius = ' { $lines[$i] = $lines[$i] -replace '[\d.]+$', $radius }
|
|
'YRadius = ' { $lines[$i] = $lines[$i] -replace '[\d.]+$', $radius }
|
|
}
|
|
}
|
|
|
|
# Couleur du texte saisi : 'foreground' vient juste apres le fond.
|
|
for ($i = $at; $i -lt [Math]::Min($at + 34, $lines.Count); $i++) {
|
|
if ($lines[$i] -match "StyleName = 'foreground'") {
|
|
$lines[$i+1] = $lines[$i+1] -replace 'x[0-9A-Fa-f]{8}', $text
|
|
break
|
|
}
|
|
}
|
|
}
|
|
|
|
Set-Content $dst $lines -Encoding UTF8
|
|
"pm-dark.style ecrit, $patched couleurs remplacees"
|