Commit af380b1d authored by ibuler's avatar ibuler

[Update] 适应大小

parent fef9f161
...@@ -57,10 +57,10 @@ export class ElementTermComponent implements OnInit, AfterViewInit { ...@@ -57,10 +57,10 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
const elementPaddingHor = elementPadding.right + elementPadding.left; const elementPaddingHor = elementPadding.right + elementPadding.left;
const availableHeight = activeEle.height() - elementPaddingVer; const availableHeight = activeEle.height() - elementPaddingVer;
const availableWidth = activeEle.width() - elementPaddingHor - (<any>this.term).viewport.scrollBarWidth; const availableWidth = activeEle.width() - elementPaddingHor - (<any>this.term).viewport.scrollBarWidth;
const geometry = ( const geometry = [
Math.floor(availableWidth / (<any>this.term).renderer.dimensions.actualCellWidth), Math.floor(availableWidth / (<any>this.term).renderer.dimensions.actualCellWidth) - 1,
Math.floor(availableHeight / (<any>this.term).renderer.dimensions.actualCellHeight) Math.floor(availableHeight / (<any>this.term).renderer.dimensions.actualCellHeight) - 1
); ];
return geometry; return geometry;
// const cols = Math.floor((activeEle.width() - 15) / markerEle.width() * 6) - 1; // const cols = Math.floor((activeEle.width() - 15) / markerEle.width() * 6) - 1;
...@@ -69,14 +69,15 @@ export class ElementTermComponent implements OnInit, AfterViewInit { ...@@ -69,14 +69,15 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
} }
resizeTerm() { resizeTerm() {
// fit(this.term);
const size = this.getWinSize(); const size = this.getWinSize();
console.log('get SIze', size);
if (isNaN(size[0]) || isNaN(size[1])) { if (isNaN(size[0]) || isNaN(size[1])) {
fit(this.term); fit(this.term);
} else { } else {
(<any>this.term).renderer.clear();
this.term.resize(size[0], size[1]); this.term.resize(size[0], size[1]);
this.winSizeChangeTrigger.emit([this.term.cols, this.term.rows]);
} }
this.winSizeChangeTrigger.emit([this.term.cols, this.term.rows]);
this._cookie.set('cols', this.term.cols.toString(), 0, '/', document.domain); this._cookie.set('cols', this.term.cols.toString(), 0, '/', document.domain);
this._cookie.set('rows', this.term.rows.toString(), 0, '/', document.domain); this._cookie.set('rows', this.term.rows.toString(), 0, '/', document.domain);
} }
......
...@@ -76,16 +76,18 @@ app-root { ...@@ -76,16 +76,18 @@ app-root {
body ::-webkit-scrollbar-track { body ::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.3); -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.3);
background-color: #676a6c; background-color: #272323;
border-radius: 6px;
} }
body ::-webkit-scrollbar { body ::-webkit-scrollbar {
width: 8px; width: 8px;
height: 8px; height:8px;
} }
body ::-webkit-scrollbar-thumb { body ::-webkit-scrollbar-thumb {
background-color: #F5F5F5; background-color: #494141;
border-radius: 6px;
} }
.ztree * { .ztree * {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment