Commit Graph

187 Commits

Author SHA1 Message Date
Juerd Waalboer
9dfcd62eba Calculate splitter sizes when child is removed
Has as sizeable comment because the cause and fix are non-obvious and
the fix is based on the underdocumented QSplitter::refresh().

BUG: 472641
2023-08-11 23:39:11 +00:00
Friedrich W. H. Kossebau
451ed33d63 Add explicit moc includes to sources for moc-covered headers
* speeds up incremental builds as changes to a header will not always
  need the full mocs_compilation.cpp for all the target's headers rebuild,
  while having a moc file sourced into a source file only adds minor
  extra costs, due to small own code and the used headers usually
  already covered by the source file, being for the same class/struct
* seems to not slow down clean builds, due to empty mocs_compilation.cpp
  resulting in those quickly processed, while the minor extra cost of the
  sourced moc files does not outweigh that in summary.
  Measured times actually improved by some percent points.
  (ideally CMake would just skip empty mocs_compilation.cpp & its object
  file one day)
* enables compiler to see all methods of a class in same compilation unit
  to do some sanity checks
* potentially more inlining in general, due to more in the compilation unit
* allows to keep using more forward declarations in the header, as with the
  moc code being sourced into the cpp file there definitions can be ensured
  and often are already for the needs of the normal class methods
2023-07-28 12:17:12 +00:00
Laurent Montel
e097910eeb Remove Designer's "." normaloff file data from icon properties in .ui files
Qt Designer (accidentally) injected "." file names as fallback when
setting theme icon names, which then results in generated code like:
    QIcon icon;
    QString iconThemeName = QString::fromUtf8("list-add");
    if (QIcon::hasThemeIcon(iconThemeName)) {
        icon = QIcon::fromTheme(iconThemeName);
    } else {
        icon.addFile(QString::fromUtf8("."), QSize(), QIcon::Normal, QIcon::Off);
    }
Such a "." file name is not documented to serve any purpose, just results
in failing icon lookup.
2023-07-19 19:37:49 +02:00
Tobias Fella
53d473cff3 Port to KF6 2023-05-29 16:17:23 +00:00
Waqar Ahmed
efb1686e62 Make konsole compile on windows 2023-03-09 11:16:35 +05:00
Matan Ziv-Av
60a534a2e7 codecNameTrigger's parameter is a QString, not QByteArray. 2023-02-26 12:28:35 +00:00
Matan Ziv-Av
0717268d03 Fix a typo in e98a6a19ff
the cases for version >= 5.103 and < 5.103 are reversed
2023-02-26 12:28:35 +00:00
Nicolas Fella
e98a6a19ff Port away from deprecated KCodecAction API 2023-02-24 01:05:24 +00:00
Matan Ziv-Av
feb44c226f Make behaviour of characters with problematic width configurable
Add a profile option to follow Unicode standard for the display width of
characters, where this width differs from glibc's wcwidth.

Currently the only character affected by this is soft hyphen (unicode 0x00ad).

Konsole generally follows wcwidth() function when determining the display
width of characters, since this is behaviour expected by libreadline, and
doing otherwise corrupts lines containing problematic characters. When such
characters are used more for display, then on the command line, following
the Unicode standard may be prefferable.

The default for this option is disabled - that is follow wcwidth().

CCBUG: 464823
2023-02-24 00:46:34 +00:00
Waqar Ahmed
ae1b05e629 Fix ASAN build failure with 2023-02-23 23:53:26 +00:00
Waqar Ahmed
0a78bfe4ac Fix inconsistent dll linkage errors and warnings on windows 2023-02-23 23:53:26 +00:00
Nicolas Fella
599d44b5bf Port away from deprecated KWindowSystem::compositingActive 2023-02-15 22:45:14 +00:00
Nicolas Fella
659bf0814b Fix applying default encoding in profile editor 2023-01-02 14:52:16 +00:00
Fabian Vogt
53c3839e60 Fix saving new profiles
When using the "Apply" button in the "Create new profile" dialog, the profile
was saved but the dialog remained in the "new profile" state. This meant that
when clicking on "Apply" again or accepting the dialog, it saved the profile
from scratch instead of editing the existing one. The ProfileManager
interpreted that as a rename because the "Name"/"UntranslatedName" properties
were set and decided to delete the profile at its "old" (== current) path.

BUG: 460383
2022-12-27 16:59:52 +00:00
Matan Ziv-Av
5362bd97f4 Set half page scrolling when the user selects this in the profile edit dialog
BUG: 462971
2022-12-13 19:18:46 +02:00
Matan Ziv-Av
655f3c115e Add four profile checkboxes to control rendering options
- Word mode to render (some) words with one drawText() call, instead of
  one per character.
- Ascii - to render words of ASCII characters
- Brahmic - to render words of Brahmic scripts characters.
- Option to consider attribute (color, bold, etc.) as word boundary.
2022-11-08 00:32:56 +00:00
Matan Ziv-Av
43641e27b9 Allow configuring of hinting mode for four new semantic visual hints. 2022-10-30 16:31:59 +00:00
Tomaz Canabrava
15bb0100e5 Do not allow the user to click on apply for new profiles
For some reason the profile is being deleted when the user
clicks on "Ok" after clicking on "Apply" only for new profiles.
2022-10-16 16:14:41 +00:00
Kurt Hindenburg
41ae51e01b Allow default displayVerticalLineAtColumn > 99 to 999
BR: 456054
2022-10-01 21:02:29 -04:00
Kurt Hindenburg
6ff683d5d2 Spelling fixes 2022-09-30 14:04:38 -04:00
Laurent Montel
c450e754c7 Add QMenu include needs in qt6 2022-09-28 04:50:24 +00:00
Laurent Montel
2ddb680bee Remove unused includes 2022-09-28 04:50:24 +00:00
Matan Ziv-Av
274ebb9887 Add keyboard shortcut for toggling display of semantic hints 2022-09-05 07:06:49 +00:00
Matan Ziv-Av
76f879cd70 Draw characters in exact positions
QT can't be made to draw monospaced text (if the font does not cooperate),
so avoid combining characters, using a QPainter::drawText() call for each
character.

For bidi text support this change requires konsole to reorder and reshape
the characters. This is done using the ICU library (which QT also uses).

This change allows for some improvements related to text rendering:

- More precise bidi reordering, which is no longer changed by characters'
  attributes and selection.
- underlines drawn separately from the text, allowing for differing
  underline modes (double, curly, dashed, dotted, colored).
- Overriding font for emoji characters.

This commit fixes a few bugs and addresses a lot more:

Feature requests: More standard conforming RTL and various underlines:
BUG: 403729
BUG: 387811

Using non-monospace font:
BUG: 416508
BUG: 452087
BUG: 425973
BUG: 430822
BUG: 442742
BUG: 441037
BUG: 430822



Emoji:
BUG: 440070
CCBUG: 450017
CCBUG: 445846
CCBUG: 453086

Regression: devanagari rendering
CCBUG: 381593
CCBUG: 451716
2022-08-26 19:24:56 +00:00
Ahmad Samir
295d42a4ca Reuse the same _tempProfile in Edit dialog and clear its properties
Also in save() just clear _previewedProperties; logically it wouldn't be
holding any properties that weren't set on _tempProfile, since all those
properties have been saved by the changeProfile() call, clear() makes
sense.
2022-08-15 23:11:12 +02:00
Ahmad Samir
f37fbc1aea Remove a redundant method from EditProfileDialog 2022-08-15 23:11:12 +02:00
Ahmad Samir
364ece1de0 Use Profile::PropertyMap in EditProfileDialog
This simplifies the code a bit.
2022-08-15 23:11:12 +02:00
Ahmad Samir
6a341a520c Preview ColorScheme changes like other Profile Properties
The difference is the preview isn't triggered on hover, you now have to
select a color scheme in the model to trigger a preview.

The font selection dialog works the same way (i.e. select to preview, not
just hover), and that seems to work quite well.
2022-08-15 23:11:12 +02:00
Ahmad Samir
d6706efc43 Change Profile::PropertyMap to a std::map
This fixes an issue with QHash in Qt6, see:
https://invent.kde.org/utilities/konsole/-/issues/30
2022-08-15 23:11:09 +02:00
Ahmad Samir
9bc2211ffb Rename Profile::setProperties() to properties()
That sounds more like a getter, which is what that method is.

(I plan to add a setProperties() method that takes a PropertyMap arg).
2022-08-12 22:10:11 +02:00
Ahmad Samir
50f87107bd Use a type alias for the Profile Property map 2022-08-12 22:10:11 +02:00
Matan Ziv-Av
ccd56f20a6 Add click to position cursor in shell input
- Conditional on a profile option.
- Visually improve semantic integration options tab.
- Save/load semantic integration
2022-07-12 11:49:24 +00:00
Matan Ziv-Av
7f6d100904 Add profile options to enable semantic integration options
- The line separating commands may appear never, always, or when showing
  URL hints.
- Up/Down arrows may be translated to a number of Left/Right arrows.

A UI for those options was also added.
2022-07-12 11:49:24 +00:00
Harald Sitter
87e27eb811 automatic clang-format run (clang 14) 2022-07-11 11:43:02 +02:00
Luis Javier Merino Morán
25f49b723d Support XdgActivation for focus from notification
To support focusing a session from a notification in Wayland, we need to
use the XdgActivation protocol.  This is done by passing to
KWindowSystem an XDG activation token that we get from the notification.
2022-07-05 09:04:52 +00:00
Luis Javier Merino Morán
8fb6899389 Focus session from notification
Adds a "Show session" button to notifications, which, when clicked, will
focus the originating session.

Original patch by Kasper Laudrup at bug 305162, then updated by Martin
T. H. Sandsmark.

Now updated and extended to silence/activity/process termination
notifications, adding support for focusing a TerminalDisplay inside a
hierarchy of ViewSplitters inside a TabbedViewContainer, and using
KWindowSystem::forceActiveWindow() instead of ::activateWindow().

BUG: 305162
BUG: 344208
2022-07-05 09:04:52 +00:00
Laurent Montel
73eb17ce9f Fix warning about not existing widget 2022-06-24 07:56:46 +02:00
Ahmad Samir
7b89ba176c Port away from KNewStuff deprecated API 2022-06-01 14:35:49 +00:00
Ahmad Samir
806bd5a0d9 Port away from deprecated Qt API 2022-06-01 14:35:49 +00:00
Ahmad Samir
46768ea173 Fix includes for Qt6
GIT_SILENT
2022-06-01 14:35:49 +00:00
Ahmad Samir
b3bfed5ab1 Fix includes with respect to QMetaObject
Looks like Q6MetaObject has a requirement that types are fully defined to
be used, so we have to add more explicit #include's.
2022-06-01 14:35:49 +00:00
Luis Javier Merino Morán
836b1d9814 Selecting past last char -> extend to last column
When selecting past the last character, extend the selection to the last
column.  This allows the user to know when the selection has extended
past the last character on a line, even in the presence of trailing
spaces, and will get a newline added to the last line.

This is the behavior of xterm, VTE and rxvt.  mlterm doesn't allow
selections to extend past the last non-space character on a line.

BUG: 413426
CCBUG: 158726
2022-05-26 08:12:52 +00:00
ivan tkachenko
fca0f4f9d7 Rename "fallback" profile to Built-in
* Rename everything related to built-in profile both in code and UI.

* Unified style for [Read-only] and [Default] badges in profile
  manager's list model.

* Change --fallback-profile option to --builtin-profile.

* Backward compatibility: yes. If a user happened to name their
  profile "Built-in", it would continue to work as normal, and even
  load with `--profile "Built-in"` command line flag. It will let them
  modify any property including Name; but changing the name back
  to "Built-in" shows a warning and reverts the change as usual.

* Remove "This option is a shortcut for" sentence. While it is still
  technically possible to pass built-in profile's magic path, this
  option is not a shortcut, nor implemented as such.

* Delete extra naming conditions in ProfileManager::changeProfile,
  because they could never be triggered anyway, due to pre-flight
  checks in EditProfileDialog::isProfileNameValid. Automatic unique
  profile names generation has been done even earlier in either
  SessionController or ProfileSettings. Just as before, users will
  continue experiencing a generic "A profile with the name \"%1\"
  already exists." message.

Tests:

* Improve test for uncreatable file name of built-in profile.

* Add backward compatibility test for loading existing profile
  named "Built-in" which also references real built-in as its parent.

BUG: 438309
2022-05-25 11:15:17 +00:00
Ahmad Samir
dc353e8f20 Minor cleanup 2022-05-24 13:02:59 +00:00
Ahmad Samir
33b3a1a7a7 Port away from using QObject::sender()
By passing the sender object as an arg to the signal/slot.
2022-05-24 13:02:59 +00:00
Nicolas Fella
b621d0c0e5 Improve settings name for color preview
The current name is not descriptive at all

The setting is still buried rather deep, but at least it has a somewhat better name now

BUG: 454034
2022-05-23 11:03:53 +00:00
Ahmad Samir
f813c33415 Fix KStatefulBrush include when building without deprecated code
It's been split to a separate header in KConfigWidgets 5.93.
2022-05-18 11:33:38 +02:00
Ahmad Samir
fb44a54349 Initialize members in-class where possible
- Default constructed Profile::Ptr is null
- QHash is empty by default
2022-05-08 00:56:44 +00:00
Ahmad Samir
b470e91ae0 Minor cleanup 2022-04-27 20:18:04 +00:00
Ahmad Samir
f2f860d53e Port from I18N_NOOP to KLazyLocalizedString 2022-04-27 20:18:04 +00:00