c-smile / sciter-js-sdk

Sciter.JS - Sciter but with QuickJS on board instead of my TIScript
BSD 3-Clause "New" or "Revised" License
1.64k stars 97 forks source link

what's the difference between the two modes. #249

Open liudonghua123 opened 2 years ago

liudonghua123 commented 2 years ago

I have this sample main.html.

<html lang="en">
<head>
    <head>
        <title>Hello</title>
        <!-- 
        <script type="text/tiscript">
          const w = self.intrinsicWidthMax();
          const h = self.intrinsicHeight();
          const (sw, sh) = view.screenBox(#frame, #dimension);
          view.move((sw / 2) - (w / 2), (sh / 2) - (h / 2), w, h, true);
        </script>
        -->
        <script>
            const [wmin,w] = document.state.contentWidths();
            const h = document.state.contentHeight(w);

            const [sw,sh] = Window.this.screenBox("frame", "dimension");

            Window.this.move( (sw - w) / 2, (sh - h) / 2, w, h, true );            
        </script>
    </head>
    <body>
       <h1>Hello World!</h1>
    </body>
</html>

I placed a bin\windows\x32\scapp.exe in the same directory of main.html, If I double click scapp.exe, the demo app is shown, and the title bar is opaque, when I tried to execute scapp.exe main.html like run-calculator-sciter.bat does, then About ScApp is shown and when I choose to open main.html, the demo app is shown with title bar some transparency.

image

image

Also I have noticed the height of title bar of bin\windows\x32\scapp.exe is bigger then sciter-sdk\bin.win\x32\scapp.exe.

c-smile commented 2 years ago

Up until recently bin\windows\x32\scapp.exe was using window-frame=extended that means caption and window chrome was defined in HTML/CSS - may differ from system one.

I've switched back to window-frame=standard recently.