@@ -16,11 +16,9 @@ def __init__(self, parent=None):
1616
1717 title_bar = QWidget ()
1818 title_bar_layout = QHBoxLayout (title_bar )
19- title_bar_layout .setContentsMargins (5 , 5 , 5 , 0 )
19+ title_bar_layout .setContentsMargins (0 , 5 , 0 , 0 )
2020 title_bar_layout .setSpacing (5 )
2121
22- title_bar_layout .addStretch ()
23-
2422 self .is_maximized = False
2523 self .restore_height = 0
2624
@@ -30,46 +28,67 @@ def __init__(self, parent=None):
3028 open_log_icon = style .standardIcon (QStyle .StandardPixmap .SP_DialogOpenButton )
3129 self .maximize_icon = style .standardIcon (QStyle .StandardPixmap .SP_TitleBarMaxButton )
3230 self .restore_icon = style .standardIcon (QStyle .StandardPixmap .SP_TitleBarNormalButton )
31+ self .minimize_icon = style .standardIcon (QStyle .StandardPixmap .SP_TitleBarMinButton )
3332
3433 self .back_button = QPushButton ("◀" )
3534 self .forward_button = QPushButton ("▶" )
3635 self .refresh_button = QPushButton ("⟳" )
3736 self .maximize_button = QPushButton (icon = self .maximize_icon )
3837 self .open_log_button = QPushButton (icon = open_log_icon )
38+ self .minimize_button = QPushButton (icon = self .minimize_icon )
3939
4040 self .back_button .setObjectName ("DockTitleBarButton" )
4141 self .forward_button .setObjectName ("DockTitleBarButton" )
4242 self .refresh_button .setObjectName ("DockTitleBarButton" )
4343 self .maximize_button .setObjectName ("DockTitleBarButton" )
4444 self .open_log_button .setObjectName ("DockTitleBarButton" )
45+ self .minimize_button .setObjectName ("DockTitleBarButton" )
4546
4647 self .back_button .hide ()
4748 self .forward_button .hide ()
4849 self .refresh_button .hide ()
4950
50- title_bar_layout .addWidget (self .back_button )
51- title_bar_layout .addWidget (self .forward_button )
52- title_bar_layout .addWidget (self .refresh_button )
53- title_bar_layout .addWidget (self .open_log_button )
54- title_bar_layout .addWidget (self .maximize_button )
51+ nav_container = QWidget ()
52+ nav_container .setObjectName ("DockButtonContainerL" )
53+ nav_layout = QHBoxLayout (nav_container )
54+ nav_layout .setContentsMargins (4 , 4 , 4 , 4 )
55+ nav_layout .setSpacing (2 )
56+ nav_layout .addWidget (self .back_button )
57+ nav_layout .addWidget (self .forward_button )
58+ nav_layout .addWidget (self .refresh_button )
59+
60+ action_container = QWidget ()
61+ action_container .setObjectName ("DockButtonContainerR" )
62+ action_layout = QHBoxLayout (action_container )
63+ action_layout .setContentsMargins (4 , 4 , 4 , 4 )
64+ action_layout .setSpacing (2 )
65+ action_layout .addWidget (self .open_log_button )
66+ action_layout .addWidget (self .minimize_button )
67+ action_layout .addWidget (self .maximize_button )
68+
69+ title_bar_layout .addWidget (nav_container )
70+ title_bar_layout .addStretch ()
71+ title_bar_layout .addWidget (action_container )
5572
5673 self .back_button .setFlat (True )
5774 self .forward_button .setFlat (True )
5875 self .refresh_button .setFlat (True )
5976 self .open_log_button .setFlat (True )
6077 self .maximize_button .setFlat (True )
78+ self .minimize_button .setFlat (True )
6179
62- self .back_button .setToolTip ("Go Back (Alt+Left)" )
63- self .forward_button .setToolTip ("Go Forward (Alt+Right)" )
80+ self .back_button .setToolTip ("Back (Alt+Left)" )
81+ self .forward_button .setToolTip ("Forward (Alt+Right)" )
6482 self .refresh_button .setToolTip ("Refresh (F5)" )
6583 self .open_log_button .setToolTip ("Open Log File" )
66- self .maximize_button .setToolTip ("Maximize/Restore Dock (Ctrl+M)" )
84+ self .maximize_button .setToolTip ("Maximize (Ctrl+M)" )
85+ self .minimize_button .setToolTip ("Minimize (Ctrl+`)" )
6786
6887 self .setTitleBarWidget (title_bar )
88+ self .minimize_button .clicked .connect (self .hide )
6989 self .maximize_button .clicked .connect (self .toggle_maximize )
7090 self .refresh_button .clicked .connect (self .refresh_current_view )
7191
72-
7392 container = QWidget ()
7493 layout = QVBoxLayout (container )
7594 layout .setContentsMargins (0 , 0 , 0 , 0 )
@@ -190,6 +209,10 @@ def get_scroll_and_refresh(scroll_y):
190209 if not url :
191210 return
192211
212+ if not (url .lower ().endswith (".html" ) or url .lower ().endswith (".htm" )):
213+ current_widget .reload ()
214+ return
215+
193216 try :
194217 with open (url , 'r' , encoding = 'utf-8' ) as f :
195218 new_html = f .read ()
0 commit comments