Skip to content

Commit 76f9478

Browse files
committed
Add attachments name when printing an email.
If the attachments list is expanded show the list otherwise show the attachments count as indication while printing an email close #10218
1 parent 5a92e06 commit 76f9478

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

src/common/gui/base/Expander.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export type ExpanderAttrs = {
2121
showWarning?: boolean
2222
color?: string
2323
style?: Record<string, any>
24+
isPrintable?: boolean
2425
}
2526
export type ExpanderPanelAttrs = {
2627
expanded: boolean
@@ -33,7 +34,8 @@ export class ExpanderButton implements Component<ExpanderAttrs> {
3334
return m(
3435
".limit-width",
3536
m(
36-
"button.expander.bg-transparent.pt-8.hover-ul.limit-width.flex.items-center.b.text-ellipsis.flash",
37+
"button.expander.bg-transparent.pt-8.hover-ul.limit-width.flex.items-center.b.text-ellipsis.flash" +
38+
`${!a.expanded && a.isPrintable ? ".print" : ""}`,
3739
{
3840
style: a.style,
3941
onclick: (event: MouseEvent) => {

src/common/gui/base/buttons/BaseButton.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export interface BaseButtonAttrs {
2222
class?: string
2323
role?: AriaRole
2424
iconWrapperSelector?: string
25+
isPrintable?: boolean
2526
}
2627

2728
export class BaseButton implements ClassComponent<BaseButtonAttrs> {
@@ -32,7 +33,7 @@ export class BaseButton implements ClassComponent<BaseButtonAttrs> {
3233
const pressed = booleanToAttributeValue(attrs.pressed)
3334
const selected = booleanToAttributeValue(attrs.selected)
3435
return m(
35-
"button",
36+
attrs.isPrintable ? "button.print" : "button",
3637
{
3738
title: lang.getTranslationText(attrs.label),
3839
disabled,

src/common/gui/base/buttons/BubbleButton.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { lang, MaybeTranslation } from "../../../misc/LanguageViewModel.js"
44
import { AllIcons, Icon } from "../Icon.js"
55
import { theme } from "../../theme.js"
66
import { styles } from "../../styles.js"
7-
import { component_size, px, size } from "../../size.js"
7+
import { component_size, px } from "../../size.js"
88

99
export interface BubbleButtonAttrs {
1010
label: MaybeTranslation
@@ -49,6 +49,7 @@ export class BubbleButton implements Component<BubbleButtonAttrs> {
4949
style: { height: px(bubbleButtonHeight()), maxHeight: px(bubbleButtonHeight()) },
5050
class: `smaller bubble flex center-vertically limit-width ${bubbleButtonPadding()} flash`,
5151
onclick: attrs.onclick,
52+
isPrintable: true,
5253
},
5354
children,
5455
)

src/common/gui/main-styles.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2807,7 +2807,6 @@ styles.registerStyle("main", () => {
28072807
".print": {
28082808
color: "black",
28092809
"background-color": "white",
2810-
display: "block",
28112810
},
28122811
"html, body": {
28132812
position: "initial",

src/mail-app/mail/view/MailViewerHeader.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@ export class MailViewerHeader implements Component<MailViewerHeaderAttrs> {
628628
onExpandedChange: (change) => {
629629
this.filesExpanded = change
630630
},
631+
isPrintable: true,
631632
}),
632633
]),
633634

0 commit comments

Comments
 (0)