Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

Commit

Permalink
Update to [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed May 25, 2020
1 parent 37aa599 commit ccf67c2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
17 changes: 11 additions & 6 deletions lib/view/account-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ const HOVER_BACKGROUND = '#2B2E3B'
const PADDING = 10

class AccountHeader {
constructor(account) {
constructor() {
this.account = null

this.font = gui.Font.default().derive(8, 'semi-bold', 'normal')
this.hover = false

// Toggle the menu when clicking on the panel.
Expand Down Expand Up @@ -47,6 +46,11 @@ class AccountHeader {

loadAccount(account) {
this.account = account
this.text = gui.AttributedText.create(this.account.name, {
font: gui.Font.default().derive(8, 'semi-bold', 'normal'),
color: ACCOUNT_NAME_COLOR,
valign: 'center'
})
this.view.schedulePaint()
}

Expand All @@ -62,10 +66,11 @@ class AccountHeader {
painter.setFillColor(HOVER_BACKGROUND)
painter.fillRect(bounds)
}
const attributes = { font: this.font, color: ACCOUNT_NAME_COLOR }
bounds.x = PADDING
bounds.y = PADDING
painter.drawText(this.account.name, bounds, attributes)
if (this.text) {
bounds.x = PADDING
bounds.width -= PADDING
painter.drawAttributedText(this.text, bounds)
}
}
}

Expand Down
1 change: 1 addition & 0 deletions lib/view/channel-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class ChannelItem {
const attributes = {
color: theme.channelItem.normalColor,
valign: 'center',
wrap: false,
}
let padding = theme.channelItem.padding
if (this.channel.type === 'dm')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"binary-search-bounds": "2.0.4",
"fetch-yode": "1.0.x",
"fs-extra": "5.0.0",
"gui": "0.8.1",
"gui": "0.8.3-2",
"keytar": "5.4.0",
"mini-signals": "1.1.1",
"opn": "5.3.0",
Expand Down

0 comments on commit ccf67c2

Please sign in to comment.