mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
remove video, make initial window larger to fill the screen
This commit is contained in:
parent
817afd6138
commit
49a365e10b
@ -297,11 +297,31 @@ function createBrowserWindow(
|
||||
waveWindow: WaveWindow,
|
||||
settings: SettingsConfigType
|
||||
): WaveBrowserWindow {
|
||||
let winWidth = waveWindow?.winsize?.width;
|
||||
let winHeight = waveWindow?.winsize?.height;
|
||||
let winPosX = waveWindow.pos.x;
|
||||
let winPosY = waveWindow.pos.y;
|
||||
if (winWidth == null || winWidth == 0) {
|
||||
const primaryDisplay = electron.screen.getPrimaryDisplay();
|
||||
const { width } = primaryDisplay.workAreaSize;
|
||||
winWidth = width - winPosX - 100;
|
||||
if (winWidth > 2000) {
|
||||
winWidth = 2000;
|
||||
}
|
||||
}
|
||||
if (winHeight == null || winHeight == 0) {
|
||||
const primaryDisplay = electron.screen.getPrimaryDisplay();
|
||||
const { height } = primaryDisplay.workAreaSize;
|
||||
winHeight = height - winPosY - 100;
|
||||
if (winHeight > 1200) {
|
||||
winHeight = 1200;
|
||||
}
|
||||
}
|
||||
let winBounds = {
|
||||
x: waveWindow.pos.x,
|
||||
y: waveWindow.pos.y,
|
||||
width: waveWindow.winsize.width,
|
||||
height: waveWindow.winsize.height,
|
||||
x: winPosX,
|
||||
y: winPosY,
|
||||
width: winWidth,
|
||||
height: winHeight,
|
||||
};
|
||||
winBounds = ensureBoundsAreVisible(winBounds);
|
||||
const winOpts: Electron.BrowserWindowConstructorOptions = {
|
||||
|
@ -60,7 +60,7 @@ func (cs *ClientService) GetWindow(windowId string) (*wstore.Window, error) {
|
||||
}
|
||||
|
||||
func (cs *ClientService) MakeWindow(ctx context.Context) (*wstore.Window, error) {
|
||||
return wstore.CreateWindow(ctx)
|
||||
return wstore.CreateWindow(ctx, nil)
|
||||
}
|
||||
|
||||
// moves the window to the front of the windowId stack
|
||||
@ -155,12 +155,12 @@ func (cs *ClientService) BootstrapStarterLayout(ctx context.Context) error {
|
||||
wstore.MetaKey_View: "waveai",
|
||||
},
|
||||
}},
|
||||
{IndexArr: []int{2, 2}, BlockDef: &wstore.BlockDef{
|
||||
Meta: wstore.MetaMapType{
|
||||
wstore.MetaKey_View: "web",
|
||||
wstore.MetaKey_Url: "https://www.youtube.com/embed/cKqsw_sAsU8",
|
||||
},
|
||||
}},
|
||||
// {IndexArr: []int{2, 2}, BlockDef: &wstore.BlockDef{
|
||||
// Meta: wstore.MetaMapType{
|
||||
// wstore.MetaKey_View: "web",
|
||||
// wstore.MetaKey_Url: "https://www.youtube.com/embed/cKqsw_sAsU8",
|
||||
// },
|
||||
// }},
|
||||
}
|
||||
|
||||
objsvc := &objectservice.ObjectService{}
|
||||
|
@ -117,7 +117,7 @@ func (svc *WindowService) MoveBlockToNewWindow(ctx context.Context, currentTabId
|
||||
if !foundBlock {
|
||||
return nil, fmt.Errorf("block not found in current tab")
|
||||
}
|
||||
newWindow, err := wstore.CreateWindow(ctx)
|
||||
newWindow, err := wstore.CreateWindow(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error creating window: %w", err)
|
||||
}
|
||||
|
@ -317,11 +317,17 @@ func UpdateObjectMeta(ctx context.Context, oref waveobj.ORef, meta MetaMapType)
|
||||
})
|
||||
}
|
||||
|
||||
func CreateWindow(ctx context.Context) (*Window, error) {
|
||||
func CreateWindow(ctx context.Context, winSize *WinSize) (*Window, error) {
|
||||
windowId := uuid.NewString()
|
||||
workspaceId := uuid.NewString()
|
||||
tabId := uuid.NewString()
|
||||
layoutNodeId := uuid.NewString()
|
||||
if winSize == nil {
|
||||
winSize = &WinSize{
|
||||
Width: 1200,
|
||||
Height: 800,
|
||||
}
|
||||
}
|
||||
window := &Window{
|
||||
OID: windowId,
|
||||
WorkspaceId: workspaceId,
|
||||
@ -331,10 +337,7 @@ func CreateWindow(ctx context.Context) (*Window, error) {
|
||||
X: 100,
|
||||
Y: 100,
|
||||
},
|
||||
WinSize: WinSize{
|
||||
Width: 1200,
|
||||
Height: 800,
|
||||
},
|
||||
WinSize: *winSize,
|
||||
}
|
||||
err := DBInsert(ctx, window)
|
||||
if err != nil {
|
||||
@ -427,7 +430,7 @@ func EnsureInitialData() error {
|
||||
if len(client.WindowIds) > 0 {
|
||||
return nil
|
||||
}
|
||||
_, err = CreateWindow(ctx)
|
||||
_, err = CreateWindow(ctx, &WinSize{0, 0})
|
||||
if err != nil {
|
||||
return fmt.Errorf("error creating window: %w", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user