Warning, /network/angelfish/src/contents/ui/SettingsGeneral.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-FileCopyrightText: 2020 Rinigus <rinigus.git@gmail.com>
0002 // SPDX-FileCopyrightText: 2021 Jonah BrĂ¼chert  <jbb@kaidan.im>
0003 // SPDX-FileCopyrightText: 2021 Felipe Kinoshita <kinofhek@gmail.com>
0004 //
0005 // SPDX-License-Identifier: GPL-2.0-or-later
0006 
0007 import QtQuick.Controls 2.5 as Controls
0008 import QtQuick.Layouts 1.12
0009 
0010 import org.kde.kirigami 2.5 as Kirigami
0011 import org.kde.kirigamiaddons.formcard 1.0 as FormCard
0012 
0013 import org.kde.angelfish 1.0
0014 
0015 Kirigami.ScrollablePage {
0016     id: root
0017     title: i18n("General")
0018 
0019     leftPadding: 0
0020     rightPadding: 0
0021     topPadding: Kirigami.Units.gridUnit
0022     bottomPadding: Kirigami.Units.gridUnit
0023 
0024     Kirigami.Theme.colorSet: Kirigami.Theme.Window
0025     Kirigami.Theme.inherit: false
0026 
0027     ColumnLayout {
0028         spacing: 0
0029 
0030         FormCard.FormHeader {
0031             title: root.title
0032         }
0033 
0034         FormCard.FormCard {
0035             Layout.fillWidth: true
0036 
0037             FormCard.FormSwitchDelegate {
0038                 id: enableJavascript
0039                 text: i18n("Enable JavaScript")
0040                 description: i18n("This may be required on certain websites for them to work.")
0041                 checked: Settings.webJavaScriptEnabled
0042                 onClicked: Settings.webJavaScriptEnabled = checked
0043             }
0044 
0045             FormCard.FormDelegateSeparator { above: enableJavascript; below: loadImages }
0046 
0047             FormCard.FormSwitchDelegate {
0048                 id: loadImages
0049                 text: i18n("Load images")
0050                 description: i18n("Whether to load images on websites.")
0051                 checked: Settings.webAutoLoadImages
0052                 onClicked: Settings.webAutoLoadImages = checked
0053             }
0054 
0055             FormCard.FormDelegateSeparator { above: loadImages; below: enableAdblock }
0056 
0057             FormCard.FormSwitchDelegate {
0058                 id: enableAdblock
0059                 text: i18n("Enable adblock")
0060                 description: enabled ? i18n("Attempts to prevent advertisements on websites from showing.") : i18n("AdBlock functionality was not included in this build.")
0061                 enabled: AdblockUrlInterceptor.adblockSupported
0062                 checked: AdblockUrlInterceptor.enabled
0063                 onClicked: AdblockUrlInterceptor.enabled = checked
0064             }
0065 
0066             FormCard.FormDelegateSeparator { above: enableAdblock; below: openLinkSwitch }
0067 
0068             FormCard.FormSwitchDelegate {
0069                 id: openLinkSwitch
0070                 text: i18n("Switch to new tab immediately")
0071                 description: i18n("When you open a link, image or media in a new tab, switch to it immediately")
0072                 checked: Settings.switchToNewTab
0073                 onClicked: Settings.switchToNewTab = checked
0074             }
0075 
0076             FormCard.FormDelegateSeparator { above: openLinkSwitch; below: enableSmoothScrolling }
0077 
0078             FormCard.FormSwitchDelegate {
0079                 id: enableSmoothScrolling
0080                 text: i18n("Use Smooth Scrolling")
0081                 description: i18n("Scrolling is smoother and will not stop suddenly when you stop scrolling. Requires app restart to take effect.")
0082                 checked: Settings.webSmoothScrollingEnabled
0083                 onClicked: Settings.webSmoothScrollingEnabled = checked
0084             }
0085 
0086             FormCard.FormDelegateSeparator { above: enableSmoothScrolling; below: enableDarkMode }
0087 
0088             FormCard.FormSwitchDelegate {
0089                 id: enableDarkMode
0090                 text: i18n("Use dark color scheme")
0091                 description: i18n("Websites will have their color schemes set to dark. Requires app restart to take effect.")
0092                 checked: Settings.webDarkModeEnabled
0093                 onClicked: Settings.webDarkModeEnabled = checked
0094             }
0095         }
0096     }
0097 }