Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CM position/size update #680

Merged
merged 1 commit into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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