Commit Graph

304 Commits

Author SHA1 Message Date
Martin T. H. Sandsmark
25e07b7e20 Add support for dimming the colors when losing focus
Summary:
pretty vital (at least for me) if one doesn't have compositing.

we can't use the normal QPalette::Inactive because of color schemes,
but I made the new scrollbar color code follow the same dimming colors.

Test Plan:
tested with and without compositing, with and without scrollbar,
and dark and light color schemes.

Reviewers: hindenburg, #konsole

Reviewed By: hindenburg, #konsole

Subscribers: anthonyfieroni, konsole-devel, #konsole

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D16198
2018-10-27 16:21:27 -04:00
Lindsay Roberts
f5cc6d6c90 Restore new tab behavior
Summary:
As part of the QTabBar refactoring, honouring of the new tab behaviour
setting was lost. Restore using a simpler implementation that simply
asks QTabWidget for the current index.

BUG: 396701

Reviewers: #konsole, hindenburg, tcanabrava

Subscribers: konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D15828
2018-10-06 15:56:49 +03:00
Tomaz Canabrava
d77b991f3a Revert "Refactor Profile and ColorScheme"
This commit breaks sessionProfileCommandReceived
causing crashes in programs such as nvim.
I'm reverting it for now while I can't dig deeper.

This reverts commit 99f233b9a1.
2018-09-25 17:22:08 +02:00
Tomaz Canabrava
99f233b9a1 Refactor Profile and ColorScheme
Summary:
There's no point in returning null if we have a default
and we would check for null and query for the default
in all cases that we used it.

Export the private header ColorScheme

It's going to be used from Parts and App

Add ColorScheme() to the Profile

The profile used to hold the ColorScheme name, but if you
want to query for the ColorScheme you had to call ViewManager
but there's a class ColorSchemeManager that ViewManager used to call

Just make things simple:
- Profile has a colorScheme that it queries from the ColorSchemeManager
- Use profile->colorScheme() when you wanna something from the
colorScheme at the profile.

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D13854
2018-09-23 19:07:00 +02:00
Kurt Hindenburg
fb6c0eeed1 Add option to reverse URL hint numbering
Summary:
Adds option to reverse the order of URL hints such that the last URL
(the bottom-most one) has the number 1 and the numbers increase from
bottom to top.

This becomes particularly useful when watching a log or buffer, or in terminal
chat applications. Very often, the most useful URL is the most recent one and
if there are many (> 10) URLs on the screen, the desired one will not get a
hint. Reversing the numbering makes the most recent URL hint take the number 1,
while the oldest will have the highest number or no number at all.{F6244152}

{F6244154}

{F6244155}

Reviewers: #konsole, #vdg, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: hindenburg, ngraham, konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D15362
2018-09-18 09:41:14 -04:00
Tomaz Canabrava
6330bb82bb Fixes crashes related to closing tabs with splits
Summary:
If you moved the tabs to splits in a way that you have a different
number of tabs in each split, and started closing it, the count()
of the tabs would be different and we would hit an assert.

The fix is simple: don't separate the logic between tabEmpty and
tabDestroyed, if the tab is empty it will be destroyed but we can
treat everything in the tabEmpty signal, this way we will never hit
a dangling pointer.

Because of that it was possible that a splitView had a invalid
activeWidget for a microsecond, when it's deleting itself, so
instead of asserting if we have no active view, I choose to return
a empty list of properties.

Reviewers: hindenburg, ngraham, sandsmark

Reviewed By: hindenburg

Subscribers: konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D15379
2018-09-16 18:28:14 -04:00
Tomaz Canabrava
8fd74e8b74 Fix tab attach/reattach and simplify tab dnd code
Summary:
This continues the patch series of the rewrite
of the Tab handling code to a more modern approach
using QTabWidget.

This fixes the attach and reattach bug on multiple
konsole windows and reworks the drag & drop code
to a more simplified version of it.

Reviewers: hindenburg, ngraham, sandsmark

Reviewed By: hindenburg

Subscribers: lbergdoll, konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D15377
2018-09-16 12:48:29 -04:00
Kurt Hindenburg
f29ca068d4 move container usage after nullptr check 2018-07-25 10:13:07 -04:00
Tomaz Canabrava
8b377385ab Re-Enable --hide-tabbar and --show-tabbar
Summary:
Show tabbar and hide tabbar got lost in the transition to a modern
QTabBar, this re-enables them.  These options will override the
current settings if you use --hide-tabbar or --show-tabbar.
Changing these options in the settings will change these settings.

To use the current preferences just start konsole without --hide-tabbar
or --show-tabbar

Reviewers: #konsole, sandsmark, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: ngraham, konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D14294
2018-07-25 09:18:11 -04:00
Tomaz Canabrava
50cbc1d930 Fix option "Expand individual tab to full window"
Reviewers: #konsole, sandsmark, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D14296
2018-07-24 09:47:15 -04:00
Kurt Hindenburg
c5182b5e6f Revert back to using cmake variable ENABLE_DETACHING to fix build
Builds have been failing since this new QTabBar code was committed
since QOperatingSystemVersion::currentType() is Qt5.9+.  We currently
only require Qt5.6 and I don't want to change that just for this.
ENABLE_DETACHING is only set to false for MacOSX/Darwin.
2018-07-23 23:35:34 -04:00
Tomaz Canabrava
59b9fa5107 re-add detachTab 2018-07-17 10:11:48 +02:00
Tomaz Canabrava
93982ded1e Re-Enable detaching actions
(Detaching is still broken atm)
Move out of the CMake the check for crashes in detaching
It's better to check that in the code - I was quite lost
for a while on why there was a DETACHING_ENABLED definition
as it did not made sense
2018-07-17 10:11:48 +02:00
Tomaz Canabrava
b4ef40dfa1 Re enable close tabs, simplify code 2018-07-17 10:11:48 +02:00
Tomaz Canabrava
0e45cf0584 Connect to KonsoleSettings directly
Bypass boilerplate code, no need for that.
2018-07-17 10:11:48 +02:00
Tomaz Canabrava
83ebda5bf4 Use QTabBar: drop tons of code
Summary:
this is a WIP, I don't plan to merge this yet, there are many thigns to solve.

Drop the handmade TabWidget used inside of konsole in favor of Qt's QTabWidget
This drops tons of code we manually did, but it also drops a bit of functionality.

Missing features:
- Close Button
- New Tab on double click
- Drag'n Drop
- Detach

and lots of testing.

Subscribers: konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D13882
2018-07-17 10:11:48 +02:00
Kurt Hindenburg
274633a321 Revert "Simplify code dealing with creating new sessions."
This reverts commit e1f7107cc0.

This broke -e <cmd>.  Since this was just to simpify code, reverting
for now

BUG: 395555
2018-06-22 06:40:29 -04:00
Tomaz Canabrava
e1f7107cc0 Simplify code dealing with creating new sessions.
Summary:
Remove duplicated code in various places dealing
with starting new sessions.

Test Plan: open konsole, multiple tabs, closed, didn't crash, seems to work.

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D12968
2018-06-14 10:39:40 -04:00
Tomaz Canabrava
8c7d05f3a7 De duplicate setContainerFeatures
Reviewers: hindenburg, #konsole

Reviewed By: hindenburg, #konsole

Subscribers: ahmadsamir, konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D13428
2018-06-09 18:47:13 -04:00
Tomaz Canabrava
e15c57e3fa Simplify Apply Profile to View
Summary: Use c++'s casts to remove some unecessary logic.

Reviewers: hindenburg, #konsole

Reviewed By: hindenburg, #konsole

Subscribers: konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D13430
2018-06-09 18:26:42 -04:00
Tomaz Canabrava
5a3bfc6497 Simplify calls using a lambda
Reviewers: hindenburg, #konsole

Reviewed By: hindenburg, #konsole

Subscribers: konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D13431
2018-06-09 15:08:43 -04:00
Tomaz Canabrava
12fa4737ab Remove StackedViewContainer class
Summary:
StackedViewContainer is a plain view container with no navigiations.
It can be replaced using TabbedViewContainer and hiding the tabbar.
This will minimize duplicate code and allow easier control of code
in Konsole and KonsolePart.

Test Plan:
Run konsole and konsole part test, and then
use the shortcuts to create tab.

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: pedroarthurp, konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D12964
2018-05-23 18:10:15 -04:00
Tomaz Canabrava
58a9311bcb Modernize: Remove 'this->'
Summary:
This is not userfully, only adds more code and
the code is happy without it.

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: hindenburg, konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D12965
2018-05-22 21:48:00 -04:00
Ahmad Samir
6b1d799a51 Add profile property to toggle alternate scrolling
Summary:
Konsole sends up/down key press events to programs running in the shell
if they indicate they are not interested in mouse events. This adds a
profile property to toggle this behaviour.

BUG: 170582
FIXED-IN: 18.08

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: #konsole

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D12139
2018-04-12 20:46:00 -04:00
Kurt Hindenburg
b0e4e474a9 For QPointer do not compare to nullptr, use isNull() 2018-04-01 14:45:13 -04:00
Kurt Hindenburg
8b4cbcaf7a Use constuctor initialization list for all members 2018-04-01 11:30:45 -04:00
Kurt Hindenburg
b85c469efc Check for valid session when detaching to prevent crashes
It is unclear what causes the session to be invalid when detaching
tabs, but there are enough BRs with the same backtraces to confirm it.
For now, check to prevent crashes.

CCBUG: 390736
2018-03-07 23:00:24 -05:00
Kurt Hindenburg
caf0ab2b75 Add a profile property to toggle copying text as HTML
The default behavior hasn't change.  Toggling this off will cause all
copy/paste to be text only.

BUG: 387397
FIXED-IN: 18.04
Differential Revision: https://phabricator.kde.org/D10448
2018-02-14 14:40:23 -05:00
Kurt Hindenburg
c63525fcdc Add option to ColorScheme to blur transparent background
Note that this does not affect KonsolePart; it is up to the app using
it to enable transparency (see src/tests/demo_konsolepart).

Patch by anemeth

FEATURE: 198175
Differential Revision: https://phabricator.kde.org/D10015
2018-02-01 08:52:05 -05:00
Kurt Hindenburg
3805cb9d9d convert QSignalMapper (switchToTab shortcuts) to lambda 2018-01-09 09:14:25 -05:00
Kurt Hindenburg
6b990498e7 convert QSignalMapper (viewAdded/Removed) to lambda 2018-01-08 22:57:57 -05:00
Kurt Hindenburg
cf56e5db4c sync declarations with definitions (have .h and .cpp variable names match) 2018-01-06 14:32:02 -05:00
Kurt Hindenburg
2e86be05dc Implement support for trimming leading whitespace
There's already an option for removing trailing whitespace.

Combining both pulls since the later makes the code easier to read.

Patches by sandsmark

Differential Revision: https://phabricator.kde.org/D8381
Differential Revision: https://phabricator.kde.org/D8417
2017-12-25 11:30:35 -05:00
Kurt Hindenburg
52185790cb Fix menus after closing a detaching tab
Patch by ahmadsamir

BUG: 348478
Differential Revision: https://phabricator.kde.org/D9448
2017-12-23 12:05:02 -05:00
Kurt Hindenburg
001d937d10 Add option to allow tab width to be expanding
Qt5.9+ changed the way tab widths are handled.  Add option to allow
tab width to expanding to full window or as width of tab text.

GUI:
BUG: 380879
FIXED-IN: 17.12
2017-11-05 11:56:18 -05:00
Albert Astals Cid
374b602d52 Add new standard KDE tab switching shortcuts (ctrl+pgup/pgdn)
Summary:
BUG: 383603

Add the new KDE standard tab switching shortcuts that were introduced in https://phabricator.kde.org/R237:d85a57645f94d2d087711d7c608a0c5a46ed7ede.

Test Plan: Built and tested with current git master in up-to-date KDE Neon. Expected behavior is seen (default shortcuts have become shift+left/right and cmd+pgup/pgdn).

Reviewers: #kde_applications, #konsole, hindenburg, aacid, ltoscano, pino, dfaure

Reviewed By: dfaure

Subscribers: dfaure, davidedmundson, aacid, #konsole

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D7354
2017-08-28 01:01:37 +02:00
Kurt Hindenburg
8d27a2d388 Add new DBus method setCurrentSession
DBus slot that sets the current (active) session window using unique
session Id.

Differential Revision: https://phabricator.kde.org/D7066
2017-08-06 23:45:16 -04:00
Kurt Hindenburg
fa10e567ca change to use const_iterator 2017-08-06 23:33:12 -04:00
Kurt Hindenburg
c599242682 Add new DBus method sessionList
DBus slot that returns the unique ids of the sessions in the
current view.  The returned list is not sorted.

Differential Revision: https://phabricator.kde.org/D7067
2017-08-06 22:36:04 -04:00
Kurt Hindenburg
2a2a56d73c modernize use nullptr 2017-07-15 23:28:32 -04:00
Kurt Hindenburg
f360d02016 Add new DBus method newSession(profile)
This seems more useful then newSession(profile, directory) as the
working directory from the profile should be used.
A lot of duplicated code ATM.
2017-07-08 16:54:55 -04:00
Kurt Hindenburg
51cc49e95e Set KONSOLE_DBUS_WINDOW for new sessions started with DBus
BUG: 382116
2017-07-08 16:43:27 -04:00
R.J.V. Bertin
4cd725ffbe use the proper Mac platform token 2017-06-15 18:30:43 +02:00
Kurt Hindenburg
7d692e4446 uncrustify using kf5 config 2017-06-11 13:04:01 -04:00
Kurt Hindenburg
4db5fb89e7 More changes to QLatin1String, QLatin1Char and QStringLiteral 2017-05-08 10:12:49 -04:00
Kurt Hindenburg
59bdf59b24 remove unneeded includes 2017-04-26 22:52:07 -04:00
Kurt Hindenburg
eade05a4bd Do not specify Qt modules in includes 2017-04-26 21:33:34 -04:00
Kurt Hindenburg
a2b6a81b45 Add check for valid container (possible crash fix)
Possible fix for crashes from ambiguous shortcuts.  I have been unable
to duplicate the crashes.

CCBUG: 375540
2017-04-21 21:40:32 -04:00
Kurt Hindenburg
a540e6fdd0 Fix readability-implicit-bool-cast issues using nullptr 2017-04-21 10:51:31 -04:00
Kurt Hindenburg
ac8aedb3c6 Add Q_ASSERT/returns for _actionCollection
KXMLGUIClient->actionCollection() only returns a non NULL value so I
don't think these checks are needed but for now add Q_ASSERTs and
returns.  Previously, the if() didn't cover all the assignments.
2017-04-20 22:44:30 -04:00