From fb2760a23bc59d63c74e18c92628ef03ccd8bf3a Mon Sep 17 00:00:00 2001
From: Soren Stoutner <soren@stoutner.com>
Date: Tue, 9 Aug 2022 16:39:12 -0700
Subject: [PATCH] Highlight non-default domain settings.

---
 src/dialogs/DomainSettingsDialog.cpp |  77 +++-
 src/dialogs/DomainSettingsDialog.h   |   7 +
 src/helpers/UserAgentHelper.cpp      |  10 +-
 src/uis/DomainSettingsDialog.ui      | 578 ++++++++++++++++-----------
 src/uis/TabWidget.ui                 |   4 -
 src/widgets/TabWidget.cpp            |   4 +-
 src/windows/BrowserWindow.cpp        |   2 +-
 7 files changed, 433 insertions(+), 249 deletions(-)

diff --git a/src/dialogs/DomainSettingsDialog.cpp b/src/dialogs/DomainSettingsDialog.cpp
index c8dc3ea..34ff70e 100644
--- a/src/dialogs/DomainSettingsDialog.cpp
+++ b/src/dialogs/DomainSettingsDialog.cpp
@@ -53,14 +53,19 @@ DomainSettingsDialog::DomainSettingsDialog(const int &startType, const QString &
     domainsListViewPointer = domainSettingsDialogUi.domainsListView;
     domainSettingsWidgetPointer = domainSettingsDialogUi.domainSettingsWidget;
     domainNameLineEditPointer = domainSettingsDialogUi.domainNameLineEdit;
+    javaScriptWidgetPointer = domainSettingsDialogUi.javaScriptWidget;
     javaScriptComboBoxPointer = domainSettingsDialogUi.javaScriptComboBox;
     javaScriptLabelPointer = domainSettingsDialogUi.javaScriptLabel;
+    localStorageWidgetPointer = domainSettingsDialogUi.localStorageWidget;
     localStorageComboBoxPointer = domainSettingsDialogUi.localStorageComboBox;
     localStorageLabelPointer = domainSettingsDialogUi.localStorageLabel;
+    domStorageWidgetPointer = domainSettingsDialogUi.domStorageWidget;
     domStorageComboBoxPointer = domainSettingsDialogUi.domStorageComboBox;
     domStorageLabelPointer = domainSettingsDialogUi.domStorageLabel;
+    userAgentWidgetPointer = domainSettingsDialogUi.userAgentWidget;
     userAgentComboBoxPointer = domainSettingsDialogUi.userAgentComboBox;
     userAgentLabelPointer = domainSettingsDialogUi.userAgentLabel;
+    zoomFactorWidgetPointer = domainSettingsDialogUi.zoomFactorWidget;
     zoomFactorComboBoxPointer = domainSettingsDialogUi.zoomFactorComboBox;
     customZoomFactorSpinBoxPointer = domainSettingsDialogUi.customZoomFactorSpinBox;
     QPushButton *addDomainButtonPointer = domainSettingsDialogUi.addDomainButton;
@@ -96,6 +101,21 @@ DomainSettingsDialog::DomainSettingsDialog(const int &startType, const QString &
     // Read the data from the database and apply it to the table model.
     domainsTableModelPointer->select();
 
+    // Get the default palette.
+    defaultPalette = javaScriptWidgetPointer->palette();
+
+    // Populate the highlighted palette.
+    highlightedPalette = defaultPalette;
+
+    // Get the default highlight color.
+    QColor highlightColor = defaultPalette.color(QPalette::Highlight);
+
+    // Set the highlight color to be partially transparent.
+    highlightColor.setAlpha(64);
+
+    // Set highlighted background color.
+    highlightedPalette.setColor(QPalette::Window, highlightColor);
+
     // Setup the dialog according to the start type.
     switch (startType)
     {
@@ -353,30 +373,39 @@ void DomainSettingsDialog::populateDomStorageLabel() const
     // Populate the label according to the currently selected index.
     switch (domStorageComboBoxPointer->currentIndex())
     {
-        // Set the text according to the system default.
         case (DomainsDatabase::SYSTEM_DEFAULT):
         {
+            // Set the text according to the system default.
             if (Settings::domStorageEnabled())
                 domStorageLabelPointer->setText(i18nc("Domain settings DOM storage label.", "DOM storage enabled"));
             else
                 domStorageLabelPointer->setText(i18nc("Domain settings DOM storage label.", "DOM storage disabled"));
 
+            // Reset the palette.
+            domStorageWidgetPointer->setPalette(defaultPalette);
+
             break;
         }
 
-        // Set the disabled text in bold.
         case (DomainsDatabase::DISABLED):
         {
+            // Set the disabled text in bold.
             domStorageLabelPointer->setText(i18nc("Domain settings DOM storage label.  The <b> tags should be retained.", "<b>DOM storage disabled</b>"));
 
+            // Set the palette.
+            domStorageWidgetPointer->setPalette(highlightedPalette);
+
             break;
         }
 
-        // Set the enabled text in bold.
         case (DomainsDatabase::ENABLED):
         {
+            // Set the enabled text in bold.
             domStorageLabelPointer->setText(i18nc("Domain settings DOM storage label.  The <b> tags should be retained.", "<b>DOM storage enabled</b>"));
 
+            // Set the palette.
+            domStorageWidgetPointer->setPalette(highlightedPalette);
+
             break;
         }
     }
@@ -387,30 +416,39 @@ void DomainSettingsDialog::populateJavaScriptLabel() const
     // Populate the label according to the currently selected index.
     switch (javaScriptComboBoxPointer->currentIndex())
     {
-        // Set the text according to the system default.
         case (DomainsDatabase::SYSTEM_DEFAULT):
         {
+            // Set the text according to the system default.
             if (Settings::javaScriptEnabled())
                 javaScriptLabelPointer->setText(i18nc("Domain settings JavaScript label.", "JavaScript enabled"));
             else
                 javaScriptLabelPointer->setText(i18nc("Domain settings JavaScript label.", "JavaScript disabled"));
 
+            // Reset the palette.
+            javaScriptWidgetPointer->setPalette(defaultPalette);
+
             break;
         }
 
-        // Set the disabled text in bold.
         case (DomainsDatabase::DISABLED):
         {
+            // Set the disabled text in bold.
             javaScriptLabelPointer->setText(i18nc("Domain settings JavaScript label.  The <b> tags should be retained.", "<b>JavaScript disabled</b>"));
 
+            // Set the palette.
+            javaScriptWidgetPointer->setPalette(highlightedPalette);
+
             break;
         }
 
-        // Set the enabled text in bold.
         case (DomainsDatabase::ENABLED):
         {
+            // Set the enabled text in bold.
             javaScriptLabelPointer->setText(i18nc("Domain settings JavaScript label.  The <b> tags should be retained.", "<b>JavaScript enabled</b>"));
 
+            // Set the palette.
+            javaScriptWidgetPointer->setPalette(highlightedPalette);
+
             break;
         }
     }
@@ -421,30 +459,39 @@ void DomainSettingsDialog::populateLocalStorageLabel() const
     // Populate the label according to the currently selected index.
     switch (localStorageComboBoxPointer->currentIndex())
     {
-        // Set the text according to the system default.
         case (DomainsDatabase::SYSTEM_DEFAULT):
         {
+            // Set the text according to the system default.
             if (Settings::localStorageEnabled())
                 localStorageLabelPointer->setText(i18nc("Domain settings local storage label.", "Local storage enabled"));
             else
                 localStorageLabelPointer->setText(i18nc("Domain settings local storage label.", "Local storage disabled"));
 
+            // Reset the palette.
+            localStorageWidgetPointer->setPalette(defaultPalette);
+
             break;
         }
 
-        // Set the disabled text in bold.
         case (DomainsDatabase::DISABLED):
         {
+            // Set the disabled text in bold.
             localStorageLabelPointer->setText(i18nc("Domain settings local storage label.  The <b> tags should be retained.", "<b>Local storage disabled</b>"));
 
+            // Set the palette.
+            localStorageWidgetPointer->setPalette(highlightedPalette);
+
             break;
         }
 
-        // Set the enabled text in bold.
         case (DomainsDatabase::ENABLED):
         {
+            // Set the enabled text in bold.
             localStorageLabelPointer->setText(i18nc("Domain settings local storage label.  The <b> tabs should be retained.", "<b>Local storage enabled</b>"));
 
+            // Set the palette.
+            localStorageWidgetPointer->setPalette(highlightedPalette);
+
             break;
         }
     }
@@ -458,11 +505,17 @@ void DomainSettingsDialog::populateUserAgentLabel(const QString &userAgentName)
     {
         // Display the system default user agent name.
         userAgentLabelPointer->setText(UserAgentHelper::getTranslatedUserAgentNameFromDatabaseName(Settings::userAgent()));
+
+        // Reset the palette.
+        userAgentWidgetPointer->setPalette(defaultPalette);
     }
     else
     {
         // Display the user agent name in bold.
         userAgentLabelPointer->setText("<strong>" + userAgentName + "</strong>");
+
+        // Set the palette.
+        userAgentWidgetPointer->setPalette(highlightedPalette);
     }
 }
 
@@ -597,11 +650,17 @@ void DomainSettingsDialog::zoomFactorComboBoxChanged(const int &newIndex) const
     {
         // Display the default zoom factor.
         customZoomFactorSpinBoxPointer->setValue(Settings::zoomFactor());
+
+        // Reset the palette.
+        zoomFactorWidgetPointer->setPalette(defaultPalette);
     }
     else  // Custom zoom factor is selected.
     {
         // Display the custom zoom factor from the domain settings.
         customZoomFactorSpinBoxPointer->setValue(modelIndex.siblingAtColumn(domainsTableModelPointer->fieldIndex(DomainsDatabase::CUSTOM_ZOOM_FACTOR)).data().toDouble());
+
+        // Set the palette.
+        zoomFactorWidgetPointer->setPalette(highlightedPalette);
     }
 
     // Update the status of the custom zoom factor spin box.
diff --git a/src/dialogs/DomainSettingsDialog.h b/src/dialogs/DomainSettingsDialog.h
index fb45902..7680a03 100644
--- a/src/dialogs/DomainSettingsDialog.h
+++ b/src/dialogs/DomainSettingsDialog.h
@@ -67,7 +67,9 @@ private:
     // The private variables.
     QPushButton *applyButtonPointer;
     QDoubleSpinBox *customZoomFactorSpinBoxPointer;
+    QPalette defaultPalette;
     QPushButton *deleteDomainButtonPointer;
+    QWidget *domStorageWidgetPointer;
     QComboBox *domStorageComboBoxPointer;
     QLabel *domStorageLabelPointer;
     KLineEdit *domainNameLineEditPointer;
@@ -75,13 +77,18 @@ private:
     QListView *domainsListViewPointer;
     QSqlTableModel *domainsTableModelPointer;
     QItemSelectionModel *domainsSelectionModelPointer;
+    QPalette highlightedPalette;
+    QWidget *javaScriptWidgetPointer;
     QComboBox *javaScriptComboBoxPointer;
     QLabel *javaScriptLabelPointer;
+    QWidget *localStorageWidgetPointer;
     QComboBox *localStorageComboBoxPointer;
     QLabel *localStorageLabelPointer;
     QPushButton *resetButtonPointer;
+    QWidget *userAgentWidgetPointer;
     QComboBox *userAgentComboBoxPointer;
     QLabel *userAgentLabelPointer;
+    QWidget *zoomFactorWidgetPointer;
     QComboBox *zoomFactorComboBoxPointer;
 
     // The private functions.
diff --git a/src/helpers/UserAgentHelper.cpp b/src/helpers/UserAgentHelper.cpp
index 9727c31..14a71e2 100644
--- a/src/helpers/UserAgentHelper.cpp
+++ b/src/helpers/UserAgentHelper.cpp
@@ -50,11 +50,11 @@ const QString UserAgentHelper::SAFARI_MACOS_TRANSLATED = i18n("Safari on macOS")
 // Define the public user agent constants.
 const QString UserAgentHelper::PRIVACY_BROWSER_USER_AGENT = QStringLiteral("PrivacyBrowser/1.0");
 const QString UserAgentHelper::FIREFOX_LINUX_USER_AGENT = QStringLiteral("Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0");
-const QString UserAgentHelper::CHROMIUM_LINUX_USER_AGENT = QStringLiteral("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36");
-const QString UserAgentHelper::FIREFOX_WINDOWS_USER_AGENT = QStringLiteral("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Firefox/97.0");
-const QString UserAgentHelper::CHROME_WINDOWS_USER_AGENT = QStringLiteral("Mozilla/5.0 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36");
-const QString UserAgentHelper::EDGE_WINDOWS_USER_AGENT = QStringLiteral("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 Edg/98.0.1108.56");
-const QString UserAgentHelper::SAFARI_MACOS_USER_AGENT = QStringLiteral("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15");
+const QString UserAgentHelper::CHROMIUM_LINUX_USER_AGENT = QStringLiteral("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36");
+const QString UserAgentHelper::FIREFOX_WINDOWS_USER_AGENT = QStringLiteral("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0");
+const QString UserAgentHelper::CHROME_WINDOWS_USER_AGENT = QStringLiteral("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36");
+const QString UserAgentHelper::EDGE_WINDOWS_USER_AGENT = QStringLiteral("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36 Edg/103.0.1264.71");
+const QString UserAgentHelper::SAFARI_MACOS_USER_AGENT = QStringLiteral("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15");
 
 // Construct the class.
 UserAgentHelper::UserAgentHelper() {};
diff --git a/src/uis/DomainSettingsDialog.ui b/src/uis/DomainSettingsDialog.ui
index d7eac8e..f089363 100644
--- a/src/uis/DomainSettingsDialog.ui
+++ b/src/uis/DomainSettingsDialog.ui
@@ -33,6 +33,7 @@
 
         <!-- Main layout. -->
         <layout class="QHBoxLayout">
+            <!-- Left column. -->
             <item>
                 <layout class="QVBoxLayout">
                     <!-- Domains list view. -->
@@ -82,290 +83,411 @@
                 </layout>
             </item>
 
+            <!-- Right column. -->
             <item>
                 <layout class="QVBoxLayout">
+                    <!-- Domain settings widget.-->
                     <item>
                         <widget class="QWidget" name="domainSettingsWidget">
-                            <!-- Domain settings form layout. -->
-                            <layout class="QFormLayout">
-                                <!-- Domain name. -->
-                                <item row="0" column="0">
-                                    <widget class="QLabel">
-                                        <property name="text">
-                                            <string>Domain name</string>
-                                        </property>
+                            <layout class="QVBoxLayout">
 
-                                        <property name="toolTip">
-                                            <string>*. may be prepended to a domain to include all subdomains (eg. *.stoutner.com).</string>
-                                        </property>
-                                    </widget>
-                                </item>
+                                <!-- Domain name. -->
+                                <item>
+                                    <layout class="QFormLayout">
+                                        <item row="0" column="0">
+                                            <widget class="QLabel">
+                                                <property name="text">
+                                                    <string>Domain name</string>
+                                                </property>
+
+                                                <property name="toolTip">
+                                                    <string>*. may be prepended to a domain to include all subdomains (eg. *.stoutner.com).</string>
+                                                </property>
+                                            </widget>
+                                        </item>
 
-                                <item row="0" column="1">
-                                    <widget class="KLineEdit" name="domainNameLineEdit" />
+                                        <item row="0" column="1">
+                                            <widget class="KLineEdit" name="domainNameLineEdit" />
+                                        </item>
+                                    </layout>
                                 </item>
 
                                 <!-- JavaScript. -->
-                                <item row="1" column="0">
-                                    <widget class="QLabel">
-                                        <property name="text">
-                                            <string>JavaScript</string>
-                                        </property>
-
-                                        <property name="toolTip">
-                                            <string>JavaScript allows websites to run programs (scripts) on the device.</string>
+                                <item>
+                                    <widget class="QWidget" name="javaScriptWidget">
+                                        <property name="autoFillBackground">
+                                            <bool>true</bool>
                                         </property>
-                                    </widget>
-                                </item>
 
-                                <item row="1" column="1">
-                                    <widget class="QComboBox" name="javaScriptComboBox">
-                                        <item>
-                                            <property name="text">
-                                                <string>System default</string>
+                                        <layout class="QFormLayout">
+                                            <property name="leftMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>JavaScript disabled</string>
+                                            <property name="topMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>JavaScript enabled</string>
+                                            <property name="rightMargin">
+                                                <number>10</number>
+                                            </property>
+                                            <property name="bottomMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-                                    </widget>
-                                </item>
 
-                                <item row="2" column="1">
-                                    <widget class="QLabel" name="javaScriptLabel">
-                                        <property name="textFormat">
-                                            <enum>Qt::RichText</enum>
-                                        </property>
+                                            <item row="0" column="0">
+                                                <widget class="QLabel">
+                                                    <property name="text">
+                                                        <string>JavaScript</string>
+                                                    </property>
+
+                                                    <property name="toolTip">
+                                                        <string>JavaScript allows websites to run programs (scripts) on the device.</string>
+                                                    </property>
+                                                </widget>
+                                            </item>
+
+                                            <item row="0" column="1">
+                                                <widget class="QComboBox" name="javaScriptComboBox">
+                                                    <item>
+                                                        <property name="text">
+                                                            <string>System default</string>
+                                                        </property>
+                                                    </item>
+
+                                                    <item>
+                                                        <property name="text">
+                                                            <string>JavaScript disabled</string>
+                                                        </property>
+                                                    </item>
+
+                                                    <item>
+                                                        <property name="text">
+                                                            <string>JavaScript enabled</string>
+                                                        </property>
+                                                    </item>
+                                                </widget>
+                                            </item>
+
+                                            <item row="1" column="1">
+                                                <widget class="QLabel" name="javaScriptLabel">
+                                                    <property name="textFormat">
+                                                        <enum>Qt::RichText</enum>
+                                                    </property>
+                                                </widget>
+                                            </item>
+                                        </layout>
                                     </widget>
                                 </item>
 
                                 <!-- Local storage. -->
-                                <item row="3" column="0">
-                                    <widget class="QLabel">
-                                        <property name="text">
-                                            <string>Local storage</string>
-                                        </property>
-
-                                        <property name="toolTip">
-                                            <string>Local storage includes cookies, IndexedDB, DOM storage, filesystem API, and service workers.  DOM storage also requires a separate control to be enabled.  Local storage is disabled by default.</string>
+                                <item>
+                                    <widget class="QWidget" name="localStorageWidget">
+                                        <property name="autoFillBackground">
+                                            <bool>true</bool>
                                         </property>
-                                    </widget>
-                                </item>
 
-                                <item row="3" column="1">
-                                    <widget class="QComboBox" name="localStorageComboBox">
-                                        <item>
-                                            <property name="text">
-                                                <string>System default</string>
+                                        <layout class="QFormLayout">
+                                            <property name="leftMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Local storage disabled</string>
+                                            <property name="topMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Local storage enabled</string>
+                                            <property name="rightMargin">
+                                                <number>10</number>
+                                            </property>
+                                            <property name="bottomMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-                                    </widget>
-                                </item>
 
-                                <item row="4" column="1">
-                                    <widget class="QLabel" name="localStorageLabel">
-                                        <property name="textFormat">
-                                            <enum>Qt::RichText</enum>
-                                        </property>
+                                            <item row="0" column="0">
+                                                <widget class="QLabel">
+                                                    <property name="text">
+                                                        <string>Local storage</string>
+                                                    </property>
+
+                                                    <property name="toolTip">
+                                                        <string>Local storage includes cookies, IndexedDB, DOM storage, filesystem API, and service workers.  DOM storage also requires a separate control to be enabled.  Local storage is disabled by default.</string>
+                                                    </property>
+                                                </widget>
+                                            </item>
+
+                                            <item row="0" column="1">
+                                                <widget class="QComboBox" name="localStorageComboBox">
+                                                    <item>
+                                                        <property name="text">
+                                                            <string>System default</string>
+                                                        </property>
+                                                    </item>
+
+                                                    <item>
+                                                        <property name="text">
+                                                            <string>Local storage disabled</string>
+                                                        </property>
+                                                    </item>
+
+                                                    <item>
+                                                        <property name="text">
+                                                            <string>Local storage enabled</string>
+                                                        </property>
+                                                    </item>
+                                                </widget>
+                                            </item>
+
+                                            <item row="1" column="1">
+                                                <widget class="QLabel" name="localStorageLabel">
+                                                    <property name="textFormat">
+                                                        <enum>Qt::RichText</enum>
+                                                    </property>
+                                                </widget>
+                                            </item>
+                                        </layout>
                                     </widget>
                                 </item>
 
                                 <!-- DOM storage. -->
-                                <item row="5" column="0">
-                                    <widget class="QLabel">
-                                        <property name="text">
-                                            <string>DOM storage</string>
-                                        </property>
-
-                                        <property name="toolTip">
-                                            <string>DOM storage, sometimes called web storage, is like cookies on steroids.  To function, it requires that both JavaScript and local storage be enabled.</string>
+                                <item>
+                                    <widget class="QWidget" name="domStorageWidget">
+                                        <property name="autoFillBackground">
+                                            <bool>true</bool>
                                         </property>
-                                    </widget>
-                                </item>
 
-                                <item row="5" column="1">
-                                    <widget class="QComboBox" name="domStorageComboBox">
-                                        <item>
-                                            <property name="text">
-                                                <string>System default</string>
+                                        <layout class="QFormLayout">
+                                            <property name="leftMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>DOM storage disabled</string>
+                                            <property name="topMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>DOM storage enabled</string>
+                                            <property name="rightMargin">
+                                                <number>10</number>
+                                            </property>
+                                            <property name="bottomMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-                                    </widget>
-                                </item>
 
-                                <item row="6" column="1">
-                                    <widget class="QLabel" name="domStorageLabel">
-                                        <property name="textFormat">
-                                            <enum>Qt::RichText</enum>
-                                        </property>
+                                            <item row="0" column="0">
+                                                <widget class="QLabel">
+                                                    <property name="text">
+                                                        <string>DOM storage</string>
+                                                    </property>
+
+                                                    <property name="toolTip">
+                                                        <string>DOM storage, sometimes called web storage, is like cookies on steroids.  To function, it requires that both JavaScript and local storage be enabled.</string>
+                                                    </property>
+                                                </widget>
+                                            </item>
+
+                                            <item row="0" column="1">
+                                                <widget class="QComboBox" name="domStorageComboBox">
+                                                    <item>
+                                                        <property name="text">
+                                                            <string>System default</string>
+                                                        </property>
+                                                    </item>
+
+                                                    <item>
+                                                        <property name="text">
+                                                            <string>DOM storage disabled</string>
+                                                        </property>
+                                                    </item>
+
+                                                    <item>
+                                                        <property name="text">
+                                                            <string>DOM storage enabled</string>
+                                                        </property>
+                                                    </item>
+                                                </widget>
+                                            </item>
+
+                                            <item row="1" column="1">
+                                                <widget class="QLabel" name="domStorageLabel">
+                                                    <property name="textFormat">
+                                                        <enum>Qt::RichText</enum>
+                                                    </property>
+                                                </widget>
+                                            </item>
+                                        </layout>
                                     </widget>
                                 </item>
 
                                 <!-- User agent. -->
-                                <item row="7" column="0">
-                                    <widget class="QLabel">
-                                        <property name="text">
-                                            <string>User agent</string>
-                                        </property>
-
-                                        <property name="toolTip">
-                                            <string>The user agent identifies the browser to the web server.  It serves no useful purpose, but many web servers refuse to return the web page if they don't see a user agent they like.</string>
-                                        </property>
-                                    </widget>
-                                </item>
-
-                                <item row="7" column="1">
-                                    <widget class="QComboBox" name="userAgentComboBox">
-                                        <property name="sizePolicy">
-                                            <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-                                                <horstretch>0</horstretch>
-                                                <verstretch>0</verstretch>
-                                            </sizepolicy>
-                                        </property>
-
-                                        <property name="editable">
+                                <item>
+                                    <widget class="QWidget" name="userAgentWidget">
+                                        <property name="autoFillBackground">
                                             <bool>true</bool>
                                         </property>
 
-                                        <item>
-                                            <property name="text">
-                                                <string>System default</string>
-                                            </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Privacy Browser</string>
+                                        <layout class="QFormLayout">
+                                            <property name="leftMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>WebEngine default</string>
-                                            </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Firefox on Linux</string>
-                                            </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Chromium on Linux</string>
-                                            </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Firefox on Windows</string>
-                                            </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Chrome on Windows</string>
+                                            <property name="topMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Edge on Windows</string>
+                                            <property name="rightMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Safari on macOS</string>
+                                            <property name="bottomMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-                                    </widget>
-                                </item>
 
-                                <item row="8" column="1">
-                                    <widget class="QLabel" name="userAgentLabel">
-                                        <property name="textFormat">
-                                            <enum>Qt::RichText</enum>
-                                        </property>
+                                            <item row="0" column="0">
+                                                <widget class="QLabel">
+                                                    <property name="text">
+                                                        <string>User agent</string>
+                                                    </property>
+
+                                                    <property name="toolTip">
+                                                        <string>The user agent identifies the browser to the web server.  It serves no useful purpose, but many web servers refuse to return the web page if they don't see a user agent they like.</string>
+                                                    </property>
+                                                </widget>
+                                            </item>
+
+                                            <item row="0" column="1">
+                                                <widget class="QComboBox" name="userAgentComboBox">
+                                                    <property name="sizePolicy">
+                                                        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                                                            <horstretch>0</horstretch>
+                                                            <verstretch>0</verstretch>
+                                                        </sizepolicy>
+                                                    </property>
+
+                                                    <property name="editable">
+                                                        <bool>true</bool>
+                                                    </property>
+
+                                                    <item>
+                                                        <property name="text">
+                                                            <string>System default</string>
+                                                        </property>
+                                                    </item>
+
+                                                    <item>
+                                                        <property name="text">
+                                                            <string>Privacy Browser</string>
+                                                        </property>
+                                                    </item>
+
+                                                    <item>
+                                                        <property name="text">
+                                                            <string>WebEngine default</string>
+                                                        </property>
+                                                    </item>
+
+                                                    <item>
+                                                        <property name="text">
+                                                            <string>Firefox on Linux</string>
+                                                        </property>
+                                                    </item>
+
+                                                    <item>
+                                                        <property name="text">
+                                                            <string>Chromium on Linux</string>
+                                                        </property>
+                                                    </item>
+
+                                                    <item>
+                                                        <property name="text">
+                                                            <string>Firefox on Windows</string>
+                                                        </property>
+                                                    </item>
+
+                                                    <item>
+                                                        <property name="text">
+                                                            <string>Chrome on Windows</string>
+                                                        </property>
+                                                    </item>
+
+                                                    <item>
+                                                        <property name="text">
+                                                            <string>Edge on Windows</string>
+                                                        </property>
+                                                    </item>
+
+                                                    <item>
+                                                        <property name="text">
+                                                            <string>Safari on macOS</string>
+                                                        </property>
+                                                    </item>
+                                                </widget>
+                                            </item>
+
+                                            <item row="1" column="1">
+                                                <widget class="QLabel" name="userAgentLabel">
+                                                    <property name="textFormat">
+                                                        <enum>Qt::RichText</enum>
+                                                    </property>
+                                                </widget>
+                                            </item>
+                                        </layout>
                                     </widget>
                                 </item>
 
                                 <!-- Zoom factor. -->
-                                <item row="9" column="0">
-                                    <widget class="QLabel">
-                                        <property name="text">
-                                            <string>Zoom factor</string>
-                                        </property>
-
-                                        <property name="toolTip">
-                                            <string>Valid values for the zoom factor are between 0.25 and 5.00.</string>
+                                <item>
+                                    <widget class="QWidget" name="zoomFactorWidget">
+                                        <property name="autoFillBackground">
+                                            <bool>true</bool>
                                         </property>
-                                    </widget>
-                                </item>
 
-                                <item row="9" column="1">
-                                    <widget class="QComboBox" name="zoomFactorComboBox">
-                                        <item>
-                                            <property name="text">
-                                                <string>System default</string>
+                                        <layout class="QFormLayout">
+                                            <property name="leftMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Custom</string>
+                                            <property name="topMargin">
+                                                <number>10</number>
+                                            </property>
+                                            <property name="rightMargin">
+                                                <number>10</number>
+                                            </property>
+                                            <property name="bottomMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-                                    </widget>
-                                </item>
-
-                                <item row="10" column="1">
-                                    <widget class="QDoubleSpinBox" name="customZoomFactorSpinBox">
-                                        <property name="minimum">
-                                            <double>0.250000000000000</double>
-                                        </property>
-
-                                        <property name="maximum">
-                                            <double>5.000000000000000</double>
-                                        </property>
 
-                                        <property name="singleStep">
-                                            <double>0.250000000000000</double>
-                                        </property>
+                                            <item row="0" column="0">
+                                                <widget class="QLabel">
+                                                    <property name="text">
+                                                        <string>Zoom factor</string>
+                                                    </property>
+
+                                                    <property name="toolTip">
+                                                        <string>Valid values for the zoom factor are between 0.25 and 5.00.</string>
+                                                    </property>
+                                                </widget>
+                                            </item>
+
+                                            <item row="0" column="1">
+                                                <widget class="QComboBox" name="zoomFactorComboBox">
+                                                    <item>
+                                                        <property name="text">
+                                                            <string>System default</string>
+                                                        </property>
+                                                    </item>
+
+                                                    <item>
+                                                        <property name="text">
+                                                            <string>Custom</string>
+                                                        </property>
+                                                    </item>
+                                                </widget>
+                                            </item>
+
+                                            <item row="1" column="1">
+                                                <widget class="QDoubleSpinBox" name="customZoomFactorSpinBox">
+                                                    <property name="minimum">
+                                                        <double>0.250000000000000</double>
+                                                    </property>
+
+                                                    <property name="maximum">
+                                                        <double>5.000000000000000</double>
+                                                    </property>
+
+                                                    <property name="singleStep">
+                                                        <double>0.250000000000000</double>
+                                                    </property>
+                                                </widget>
+                                            </item>
+                                        </layout>
                                     </widget>
                                 </item>
                             </layout>
diff --git a/src/uis/TabWidget.ui b/src/uis/TabWidget.ui
index 375f4d5..ad6a5a0 100644
--- a/src/uis/TabWidget.ui
+++ b/src/uis/TabWidget.ui
@@ -53,10 +53,6 @@
                         </size>
                     </property>
 
-                    <property name="documentMode">
-                        <bool>true</bool>
-                    </property>
-
                     <property name="tabsClosable">
                         <bool>true</bool>
                     </property>
diff --git a/src/widgets/TabWidget.cpp b/src/widgets/TabWidget.cpp
index 3b0ce08..59e4243 100644
--- a/src/widgets/TabWidget.cpp
+++ b/src/widgets/TabWidget.cpp
@@ -449,9 +449,9 @@ void TabWidget::applyDomainSettings(const QString &hostname, const bool reloadWe
         currentWebEngineSettingsPointer->setAttribute(QWebEngineSettings::JavascriptEnabled, Settings::javaScriptEnabled());
 
         // Set the local storage status.
-        //currentPrivacyWebEngineViewPointer->localStorageEnabled = Settings::localStorageEnabled();
+        currentPrivacyWebEngineViewPointer->localStorageEnabled = Settings::localStorageEnabled();
 
-        // Set DOM storage.
+        // Set DOM storage.  In QWebEngineSettings it is called Local Storage.
         currentWebEngineSettingsPointer->setAttribute(QWebEngineSettings::LocalStorageEnabled, Settings::domStorageEnabled());
 
         // Set the user agent.
diff --git a/src/windows/BrowserWindow.cpp b/src/windows/BrowserWindow.cpp
index 8d24171..acf72db 100644
--- a/src/windows/BrowserWindow.cpp
+++ b/src/windows/BrowserWindow.cpp
@@ -175,7 +175,7 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
     zoomFactorActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("zoom")));
     domainSettingsActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("settings-configure")));
     cookiesActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("preferences-web-browser-cookies")));
-    domStorageActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("view-web-browser-dom-tree")));
+    domStorageActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("code-class")));
 
     // Update the on-the-fly menus.
     connect(tabWidgetPointer, SIGNAL(updateUserAgentActions(QString, bool)), this, SLOT(updateUserAgentActions(QString, bool)));
-- 
2.47.2