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;
// 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)
{
// 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;
}
}
// 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;
}
}
// 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;
}
}
{
// 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);
}
}
{
// 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.
<!-- Main layout. -->
<layout class="QHBoxLayout">
+ <!-- Left column. -->
<item>
<layout class="QVBoxLayout">
<!-- Domains list view. -->
</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>