Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit cc3273d

Browse files
committed
Better fix to default background using pane bgs
1 parent 01f3a64 commit cc3273d

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

app/bg/ui/tabs/pane.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,6 @@ export class Pane extends EventEmitter {
520520
let isJSON = contentType.startsWith('application/json') || (isPlainText && this.url.endsWith('.json'))
521521
let isJS = contentType.includes('/javascript') || (isPlainText && this.url.endsWith('.js'))
522522
let isCSS = contentType.startsWith('text/css') || (isPlainText && this.url.endsWith('.css'))
523-
524-
// dont allow the background to be transparent
525-
this.webContents.insertCSS(`html { background: #fff }`)
526523

527524
// json rendering
528525
// inject the json render script

app/fg/shell-window/panes.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ class ShellWindowPanes extends LitElement {
1212

1313
static get styles () {
1414
return css`
15+
.pane-background {
16+
position: fixed;
17+
background: #fff;
18+
}
1519
.pane-border {
1620
position: fixed;
1721
background: var(--bg-color--paneborder);
@@ -47,9 +51,14 @@ class ShellWindowPanes extends LitElement {
4751
// =
4852

4953
render () {
50-
if (!this.activeTab || this.activeTab.paneLayout.length <= 1) {
54+
if (!this.activeTab) {
5155
return html``
5256
}
57+
const background = (pane) => this.isResizing ? '' : html`
58+
<div class="pane-background"
59+
style="left: ${pane.bounds.x}px; top: ${pane.bounds.y}px; width: ${pane.bounds.width}px; height: ${pane.bounds.height}px"
60+
></div>
61+
`
5362
const horzLine = (pane, y, edge) => html`
5463
<div class="pane-border horz ${pane.isActive ? 'active' : ''} ${!pane.isEdge[edge] ? 'movable' : ''}"
5564
style="left: ${pane.bounds.x - 2}px; top: ${y}px; width: ${pane.bounds.width + 4}px"
@@ -66,8 +75,16 @@ class ShellWindowPanes extends LitElement {
6675
@mouseup=${this.onMouseUp}
6776
></div>
6877
`
78+
if (this.activeTab.paneLayout.length <= 1) {
79+
return html`
80+
${repeat(this.activeTab.paneLayout, pane => pane.id, pane => html`
81+
${background(pane)}
82+
`)}
83+
`
84+
}
6985
return html`
7086
${repeat(this.activeTab.paneLayout, pane => pane.id, pane => html`
87+
${background(pane)}
7188
${horzLine(pane, pane.bounds.y - 2, 'top')}
7289
${horzLine(pane, pane.bounds.y + pane.bounds.height, 'bottom')}
7390
${vertLine(pane, pane.bounds.x - 2, 'left')}

0 commit comments

Comments
 (0)