[utilities/konsole/release/24.05] /: Document line numbers overlay and add GUI method to configure
Kurt Hindenburg
null at kde.org
Wed Apr 24 01:04:24 BST 2024
Git commit f9e4400e197f1dfad7c05dcb4bae6a07219215b8 by Kurt Hindenburg, on behalf of Matan Ziv-Av.
Committed on 23/04/2024 at 23:53.
Pushed by hindenburg into branch 'release/24.05'.
Document line numbers overlay and add GUI method to configure
(cherry picked from commit 5dc05857f2f4c9e800181052f74dfbf0e7a89d0d)
M +24 -4 doc/manual/index.docbook
M +52 -0 src/widgets/EditProfileAdvancedPage.ui
M +13 -0 src/widgets/EditProfileDialog.cpp
https://invent.kde.org/utilities/konsole/-/commit/f9e4400e197f1dfad7c05dcb4bae6a07219215b8
diff --git a/doc/manual/index.docbook b/doc/manual/index.docbook
index 3ac99156a0..c93fb3cc90 100644
--- a/doc/manual/index.docbook
+++ b/doc/manual/index.docbook
@@ -52,8 +52,8 @@
<legalnotice>&FDLNotice;</legalnotice>
-<date>2023-04-25</date>
-<releaseinfo>KDE Gear 23.08</releaseinfo>
+<date>2024-04-23</date>
+<releaseinfo>KDE Gear 24.05</releaseinfo>
<abstract><para>&konsole; is &kde;'s terminal emulator.</para></abstract>
@@ -437,7 +437,7 @@ For other shells, such as fish, zsh, python, etc. consult the relevant program's
<title>Complex Text Layout</title>
<para>
-In the <guilabel>Complex Text Layout</guilabel> page of the <guilabel>Edit Profile</guilabel> dialog, you will find options that control
+In the <guilabel>Complex Text Layout</guilabel> tab of the <guilabel>Appearance</guilabel> page in the <guilabel>Edit Profile</guilabel> dialog, you will find options that control
the rendering of text.
</para>
@@ -490,11 +490,31 @@ Consider graphic table characters as strong LTR characters. This allows table co
Problematic characters follow Unicode standard, rather than glibc's wcwidth(). Currently only soft hyphen (Unicode 0x00AD) which has wcwidth of 1 and Unicode width of 0 is affected by this option. Generally, this option should be disabled when mainly using those characters on the command line, and enabled when they are only displayed.
</para></listitem>
-
</itemizedlist>
</para>
</sect1>
+<sect1 id="visualhints">
+<title>Visual Hints</title>
+<para>
+In addition to the various visual hints described in <xref linkend="semantic-shell-integration"/>, &konsole; has other visual hints:
+</para>
+
+<itemizedlist>
+<listitem><para>
+A vertical line at column 80 (or another). This is configured in the <guilabel>Miscellaneous</guilabel> tab of the <guilabel>Appearance</guilabel> page in the
+<guilabel>Edit Profile</guilabel> dialog.
+</para></listitem>
+
+<listitem><para> Line numbers may be displayed as an overlay of the terminal text. Line numbers appear in red on the right end of each line.
+The line are numbered consecutively from the first (top) line in the scrollback. Displaying the line numbers can be configured in
+the <guilabel>Advanced</guilabel> page in the <guilabel>Edit Profile</guilabel> dialog.
+Cycling between the three displayed mode can also be done by a keyboard shortcut. The default shortcut is
+<keycombo>&Ctrl;&Alt;<keycap>\</keycap></keycombo>
+</para></listitem>
+</itemizedlist>
+</sect1>
+
</chapter>
<chapter id="commandreference">
diff --git a/src/widgets/EditProfileAdvancedPage.ui b/src/widgets/EditProfileAdvancedPage.ui
index 61338fc7af..75b067b217 100644
--- a/src/widgets/EditProfileAdvancedPage.ui
+++ b/src/widgets/EditProfileAdvancedPage.ui
@@ -270,6 +270,52 @@
</item>
</layout>
</item>
+ <item row="20" column="0" alignment="Qt::AlignRight">
+ <widget class="QLabel" name="label_linenums">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Line Numbers:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="20" column="1">
+ <widget class="QRadioButton" name="lineNumsNever">
+ <property name="text">
+ <string comment="Never">Never</string>
+ </property>
+ <attribute name="buttonGroup">
+ <string notr="true">lineNums</string>
+ </attribute>
+ </widget>
+ </item>
+ <item row="21" column="1">
+ <widget class="QRadioButton" name="lineNumsURL">
+ <property name="text">
+ <string comment="When showing URL hints">When URL hints show</string>
+ </property>
+ <attribute name="buttonGroup">
+ <string notr="true">lineNums</string>
+ </attribute>
+ </widget>
+ </item>
+ <item row="22" column="1">
+ <widget class="QRadioButton" name="lineNumsAlways">
+ <property name="text">
+ <string comment="Always">Always</string>
+ </property>
+ <attribute name="buttonGroup">
+ <string notr="true">lineNums</string>
+ </attribute>
+ </widget>
+ </item>
<item>
<spacer>
<property name="orientation">
@@ -290,7 +336,13 @@
<tabstop>urlHintsModifierCtrl</tabstop>
<tabstop>urlHintsModifierAlt</tabstop>
<tabstop>urlHintsModifierMeta</tabstop>
+ <tabstop>lineNumsNever</tabstop>
+ <tabstop>lineNumsAlways</tabstop>
+ <tabstop>lineNumsURL</tabstop>
</tabstops>
+ <buttongroups>
+ <buttongroup name="lineNums"/>
+ </buttongroups>
<resources/>
<connections/>
</ui>
diff --git a/src/widgets/EditProfileDialog.cpp b/src/widgets/EditProfileDialog.cpp
index bbe4d8f097..131d16dc3d 100644
--- a/src/widgets/EditProfileDialog.cpp
+++ b/src/widgets/EditProfileDialog.cpp
@@ -1981,6 +1981,19 @@ void EditProfileDialog::setupAdvancedPage(const Profile::Ptr &profile)
_advancedUi->peekPrimaryWidget->setKeySequence(profile->peekPrimaryKeySequence());
connect(_advancedUi->peekPrimaryWidget, &QKeySequenceEdit::editingFinished, this, &EditProfileDialog::peekPrimaryKeySequenceChanged);
+
+ const ButtonGroupOptions lineNums = {
+ _advancedUi->lineNums, // group
+ Profile::LineNumbers, // profileProperty
+ false, // preview
+ {
+ // buttons
+ {_advancedUi->lineNumsNever, Enum::HintsNever},
+ {_advancedUi->lineNumsURL, Enum::HintsURL},
+ {_advancedUi->lineNumsAlways, Enum::HintsAlways},
+ },
+ };
+ setupButtonGroup(lineNums, profile);
}
int EditProfileDialog::maxSpinBoxWidth(const KPluralHandlingSpinBox *spinBox, const KLocalizedString &suffix)
More information about the kde-doc-english
mailing list