Skip to content

Commit

Permalink
Merge pull request #680 from jojo535275/develop
Browse files Browse the repository at this point in the history
CM position/size update
  • Loading branch information
cavearr authored Feb 23, 2023
2 parents e6f1368 + 595af11 commit f159cfd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
4 changes: 4 additions & 0 deletions app/resources/libs/Icestudio/GUI/WafleWindowManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ class WafleWindowManager {
}
target.style.left = target.oldLeft + target.distX + "px";
target.style.top = target.oldTop + target.distY + "px";
//default size of collection manager window when dragged/floating in the icestudio workspace
target.style.width='180px';
target.style.height='450px';

}

function endDrag() {
Expand Down
28 changes: 15 additions & 13 deletions app/resources/libs/Icestudio/GUI/Widgets/WafleUIWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,33 @@ class WafleUIWindow{
params.html ='';
}
if(typeof params.y === 'undefined'){
params.y ='100px';
}
if(typeof params.x === 'undefined'){
params.x ='500px';
}
if(typeof params.height === 'undefined'){
params.height ='450px';
params.y ='70px';
}
if(typeof params.right === 'undefined'){
params.right ='0px'; //CM window sticked to the rigth side of icestudio window
}
if(typeof params.width === 'undefined'){
params.width ='180px';
params.width ="calc(7% + 150px)"; //adjust size of CM window with icestudio window size
}
if(typeof params.height === 'undefined'){
params.height ="calc(100% - 118px)"
}

/*-- ¡¡ Be careful !!
-- If you modify x and - symbols, check that is consisteng with all OS fonts , in this momment we use unicode symbol that is universal and not consume resources.
-- For the future we could change by svg image for the icons.
-- */
this.winId=params.id;
let content=`<div class="ics-wm-window--topbar | ics-wm__is-draggable" data-dragcontainerid="#${params.id}"><div class="ics-wm-window--topbar--button | ics-wm-window__close" data-winid="#${params.id}">x</div><div class="ics-wm-window--topbar--button | ics-wm-window__minify | hidden">-</div></div>
<div class="ics-wm-window--body"></div>
<div class="ics-wm-window--bottombar"></div>
`;
let content=
`<div class="ics-wm-window--topbar | ics-wm__is-draggable" data-dragcontainerid="#${params.id}">
<div class="ics-wm-window--topbar--button | ics-wm-window__close" data-winid="#${params.id}">x</div>
<div class="ics-wm-window--topbar--button | ics-wm-window__minify | hidden">-</div></div>
<div class="ics-wm-window--body"></div>
<div class="ics-wm-window--bottombar"></div>`;

this.dom = iceStudio.gui.addDiv(params.id,params.htmlClass,content);
this.dom.style.top=params.y;
this.dom.style.left=params.x;
this.dom.style.right=params.right;
this.dom.style.width=params.width;
this.dom.style.height=params.height;
}
Expand Down

0 comments on commit f159cfd

Please sign in to comment.