Add option to have close button on each tab
ClosedPublic

Authored by marssola on Dec 27 2018, 1:14 AM.

Details

Summary

Per VDG, allow closable tabs to have close buttons;
this adds this option while leaving the previous options.

Diff Detail

Repository
R319 Konsole
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 6509
Build 6527: arc lint + arc unit
marssola created this revision.Dec 27 2018, 1:14 AM
Restricted Application added a project: Konsole. · View Herald TranscriptDec 27 2018, 1:14 AM
Restricted Application added a subscriber: konsole-devel. · View Herald Transcript
marssola requested review of this revision.Dec 27 2018, 1:14 AM
marssola edited the summary of this revision. (Show Details)Dec 27 2018, 1:20 AM
marssola added a reviewer: tcanabrava.
ngraham added subscribers: hindenburg, ngraham.

+1 on the concept; having the close button off to the side always struck me as really weird and nonstandard.

-1 on the patch formatting. :) Can you follow @hindenburg's advice?

abetts added a subscriber: abetts.Dec 27 2018, 2:57 PM

Screenshot?

Screenshot?

ngraham requested changes to this revision.Dec 27 2018, 7:59 PM

Actually, now that I apply this, I don't see any new files being created, so sorry about the comment.

Functionally, it works fine! UI-wise, I think we need to change a few things. The current UI is a bit off:

I feel fairly strongly that this should not be an option and when close buttons are shown, they should always be on the tab rather than on the bar. But if this is just too controversial, the following UI would be an improvement:

New Tab button: [ ] Show
 Close buttons: (o) On each tab
                ( ) On the tab bar
                ( ) None

If it's absolutely imperative that a single checkbox control both the new tab and close button visibility, then we could do the following:

[] Show 'New Tab' and 'Close Tab' Buttons
    Close buttons: (o) On each tab
                   ( ) On the tab bar

...And the radio buttons would only be enabled when the checkbox above them was checked.

But again, I think it would be best to always show the close buttons on the individual tabs when close buttons are visible.

This revision now requires changes to proceed.Dec 27 2018, 7:59 PM

The labels and checkboxes are not starting with a verb. I think that can be reworked.

marssola updated this revision to Diff 48451.Dec 31 2018, 4:43 PM
  • Added option to show 'close tab' button on each tab in the tab bar, and does not display button. Added option for 'New tab'.
tcanabrava accepted this revision.Dec 31 2018, 5:02 PM

I think the New Tab icon should be "tab-new", not "document-new".

Looking great, now the text strings in the combobox just need to use Title Case.

I think the New Tab icon should be "tab-new", not "document-new".

+1

rizzitello added inline comments.Dec 31 2018, 5:23 PM
src/ViewContainer.cpp
73

To save you time looking for it the icon set here.

marssola updated this revision to Diff 48458.Dec 31 2018, 5:42 PM
  • Changed button 'document-new' to 'tab-new'

Looking great, now the text strings in the combobox just need to use Title Case.

I think the New Tab icon should be "tab-new", not "document-new".

+1

Changed

ngraham accepted this revision.Dec 31 2018, 9:03 PM
This revision is now accepted and ready to land.Dec 31 2018, 9:03 PM

The default should be None as it is now

For now the default can remain none, but I recommend we change the default to show a close button--if not in this patch, then in another one.

We are currently working on harmonizing the appearance and behavior of tabs throughout KDE software (T10233) and closable tabs needs close buttons. It's one of the ways that the tab communicates to the user that it's closable. Other KDE apps with closable tabs (Dolphin, Kate, KDevelop, Okteta, Okular) all have close buttons shown on their tabs. Konsole should too.

aacid added a subscriber: aacid.Jan 16 2019, 10:59 PM

Is it me or this patch no longer applies cleanly to master?

Works for me:

Checking patch src/settings/konsole.kcfg...
Checking patch src/settings/TabBarSettings.ui...
Checking patch src/ViewContainer.cpp...
Applied patch src/settings/konsole.kcfg cleanly.
Applied patch src/settings/TabBarSettings.ui cleanly.
Applied patch src/ViewContainer.cpp cleanly.
 OKAY  Successfully committed patch.

@ngraham is this accepted? I can't tel because of the talk after the last ok.

From my perspective yes, but now I can't apply it cleanly on current master either (or rather, I can't cleanly merge master into it):

$  (arcpatch-D17814) git pull --rebase origin master
From git://anongit.kde.org/konsole
 * branch              master     -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Applying: Added button to close the tab individually
Using index info to reconstruct a base tree...
M       src/ViewContainer.cpp
M       src/settings/TabBarSettings.ui
M       src/settings/konsole.kcfg
Falling back to patching base and 3-way merge...
Auto-merging src/settings/konsole.kcfg
Auto-merging src/settings/TabBarSettings.ui
CONFLICT (content): Merge conflict in src/settings/TabBarSettings.ui
Auto-merging src/ViewContainer.cpp
error: Failed to merge in the changes.

@marssola can you rebase on current master?

Also it would be nice to get @hindenburg's blessing too.

Can you rebase this please? A lot of the code has changed since Dec

hindenburg retitled this revision from Added button to close the tab individually to Add option to have close button on each tab.Feb 8 2019, 3:48 AM
hindenburg edited the summary of this revision. (Show Details)

@marssola are you still there? If you rebase this patch on current master so it applies again, we can continue reviewing it and hopefully get it landed.

marssola updated this revision to Diff 51404.Feb 11 2019, 11:52 AM

Rebase patch

ngraham accepted this revision.Feb 11 2019, 2:25 PM

Thanks a lot. :)

@hindenburg?

hindenburg accepted this revision.Feb 11 2019, 8:58 PM

Looks fine - thanks - we can leave the default as-is for now

This revision was automatically updated to reflect the committed changes.