Skip to content

Commit 05778dc

Browse files
committed
Fixed layout issues
1 parent 9d0698c commit 05778dc

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

src/webviews/apps/calc/calc.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ <h3>Chip Load</h3>
7272
<section id="mrr" class="calculator">
7373
<h3>Metal Removal</h3>
7474
<vscode-divider role="separator"></vscode-divider>
75-
<vscode-text-field id="mrr-ap" placeholder="Axial DoC" size="6">A<sub>p</sub> - Axial Depth of Cut</vscode-text-field>
76-
<vscode-text-field id="mrr-ae" placeholder="Radial DoC" size="6">A<sub>e</sub> - Radial Depth of Cut</vscode-text-field>
75+
<vscode-text-field id="mrr-ap" placeholder="Axial DoC" size="6">A<sub>p</sub> - Axial DoC</vscode-text-field>
76+
<vscode-text-field id="mrr-ae" placeholder="Radial DoC" size="6">A<sub>e</sub> - Radial DoC</vscode-text-field>
7777
<vscode-text-field id="mrr-fr" placeholder="Enter Feedrate" size="6">Feedrate</vscode-text-field>
7878
<label class="results">Metal Removal</label><span id="mrr-results" class="results"></span>
7979
<vscode-button id="mrr-calc-btn">Calculate</vscode-button>

src/webviews/apps/calc/calc.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
.container {
66
display: flex;
7+
justify-content: center;
78
min-height: 100%;
89
margin: 0;
910
padding: 0;

src/webviews/apps/calc/calc.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,16 @@ export class CalcApp extends GWebviewApp {
134134
switch (this._machineType) {
135135
case MachineTypes.Mill:
136136
{
137+
// Focus Speeds Tab
138+
const speedsTab = document.getElementById('tab-1') as HTMLElement;
139+
if (speedsTab) {
140+
speedsTab.click();
141+
}
142+
137143
// Hide Surface Finish Calculator
138-
const finishSection = document.getElementById('finish')?.parentElement as HTMLElement;
144+
const finishSection = document.getElementById('finish') as HTMLElement;
139145
if (finishSection) {
140-
finishSection.style.display = 'none';
146+
finishSection.style.visibility = 'hidden';
141147
}
142148

143149
const mrrTab = document.getElementById('tab-3') as HTMLElement;
@@ -169,14 +175,14 @@ export class CalcApp extends GWebviewApp {
169175
// Update MRR Calculator
170176
const mrrDepth = document.getElementById('mrr-ap') as HTMLElement;
171177
if (mrrDepth) {
172-
mrrDepth.setAttribute('placeholder', 'Axial Depth of Cut');
173-
mrrDepth.innerHTML = 'A<sub>p</sub> - Axial Depth of Cut';
178+
mrrDepth.setAttribute('placeholder', 'Axial DoC');
179+
mrrDepth.innerHTML = 'A<sub>p</sub> - Axial DoC';
174180
}
175181

176182
const mrrSpeed = document.getElementById('mrr-ae') as HTMLElement;
177183
if (mrrSpeed) {
178-
mrrSpeed.setAttribute('placeholder', 'Radial Depth of Cut');
179-
mrrSpeed.innerHTML = 'A<sub>e</sub> - Radial Depth of Cut';
184+
mrrSpeed.setAttribute('placeholder', 'Radial DoC');
185+
mrrSpeed.innerHTML = 'A<sub>e</sub> - Radial DoC';
180186
}
181187
}
182188
break;
@@ -220,14 +226,14 @@ export class CalcApp extends GWebviewApp {
220226

221227
const mrrSpeed = document.getElementById('mrr-ae') as HTMLElement;
222228
if (mrrSpeed) {
223-
mrrSpeed.setAttribute('placeholder', 'Enter Cutting Speed');
229+
mrrSpeed.setAttribute('placeholder', `Enter ${this._units === Units.MM ? 'SMM' : 'SFM'}`);
224230
mrrSpeed.innerHTML = 'Cutting Speed';
225231
}
226232

227233
// Show Surface Finish Calculator
228-
const finishSection = document.getElementById('finish')?.parentElement as HTMLElement;
234+
const finishSection = document.getElementById('finish') as HTMLElement;
229235
if (finishSection) {
230-
finishSection.style.display = '';
236+
finishSection.style.visibility = '';
231237
}
232238

233239
const mrrTab = document.getElementById('tab-3') as HTMLElement;

0 commit comments

Comments
 (0)