From 4e05fb1c6a62ba022f00a66d7516e11eb7d80c13 Mon Sep 17 00:00:00 2001 From: Konrad Neitzel Date: Tue, 29 Sep 2026 02:53:59 +0200 Subject: [PATCH] Paint a destructive Dialog button with Nextcloud's error text color. The theme's error background is a pale pink, so a white label looked disabled. --- dialog.go | 10 +++++----- dialog_test.go | 7 +++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/dialog.go b/dialog.go index 2796d6f..4253f3b 100644 --- a/dialog.go +++ b/dialog.go @@ -67,16 +67,16 @@ const dialogStyle = `` const dialogMarkup = ` diff --git a/dialog_test.go b/dialog_test.go index 7bbdd8a..a8d7ec7 100644 --- a/dialog_test.go +++ b/dialog_test.go @@ -350,6 +350,13 @@ func TestConfirmYesNoAndDestructive(t *testing.T) { if plain == destructive { return fmt.Errorf("destructive button color %q matches Cancel", destructive) } + var text string + if err := chromedp.Evaluate(`getComputedStyle(document.getElementById("exapp-dialog-agree")).color`, &text).Do(ctx); err != nil { + return err + } + if text == "rgb(255, 255, 255)" || text == destructive { + return fmt.Errorf("destructive label color %q on background %q", text, destructive) + } var label string if err := chromedp.Evaluate(`document.getElementById("exapp-dialog-agree").textContent`, &label).Do(ctx); err != nil { return err