Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #3499. Finishes Dim.Auto implementation #3615

Merged
merged 65 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
b64db9b
Fixed gitversion
tig Jul 11, 2024
bebf7c6
Fixed publish.yml
tig Jul 11, 2024
3650392
Merged with v2_develop
tig Jul 14, 2024
725855d
Removed accidental stuff
tig Jul 14, 2024
78ab7ec
Progress. WIP
tig Jul 14, 2024
e105643
Updated About box
tig Jul 15, 2024
58e4271
MessageBox works. Dialog broken
tig Jul 15, 2024
8bf0207
Dialog works
tig Jul 15, 2024
a3b606f
New unit tests. Lots of fixes
tig Jul 15, 2024
0c10d4b
More unit tests
tig Jul 15, 2024
f51e38d
Fixed TextFormatter.FormatAndGetSize for wide vertical text
tig Jul 16, 2024
06339c9
Fixed ShadowTests
tig Jul 16, 2024
ce5fc1c
Fixed ShadowTests
tig Jul 16, 2024
3b8319b
Added low-level TextFormatter.FormatAndGetSize tests
tig Jul 16, 2024
0e7e1e2
Fixed bogus Title test
tig Jul 16, 2024
e93eebb
Fixed little things.
tig Jul 17, 2024
dd6d96a
Undid PosCenter change
tig Jul 17, 2024
4654d4a
Undid PosCenter change
tig Jul 17, 2024
a30dbe7
Fixed broken Window test
tig Jul 17, 2024
f6064be
Fixed SetTextFormatterSize
tig Jul 17, 2024
d8bc511
Fixed Shortcut
tig Jul 17, 2024
e566dce
Fixed Horizontal FormatAndGetSize Fill issue; Vertical is still broken
tig Jul 17, 2024
b528ba8
Fixed Vertical FormatAndGetSize Fill issue
tig Jul 17, 2024
3708873
Removed lame title test
tig Jul 17, 2024
51433c0
Refactored DimAuto unit tests
tig Jul 17, 2024
2cecc77
WIP - Trying to make TextFormatter have indepdentent width/height
tig Jul 17, 2024
b4e1b3e
All unit tests pass.
tig Jul 18, 2024
48eba3b
Code cleanup
tig Jul 18, 2024
c4de9fe
Code cleanup
tig Jul 18, 2024
6c07532
Code cleanup
tig Jul 18, 2024
e4e2b59
Code cleanup
tig Jul 18, 2024
7733a69
Code cleanup
tig Jul 19, 2024
c119fc5
Updated DimAuto.md
tig Jul 19, 2024
ee57f41
Fixed @bdisp noted error
tig Jul 19, 2024
153f101
Fixed warnings
tig Jul 19, 2024
c6a9021
Fixed error in Textformatter
tig Jul 19, 2024
c537c34
doc tweak
tig Jul 19, 2024
23737de
rebased against v2_develop
tig Jul 19, 2024
6b5bcce
Fix typo in config.json
csinkers Jul 19, 2024
24e5fbd
Revert "Fix typo in config.json"
tig Jul 19, 2024
fa847f4
Revert "rebased against v2_develop"
tig Jul 19, 2024
4128b51
Merge branch 'v2_develop' into v2_3499-Finish-DimAuto
tig Jul 19, 2024
3ed3076
Addressed review feedback from @dodexahedron.
tig Jul 20, 2024
6550cde
Nuked Textformatter.AutoSize.
tig Jul 20, 2024
0e70444
Renamed Width/Height/Size
tig Jul 20, 2024
71e14c8
API doc improvements
tig Jul 20, 2024
4bdaef7
Nuked TextFormatter.CalcRect and unit tests
tig Jul 20, 2024
31ef0fc
Revamped Messagebox tests
tig Jul 20, 2024
c7ae986
Review feedback
tig Jul 20, 2024
8a8666c
Removed old comments
tig Jul 20, 2024
07d7bbb
reverted bad change
tig Jul 20, 2024
6c6244a
Updated DatePicker BUGBUG
tig Jul 20, 2024
ffc4136
Fixed ExpanderButton
tig Jul 20, 2024
c59f59a
Identified Dim.Auto bug with AnchorEnd
tig Jul 20, 2024
149bedf
Added more AnchorEnd unit tests.
tig Jul 20, 2024
bf852ff
Added BUGBUG
tig Jul 20, 2024
87c5a43
Undid previous change that broke StatusBar
tig Jul 20, 2024
6f9fb1a
Trying to debug @bdisp's About box issue
tig Jul 20, 2024
6da8dab
Trying to figure out aboutbox issue
tig Jul 20, 2024
0073156
added message box unit test for UI Catalog about box
tig Jul 20, 2024
d003d00
Removed verbatim strings
tig Jul 20, 2024
b2cd779
Use .ReplaceLineEndings() in TextFormatter
tig Jul 21, 2024
8ca972b
Learning how to use [CombinatorialData]
tig Jul 21, 2024
f0d4c48
Learning how to use [CombinatorialData] moar
tig Jul 21, 2024
2d2954d
Merge branch 'v2_develop' into v2_3499-Finish-DimAuto
tig Jul 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and publish API docs

on:
push:
branches: [main, v2_develop]
branches: [v1_release, v2_develop]

permissions:
id-token: write
Expand All @@ -17,11 +17,11 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout
if: github.ref_name == 'main' || github.ref_name == 'develop'
if: github.ref_name == 'v1_release' || github.ref_name == 'v1_develop'
uses: actions/checkout@v4

- name: DocFX Build
if: github.ref_name == 'main' || github.ref_name == 'develop'
if: github.ref_name == 'v1_release' || github.ref_name == 'v1_develop'
working-directory: docfx
run: |
dotnet tool install -g docfx
Expand All @@ -31,17 +31,17 @@ jobs:
continue-on-error: false

- name: Setup Pages
if: github.ref_name == 'main' || github.ref_name == 'develop'
if: github.ref_name == 'v1_release' || github.ref_name == 'v1_develop'
uses: actions/configure-pages@v5

- name: Upload artifact
if: github.ref_name == 'main' || github.ref_name == 'develop'
if: github.ref_name == 'v1_release' || github.ref_name == 'v1_develop'
uses: actions/upload-pages-artifact@v3
with:
path: docfx/_site

- name: Deploy to GitHub Pages
if: github.ref_name == 'main' || github.ref_name == 'develop'
if: github.ref_name == 'v1_release' || github.ref_name == 'v1_develop'
id: deployment
uses: actions/deploy-pages@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish Terminal.Gui

on:
push:
branches: [ main, develop, v2_release, v2_develop ]
branches: [ v1_release, v1_develop, v2_release, v2_develop ]
tags:
- v*
paths-ignore:
Expand Down
11 changes: 5 additions & 6 deletions GitVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ mode: ContinuousDeployment
tag-prefix: '[vV]'
continuous-delivery-fallback-tag: dev
branches:
develop:
v1_develop:
mode: ContinuousDeployment
tag: dev
regex: develop
regex: v1_develop
source-branches:
- main
- v1_release
pre-release-weight: 100

v2_develop:
Expand All @@ -32,9 +32,8 @@ branches:
tag-number-pattern: '[/-](?<number>\d+)'
regex: ^(pull|pull\-requests|pr)[/-]
source-branches:
- develop
- main
- release
- v1_develop
- v1_release
- v2_develop
- v2_release
- feature
Expand Down
12 changes: 10 additions & 2 deletions Terminal.Gui/Application/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ internal static List<CultureInfo> GetSupportedCultures ()
.ToList ();
}

/// <summary>
/// Gets the size of the screen. This is the size of the screen as reported by the <see cref="ConsoleDriver"/>.
/// </summary>
/// <remarks>
/// If the <see cref="ConsoleDriver"/> has not been initialized, this will return a default size of 2048x2048; useful for unit tests.
/// </remarks>
public static Rectangle Screen => Driver?.Screen ?? new (0, 0, 2048, 2048);
tig marked this conversation as resolved.
Show resolved Hide resolved

// When `End ()` is called, it is possible `RunState.Toplevel` is a different object than `Top`.
// This variable is set in `End` in this case so that `Begin` correctly sets `Top`.
private static Toplevel _cachedRunStateToplevel;
Expand Down Expand Up @@ -538,7 +546,7 @@ public static RunState Begin (Toplevel toplevel)
MoveCurrent (Current);
}

toplevel.SetRelativeLayout (Driver.Screen.Size);
toplevel.SetRelativeLayout (Screen.Size);

toplevel.LayoutSubviews ();
toplevel.PositionToplevels ();
Expand Down Expand Up @@ -607,7 +615,7 @@ internal static bool PositionCursor (View view)

// If the view is not visible within it's superview, don't position the cursor
Rectangle mostFocusedViewport = mostFocused.ViewportToScreen (mostFocused.Viewport with { Location = Point.Empty });
Rectangle superViewViewport = mostFocused.SuperView?.ViewportToScreen (mostFocused.SuperView.Viewport with { Location = Point.Empty }) ?? Driver.Screen;
Rectangle superViewViewport = mostFocused.SuperView?.ViewportToScreen (mostFocused.SuperView.Viewport with { Location = Point.Empty }) ?? Application.Screen;

if (!superViewViewport.IntersectsWith (mostFocusedViewport))
{
Expand Down
3 changes: 2 additions & 1 deletion Terminal.Gui/ConsoleDrivers/ConsoleDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public abstract class ConsoleDriver

// QUESTION: When non-full screen apps are supported, will this represent the app size, or will that be in Application?
/// <summary>Gets the location and size of the terminal screen.</summary>
public Rectangle Screen => new (0, 0, Cols, Rows);
internal Rectangle Screen => new (0, 0, Cols, Rows);
tig marked this conversation as resolved.
Show resolved Hide resolved

private Rectangle _clip;

Expand Down Expand Up @@ -426,6 +426,7 @@ public bool IsValidLocation (int col, int row)
/// <param name="row">Row to move to.</param>
public virtual void Move (int col, int row)
tig marked this conversation as resolved.
Show resolved Hide resolved
{
//Debug.Assert (col >= 0 && row >= 0 && col < Contents.GetLength(1) && row < Contents.GetLength(0));
Col = col;
Row = row;
}
Expand Down
4 changes: 2 additions & 2 deletions Terminal.Gui/Drawing/Glyphs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -442,13 +442,13 @@ public class GlyphDefinitions


/// <summary>Shadow - Vertical Start - Left Half Block - ▌ U+0258c</summary>
public Rune ShadowVerticalStart { get; set; } = (Rune)''; // Half: '\u2596' ▖;
public Rune ShadowVerticalStart { get; set; } = (Rune)''; // Half: '\u2596' ▖;
tig marked this conversation as resolved.
Show resolved Hide resolved

/// <summary>Shadow - Vertical - Left Half Block - ▌ U+0258c</summary>
public Rune ShadowVertical { get; set; } = (Rune)'▌';

/// <summary>Shadow - Horizontal Start - Upper Half Block - ▀ U+02580</summary>
public Rune ShadowHorizontalStart { get; set; } = (Rune)''; // Half: ▝ U+0259d;
public Rune ShadowHorizontalStart { get; set; } = (Rune)''; // Half: ▝ U+0259d;

/// <summary>Shadow - Horizontal - Upper Half Block - ▀ U+02580</summary>
public Rune ShadowHorizontal { get; set; } = (Rune)'▀';
Expand Down
6 changes: 4 additions & 2 deletions Terminal.Gui/Drawing/Thickness.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
/// </summary>
/// <param name="other"></param>
/// <returns></returns>
public readonly Thickness Add (Thickness other) { return new (Left + other.Left, Top + other.Top, Right + other.Right, Bottom + other.Bottom); }

Check warning on line 58 in Terminal.Gui/Drawing/Thickness.cs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest)

Call to non-readonly member 'Thickness.Left.get' from a 'readonly' member results in an implicit copy of 'this'.

Check warning on line 58 in Terminal.Gui/Drawing/Thickness.cs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest)

Call to non-readonly member 'Thickness.Top.get' from a 'readonly' member results in an implicit copy of 'this'.

Check warning on line 58 in Terminal.Gui/Drawing/Thickness.cs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest)

Call to non-readonly member 'Thickness.Right.get' from a 'readonly' member results in an implicit copy of 'this'.

Check warning on line 58 in Terminal.Gui/Drawing/Thickness.cs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest)

Call to non-readonly member 'Thickness.Bottom.get' from a 'readonly' member results in an implicit copy of 'this'.

Check warning on line 58 in Terminal.Gui/Drawing/Thickness.cs

View workflow job for this annotation

GitHub Actions / build_and_test (windows-latest)

Call to non-readonly member 'Thickness.Left.get' from a 'readonly' member results in an implicit copy of 'this'.

Check warning on line 58 in Terminal.Gui/Drawing/Thickness.cs

View workflow job for this annotation

GitHub Actions / build_and_test (windows-latest)

Call to non-readonly member 'Thickness.Top.get' from a 'readonly' member results in an implicit copy of 'this'.

Check warning on line 58 in Terminal.Gui/Drawing/Thickness.cs

View workflow job for this annotation

GitHub Actions / build_and_test (windows-latest)

Call to non-readonly member 'Thickness.Right.get' from a 'readonly' member results in an implicit copy of 'this'.

Check warning on line 58 in Terminal.Gui/Drawing/Thickness.cs

View workflow job for this annotation

GitHub Actions / build_and_test (windows-latest)

Call to non-readonly member 'Thickness.Bottom.get' from a 'readonly' member results in an implicit copy of 'this'.

Check warning on line 58 in Terminal.Gui/Drawing/Thickness.cs

View workflow job for this annotation

GitHub Actions / build_and_test (macos-latest)

Call to non-readonly member 'Thickness.Left.get' from a 'readonly' member results in an implicit copy of 'this'.

Check warning on line 58 in Terminal.Gui/Drawing/Thickness.cs

View workflow job for this annotation

GitHub Actions / build_and_test (macos-latest)

Call to non-readonly member 'Thickness.Top.get' from a 'readonly' member results in an implicit copy of 'this'.

Check warning on line 58 in Terminal.Gui/Drawing/Thickness.cs

View workflow job for this annotation

GitHub Actions / build_and_test (macos-latest)

Call to non-readonly member 'Thickness.Right.get' from a 'readonly' member results in an implicit copy of 'this'.

Check warning on line 58 in Terminal.Gui/Drawing/Thickness.cs

View workflow job for this annotation

GitHub Actions / build_and_test (macos-latest)

Call to non-readonly member 'Thickness.Bottom.get' from a 'readonly' member results in an implicit copy of 'this'.

/// <summary>Gets or sets the width of the lower side of the rectangle.</summary>
[JsonInclude]
Expand Down Expand Up @@ -190,12 +190,14 @@
if (View.Diagnostics.HasFlag (ViewDiagnosticFlags.Padding))
{
// Draw the diagnostics label on the bottom
string text = label is null ? string.Empty : $"{label} {this}";
var tf = new TextFormatter
{
Text = label is null ? string.Empty : $"{label} {this}",
Text = text,
Alignment = Alignment.Center,
VerticalAlignment = Alignment.End,
AutoSize = true
ConstrainToWidth = text.GetColumns (),
ConstrainToHeight = 1
};
tf.Draw (rect, Application.Driver.CurrentAttribute, Application.Driver.CurrentAttribute, rect);
}
Expand Down
Loading
Loading