feat(android): recolour the two native controls, and hide the log by default
Dark.style has no transparent template for an edit or a memo, so a StyleLookup at them fell back silently to the normal one and its grey background - the search field and the log were the last two things clashing with a painted interface. Since the style is vendored anyway, make-style.ps1 rebuilds it from Delphi's with those two backgrounds set to the palette. Reproducible, so a palette change does not quietly lose the patch. The log is hidden now: it only serves diagnosis and it was taking a third of the screen at every launch. A Journal button beside the server settings brings it back. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
# 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 = 'xFF1E293B' # COL_SURFACE
|
||||
$border = 'xFF334155' # COL_RAISED, en bordure discrete
|
||||
$text = 'xFFE2E8F0' # 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 }
|
||||
|
||||
# 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.]+$', '10.000000000000000000' }
|
||||
'YRadius = ' { $lines[$i] = $lines[$i] -replace '[\d.]+$', '10.000000000000000000' }
|
||||
}
|
||||
}
|
||||
|
||||
# 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"
|
||||
Reference in New Issue
Block a user