Set default backgroundColor 77/208177/11
authorDongHyun Song <dh81.song@samsung.com>
Wed, 19 Jun 2019 08:22:52 +0000 (17:22 +0900)
committerDongHyun Song <dh81.song@samsung.com>
Wed, 26 Jun 2019 07:13:05 +0000 (16:13 +0900)
1)
Set background color as follows
  - TV: black
  - Others : white

2)
transparent is not truely working, becuase there is no proper
implementation of native side.
If needs, NativeWindowEfl class will support this

Related patch for this:
  https://review.tizen.org/gerrit/208174/

Change-Id: Id028bb05d98be8be221784ab20892da8ba71ec88
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
wrt_app/src/web_application.js [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 69f45a8..b6729c4
@@ -45,6 +45,9 @@ class WebApplication {
         this.suspended = true;
         this.loadFinished = false;
         this.runningStatus = 'none';
+        this.isTVProfile = (wrt.getPlatformType() === "product_tv");
+        this.defaultBackgroundColor = (this.isTVProfile ? '#000' : '#FFF');
+        this.defaultTransparent = (this.isTVProfile ? true : false);
 
         let self = this;
         app.on('browser-window-created', function(event, window) {
@@ -170,6 +173,8 @@ class WebApplication {
     getBrowserWindowOption(options) {
         return {
             fullscreen: false,
+            backgroundColor: this.defaultBackgroundColor,
+            transparent: this.defaultTransparent,
             show: false,
             webPreferences: {
                 nodeIntegration: options.isAddonAvailable,
@@ -191,7 +196,7 @@ class WebApplication {
             });
         }
         let self = this;
-        if (!(wrt.getPlatformType() === "product_tv")) {
+        if (!self.isTVProfile) {
             self.showTimer = setTimeout(() => {
                 if (!self.suspended) {
                     console.log('FrameRendered not obtained from engine. To show window, timer fired');
@@ -228,7 +233,7 @@ class WebApplication {
                 if (self.runningStatus !== 'behind')
                     wrt.notifyAppStatus('preload');
             }
-            if((self.debugport) && (wrt.getPlatformType() === "product_tv")) {
+            if(self.debugport && self.isTVProfile) {
                 const kDebugPopupScript = "alert('port number :" + self.debugport +"')";
                 wrt.executeJS(self.mainWindow.webContents, kDebugPopupScript);
                 self.debugport = 0;