Add a refresh button.
authorSoren Stoutner <soren@stoutner.com>
Sat, 5 Feb 2022 19:58:38 +0000 (12:58 -0700)
committerSoren Stoutner <soren@stoutner.com>
Sat, 5 Feb 2022 19:58:38 +0000 (12:58 -0700)
src/MainView.cpp
src/MainView.ui

index cf84eccf063142977d66cd48d259b9fd91e2632f..f879451b97b2b99a1cee988b4dca0e8f03ded2c2 100644 (file)
@@ -38,6 +38,7 @@ MainView::MainView(QWidget *parent) : QWidget(parent)
     // Get handles for the views.
     backButtonPointer = mainViewUi.backButton;
     forwardButtonPointer = mainViewUi.forwardButton;
+    QPushButton *refreshButtonPointer = mainViewUi.refreshButton;
     QPushButton *homeButtonPointer = mainViewUi.homeButton;
     urlLineEditPointer = mainViewUi.urlLineEdit;
     javaScriptButtonPointer = mainViewUi.javaScript;
@@ -60,6 +61,7 @@ MainView::MainView(QWidget *parent) : QWidget(parent)
     // Setup the URL bar buttons.
     connect(backButtonPointer, SIGNAL(clicked()), webEngineViewPointer, SLOT(back()));
     connect(forwardButtonPointer, SIGNAL(clicked()), webEngineViewPointer, SLOT(forward()));
+    connect(refreshButtonPointer, SIGNAL(clicked()), webEngineViewPointer, SLOT(reload()));
     connect(homeButtonPointer, SIGNAL(clicked()), this, SLOT(goHome()));
     connect(javaScriptButtonPointer, SIGNAL(clicked()), this, SLOT(toggleJavaScript()));
 
index c7afeb850379167bb43aa3ce430aabc78fd77927..632ae6f7c04fb31c05afc27bfa7c95582fd6d3fc 100644 (file)
@@ -32,6 +32,7 @@
             </rect>
         </property>
 
+        <!-- Main widget. -->
         <layout class="QVBoxLayout">
             <!-- Set the spacing between items to 0. -->
             <property name="spacing">
                         </widget>
                     </item>
 
+                    <!-- Refresh button. -->
+                    <item>
+                        <widget class="QPushButton" name="refreshButton">
+                            <property name="icon">
+                                <iconset theme="view-refresh" />
+                            </property>
+
+                            <property name="iconSize">
+                                <size>
+                                    <height>24</height>
+                                    <width>24</width>
+                                </size>
+                            </property>
+
+                            <property name="flat">
+                                <bool>true</bool>
+                            </property>
+                        </widget>
+                    </item>
+
                     <!-- Home button. -->
                     <item>
                         <widget class="QPushButton" name="homeButton">