@@ -44,6 +44,7 @@ type FrameViewModel(cfg: config.ConfigObject.Workspace option, ?_maingrid: GridV
4444
4545 let mutable m_windowState = WindowState.Normal
4646 let mutable m_customTitleBar = false
47+ let mutable m_noTitleBar = false
4748 let mutable m_fullscreen = false
4849 let mutable m_title = " FVim"
4950
@@ -94,6 +95,9 @@ type FrameViewModel(cfg: config.ConfigObject.Workspace option, ?_maingrid: GridV
9495 match cfg.Mainwin.CustomTitleBar with
9596 | Some true -> m_ customTitleBar <- true
9697 | _ -> ()
98+ match cfg.Mainwin.NoTitleBar with
99+ | Some true -> m_ noTitleBar <- true
100+ | _ -> ()
97101 | _, Some grid ->
98102 this.Height <- grid.BufferHeight
99103 this.Width <- grid.BufferWidth
@@ -103,11 +107,15 @@ type FrameViewModel(cfg: config.ConfigObject.Workspace option, ?_maingrid: GridV
103107 match cfg.Mainwin.CustomTitleBar with
104108 | Some true -> m_ customTitleBar <- true
105109 | _ -> ()
110+ match cfg.Mainwin.NoTitleBar with
111+ | Some true -> m_ noTitleBar <- true
112+ | _ -> ()
106113 | _ -> ()
107114 | _ -> ()
108115 this.Watch [
109116 rpc.register.notify " ToggleFullScreen" ( fun _ -> toggleFullScreen())
110117 rpc.register.notify " CustomTitleBar" ( fun [| Bool ( v ) |] -> this.CustomTitleBar <- v )
118+ rpc.register.notify " NoTitleBar" ( fun [| Bool ( v ) |] -> this.NoTitleBar <- v )
111119 rpc.register.watch " background.image" ( fun _ -> updateBackgroundImage())
112120 ]
113121 match _ maingrid with
@@ -141,21 +149,35 @@ type FrameViewModel(cfg: config.ConfigObject.Workspace option, ?_maingrid: GridV
141149
142150 member this.CustomTitleBarHeight
143151 with get() =
144- if this.CustomTitleBar && ( not this.Fullscreen) then GridLength 26.0
145- else GridLength 0.0
152+ GridLength <|
153+ if this.CustomTitleBar && ( not this.Fullscreen) && ( not this.NoTitleBar) then 26.0
154+ else 0.0
146155
147156 member this.BorderSize
148157 with get() =
149- if this.CustomTitleBar && ( not this.Fullscreen) && ( this.WindowState <> WindowState.Maximized)
150- then GridLength 1.0
151- else GridLength 0.0
158+ GridLength <|
159+ if ( this.NoSystemTitleBar) && ( not this.Fullscreen) && ( this.WindowState <> WindowState.Maximized)
160+ then 1.0
161+ else 0.0
152162
153163 member this.CustomTitleBar
154164 with get() = m_ customTitleBar
155165 and set ( v ) =
156166 ignore <| this.RaiseAndSetIfChanged(& m_ customTitleBar, v)
157167 this.RaisePropertyChanged( " CustomTitleBarHeight" )
158168 this.RaisePropertyChanged( " BorderSize" )
169+ this.RaisePropertyChanged( " NoSystemTitleBar" )
170+
171+ member this.NoTitleBar
172+ with get() = m_ noTitleBar
173+ and set ( v ) =
174+ ignore <| this.RaiseAndSetIfChanged(& m_ noTitleBar, v)
175+ this.RaisePropertyChanged( " CustomTitleBarHeight" )
176+ this.RaisePropertyChanged( " BorderSize" )
177+ this.RaisePropertyChanged( " NoSystemTitleBar" )
178+
179+ member __.NoSystemTitleBar
180+ with get() = m_ customTitleBar || m_ noTitleBar
159181
160182 member __.BackgroundImage with get(): IBitmap = m_ bgimg_ src :> IBitmap
161183 member __.BackgroundImageHAlign with get(): HorizontalAlignment = m_ bgimg_ halign
@@ -174,6 +196,7 @@ type FrameViewModel(cfg: config.ConfigObject.Workspace option, ?_maingrid: GridV
174196 member __.Sync ( _other : IFrame ) =
175197 let that = _ other :?> FrameViewModel
176198 m_ customTitleBar <- that.CustomTitleBar
199+ m_ noTitleBar <- that.NoTitleBar
177200 m_ bgimg_ src <- that.BackgroundImage :?> Bitmap
178201 m_ bgimg_ halign <- that.BackgroundImageHAlign
179202 m_ bgimg_ valign <- that.BackgroundImageVAlign
0 commit comments