Terminal.Gui icon indicating copy to clipboard operation
Terminal.Gui copied to clipboard

Fixes #3875. Add left and right tab sides with alignments to the TabView.

Open BDisp opened this issue 1 year ago • 2 comments

Fixes

  • Fixes #3875

Proposed Changes/Todos

  • [x] Add tabs on left and right with alignments feature. Note that alignments are only noticed on tabs on left and right because tabs on top and on bottom the tabs length are always justified to the text length.

Pull Request checklist:

  • [x] I've named my PR in the form of "Fixes #issue. Terse description."
  • [x] My code follows the style guidelines of Terminal.Gui - if you use Visual Studio, hit CTRL-K-D to automatically reformat your files before committing.
  • [x] My code follows the Terminal.Gui library design guidelines
  • [x] I ran dotnet test before commit
  • [x] I have made corresponding changes to the API documentation (using /// style comments)
  • [x] My changes generate no new warnings
  • [x] I have checked my code and corrected any poor grammar or misspellings
  • [x] I conducted basic QA to assure all features are working

BDisp avatar Dec 02 '24 02:12 BDisp

@tig there are 4 unit tests failing because the Clip is returning a empty region when the down arrow being draw. This only happen when it's needed to draw over the tab border, which could be possible because the down arrow super-view is the TabRow and not the last tab. Only when the selected tab is the last on the botton the down arrow is draw. I need your help to find what it's causing this failure, please. Here the unit tests failing:

Add_Three_TabsSide_Left_ShowInitialLine_False_ChangesTab_Height5

    Expected:
───────────────────┐
Tab1 hi            │
────╮              │
Tab2│              │
────▼──────────────┘
 But Was:
───────────────────┐
Tab1 hi            │
────╮              │
Tab2│              │
────╯──────────────┘

Add_Three_TabsSide_Left_ShowInitialLine_True_ChangesTab_Height5

Expected:
╭──────────────────┐
│Tab1 hi           │
├────╮             │
│Tab2│             │
╰────▼─────────────┘
 But Was:
╭──────────────────┐
│Tab1 hi           │
├────╮             │
│Tab2│             │
╰────╯─────────────┘

Add_Three_TabsSide_Right_ShowInitialLine_False_ChangesTab_Height5

Expected:
┌───────────────────
│hi             Tab1
│              ╭────
│              │Tab2
└──────────────▼────
 But Was:
┌───────────────────
│hi             Tab1
│              ╭────
│              │Tab2
└──────────────╰────

Add_Three_TabsSide_Right_ShowInitialLine_True_ChangesTab_Height5

Expected:
┌──────────────────╮
│hi            Tab1│
│             ╭────┤
│             │Tab2│
└─────────────▼────╯
 But Was:
┌──────────────────╮
│hi            Tab1│
│             ╭────┤
│             │Tab2│
└─────────────╰────╯

The strange is if there isn't enough space to add another tab an vertical line is added and the down arrow is draw. This issue only happens if the height fit exactly the tabs than can be currently visible.

────┐
Ta h│
──╮ │
  ▼─┘

┌────
│h Ta
│ ╭──
└─▼  

BDisp avatar Dec 02 '24 02:12 BDisp

It was a bug with the _rightDownScrollIndicator using the MoveSubviewToStart method instead of the MoveSubviewToEnd. Fixed in https://github.com/gui-cs/Terminal.Gui/pull/3876/commits/c93230689be4a4181e919b40f561a6e7f2d818f4.

BDisp avatar Dec 03 '24 22:12 BDisp