Skip to content

Commit fd60c5e

Browse files
committed
fix dialog buttons border colors
- Dialogs buttons had an in between border that did not apply the right style, this happened because buttons always set a border color status. - This change always sets a value for button colors, using ButtonColor.Dialog
1 parent ba003a3 commit fd60c5e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/common/gui/base/Button.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const enum ButtonColor {
2020
Elevated = "elevated",
2121
DrawerNav = "drawernav",
2222
Fab = "fab",
23+
Dialog = "dialog",
2324
}
2425

2526
export function getColors(buttonColors: ButtonColor | null | undefined): {
@@ -51,6 +52,11 @@ export function getColors(buttonColors: ButtonColor | null | undefined): {
5152
border: getElevatedBackground(),
5253
}
5354

55+
case ButtonColor.Dialog:
56+
return {
57+
button: theme.content_button,
58+
border: theme.content_border,
59+
}
5460
case ButtonColor.Content:
5561
default:
5662
return {

src/common/gui/base/Dialog.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import { getElevatedBackground } from "../theme"
1111
import { px, size } from "../size"
1212
import { HabReminderImage } from "./icons/Icons"
1313
import { windowFacade } from "../../misc/WindowFacade"
14-
import type { ButtonAttrs } from "./Button.js"
15-
import { Button, ButtonType } from "./Button.js"
14+
import { Button, ButtonAttrs, ButtonColor, ButtonType } from "./Button.js"
1615
import type { DialogHeaderBarAttrs } from "./DialogHeaderBar"
1716
import { DialogHeaderBar } from "./DialogHeaderBar"
1817
import { TextField, TextFieldType } from "./TextField.js"
@@ -516,7 +515,7 @@ export class Dialog implements ModalComponent {
516515
? null
517516
: m(
518517
".flex-center.dialog-buttons",
519-
buttons.map((a) => m(Button, a)),
518+
buttons.map((a) => m(Button, { colors: ButtonColor.Dialog, ...a })),
520519
),
521520
],
522521
})

0 commit comments

Comments
 (0)