Skip to content

Commit

Permalink
bar: panels are resizable [Closes #285]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Apr 3, 2018
1 parent 681d1f0 commit d22a606
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/Tracy/assets/Bar/bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ body#tracy-debug .tracy-panel { /* in popup window */
#tracy-debug .tracy-mode-float {
position: absolute;
padding: 10px;
min-width: 150px;
min-height: 50px;
min-width: 200px;
min-height: 80px;
border-radius: 5px;
box-shadow: 1px 1px 20px rgba(102, 102, 102, 0.36);
border: 1px solid rgba(0, 0, 0, 0.1);
Expand All @@ -263,6 +263,8 @@ body#tracy-debug .tracy-panel { /* in popup window */
opacity: .95;
transition: opacity 0.2s;
will-change: opacity, top, left;
overflow: auto;
resize: both;
}

#tracy-debug .tracy-focused {
Expand Down
6 changes: 5 additions & 1 deletion src/Tracy/assets/Bar/bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@
this.elem.classList.remove(Panel.FLOAT);
this.elem.classList.remove(Panel.FOCUSED);
this.elem.classList.add(Panel.PEEK);
this.elem.style.width = '';
this.elem.style.height = '';
};

Panel.prototype.toWindow = function() {
Expand Down Expand Up @@ -172,7 +174,7 @@
if (this.is(Panel.WINDOW)) {
localStorage.setItem(this.id, JSON.stringify({window: true}));
} else if (pos.width) {
localStorage.setItem(this.id, JSON.stringify({right: pos.right, bottom: pos.bottom, zIndex: this.elem.style.zIndex - Tracy.panelZIndex}));
localStorage.setItem(this.id, JSON.stringify({right: pos.right, bottom: pos.bottom, width: this.elem.style.width, height: this.elem.style.height, zIndex: this.elem.style.zIndex - Tracy.panelZIndex}));
} else {
localStorage.removeItem(this.id);
}
Expand All @@ -188,6 +190,8 @@
} else if (this.elem.dataset.tracyContent) {
this.init();
this.toFloat();
this.elem.style.width = pos.width;
this.elem.style.height = pos.height;
setPosition(this.elem, pos);
this.elem.style.zIndex = Tracy.panelZIndex + (pos.zIndex || 1);
Panel.zIndexCounter = Math.max(Panel.zIndexCounter, (pos.zIndex || 1)) + 1;
Expand Down

0 comments on commit d22a606

Please sign in to comment.