Skip to content

Commit

Permalink
Show mail folder icons in label view
Browse files Browse the repository at this point in the history
Close #7760

Co-authored-by: ivk <ivk@tutao.de>
  • Loading branch information
hrb-hub and charlag committed Nov 21, 2024
1 parent 4133c42 commit 8f59f0a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/common/api/common/TutanotaConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ export enum MailSetKind {
LABEL = "8",
}

export function getMailSetKind(folder: MailFolder): MailSetKind {
return folder.folderType as MailSetKind
}

export const enum ReplyType {
NONE = "0",
REPLY = "1",
Expand Down
4 changes: 2 additions & 2 deletions src/common/gui/main-styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1623,9 +1623,9 @@ styles.registerStyle("main", () => {
"line-height": px(18),
},
".list-font-icons": {
"letter-spacing": "8px",
"letter-spacing": "1px",
"text-align": "right",
"margin-right": "-8px",
"margin-right": "-3px",
},
".monospace": {
"font-family": '"Lucida Console", Monaco, monospace',
Expand Down
2 changes: 1 addition & 1 deletion src/mail-app/mail/view/MailListView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class MailListView implements Component<MailListViewAttrs> {
multiselectionAllowed: MultiselectMode.Enabled,
createElement: (dom: HTMLElement) => {
const mailRow = new MailRow(
false,
this.mailViewModel.getSelectedMailSetKind() === MailSetKind.LABEL,
(mail) => this.mailViewModel.getLabelsForMail(mail),
(entity) => this.attrs.onSingleExclusiveSelection(entity),
)
Expand Down
6 changes: 5 additions & 1 deletion src/mail-app/mail/view/MailViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { ListState } from "../../../common/gui/base/List.js"
import { ConversationPrefProvider, ConversationViewModel, ConversationViewModelFactory } from "./ConversationViewModel.js"
import { CreateMailViewerOptions } from "./MailViewer.js"
import { isOfflineError } from "../../../common/api/common/utils/ErrorUtils.js"
import { MailSetKind, OperationType } from "../../../common/api/common/TutanotaConstants.js"
import { getMailSetKind, MailSetKind, OperationType } from "../../../common/api/common/TutanotaConstants.js"
import { WsConnectionState } from "../../../common/api/main/WorkerClient.js"
import { WebsocketConnectivityModel } from "../../../common/misc/WebsocketConnectivityModel.js"
import { ExposedCacheStorage } from "../../../common/api/worker/rest/DefaultEntityRestCache.js"
Expand Down Expand Up @@ -113,6 +113,10 @@ export class MailViewModel {
private readonly updateUi: () => unknown,
) {}

getSelectedMailSetKind(): MailSetKind | null {
return this._folder ? getMailSetKind(this._folder) : null
}

/** Map from element id of MailSetEntry to an entry itself. Needed to react to entity updates. Reset on folder change. */
private mailSetEntries: () => Map<Id, MailSetEntry> = memoizedWithHiddenArgument(
() => this._folder?._id?.[1],
Expand Down

0 comments on commit 8f59f0a

Please sign in to comment.