Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
energye
energy
提交
68bc847f
energy
项目概览
energye
/
energy
通知
13
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
energy
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
68bc847f
编写于
1月 09, 2023
作者:
yanghye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
v2.2.18 Fixed Chinese input and gtk3 issues for linux packagin
上级
74075169
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
47 addition
and
34 deletion
+47
-34
cef/cef-aux-dev-tools-window.go
cef/cef-aux-dev-tools-window.go
+1
-1
cef/cef-aux-view-source-window.go
cef/cef-aux-view-source-window.go
+24
-18
cef/cef-browser-window.go
cef/cef-browser-window.go
+14
-6
cef/cef-views-framework-browser-window.go
cef/cef-views-framework-browser-window.go
+8
-9
未找到文件。
cef/cef-aux-dev-tools-window.go
浏览文件 @
68bc847f
...
...
@@ -95,7 +95,7 @@ func (m *ICefBrowser) createBrowserDevTools(browserWinInfo IBrowserWindow) {
wp
.
Title
=
dev_tools_name
wp
.
IconFS
=
BrowserWindow
.
Config
.
IconFS
wp
.
Icon
=
BrowserWindow
.
Config
.
Icon
devToolsWindow
:=
NewViewsFrameworkBrowserWindow
(
nil
,
wp
)
devToolsWindow
:=
NewViewsFrameworkBrowserWindow
(
nil
,
wp
,
BrowserWindow
.
MainWindow
()
.
AsViewsFrameworkBrowserWindow
()
.
Component
()
)
devToolsWindow
.
resetWindowPropertyEvent
()
devToolsWindow
.
SetWindowType
(
WT_DEV_TOOLS
)
devToolsWindow
.
windowId
=
BrowserWindow
.
GetNextWindowNum
()
...
...
cef/cef-aux-view-source-window.go
浏览文件 @
68bc847f
...
...
@@ -42,23 +42,29 @@ func viewSourceAfterCreate(browser *ICefBrowser) bool {
func
(
m
*
ICefBrowser
)
createBrowserViewSource
(
frame
*
ICefFrame
)
{
var
viewSourceUrl
=
fmt
.
Sprintf
(
"view-source:%s"
,
frame
.
Url
)
QueueAsyncCall
(
func
(
id
int
)
{
var
browserWindow
=
BrowserWindow
.
popupWindow
.
AsLCLBrowserWindow
()
.
BrowserWindow
()
if
browserWindow
!=
nil
{
browserWindow
.
SetShowInTaskBar
()
browserWindow
.
SetWindowType
(
WT_VIEW_SOURCE
)
browserWindow
.
ChromiumCreate
(
nil
,
viewSourceUrl
)
browserWindow
.
putChromiumWindowInfo
()
browserWindow
.
defaultChromiumEvent
()
browserWindow
.
SetSize
(
1024
,
768
)
if
winInfo
:=
BrowserWindow
.
GetWindowInfo
(
browserWindow
.
windowId
);
winInfo
!=
nil
{
winInfo
.
createAuxTools
()
winInfo
.
getAuxTools
()
.
viewSourceUrl
=
viewSourceUrl
winInfo
.
getAuxTools
()
.
viewSourceWindow
=
browserWindow
}
browserWindow
.
Show
()
}
else
{
logger
.
Fatal
(
"Window not initialized successfully"
)
if
currentWindowInfo
:=
BrowserWindow
.
GetWindowInfo
(
m
.
Identifier
());
currentWindowInfo
!=
nil
{
if
currentWindowInfo
.
IsLCL
()
{
QueueAsyncCall
(
func
(
id
int
)
{
var
bw
=
BrowserWindow
.
popupWindow
.
AsLCLBrowserWindow
()
.
BrowserWindow
()
if
bw
!=
nil
{
bw
.
SetShowInTaskBar
()
bw
.
SetWindowType
(
WT_VIEW_SOURCE
)
bw
.
ChromiumCreate
(
nil
,
viewSourceUrl
)
bw
.
putChromiumWindowInfo
()
bw
.
defaultChromiumEvent
()
bw
.
SetSize
(
1024
,
768
)
if
winInfo
:=
BrowserWindow
.
GetWindowInfo
(
bw
.
windowId
);
winInfo
!=
nil
{
winInfo
.
createAuxTools
()
winInfo
.
getAuxTools
()
.
viewSourceUrl
=
viewSourceUrl
winInfo
.
getAuxTools
()
.
viewSourceWindow
=
bw
}
bw
.
Show
()
}
else
{
logger
.
Fatal
(
"Window not initialized successfully"
)
}
})
}
else
if
currentWindowInfo
.
IsViewsFramework
()
{
frame
.
ViewSource
()
}
}
)
}
}
cef/cef-browser-window.go
浏览文件 @
68bc847f
...
...
@@ -25,13 +25,12 @@ var (
//
//3. 该窗口是主窗体,因此初始化时必须第一个初始化完成,如果创建子窗口最好在 SetBrowserInitAfter 回调函数中创建
BrowserWindow
=
&
browser
{
mainBrowserWindow
:
&
browserWindow
{},
browserEvent
:
&
BrowserEvent
{},
browserEvent
:
&
BrowserEvent
{},
Config
:
&
browserConfig
{
WindowProperty
:
NewWindowProperty
(),
},
windowInfo
:
make
(
map
[
int32
]
IBrowserWindow
),
windowSerial
:
1
,
windowSerial
:
1
,
//默认1开始
}
browserProcessStartAfterCallback
browserProcessStartAfterCallbackFunc
)
...
...
@@ -119,6 +118,9 @@ func Run(cefApp *TCEFApplication) {
if
IsMessageLoop
{
cefApp
.
RunMessageLoop
()
}
else
{
if
BrowserWindow
.
mainBrowserWindow
==
nil
{
BrowserWindow
.
mainBrowserWindow
=
&
browserWindow
{}
}
lcl
.
RunApp
(
&
BrowserWindow
.
mainBrowserWindow
)
}
}
...
...
@@ -180,10 +182,16 @@ func (m *browserWindow) OnFormCreate(sender lcl.IObject) {
}
func
(
m
*
browser
)
MainWindow
()
IBrowserWindow
{
if
IsMessageLoop
{
return
m
.
mainVFBrowserWindow
.
BrowserWindow
()
if
m
.
mainVFBrowserWindow
!=
nil
{
return
m
.
mainVFBrowserWindow
}
else
if
m
.
mainBrowserWindow
!=
nil
{
return
m
.
mainBrowserWindow
}
return
m
.
mainBrowserWindow
.
BrowserWindow
()
return
nil
//if IsMessageLoop {
// return m.mainVFBrowserWindow.BrowserWindow()
//}
//return m.mainBrowserWindow.BrowserWindow()
}
// 主窗口和chromium初始化时回调
...
...
cef/cef-views-framework-browser-window.go
浏览文件 @
68bc847f
...
...
@@ -41,7 +41,7 @@ type ViewsFrameworkBrowserWindow struct {
}
//创建 ViewsFrameworkBrowserWindow 窗口
func
NewViewsFrameworkBrowserWindow
(
chromiumConfig
*
tCefChromiumConfig
,
windowProperty
*
WindowProperty
)
*
ViewsFrameworkBrowserWindow
{
func
NewViewsFrameworkBrowserWindow
(
chromiumConfig
*
tCefChromiumConfig
,
windowProperty
*
WindowProperty
,
owner
...
lcl
.
IComponent
)
*
ViewsFrameworkBrowserWindow
{
if
chromiumConfig
==
nil
{
chromiumConfig
=
NewChromiumConfig
()
chromiumConfig
.
SetEnableViewSource
(
false
)
...
...
@@ -52,7 +52,12 @@ func NewViewsFrameworkBrowserWindow(chromiumConfig *tCefChromiumConfig, windowPr
if
windowProperty
==
nil
{
windowProperty
=
NewWindowProperty
()
}
component
:=
lcl
.
NewComponent
(
nil
)
var
component
lcl
.
IComponent
if
len
(
owner
)
>
0
{
component
=
lcl
.
NewComponent
(
owner
[
0
])
}
else
{
component
=
lcl
.
NewComponent
(
nil
)
}
m
:=
&
ViewsFrameworkBrowserWindow
{
windowProperty
:
windowProperty
,
component
:
component
,
...
...
@@ -62,7 +67,6 @@ func NewViewsFrameworkBrowserWindow(chromiumConfig *tCefChromiumConfig, windowPr
}
m
.
chromium
.
SetEnableMultiBrowserMode
(
true
)
m
.
windowComponent
.
SetOnWindowCreated
(
func
(
sender
lcl
.
IObject
,
window
*
ICefWindow
)
{
fmt
.
Println
(
"args-ProcessType"
,
common
.
Args
.
ProcessType
())
if
m
.
chromium
.
CreateBrowserByBrowserViewComponent
(
windowProperty
.
Url
,
m
.
browserViewComponent
)
{
m
.
windowComponent
.
AddChildView
(
m
.
browserViewComponent
)
if
windowProperty
.
Title
!=
""
{
...
...
@@ -77,11 +81,6 @@ func NewViewsFrameworkBrowserWindow(chromiumConfig *tCefChromiumConfig, windowPr
_
=
m
.
windowComponent
.
SetWindowAppIcon
(
1
,
windowProperty
.
Icon
)
}
m
.
browserViewComponent
.
RequestFocus
()
//regions := NewCefDraggableRegions()
//regions.Append(NewCefDraggableRegion(NewCefRect(0, 0, 600, 100), true))
//regions.Append(NewCefDraggableRegion(NewCefRect(0, 0, 100, 50), false))
//window.SetDraggableRegions(regions.Regions())
m
.
windowComponent
.
Show
()
if
m
.
doOnWindowCreated
!=
nil
{
m
.
doOnWindowCreated
(
sender
,
window
)
...
...
@@ -150,7 +149,7 @@ func (m *ViewsFrameworkBrowserWindow) registerPopupEvent() {
Width
:
BrowserWindow
.
Config
.
WindowProperty
.
Width
,
Height
:
BrowserWindow
.
Config
.
WindowProperty
.
Height
,
}
var
vfbw
=
NewViewsFrameworkBrowserWindow
(
BrowserWindow
.
Config
.
ChromiumConfig
(),
wp
)
var
vfbw
=
NewViewsFrameworkBrowserWindow
(
BrowserWindow
.
Config
.
ChromiumConfig
(),
wp
,
BrowserWindow
.
MainWindow
()
.
AsViewsFrameworkBrowserWindow
()
.
Component
()
)
var
result
=
false
if
bwEvent
.
onBeforePopup
!=
nil
{
result
=
bwEvent
.
onBeforePopup
(
sender
,
browser
,
frame
,
beforePopupInfo
,
vfbw
,
noJavascriptAccess
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录