@@ -45,7 +45,11 @@ def __init__(self,
4545 icon : str = None ,
4646 debug : bool = False ,
4747 log_file : bool = None ,
48- border_less : bool = True ) -> None :
48+ border_less : bool = True ,
49+ maximize : bool = None ,
50+ minimize : bool = None ,
51+ caption = None ) -> None :
52+
4953 self .title = title
5054 self .icon = icon
5155 self .url = url
@@ -58,29 +62,39 @@ def __init__(self,
5862 if log_file :
5963 self .browser .config ['log_file' ] = log_file
6064
61- self .width , self .height = scale_window_size_for_high_dpi (self .browser .os ,
62- self .width ,
63- self .height )
65+ self .adapt_width , self .adapt_height = scale_window_size_for_high_dpi (self .browser .os ,
66+ self .width ,
67+ self .height )
6468
6569 wx .Frame .__init__ (
6670 self ,
6771 parent = None ,
6872 id = wx .ID_ANY ,
6973
7074 title = title ,
71- size = (self .width , self .height ),
7275 )
76+ width , height = self .FromDIP (wx .Size (self .width , self .height ))
77+ self .SetClientSize (width , height )
78+
79+ style = wx .DEFAULT_FRAME_STYLE
80+ if maximize :
81+ style = style & (~ wx .MAXIMIZE_BOX )
82+
83+ if minimize :
84+ style = style & (~ wx .MINIMIZE_BOX )
85+
86+ self .SetWindowStyle (style )
87+
88+ if caption :
89+ self .SetWindowStyle (wx .CAPTION )
7390
7491 if border_less :
7592 self .SetWindowStyle (wx .NO_BORDER )
7693
7794 if self .browser .os == 'Linux' :
7895 cefpython .WindowUtils .InstallX11ErrorHandlers ()
7996
80- self .panel = wx .Panel (self , size = (
81- self .width , self .height ), pos = (0 , 32 ))
82-
83- width , height = self .panel .GetClientSize ().Get ()
97+ self .panel = wx .Panel (self )
8498 self .browser .window .SetAsChild (self .panel .GetHandle (),
8599 [0 , 0 , width , height ])
86100
@@ -95,10 +109,8 @@ def __init__(self,
95109
96110 log (LogTypes .SUCCESS , 'Window added' )
97111
98-
99-
100112 self .browser .open ()
101- os .system ('clear' if self .browser .os != 'Windows' else 'cls' )
113+ # os.system('clear' if self.browser.os != 'Windows' else 'cls')
102114
103115 log (LogTypes .INFO , 'Browser open' )
104116
0 commit comments