4520 Commits

Author SHA1 Message Date
Myungchul Keum
b6b8caba1e
Add CAM16 based color scheme "Dimidium" (#18563)
Okay, here is a challenge for the default color scheme.

This PR adds the [Dimidium] color scheme.

Refs #17818
Refs #18502

I adjusted colors using CAM16. I prioritized lightness so that all
colors (especially blue) has appropriate contrast with the background.

[Brief information about the Dimidium color scheme](https://github.com/dofuuz/dimidium/blob/main/README.md)

[Detailed explanation on crafting the color scheme with CAM16](https://dofuuz.github.io/color/2024/03/17/dimidium-terminal-color-scheme.html)

[Dimidium]: https://github.com/dofuuz/dimidium
2025-02-20 15:16:40 -06:00
Marcus Tillmanns
d35c01344d
Remove outdated arg comment for _ClosePseudoConsoleMembers (#18586)
Since the argument no longer exists.
2025-02-20 20:20:57 +00:00
Windows Console Service Bot
13e7c9314d
Localization Updates - main - 02/13/2025 03:05:04 (#18569) 2025-02-18 18:07:25 -06:00
João Guerra
b8ff95d6b6
Remove duplicate entries from defaults.json (#18527)
- Remove duplicated entries.
- Fix whitespace.

Co-authored-by: João Guerra <joca-bt@users.noreply.github.com>
2025-02-12 10:06:43 -08:00
Windows Console Service Bot
f28f65870a
Localization Updates - Use Scheme Color 2025-02-08 00:42:10 +00:00
Windows Console Service Bot
8b78be5f4a
PDP Localization Updates - main - 02/04/2025 00:49:01 (#18504) 2025-02-04 19:27:22 -06:00
Carlos Zamora
7423dd3b2a
Fix missing icon and truncated text on NullableColorPicker (#18476)
Fixes an issue on Windows 10 where icon on selected color chips would be
missing in the NullableColorPicker.

Fixes (or at least significantly improves the experience) text being
truncated for the special colors in the NullableColorPicker. This was
done by removing the word "Use" from the labels and adding a visual
state trigger to change the layout of the chips and buttons when the
window becomes narrow.

Related to #18318
2025-02-04 11:07:58 -08:00
Dustin L. Howett
a24fdaa7b2
Move the Preview release notes to Stable, add new Preview release notes (#18503) 2025-02-03 16:31:22 -08:00
Leonard Hecker
e60acbc12a
Add Oklab based color scheme "Ottosson" (#18502)
Campbell has been the default color scheme for a long time now,
but it has quite some issues with hue and chroma.

This PR introduces a new scheme which was created using the Oklab
color space to find colors with maximal distance to each other
and well distributed and consistent hue and chroma.
Because of this, I've named the scheme after the creator of Oklab.
 
Closes #17818
2025-02-03 15:11:27 -08:00
James Holderness
b243fb6189
Improve quality of GDI image scaling (#18495)
When Sixel images are rendered, they're automatically scaled to match
the 10x20 cell size of the original hardware terminals. If this requires
the image to be scaled down, the default GDI stretching mode can produce
ugly visual artefacts, particularly for color images. This PR changes
the stretching mode to `COLORONCOLOR`, which looks considerably better,
but without impacting performance.

The initial Sixel implementation was added in PR #17421.

## Validation Steps Performed

I've tested with a number of different images using a small font size to
trigger the downscaling, and I think the results are generally better,
although simple black on white images are still better with the default
mode (i.e. `BLACKONWHITE`), which is understandable.

I've also checked the performance with a variation of the [sixel-bench]
test, and confirmed that the new mode is no worse than the default.

[sixel-bench]: https://github.com/jerch/sixel-bench
2025-02-03 22:46:26 +00:00
Éléa Dufresne
2e92a15464
Fix Ctrl+Insert does not copy the selected text from Command Palette (#18483)
Fixes an issue where pressing `CTRL` + `Insert` does not copy text
selected in the Command Palette. Instead, it closes it, and any text
selected in the pane is copied to the clipboard.

Since `Insert` is a virtual key, I address the issue by adding a
conditional check for `CTRL` with either `Insert` or `C` (previously, it
only checked for `CTRL` with `C`) for the copy action in the Command
Palette.

## Validation Steps Performed

I followed the reproduction steps and verified that the actual behaviour
matched the expected behaviour. All existing tests passed, but no new
test was added.

Closes #9520
2025-02-03 20:22:04 +00:00
Windows Console Service Bot
aafbd17f3d
Localization Updates - main - 01/31/2025 03:04:35 (#18484) 2025-02-03 13:42:24 -06:00
Dustin Howett
67ed65bd19 version: bump to 1.24 on main 2025-02-03 13:37:23 -06:00
Dustin L. Howett
bf074f3e40
Update Cascadia Code to 2407.24 (#18499)
This update fixes a hinting issue in Arabic glyphs.

See microsoft/cascadia-code#746 for more details.
2025-02-03 13:28:55 -06:00
Carlos Zamora
425d6b017a
Bugfix: only round to the nearest cell for selection (#18486)
## Summary of the Pull Request
Fixes a bug where VT mouse mode would round to the nearest cell when
clicking the mouse button.
The fix is to round to the nearest cell only when we're selecting text.
The other scenarios affected are:
- clicking on a hyperlink
- vt mouse mode
- where the context menu is anchored

Really the most notable ones were the first two. So now, we use the
position of the cell we clicked on. We only round for selection.

## References and Relevant Issues
Follow-up to #18106

## Detailed Description of the Pull Request / Additional comments

## Validation Steps Performed
Opened Midnight Commander in Ubuntu and clicked between the two panes.
- Before: threshold was too early to switch between panes
- After: threshold is clearly separated between the outline of the two
panes

---------

Co-authored-by: Dustin L. Howett <duhowett@microsoft.com>
2025-01-31 22:30:51 +00:00
Windows Console Service Bot
d6b56ae818
OSC 52 Localization Updates - main - 01/24/2025 03:05:35 (#18456) 2025-01-30 14:13:26 -08:00
Josh Johnson
27f775ee9e
Add the ability to show the tab bar in fullscreen (#18171)
This PR allows users to enable the tab bar in fullscreen mode.

A new setting; "showTabsFullscreen"; has been added which accepts a
boolean value. When `true`, then the tab bar will remain visible when
the terminal app is fullscreen. If the value is `false` (default), then
the tab bar is hidden in fullscreen.

When the tab bar is visible in fullscreen, the min/max/close controls
are hidden to maintain the expected behaviour of a fullscreen app.

## Validation Steps Performed
All unit tests are passing.

Manually verified that when the "launchMode" setting is "fullscreen" and
the "showTabsFullscreen" setting is `true`, the tab bar is visible on
launch.

Manually verified that changing the setting at runtime causes the tab
bar to be shown/hidden immediately (if the terminal is currently
fullscreen).

Manually verified that the new "showTabsFullscreen" setting is honoured
regardless of whether "showTabsInTitlebar" is set to `true` or `false`.

Closes #11130
2025-01-30 13:53:43 -08:00
Carlos Zamora
4da527c9b8
Fix SUI crash when image alignment not centered (#18481)
ConvergedAlignment stores vertical alignment to 0xF0 and horizontal
alignment to 0x0F. These were accidentally backwards!

Closes #18479
2025-01-30 13:28:42 -08:00
Tarang Janawalkar
8a806e0ac9
Clear up the schema description for experimental.rightClickContextMenu (#18388)
It did not cover all of the right-click behaviors.
2025-01-28 17:43:33 -06:00
Carlos Zamora
64d4fbab17
Make selection an exclusive range (#18106)
Selection is generally stored as an inclusive start and end. This PR
makes the end exclusive which now allows degenerate selections, namely
in mark mode. This also modifies mouse selection to round to the nearest
cell boundary (see #5099) and improves word boundaries to be a bit more
modern and make sense for degenerate selections (similar to #15787).

Closes #5099
Closes #13447
Closes #17892

## Detailed Description of the Pull Request / Additional comments
- Buffer, Viewport, and Point
- Introduced a few new functions here to find word boundaries, delimiter
class runs, and glyph boundaries.
- 📝These new functions should be able to replace a few other functions
(i.e. `GetWordStart` --> `GetWordStart2`). That migration is going to be
a part of #4423 to reduce the risk of breaking UIA.
- Viewport: added a few functions to handle navigating the _exclusive_
bounds (namely allowing RightExclusive as a position for buffer
coordinates). This is important for selection to be able to highlight
the entire line.
- 📝`BottomInclusiveRightExclusive()` will replace `EndExclusive` in the
UIA code
- Point: `iterate_rows_exclusive` is similar to `iterate_rows`, except
it has handling for RightExclusive
- Renderer
- Use `iterate_rows_exclusive` for proper handling (this actually fixed
a lot of our issues)
- Remove some workarounds in `_drawHighlighted` (this is a boundary
where we got inclusive coords and made them exclusive, but now we don't
need that!)
- Terminal
   - fix selection marker rendering
- `_ConvertToBufferCell()`: add a param to allow for RightExclusive or
clamp it to RightInclusive (original behavior). Both are useful!
- Use new `GetWordStart2` and `GetWordEnd2` to improve word boundaries
and make them feel right now that the selection an exclusive range.
- Convert a few `IsInBounds` --> `IsInExclusiveBounds` for safety and
correctness
   - Add `TriggerSelection` to `SelectNewRegion`
- 📝 We normally called `TriggerSelection` in a different layer, but it
turns out, UIA's `Select` function wouldn't actually update the
renderer. Whoops! This fixes that.
- TermControl
- `_getTerminalPosition` now has a new param to round to the nearest
cell (see #5099)
- UIA
- `TermControlUIAProvider::GetSelectionRange` no need to convert from
inclusive range to exclusive range anymore!
- `TextBuffer::GetPlainText` now works on an exclusive range, so no need
to convert the range anymore!

## Validation Steps Performed
This fundamental change impacts a lot of scenarios:
- Rendering selections
- Selection markers
- Copy text
- Session restore
- Mark mode navigation (i.e. character, word, line, buffer)
- Mouse selection (i.e. click+drag, shift+click, multi-click,
alt+click)
- Hyperlinks (interaction and rendering)
- Accessibility (i.e. get selection, movement, text extraction,
selecting text)
- [ ] Prev/Next Command/Output (untested)
- Unit tests

## Follow-ups
- Refs #4423
- Now that selection and UIA are both exclusive ranges, it should be a
lot easier to deduplicate code between selection and UIA. We should be
able to remove `EndExclusive` as well when we do that. This'll also be
an opportunity to modernize that code and use more `til` classes.
2025-01-28 16:54:49 -06:00
Dustin L. Howett
8e4da6e938
build: change how we find the latest VC tools version (#18468)
Apparently, we were using the package containing the CRT _source code_
to determine the version of the tools.

Also apparently, VS does not guarantee that that package has the same
version as the tools package.

We should use the version of the tools package instead.
2025-01-28 13:33:50 -08:00
Leonard Hecker
1040035b55
Reduce likelihood of races between stdout and cooked stdin reads (#18326)
As explained in the comment on `_getViewportCursorPosition`, printing
to stdout after initiating a cooked stdin reads is a race condition
between the application and the terminal. But we can significantly
reduce the likelihood of this being obvious with this change.

Related to #18265
Possibly related to #18081

## Validation Steps Performed

Execute the following Go code and start typing:
```go
package main

import (
	"fmt"
	"time"
)

func main() {
	go func() {
		time.Sleep(50 * time.Millisecond)
		fmt.Printf("Here is a prompt! >")
	}()

	var text string
	fmt.Scanln(&text)
}
```

Without this change the prompt will disappear,
and with this change in place, it'll work as expected. 
2025-01-27 14:37:04 -08:00
Dustin L. Howett
08f9afe315
Unify padding parsers, make SUI operate on struct Thickness (#18300)
The code in #17909 was not completely right for padding values with
fewer than four components, and it was doing some fragile string math
(that is: if you wanted to change the third element in the padding it
would parse out the whole thing, edit the third value, and then format
it again).

This pull request moves the control's padding parser into cppwinrt_utils
(for lack of a better place) and makes the settings UI use it to parse
the padding out into a `Thickness` as early as possible. Then, the
controls operate directly on the Thickness' members rather than parsing
the padding string again.

To handle two-way serialization properly, we also required a function
that converts a thickness back into a reduced string representation
(i.e. when all four values are N, it will return "N").

As a bonus, this pull request also:
- removes another use of `std::getline`
- fixes an issue where resetting the padding would change it
(infinitesimally) and cause it to be set again
- adds a readout of the current padding value in the expander itself
- removes `MaxValueFromPaddingString`, which was apparently unused
2025-01-24 17:17:41 -06:00
Windows Console Service Bot
1e00843598
Localization Updates - main - 01/22/2025 22:29:06 (#18452) 2025-01-23 18:39:43 -06:00
Dustin L. Howett
33556fb631
Let folks disable OSC 52 (#18449)
This pull request introduces a new profile setting,
`compatibility.allowOSC52`, which defaults to `true`. When disabled, it
will not allow applications to write to the clipboard.

Security-minded folks may choose to disable it.
2025-01-23 18:28:02 -06:00
Carlos Zamora
fb7b0e1218
Fix 'closeWindow' ignoring confirmation (#18434)
Reroutes the `closeWindow` action to use the `CloseWindow()` method like
the window's X button does. This includes logic to display the
confirmation dialog.

Also removes `CloseRequested` as it was only used by this action
handler. We already have `CloseWindowRequested` so we're just using that
instead.

## Validation Steps Performed
 `closeWindow` action while multiple tabs opened brings up the
confirmation dialog

Closes #17613
2025-01-24 00:24:49 +01:00
Carlos Zamora
51e21dd86a
[Windows 10] Fix layout in New Tab Menu page (#18424)
There's an existing WinUI bug where a nested Grid has it's star-sizing
ignored on Windows 10. This resulted in the New Tab Menu page looking
weird on Windows 10. This PR fixes the layout issue by applying a max
width to the first column, which will be clipped as necessary to make
space for the second column.

Part of #18281

## Validation Steps Performed
Validated the page looks good on Windows 10 and Windows 11, even after
resizing the window.
2025-01-21 18:22:20 -08:00
Carlos Zamora
3e969d53ee
Make SUI previews readable by screen readers (#18418)
Fixes a few accessibility bugs in the SettingContainer previews. Main
changes include:
- `SettingContainer` was considered a separate UIA element from the
inner expander. It's been marked as `AccessibilityView=Raw` to "remove"
it from the UIA tree.
- Added a `CurrentValueAccessibleName` property to the
`SettingContainer` to expose the current value to the screen reader for
`SettingContainer`s that have expanders. Non-expander
`SetttingContainer`s already worked fine.
- Applied `CurrentValueAccessibleName` to various settings throughout
the settings UI for full coverage. Added a `CurrentValue` for the ones
that were missing it.
- Removed a redundant/hidden tab stop in `Icon`

`Padding` was not updated since #18300 is handling that. This'll just
automatically make it accessible.
Font axes and features weren't updated to show previews, but I'm happy
to do it if given a suggestion.

Part of #18318

## Details
- `SettingContainer` updates:
- `AccessibilityView = Raw` for `SettingContainer`s with expanders. This
is because the expander itself is the one we care about. No need to have
another layer of UIA objects saying it's a group.
   - Added a `CurrentValueAccessibleName` property
- This specifically defines what should be read out by the screen
reader, similar to `AutomationProperties.Name`
      - It updates automatically when `CurrentValue` changes. 
      - It's applied on the inner `Expander`, if one exists.
- The accessible name is constructed to be `"<Header>:
<CurrentValueAccessibleName>"`. If `CurrentValueAccessibleName` isn't
provided, we try to use the `CurrentValue` if it's a string.
- Profile (and appearance) settings:
- `Icon`'s value is now read out by a screen reader instead of staying
silent. It'll read the icon path.
   - A redundant/hidden tab stop was removed from `Icon`.
   - `TabTitle` now displays/reads "None" if no tab title is set.
   - `ColorScheme` is now read out by a screen reader.
- The color scheme overrides (i.e. `Foreground`, `Background`,
`SelectionBackground`, and `CursorColor`) are now read out by a screen
reader. Format is "#<hex value>".
- `BackgroundImageAlignment` is now displayed and read out by a screen
reader.
- `LaunchSize` is now displayed and read out by a screen reader. Format
is "Width x Height".

## Validation Steps Performed
Tabbed through the settings UI with a screen reader. Each of these
settings now reads out a preview.
2025-01-21 18:21:30 -08:00
Leonard Hecker
b33bde1992
Fix dispatching of system keys (#18444)
This fixes the bit check for key down and adds a few comments.

Closes #18331

## Validation Steps Performed
Printing the resulting INPUT_RECORDs shows both key down and up events
when pressing F7. Alt-Space now also works again.
2025-01-21 20:48:51 +00:00
Leonard Hecker
c56fb1b2d2
Fix cursor hiding on input (#18445)
The CoreWindow approach to implementing this has proven itself to be bug
prone. This PR switches to using the much better Win32 ShowCursor API,
which uses a reference count. This prevents the exact sort of race
condition we have where we we disable the cursor in our code and the
WinUI code then sets it to a different cursor internally which gets the
system out of sync. There's no WinUI API to just hide the cursor and if
it did, it would probably be a Boolean which would result in the same
issue.

Closes #18400

## Validation Steps Performed
It's difficult to assert the correctness of this approach, outside of
just trying it out (which I did and it works). The good news is that
this uses a static bool to ensure we only hide it exactly once and show
it exactly once and we do the latter on every WM_ACTIVATE message which
should hopefully restore the cursor when tabbing out and back in at
least.
2025-01-21 13:56:50 -06:00
Javier
25392ea604
propsheet: add a CodeQL supression comment (#18431)
CodeQL is raising errors when building Visual Studio since they have a
dependency on Windows Terminal for our integrated terminal. The issue
raised by CodeQL refers to a non-constant string format, but in this
case the string comes from a resource file and should be considered
constant.
2025-01-15 14:57:54 -06:00
Dan Albrecht
8ddb14bd01
Update README to remove reference to submodules (#18427)
After #15855, this repo no longer uses submodules. Removing instruction
about needing to initialize them.
2025-01-14 17:53:58 -08:00
Carlos Zamora
3772fc3fc5
Fix tag for SessionBecameInteractive event (#18426)
Adds a description and keyword for the `SessionBecameInteractive` event

Follow-up from #17682
2025-01-15 00:35:29 +00:00
Evan Koschik
ba87ab52a7
conhost: fix WM_GETDPISCALEDSIZE to use provided size instead of current size (#18268)
The conhost window uses the window message WM_GETDPISCALEDSIZE to scale
its client rect non-linearly. This is done to keep the rows and columns
from changing when the window changes (font sizes scale non-linearly).
If you size the window such that the text perfectly fits the width (and
cursor is on the first row of the next line), dragging the window
between monitors with different DPIs should NOT change how much of the
text fits on each line.

https://learn.microsoft.com/en-us/windows/win32/hidpi/wm-getdpiscaledsize

The current code is assuming that the size that should be scaled is the
current window size. This is sometimes the case, for example when
dragging a window between monitors, but it is not always the case. This
message can sometimes contain a size that is different from the window's
current size. For example, if the window is maximized, minimized, or
snapped (the size in these cases is the normal rect, or restore rect).

The msdn page above does (now) call this out, though it is possible that
this was added after this conhost code was added...

> The LPARAM is an in/out pointer to a SIZE struct. The _In_ value in
the LPARAM is the pending size of the window after a user-initiated move
or a call to SetWindowPos.

If the window is being resized, this size is not necessarily the same as
the window's current size at the time this message is received.

This incorrect assumption can cause the conhost window to be
unexpectedly large/small in some cases. For example:

1. Requires two monitors, set to different DPIs.
2. Size window somewhat small, and type text to fit exactly the width of
the window, putting cursor on first row of next line.
3. Win+Left (or otherwise snap/arrange the window).
4. Win+Shift+Left (migrates the window to the other monitor)
5. Win+Shift+Down (restore window, can also click maximize caption
button twice, maximizing then restoring)

Expected: The window should restore to the original logical size, with
the text perfectly fitting one line.

Actual: The window restores to another size; it is the snapped size on
the original monitor (the size of the window at the time it was changing
DPI, in step 4 above).

## References and Relevant Issues

This message (WM_GETDPISCALEDSIZE) is not widely used, but it is used by
dialogs (user32!CreateDialog), since they also size their windows using
font sizes. The code in this change borrows from the code in the dialog
manager, user32!GetDialogDpiScaledSize.

## Detailed Description of the Pull Request / Additional comments

The WM_GETDPISCALEDSIZE message contains the new DPI and the new size,
which is an in/out parameter. It starts as the new window size, scaled
to the window's current DPI, and is expected to be scaled to the new
DPI.

The client area (the part with the text) is NOT scaled linearly. For
example, if the font at 100% DPI has a height of 7, it could have a
height of 15 at 200%. (And if it did have a height of 14, linearly
scaled, it would surely not be linearly scaled at 150%, since fonts
cannot have a height of 10.5.) To pick the right size, we need to
resolve the font at the new DPI and use its actual size to scale the
client area.

To keep the amount of text in the window the same, we need to remove the
non-client area of the window (caption bars, resize borders, etc). The
non-client area is outside the area with the text, and its size depends
on the window's DPI and window styles. To remove it and add it back, we
need to:

- Reduce the provided window rect size by the non-client size at the
current DPI.
 - Scale the client size using the new/old font sizes.
 - Expand the final size by the non-client size at the new DPI.
2025-01-10 16:43:03 -06:00
Dustin L. Howett
3e6690290f
Teach ServicingPipeline to paginate project board items (#18328)
Oops, it didn't support more than 100 items!
2025-01-08 15:35:40 -06:00
Dustin L. Howett
a3a4464667
build: add a couple more signing variables to ESRP (#18411)
This is in support of some identity changes we need to make.
2025-01-08 21:23:36 +00:00
YexuanXiao
b25fe55e94
Remove dependencies on unstable MSVC/STL extensions, comply w/ standards (#18334)
Fix some potential issues that may be exposed after upgrading the
compiler and dependencies. For detailed explanations, see the comments.
2025-01-06 16:15:41 -06:00
Leonard Hecker
7cd46c0397
Fix multiple regressions since #18215 (#18345)
Fixes
* Cursor vanishing, because
  ```cpp
  CoreWindow::GetForCurrentThread().PointerCursor()
  ```
  returned a non-null, but still invisible cursor.
* Alt/F7 not dispatching to newly created windows, because the
  `WM_ACTIVATE` message now arrives before the `AppHost` is initialized.
  This caused the messages to be delivered to old windows.
* Windows Terminal blocking expedited shutdown,
  because we return `FALSE` on non-`ENDSESSION_CLOSEAPP` messages.

Closes #18331
Closes #18335

## Validation Steps Performed
* Cursor still doesn't really vanish for me in the first place 
* Alt/F7 work in new windows without triggering old ones 
2025-01-06 15:41:19 -06:00
Mitch Capper (they, them)
c6e7f3244b
Fix Microsoft.Windows.Console.ConPTY package runtime identifiers #18387
win10-* is no longer a valid rid

https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/8.0/rid-graph

This package would fail to install the dependencies to the correct
location in .net 8 and later by default. win-x64 is a valid runtime id
in prior .net versions so I think this should be back compat.

Without this the package fails to do its job on newer builds unless `
<UseRidGraph>true</UseRidGraph>` and the user sets `win10-x64` as their
RID in their project file.
2025-01-06 13:39:58 -08:00
Windows Console Service Bot
441709e1e1
Localization Updates - main - 01/06/2025 17:49:30 (#18323) 2025-01-06 18:23:16 +00:00
Carlos Zamora
8598ed78d5
Add "Windows.Terminal.VisualStudio" to schema (#18322)
Closes #18037
2024-12-13 12:40:25 -08:00
Leonard Hecker
50060452ea
Pass foreground rights to the emperor (#18325)
Forgetti di spaghetti in #18215.

Closes #18324

## Validation Steps Performed

* Launch through the start menu
* Explicitly minimize
* Then...
  * Launch through the start menu again 
  * Launch via wtd.exe in Win+R 
  * Launch via wtd.exe in another Terminal 
  * Launch via handoff 
2024-12-13 18:13:03 +01:00
Javier
19460f98e0
Add CodeQL suppression comment to propsheet (#18315)
CodeQL is raising errors when building Visual Studio since we have a
dependency on Windows Terminal for our integrated terminal. The issue
raised is not applicable to this case and therefore requires a
suppression comment to ignore the raised error.
2024-12-12 15:38:21 -08:00
Carlos Zamora
8ef77fba3b
Add Profile.BellSound to Settings UI (#17983)
## Summary of the Pull Request
Adds the Profile.BellSound setting to the Settings UI under the Profile > Advanced page. 
- View changes:
   - The setting is exposed via an expander placed near the Profile.BellStyle setting.
   - Added a button to be able to preview the added sound
   - Added a browse button that opens a file picker
   - Added a delete button to be able to delete each sound entry
- View model changes:
   - `CurrentBellSounds` keeps track of the bell sounds added and exposed via the UI.
   - `BellSoundViewModel` wraps each sound. This allows us to listen (and propagate) changes to the registered sounds.
   - `BellSoundPreview` provides a written preview of the current bell sound to display in the expander

#10000
2024-12-12 22:44:32 +00:00
Leonard Hecker
8bbf00e054
Remove Monarch/Peasant & Make UI single-threaded (#18215)
As before, a minor refactor:
* I started off by removing the Monarch/Peasant with the goal of moving
  it into and deduplicating its functionality with `WindowEmperor`.
* Since I needed a replacement for the Monarch (= ensures that there's
  a single instance), I wrote single-instance code with a NT mutex
  and by yeeting data across processes with `WM_COPYDATA`.
* This resulted in severe threading issues, because it now started up
  way faster. The more I tried to solve them the deeper I had to dig,
  because you can't just put a mutex around `CascadiaSettings`.
  I then tried to seeif WinUI can run multiple windows on a single
  thread and, as it turns out, it can.
  So, I removed the multi- from the window threading.
* At this point I had dig about 1 mile deep and brought no ladder.
  So, to finish it up, I had to clean up the entire eventing system
  around `WindowEmperor`, cleaned up all the coroutines,
  and cleaned up all the callbacks.

Closes #16183
Closes #16221
Closes #16487
Closes #16532
Closes #16733
Closes #16755
Closes #17015
Closes #17360
Closes #17420
Closes #17457
Closes #17799
Closes #17976
Closes #18057
Closes #18084
Closes #18169
Closes #18176
Closes #18191

## Validation Steps Performed
* It does not crash 
* New/close tab 
* New/close window 
* Move tabs between windows 
* Split tab into new window 
* Persist windows on exit / restore startup 
2024-12-12 22:21:24 +01:00
Carlos Zamora
5132f9c553
Add nullable colors and improve Profile.Icon in settings UI (#17870)
## Summary of the Pull Request
Adds some pre-existing settings ($profile.foreground,
$profile.background, $profile.selectionBackground, $profile.cursorColor)
to the settings UI. This was accomplished by introducing a new control:
NullableColorPicker. This control allows the user to pick a color from
the color scheme, set the color to null, and select a color from an
advanced color picker.

Improves the UI for the Profile.Icon setting by adding an "Icon Type"
combo box. This allows the user to pick from multiple options:
- None: sets the icon to "none" which is interpreted as no icon
- Built-in Icon: presents a combo box that enumerates the Segoe MDL 2
assets
- Emoji: presents a text box with a hint to open the emoji picker
- File: presents a text box to input the path of the image to use

Additionally, the rendered icon is displayed in the setting container.
If "none", "none" is presented to the user (localized).

## References and Relevant Issues
#10000

## Detailed Description of the Pull Request / Additional comments
- NullableColorPicker control
- includes a built-in NullColorButton to set the current value to null
- includes a "More colors..." button to display an advanced color picker
- uses data templates on data templates (data templates squared?) to
convert the current color scheme into a grid of color chips
- color chips display a checkmark (similar to Windows settings
personalization). This automatically updates its color to stay compliant
with color contrast.
- color chips are added to a list so we can (un)check them when a new
color is selected
- SettingsContainer changes
- Forked `ExpanderSettingContainerStyle` to allow for a custom preview
template. This way, we can display the current value in the expander and
we're not just limited to text.
- changed type of `CurrentValue` property from `String` to
`IInspectable`
- added `CurrentValueTemplate` property to control how to display the
current value
- Miscellaneous:
- Added a few converters (`BooleanToVisibility`, `ColorToString`,
`ColorToBrush`)
- Added `NameWithHexCode` to `ColorTableEntry` to expose a color as `Red
#RRGGBB` (used for tooltips and a11y)
- Added `ForegroundPreview` (and equivalent for other colors) to
AppearanceViewModel to deduce the color that will be used

## Validation Steps Performed
- [X] a11y pass (NVDA, keyboard)
- [X] set the color to one of the color chips
- [X] set the color to null
- [X] set the color to a value from the integrated color picker
- [X] control updates properly when a new color scheme is selected
- [X] control updates properly when a color scheme has multiple colors
of the same value

## Follow-ups
- [A11y] Screen readers don't read expander's preview text
- Add Tab Color to settings UI
- Update CursorColor preview to display #FFFFFF as "invert"
- Use Leonard's font picker UI, with the Segoe icon picker, so that you
can filter the list
2024-12-12 20:30:54 +00:00
Windows Console Service Bot
bfab5fde4d
Localization Updates - main - 12/07/2024 03:05:36 (#18292) 2024-12-11 21:21:15 +00:00
Carlos Zamora
0b492aba51
Fix colored tab losing color when unselected (#18306)
If we colored a tab, then switched to another tab, there's a bug that
the unselected tab loses its color. This was introduced in PR #18109.
This PR fixes that by actually applying the selected color to the tab
(whoops). Additionally, I removed setting the
"TabViewItemHeaderCloseButtonBackground" resource because it looked
weird (see comment in PR).

Closes #18226
2024-12-11 10:23:24 -08:00
nukoseer
86a624517e
Add separate padding settings for left, top, right and bottom (#17909)
Left, Top, Right and Bottom paddings can be set separetely in
`Appearance`. I tried to make it as close as possible to one of the
suggestions in #9127. I hope it doesn't look that bad.

Closes #9127
2024-12-06 19:34:51 +01:00
Windows Console Service Bot
a41f915eda
Localization Updates - main - 12/06/2024 03:05:36 (#18282) 2024-12-06 12:32:57 -06:00