@@ -28,13 +28,15 @@ export const useViewOperate = (type: 'fastPanel' | 'main') => {
2828 return manager . viewActions . map ( a => {
2929 a [ '_web' ] = null
3030 a [ '_webInit' ] = false
31+ a [ '_webReady' ] = false
3132 a [ '_height' ] = a . runtime ?. view ?. heightView || 100
3233 return a
3334 } )
3435 }
3536 return manager . fastPanelViewActions . map ( a => {
3637 a [ '_web' ] = null
3738 a [ '_webInit' ] = false
39+ a [ '_webReady' ] = false
3840 a [ '_height' ] = a . runtime ?. view ?. heightView || 100
3941 return a
4042 } )
@@ -60,6 +62,8 @@ export const useViewOperate = (type: 'fastPanel' | 'main') => {
6062 readyData [ 'isView' ] = true ;
6163 ( ( aa ) => {
6264 aa [ '_web' ] . addEventListener ( 'did-finish-load' , async ( ) => {
65+ aa [ '_webReady' ] = true
66+ aa [ '_web' ] . insertCSS ( `body{overflow: hidden;}` )
6367 if ( setting . shouldDarkMode ( ) ) {
6468 aa [ '_web' ] . executeJavaScript ( `
6569 document.body.setAttribute('data-theme', 'dark');
@@ -80,15 +84,15 @@ export const useViewOperate = (type: 'fastPanel' | 'main') => {
8084 }
8185 } )
8286 aa [ '_web' ] . addEventListener ( 'ipc-message' , ( event ) => {
83- if ( 'FocusAny.FastPanel ' === event . channel ) {
87+ if ( 'FocusAny.View ' === event . channel ) {
8488 const { id, type, data} = event . args [ 0 ]
8589 switch ( type ) {
8690 case 'view.setHeight' :
8791 aa [ '_height' ] = data . height
8892 break
8993 case 'view.getHeight' :
9094 // console.log('view.getHeight', aa['_height'])
91- aa [ '_web' ] . send ( `FocusAny.FastPanel .${ id } ` , aa [ '_height' ] )
95+ aa [ '_web' ] . send ( `FocusAny.View .${ id } ` , aa [ '_height' ] )
9296 break
9397 }
9498 }
0 commit comments