diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2021-03-08 02:02:05 +0100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2021-03-08 02:23:16 +0100 |
| commit | 8b1ddcddbf85473982afa8ba1d4f23063bb56a38 (patch) | |
| tree | 0edfcb2196a21b5c05f2e9e5cf8c0bc51cc78b0c /src | |
| parent | afd25186e03d0d8f35e526acb300a6e43ed6ce41 (diff) | |
| download | kristall-8b1ddcddbf85473982afa8ba1d4f23063bb56a38.tar.gz | |
Restructures option dialog even more, adds option to strip '<nav>' tags.
Diffstat (limited to 'src')
| -rw-r--r-- | src/about/help.gemini | 53 | ||||
| -rw-r--r-- | src/dialogs/settingsdialog.cpp | 23 | ||||
| -rw-r--r-- | src/dialogs/settingsdialog.hpp | 4 | ||||
| -rw-r--r-- | src/dialogs/settingsdialog.ui | 454 | ||||
| -rw-r--r-- | src/kristall.hpp | 1 | ||||
| -rw-r--r-- | src/main.cpp | 3 | ||||
| -rw-r--r-- | src/renderers/htmlrenderer.cpp | 6 |
7 files changed, 301 insertions, 243 deletions
diff --git a/src/about/help.gemini b/src/about/help.gemini index 753d634..f273923 100644 --- a/src/about/help.gemini +++ b/src/about/help.gemini @@ -107,10 +107,6 @@ Kristall offers a vast amount of settings. You can style the documents to your l This tab contains an unsorted list of settings that allow you to tweak Kristalls behaviour. -[UI Theme] controls whether the Qt interface is displayed in a dark or a light theme. Selecting [Light] or [Dark] will use the provided Qt light/dark themes. [OS Default] will use your system theme. - -[Icon Theme] controls the specific icon set that the Qt interface will use. Usually, the default [Auto] option should be good enough, however for those using the [OS Default] UI theme, this option may be useful. - [Start Page] is the URL to the page that will be loaded for new tabs and windows. Default is [about:favourites]. [Search Engine] is the search engine to use when typing non-URLs in the URL bar. A handful of Gemini search engines are provided as a drop-down. If you would like to specify your own, specify it in a format similar to the following: @@ -125,20 +121,42 @@ Note the "%1" at the end of the URL. This is where search queries will be insert gemini://example2.com/search/another/%1 ``` -[Enabled Protocols] allows you to fine-tune which protocols are fetched by Kristall. By default, only Gemini is enabled, all other protocols are disabled. Disabled protocols are either not served, and produce an error message, or are forwarded to your OS handler for that URL scheme. +[Additional Toolbar Items] contains various additional toolbar items which some may find useful. -[Text Rendering] allows one to control whether Kristall parses text input files or not. This is usually set to [Fancy] which renders text/html, text/gemini, text/markdown and text/gophermap to a nice, hyperlinked display. When set to [Always plain text], Kristall will display all text/* files as plaintext files instead. This may be inconvenient, but necessary for misparsed sites. +* [Home] button opens the configured home page in the current tab. +* [New tab] button appears to the right of the tab bar. This simply adds a new tab to the current window. +* [Root] button takes you to the root directory of the current site. (See Menus>Navigation section for explanation of what this does). +* [Parent] button takes you to the parent directory of the current site. (See Menus>Navigation section for explanation of what this does). -[Enable text highlights] allows you to enable *bolding* and _underlining_ in text/gemini documents. Bolding **like this** also works. +[UI Theme] controls whether the Qt interface is displayed in a dark or a light theme. Selecting [Light] or [Dark] will use the provided Qt light/dark themes. [OS Default] will use your system theme. -[Gopher Map] allows you to chose a modern iconized style for gopher maps or, if you are an old schooler, just use a textual description of the item types in the map. +[Icon Theme] controls the specific icon set that the Qt interface will use. Usually, the default [Auto] option should be good enough, however for those using the [OS Default] UI theme, this option may be useful. + +[UI Density] controls the margin of the toolbar buttons. + +* [Compact] has a very low margin +* [Classic] has the original big margin + +[Enabled Protocols] allows you to fine-tune which protocols are fetched by Kristall. By default, only Gemini is enabled, all other protocols are disabled. Disabled protocols are either not served, and produce an error message, or are forwarded to your OS handler for that URL scheme. [Unknown Scheme] changes the behaviour how Kristall handles unknown/disabled URL schemes. [Use OS default handler] will invoke your OS default, [Display error message] will just pop up a message box and tell you that Kristall cannot handle this URL. -[Hidden files in file:// directories] determines whether hidden files will display in local directory listings (i.e file:// URLs which do not point to a specific document but rather a directory). +[Max. Number of Redirections] is a setting that allows you to restrict sites to redirect you only a certain number of times before erroring out. Setting this to 0 will disable redirections completely, displaying an error with the target URL. + +[Redirection Handling] allows you to fine-tune the way Kristall allows redirections. Each of the options defines if Kristall should ask you to allow the redirect or do it silently. [Ask for cross-scheme redirection] will pop up a message box if a host tries to redirect you from one URL scheme to another, e.g. when a web server redirects you from HTTP to HTTPS. [Ask for cross-host redirection] will pop up the message box for all redirections through host boundaries, e.g. when example.com redirects you to www.example.com. [Ask for cross-scheme or cross-host redirection] will enable both of the previous behaviours, asking when any cross-boundary redirection happens. [Ask for all redirections] will pop up a message box every time a server tries to redirect you, keeping you in full control over all redirections. [Silently redirect everything] is the exact oppositve of that, accepting all redirections without warning or notice. + +[Network Timeout] is the time a server is allowed to *not respond anything* before a error message appears. As long as a server dripples some bytes to Kristall, no timeout will happen, so having a slow or bad connection shouldn't yield timeouts. + +### Display + +This tabs contains tweaks you can apply to the display behaviour. Change text effects or rendering of documents. + +[Render emojis] allows you to toggle whether to render emojis using installed emoji fonts. Disabling this can help prevent text rendering issues due to emojis. Note that emojis are only supported in Kristall builds with Qt 5.13 or later. [URL bar highlights] sets whether the URL bar should use "fancy" highlights. The highlighting simply makes the domain of the site more prominent/visible, and the text around it slightly dimmed. This is purely a cosmetic feature. +[Text Rendering] allows one to control whether Kristall parses text input files or not. This is usually set to [Fancy] which renders text/html, text/gemini, text/markdown and text/gophermap to a nice, hyperlinked display. When set to [Always plain text], Kristall will display all text/* files as plaintext files instead. This may be inconvenient, but necessary for misparsed sites. + [Use typographer's quotes] sets whether to replace regular quotation marks, that is: ``` "these", and 'these' @@ -149,25 +167,22 @@ with fancy Unicode quotes, which include the following: ``` This is a purely cosmetic feature that may aid in readability. -[Render emojis] allows you to toggle whether to render emojis using installed emoji fonts. Disabling this can help prevent text rendering issues due to emojis. Note that emojis are only supported in Kristall builds with Qt 5.13 or later. - [ANSI Escape Sequences] determines the method of handling ANSI escape codes. This allows a document to alter some of the format (colour, etc) of text. * [Ignore] ignores ANSI sequences and leaves them in the text. This option will often create eyesores out of pages that have fancy ANSI art! * [Interpret (preformatted text only)] will allow Kristall to interpret ANSI escape sequences in *preformatted* text blocks. * [Strip] is a hybrid of the above. It strips ANSI sequences from the text, and displays the text normally, as if the escape sequences were not there. -[Max. Number of Redirections] is a setting that allows you to restrict sites to redirect you only a certain number of times before erroring out. Setting this to 0 will disable redirections completely, displaying an error with the target URL. +[Enable text highlights] allows you to enable *bolding* and _underlining_ in text/gemini documents. Bolding **like this** also works. -[Redirection Handling] allows you to fine-tune the way Kristall allows redirections. Each of the options defines if Kristall should ask you to allow the redirect or do it silently. [Ask for cross-scheme redirection] will pop up a message box if a host tries to redirect you from one URL scheme to another, e.g. when a web server redirects you from HTTP to HTTPS. [Ask for cross-host redirection] will pop up the message box for all redirections through host boundaries, e.g. when example.com redirects you to www.example.com. [Ask for cross-scheme or cross-host redirection] will enable both of the previous behaviours, asking when any cross-boundary redirection happens. [Ask for all redirections] will pop up a message box every time a server tries to redirect you, keeping you in full control over all redirections. [Silently redirect everything] is the exact oppositve of that, accepting all redirections without warning or notice. +[Gopher Map] allows you to chose a modern iconized style for gopher maps or, if you are an old schooler, just use a textual description of the item types in the map. -[Network Timeout] is the time a server is allowed to *not respond anything* before a error message appears. As long as a server dripples some bytes to Kristall, no timeout will happen, so having a slow or bad connection shouldn't yield timeouts. +[Hidden files in file:// directories] determines whether hidden files will display in local directory listings (i.e file:// URLs which do not point to a specific document but rather a directory). -[Additional Toolbar Items] contains various additional toolbar items which some may find useful. +[Strip <nav> from HTML pages] allows you to remove the <nav> tag from HTML pages. This might make certain pages more readable, others completly unusable. -* [Home] button opens the configured home page in the current tab. -* [New tab] button appears to the right of the tab bar. This simply adds a new tab to the current window. -* [Root] button takes you to the root directory of the current site. (See Menus>Navigation section for explanation of what this does). -* [Parent] button takes you to the parent directory of the current site. (See Menus>Navigation section for explanation of what this does). +### Cache + +Kristall employs a small cache system that makes forward/backward navigation much quicker. This tab provides controls to tweak the caching behaviour. [Total cache size limit] sets the total amount of memory that can be used by Kristall to cache pages. By default this is set to 500 KiB, but can be set to 0 to completely disable the caching system. The larger this number is, the more memory you are allowing Kristall to use. diff --git a/src/dialogs/settingsdialog.cpp b/src/dialogs/settingsdialog.cpp index d71c23e..f6d4728 100644 --- a/src/dialogs/settingsdialog.cpp +++ b/src/dialogs/settingsdialog.cpp @@ -91,11 +91,12 @@ SettingsDialog::SettingsDialog(QWidget *parent) : this->ui->redirection_mode->addItem(tr("Ask for all redirection"), int(GenericSettings::WarnAlways)); this->ui->redirection_mode->addItem(tr("Silently redirect everything"), int(GenericSettings::WarnNever)); - connect(this->ui->tabWidget, &QTabWidget::currentChanged, this, [this] (int index) { - if (index != 1) /* Style tab */ + connect(this->ui->tab_control, &QTabWidget::currentChanged, this, [this] (int index) { + if (this->ui->tab_control->widget(index) != this->ui->style_tab) return; - this->ui->style_scroll_area->setMinimumWidth(this->ui->style_scroll_layout->minimumSize().width() + this->ui->style_scroll_area->setMinimumWidth( + this->ui->style_scroll_layout->minimumSize().width() + this->ui->style_scroll_area->verticalScrollBar()->sizeHint().width()); }); } @@ -318,6 +319,12 @@ void SettingsDialog::setOptions(const GenericSettings &options) this->ui->urlbarhl_none->setChecked(true); } + if(this->current_options.strip_nav) { + this->ui->strip_nav_on->setChecked(true); + } else { + this->ui->strip_nav_off->setChecked(true); + } + if (kristall::EMOJIS_SUPPORTED && this->current_options.emojis_enabled) { this->ui->emojis_on->setChecked(true); @@ -953,3 +960,13 @@ void SettingsDialog::on_enable_unlimited_cache_life_clicked(bool checked) this->current_options.cache_unlimited_life = checked; this->ui->cache_life->setEnabled(!checked); } + +void SettingsDialog::on_strip_nav_on_clicked() +{ + this->current_options.strip_nav = true; +} + +void SettingsDialog::on_strip_nav_off_clicked() +{ + this->current_options.strip_nav = false; +} diff --git a/src/dialogs/settingsdialog.hpp b/src/dialogs/settingsdialog.hpp index e564157..9f996b1 100644 --- a/src/dialogs/settingsdialog.hpp +++ b/src/dialogs/settingsdialog.hpp @@ -172,6 +172,10 @@ private slots: void on_cache_life_valueChanged(int life); void on_enable_unlimited_cache_life_clicked(bool checked); + void on_strip_nav_on_clicked(); + + void on_strip_nav_off_clicked(); + private: void reloadStylePreview(); diff --git a/src/dialogs/settingsdialog.ui b/src/dialogs/settingsdialog.ui index 0103e18..e33ec43 100644 --- a/src/dialogs/settingsdialog.ui +++ b/src/dialogs/settingsdialog.ui @@ -33,71 +33,71 @@ </attribute> <layout class="QFormLayout" name="formLayout"> <item row="0" column="0"> - <widget class="QLabel" name="label_15"> + <widget class="QLabel" name="label_14"> <property name="text"> - <string>UI Theme</string> + <string>Start Page:</string> </property> </widget> </item> <item row="0" column="1"> - <widget class="QComboBox" name="ui_theme"/> + <widget class="QLineEdit" name="start_page"> + <property name="placeholderText"> + <string>about://blank</string> + </property> + </widget> </item> <item row="1" column="0"> - <widget class="QLabel" name="label_34"> + <widget class="QLabel" name="label_40"> <property name="text"> - <string>Icon Theme</string> + <string>Search engine:</string> </property> </widget> </item> <item row="1" column="1"> - <widget class="QComboBox" name="icon_theme"/> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="label_1"> - <property name="text"> - <string>UI Density</string> + <widget class="QComboBox" name="search_engine"> + <property name="editable"> + <bool>true</bool> </property> </widget> </item> - <item row="2" column="1"> - <widget class="QComboBox" name="ui_density"/> - </item> <item row="3" column="0"> - <widget class="QLabel" name="label_14"> + <widget class="QLabel" name="label_15"> <property name="text"> - <string>Start Page:</string> + <string>UI Theme</string> </property> </widget> </item> <item row="3" column="1"> - <widget class="QLineEdit" name="start_page"> - <property name="placeholderText"> - <string>about://blank</string> - </property> - </widget> + <widget class="QComboBox" name="ui_theme"/> </item> <item row="4" column="0"> - <widget class="QLabel" name="label_40"> + <widget class="QLabel" name="label_34"> <property name="text"> - <string>Search engine:</string> + <string>Icon Theme</string> </property> </widget> </item> <item row="4" column="1"> - <widget class="QComboBox" name="search_engine"> - <property name="editable"> - <bool>true</bool> + <widget class="QComboBox" name="icon_theme"/> + </item> + <item row="5" column="0"> + <widget class="QLabel" name="label_1"> + <property name="text"> + <string>UI Density</string> </property> </widget> </item> - <item row="5" column="0"> + <item row="5" column="1"> + <widget class="QComboBox" name="ui_density"/> + </item> + <item row="6" column="0"> <widget class="QLabel" name="label_16"> <property name="text"> <string>Enabled Protocols</string> </property> </widget> </item> - <item row="5" column="1"> + <item row="6" column="1"> <layout class="QHBoxLayout" name="horizontalLayout"> <item> <widget class="QCheckBox" name="enable_gemini"> @@ -142,82 +142,148 @@ </item> </layout> </item> - <item row="6" column="0"> - <widget class="QLabel" name="text_rendering_label"> + <item row="7" column="0"> + <widget class="QLabel" name="label_22"> <property name="text"> - <string>Text Rendering</string> + <string>Unknown Scheme</string> </property> </widget> </item> - <item row="6" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_5"> + <item row="7" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_7"> <item> - <widget class="QRadioButton" name="fancypants_on"> + <widget class="QRadioButton" name="scheme_os_default"> <property name="text"> - <string>Fancy</string> - </property> - <property name="checked"> - <bool>true</bool> + <string>Use OS default handler</string> </property> <attribute name="buttonGroup"> - <string notr="true">textRenderingBtnGroup</string> + <string notr="true">buttonGroup</string> </attribute> </widget> </item> <item> - <widget class="QRadioButton" name="fancypants_off"> + <widget class="QRadioButton" name="scheme_error"> <property name="text"> - <string>Always plain text</string> + <string>Display error message</string> </property> <attribute name="buttonGroup"> - <string notr="true">textRenderingBtnGroup</string> + <string notr="true">buttonGroup</string> </attribute> </widget> </item> </layout> </item> - <item row="7" column="0"> - <widget class="QLabel" name="text_highlight_label"> + <item row="8" column="0"> + <widget class="QLabel" name="label_26"> <property name="text"> - <string>Enable text highlights</string> + <string>Max. Number of Redirections</string> </property> </widget> </item> - <item row="7" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item row="8" column="1"> + <widget class="QSpinBox" name="max_redirects"> + <property name="value"> + <number>5</number> + </property> + </widget> + </item> + <item row="9" column="0"> + <widget class="QLabel" name="label_27"> + <property name="text"> + <string>Redirection Handling</string> + </property> + </widget> + </item> + <item row="9" column="1"> + <widget class="QComboBox" name="redirection_mode"/> + </item> + <item row="10" column="0"> + <widget class="QLabel" name="label_28"> + <property name="text"> + <string>Network Timeout</string> + </property> + </widget> + </item> + <item row="10" column="1"> + <widget class="QSpinBox" name="network_timeout"> + <property name="suffix"> + <string> ms</string> + </property> + <property name="minimum"> + <number>100</number> + </property> + <property name="maximum"> + <number>90000</number> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_29"> + <property name="text"> + <string>Additional toolbar buttons</string> + </property> + </widget> + </item> + <item row="2" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_99"> <item> - <widget class="QRadioButton" name="texthl_on"> + <widget class="QCheckBox" name="enable_home_btn"> <property name="text"> - <string>On (Experimental)</string> + <string>Home</string> </property> - <attribute name="buttonGroup"> - <string notr="true">textHighlightsBtnGroup</string> - </attribute> </widget> </item> <item> - <widget class="QRadioButton" name="texthl_off"> + <widget class="QCheckBox" name="enable_newtab_btn"> <property name="text"> - <string>Off</string> + <string>New tab</string> </property> - <property name="checked"> - <bool>true</bool> + </widget> + </item> + <item> + <widget class="QCheckBox" name="enable_root_btn"> + <property name="text"> + <string>Root (/)</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="enable_parent_btn"> + <property name="text"> + <string>Parent (..)</string> </property> - <attribute name="buttonGroup"> - <string notr="true">textHighlightsBtnGroup</string> - </attribute> </widget> </item> </layout> </item> - <item row="8" column="0"> + </layout> + </widget> + <widget class="QWidget" name="display_tab"> + <attribute name="title"> + <string>Display</string> + </attribute> + <layout class="QFormLayout" name="formLayout_3"> + <item row="4" column="0"> + <widget class="QLabel" name="ansi_label"> + <property name="toolTip"> + <string>Determine how to render ANSI escape sequences</string> + </property> + <property name="text"> + <string>ANSI Escape Sequences</string> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QComboBox" name="ansi_escapes"/> + </item> + <item row="6" column="0"> <widget class="QLabel" name="label_20"> <property name="text"> <string>Gopher Map</string> </property> </widget> </item> - <item row="8" column="1"> + <item row="6" column="1"> <layout class="QHBoxLayout" name="horizontalLayout_4"> <item> <widget class="QRadioButton" name="gophermap_icon"> @@ -228,7 +294,7 @@ <bool>true</bool> </property> <attribute name="buttonGroup"> - <string notr="true">gophermapBtnGroup</string> + <string notr="true">buttonGroup_7</string> </attribute> </widget> </item> @@ -238,276 +304,243 @@ <string>Use text only</string> </property> <attribute name="buttonGroup"> - <string notr="true">gophermapBtnGroup</string> + <string notr="true">buttonGroup_7</string> </attribute> </widget> </item> </layout> </item> - <item row="9" column="0"> - <widget class="QLabel" name="label_22"> + <item row="0" column="0"> + <widget class="QLabel" name="emojis_label"> + <property name="toolTip"> + <string>Whether to render emojis in a page.</string> + </property> <property name="text"> - <string>Unknown Scheme</string> + <string>Render emojis</string> </property> </widget> </item> - <item row="9" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_7"> + <item row="0" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_17"> <item> - <widget class="QRadioButton" name="scheme_os_default"> + <widget class="QRadioButton" name="emojis_on"> <property name="text"> - <string>Use OS default handler</string> + <string>On</string> </property> <attribute name="buttonGroup"> - <string notr="true">buttonGroup</string> + <string notr="true">buttonGroup_2</string> </attribute> </widget> </item> <item> - <widget class="QRadioButton" name="scheme_error"> + <widget class="QRadioButton" name="emojis_off"> <property name="text"> - <string>Display error message</string> + <string>Off</string> </property> <attribute name="buttonGroup"> - <string notr="true">buttonGroup</string> + <string notr="true">buttonGroup_2</string> </attribute> </widget> </item> </layout> </item> - <item row="10" column="0"> - <widget class="QLabel" name="label_23"> + <item row="1" column="0"> + <widget class="QLabel" name="label_24"> <property name="text"> - <string>Hidden files in file:// directories</string> + <string>URL bar highlights</string> </property> </widget> </item> - <item row="10" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_8"> + <item row="1" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_9"> <item> - <widget class="QRadioButton" name="show_hidden_files"> + <widget class="QRadioButton" name="urlbarhl_fancy"> <property name="text"> - <string>Show</string> + <string>Fancy</string> </property> <attribute name="buttonGroup"> - <string notr="true">hiddenFilesBtnGroup</string> + <string notr="true">buttonGroup_3</string> </attribute> </widget> </item> <item> - <widget class="QRadioButton" name="hide_hidden_files"> + <widget class="QRadioButton" name="urlbarhl_none"> <property name="text"> - <string>Hide</string> + <string>None</string> </property> <attribute name="buttonGroup"> - <string notr="true">hiddenFilesBtnGroup</string> + <string notr="true">buttonGroup_3</string> </attribute> </widget> </item> </layout> </item> - <item row="11" column="0"> - <widget class="QLabel" name="label_24"> + <item row="2" column="0"> + <widget class="QLabel" name="text_rendering_label"> <property name="text"> - <string>URL bar highlights</string> + <string>Text Rendering</string> </property> </widget> </item> - <item row="11" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_9"> + <item row="2" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_5"> <item> - <widget class="QRadioButton" name="urlbarhl_fancy"> + <widget class="QRadioButton" name="fancypants_on"> <property name="text"> <string>Fancy</string> </property> + <property name="checked"> + <bool>true</bool> + </property> <attribute name="buttonGroup"> - <string notr="true">urlbarBtnGroup</string> + <string notr="true">buttonGroup_4</string> </attribute> </widget> </item> <item> - <widget class="QRadioButton" name="urlbarhl_none"> + <widget class="QRadioButton" name="fancypants_off"> <property name="text"> - <string>None</string> + <string>Always plain text</string> </property> <attribute name="buttonGroup"> - <string notr="true">urlbarBtnGroup</string> + <string notr="true">buttonGroup_4</string> </attribute> </widget> </item> </layout> </item> - <item row="12" column="0"> - <widget class="QLabel" name="label_39"> - <property name="toolTip"> - <string>Replace single and double quotes with curly typographer quotes.</string> - </property> + <item row="5" column="0"> + <widget class="QLabel" name="text_highlight_label"> <property name="text"> - <string>Use typographer's quotes</string> + <string>Enable text highlights</string> </property> </widget> </item> - <item row="12" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_10"> + <item row="5" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> - <widget class="QRadioButton" name="fancyquotes_on"> + <widget class="QRadioButton" name="texthl_on"> <property name="text"> - <string>On</string> + <string>On (Experimental)</string> </property> <attribute name="buttonGroup"> - <string notr="true">quotesBtnGroup</string> + <string notr="true">buttonGroup_6</string> </attribute> </widget> </item> <item> - <widget class="QRadioButton" name="fancyquotes_off"> + <widget class="QRadioButton" name="texthl_off"> <property name="text"> <string>Off</string> </property> + <property name="checked"> + <bool>true</bool> + </property> <attribute name="buttonGroup"> - <string notr="true">quotesBtnGroup</string> + <string notr="true">buttonGroup_6</string> </attribute> </widget> </item> </layout> </item> - <item row="13" column="0"> - <widget class="QLabel" name="emojis_label"> - <property name="toolTip"> - <string>Whether to render emojis in a page.</string> - </property> + <item row="7" column="0"> + <widget class="QLabel" name="label_23"> <property name="text"> - <string>Render emojis</string> + <string>Hidden files in file:// directories</string> </property> </widget> </item> - <item row="13" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_17"> + <item row="7" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_8"> <item> - <widget class="QRadioButton" name="emojis_on"> + <widget class="QRadioButton" name="show_hidden_files"> <property name="text"> - <string>On</string> + <string>Show</string> </property> <attribute name="buttonGroup"> - <string notr="true">emojisBtnGroup</string> + <string notr="true">buttonGroup_8</string> </attribute> </widget> </item> <item> - <widget class="QRadioButton" name="emojis_off"> + <widget class="QRadioButton" name="hide_hidden_files"> <property name="text"> - <string>Off</string> + <string>Hide</string> </property> <attribute name="buttonGroup"> - <string notr="true">emojisBtnGroup</string> + <string notr="true">buttonGroup_8</string> </attribute> </widget> </item> </layout> </item> - <item row="14" column="0"> - <widget class="QLabel" name="ansi_label"> + <item row="3" column="0"> + <widget class="QLabel" name="label_39"> <property name="toolTip"> - <string>Determine how to render ANSI escape sequences</string> - </property> - <property name="text"> - <string>ANSI Escape Sequences</string> - </property> - </widget> - </item> - <item row="14" column="1"> - <widget class="QComboBox" name="ansi_escapes"/> - </item> - <item row="15" column="0"> - <widget class="QLabel" name="label_26"> - <property name="text"> - <string>Max. Number of Redirections</string> - </property> - </widget> - </item> - <item row="15" column="1"> - <widget class="QSpinBox" name="max_redirects"> - <property name="value"> - <number>5</number> - </property> - </widget> - </item> - <item row="16" column="0"> - <widget class="QLabel" name="label_27"> - <property name="text"> - <string>Redirection Handling</string> - </property> - </widget> - </item> - <item row="16" column="1"> - <widget class="QComboBox" name="redirection_mode"/> - </item> - <item row="17" column="0"> - <widget class="QLabel" name="label_28"> - <property name="text"> - <string>Network Timeout</string> - </property> - </widget> - </item> - <item row="17" column="1"> - <widget class="QSpinBox" name="network_timeout"> - <property name="suffix"> - <string> ms</string> - </property> - <property name="minimum"> - <number>100</number> - </property> - <property name="maximum"> - <number>90000</number> + <string>Replace single and double quotes with curly typographer quotes.</string> </property> - </widget> - </item> - <item row="18" column="0"> - <widget class="QLabel" name="label_29"> <property name="text"> - <string>Additional toolbar buttons</string> + <string>Use typographer's quotes</string> </property> </widget> </item> - <item row="18" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_99"> + <item row="3" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_10"> <item> - <widget class="QCheckBox" name="enable_home_btn"> + <widget class="QRadioButton" name="fancyquotes_on"> <property name="text"> - <string>Home</string> + <string>On</string> </property> + <attribute name="buttonGroup"> + <string notr="true">buttonGroup_5</string> + </attribute> </widget> </item> <item> - <widget class="QCheckBox" name="enable_newtab_btn"> + <widget class="QRadioButton" name="fancyquotes_off"> <property name="text"> - <string>New tab</string> + <string>Off</string> </property> + <attribute name="buttonGroup"> + <string notr="true">buttonGroup_5</string> + </attribute> </widget> </item> + </layout> + </item> + <item row="8" column="0"> + <widget class="QLabel" name="label_18"> + <property name="text"> + <string>Strip <nav> from HTML pages</string> + </property> + </widget> + </item> + <item row="8" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_11"> <item> - <widget class="QCheckBox" name="enable_root_btn"> + <widget class="QRadioButton" name="strip_nav_on"> <property name="text"> - <string>Root (/)</string> + <string>On</string> </property> + <attribute name="buttonGroup"> + <string notr="true">buttonGroup_9</string> + </attribute> </widget> </item> <item> - <widget class="QCheckBox" name="enable_parent_btn"> + <widget class="QRadioButton" name="strip_nav_off"> <property name="text"> - <string>Parent (..)</string> + <string>Off</string> </property> + <attribute name="buttonGroup"> + <string notr="true">buttonGroup_9</string> + </attribute> </widget> </item> </layout> </item> </layout> </widget> - <widget class="QWidget" name="display_tab"> - <attribute name="title"> - <string>Display</string> - </attribute> - </widget> <widget class="QWidget" name="cache_tab"> <attribute name="title"> <string>Cache</string> @@ -1538,29 +1571,13 @@ <tabstop>ui_theme</tabstop> <tabstop>icon_theme</tabstop> <tabstop>ui_density</tabstop> - <tabstop>start_page</tabstop> - <tabstop>search_engine</tabstop> <tabstop>enable_gemini</tabstop> <tabstop>enable_gopher</tabstop> <tabstop>enable_finger</tabstop> <tabstop>enable_http</tabstop> <tabstop>enable_https</tabstop> - <tabstop>fancypants_on</tabstop> - <tabstop>fancypants_off</tabstop> - <tabstop>texthl_on</tabstop> - <tabstop>texthl_off</tabstop> - <tabstop>gophermap_icon</tabstop> - <tabstop>gophermap_text</tabstop> <tabstop>scheme_os_default</tabstop> <tabstop>scheme_error</tabstop> - <tabstop>show_hidden_files</tabstop> - <tabstop>hide_hidden_files</tabstop> - <tabstop>urlbarhl_fancy</tabstop> - <tabstop>urlbarhl_none</tabstop> - <tabstop>fancyquotes_on</tabstop> - <tabstop>fancyquotes_off</tabstop> - <tabstop>emojis_on</tabstop> - <tabstop>emojis_off</tabstop> <tabstop>max_redirects</tabstop> <tabstop>redirection_mode</tabstop> <tabstop>network_timeout</tabstop> @@ -1646,13 +1663,14 @@ </connection> </connections> <buttongroups> - <buttongroup name="gophermapBtnGroup"/> <buttongroup name="buttonGroup"/> - <buttongroup name="quotesBtnGroup"/> - <buttongroup name="hiddenFilesBtnGroup"/> - <buttongroup name="textRenderingBtnGroup"/> - <buttongroup name="textHighlightsBtnGroup"/> - <buttongroup name="urlbarBtnGroup"/> - <buttongroup name="emojisBtnGroup"/> + <buttongroup name="buttonGroup_2"/> + <buttongroup name="buttonGroup_3"/> + <buttongroup name="buttonGroup_4"/> + <buttongroup name="buttonGroup_5"/> + <buttongroup name="buttonGroup_6"/> + <buttongroup name="buttonGroup_7"/> + <buttongroup name="buttonGroup_8"/> + <buttongroup name="buttonGroup_9"/> </buttongroups> </ui> diff --git a/src/kristall.hpp b/src/kristall.hpp index 950d811..4217d09 100644 --- a/src/kristall.hpp +++ b/src/kristall.hpp @@ -77,6 +77,7 @@ struct GenericSettings bool fancy_urlbar = true; bool fancy_quotes = true; bool emojis_enabled = true; + bool strip_nav = false; AnsiEscRenderMode ansi_escapes = AnsiEscRenderMode::render; // This is set automatically diff --git a/src/main.cpp b/src/main.cpp index fcc1803..9e98cc7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -741,6 +741,8 @@ void GenericSettings::load(QSettings &settings) fancy_quotes = settings.value("fancy_quotes", true).toBool(); + strip_nav = settings.value("strip_nav", false).toBool(); + emojis_enabled = kristall::EMOJIS_SUPPORTED ? settings.value("emojis_enabled", true).toBool() : false; @@ -809,6 +811,7 @@ void GenericSettings::save(QSettings &settings) const settings.setValue("show_hidden_files_in_dirs", show_hidden_files_in_dirs); settings.setValue("fancy_urlbar", fancy_urlbar); settings.setValue("fancy_quotes", fancy_quotes); + settings.setValue("strip_nav", strip_nav); settings.setValue("max_redirections", max_redirections); settings.setValue("redirection_policy", int(redirection_policy)); settings.setValue("network_timeout", network_timeout); diff --git a/src/renderers/htmlrenderer.cpp b/src/renderers/htmlrenderer.cpp index bc0385e..d0a8d54 100644 --- a/src/renderers/htmlrenderer.cpp +++ b/src/renderers/htmlrenderer.cpp @@ -3,6 +3,7 @@ #include "renderhelpers.hpp" #include "textstyleinstance.hpp" #include "gumbo.h" +#include "kristall.hpp" #include <QDebug> #include <QTextTable> @@ -126,9 +127,8 @@ static void renderRecursive(RenderState & state, GumboNode const & node, int nes return; case GUMBO_TAG_NAV: { - // TODO: Optionally strip navigation from sites - //if(true) - // return; + if(kristall::globals().options.strip_nav) + return; stream += "<nav>"; break; } |
