17
17
QFrame ,
18
18
QShortcut ,
19
19
QApplication ,
20
+ QStyle ,
20
21
)
21
22
from qtpy .QtWebEngineWidgets import QWebEngineView , QWebEngineSettings
22
23
from qtpy .QtCore import QUrl , Qt , QEvent
23
- from qtpy .QtGui import QIcon , QKeySequence
24
+ from qtpy .QtGui import QKeySequence
24
25
25
26
# Attempt to import QWebEnginePage in a way that works across different Qt bindings/versions
26
27
try :
@@ -110,25 +111,25 @@ def __init__(self, presenter, interceptor=None):
110
111
# ---------------------------------
111
112
112
113
# Back
113
- self .backButton .setIcon (QIcon . fromTheme ( "go-previous" , QIcon ( ":/qt-project.org/styles/commonstyle/images/left-arrow-32.png" ) ))
114
+ self .forwardButton .setIcon (self . style (). standardIcon ( QStyle . SP_ArrowBack ))
114
115
self .backButton .setToolTip ("Go Back" )
115
116
self .backButton .clicked .connect (self .browser .back )
116
117
self .toolbar .addWidget (self .backButton )
117
118
118
119
# Forward
119
- self .forwardButton .setIcon (QIcon . fromTheme ( "go-next" , QIcon ( ":/qt-project.org/styles/commonstyle/images/right-arrow-32.png" ) ))
120
+ self .forwardButton .setIcon (self . style (). standardIcon ( QStyle . SP_ArrowForward ))
120
121
self .forwardButton .setToolTip ("Go Forward" )
121
122
self .forwardButton .clicked .connect (self .browser .forward )
122
123
self .toolbar .addWidget (self .forwardButton )
123
124
124
125
# Home
125
- self .homeButton .setIcon (QIcon . fromTheme ( "go-home" , QIcon ( ":/qt-project.org/styles/commonstyle/images/home-32.png" ) ))
126
+ self .homeButton .setIcon (self . style (). standardIcon ( QStyle . SP_DirHomeIcon ))
126
127
self .homeButton .setToolTip ("Go to Home Page" )
127
128
self .homeButton .clicked .connect (self .on_home_clicked )
128
129
self .toolbar .addWidget (self .homeButton )
129
130
130
131
# Reload
131
- self .reloadButton .setIcon (QIcon . fromTheme ( "view-refresh" , QIcon ( ":/qt-project.org/styles/commonstyle/images/refresh-32.png" ) ))
132
+ self .reloadButton .setIcon (self . style (). standardIcon ( QStyle . SP_BrowserReload ))
132
133
self .reloadButton .setToolTip ("Reload Current Page" )
133
134
self .reloadButton .clicked .connect (self .browser .reload )
134
135
self .toolbar .addWidget (self .reloadButton )
@@ -139,7 +140,7 @@ def __init__(self, presenter, interceptor=None):
139
140
140
141
# Find button in toolbar
141
142
self .findButton = QPushButton ()
142
- self .findButton .setIcon (QIcon . fromTheme ( "edit-find" , QIcon ( ":/qt-project.org/styles/commonstyle/images/find-32.png" ) ))
143
+ self .findButton .setIcon (self . style (). standardIcon ( QStyle . SP_DialogOpenButton ))
143
144
self .findButton .setToolTip ("Find in Page (Ctrl+F)" )
144
145
self .findButton .clicked .connect (self .show_find_toolbar )
145
146
self .toolbar .addWidget (self .findButton )
0 commit comments