9bc005696d
They carried the same fill and the same pill, so the password field looked like a command. A field now holds 10 per cent white against a button's 18 and a main action's 30 - hollow against raised, which is the only cue left once borders are gone. The settings panel also reclaimed the top of the screen, above the title: created hidden, FMX moves it to the head of the stack when it becomes visible. Its position is now reasserted each time it appears. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
62 lines
2.7 KiB
PowerShell
62 lines
2.7 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.
|
|
# Un champ est CREUX : moins de blanc qu'un bouton (18 %) et bien moins que
|
|
# l'action principale (30 %). Sans cet ecart, une saisie ressemble a une
|
|
# commande - le mot de passe avait l'air d'un bouton.
|
|
$surface = 'x1AFFFFFF'
|
|
$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"
|