Skip to content

Commit 09bcdc0

Browse files
committed
Merge branch 'main' into dev/cazamor/sui/search
2 parents 2664418 + 8f3d1d8 commit 09bcdc0

20 files changed

+176
-61
lines changed

.github/actions/spelling/expect/expect.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,7 @@ Mypair
10641064
Myval
10651065
NAMELENGTH
10661066
namestream
1067+
NCACTIVATE
10671068
NCCALCSIZE
10681069
NCCREATE
10691070
NCLBUTTONDOWN

build/pipelines/pgo.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ stages:
5050
buildEverything: true
5151
pgoBuildMode: Instrument
5252
artifactStem: -instrumentation
53+
keepAllExpensiveBuildOutputs: false # the ARM64 build agent runs out of memory downloading the artifacts...
5354

5455
- stage: RunPGO
5556
displayName: Run PGO

build/pipelines/templates-v2/job-pgo-build-nuget-and-publish.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
pgoToolsPath: $(Build.SourcesDirectory)\build\PGO
2727
nuspecPath: $(pgoToolsPath)\NuSpecs
2828
nuspecFilename: PGO.nuspec
29+
nugetFeed: "https://pkgs.dev.azure.com/shine-oss/terminal/_packaging/TerminalDependencies/nuget/v3/index.json"
2930

3031
steps:
3132
- checkout: self
@@ -45,7 +46,8 @@ jobs:
4546

4647
- task: NuGetAuthenticate@1
4748
inputs:
48-
nuGetServiceConnections: 'Terminal Public Artifact Feed'
49+
azureDevOpsServiceConnection: 'Terminal Public Artifact Feed'
50+
feedUrl: $(nugetFeed)
4951

5052
# In the Microsoft Azure DevOps tenant, NuGetCommand is ambiguous.
5153
# This should be `task: NuGetCommand@2`
@@ -68,15 +70,7 @@ jobs:
6870
artifact: pgo-nupkg-${{ parameters.buildConfiguration }}${{ parameters.artifactStem }}
6971
displayName: "Publish Pipeline Artifact"
7072

71-
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
72-
displayName: 'NuGet push'
73-
inputs:
74-
command: push
75-
nuGetFeedType: external
76-
packagesToPush: $(Build.ArtifactStagingDirectory)/*.nupkg
77-
# The actual URL and PAT for this feed is configured at
78-
# https://microsoft.visualstudio.com/Dart/_settings/adminservices
79-
# This is the name of that connection
80-
publishFeedCredentials: 'Terminal Public Artifact Feed'
81-
feedsToUse: config
82-
nugetConfigPath: '$(Build.SourcesDirectory)/NuGet.config'
73+
- pwsh: |-
74+
$nupkg = Get-Item "$(Build.ArtifactStagingDirectory)/*.nupkg"
75+
& nuget push -ApiKey az -Source "$(nugetFeed)" "$nupkg"
76+
displayName: NuGet push

build/pipelines/templates-v2/job-run-pgo-tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ jobs:
4545
displayName: Extract the unpackaged build for PGO
4646
4747
- template: steps-ensure-nuget-version.yml
48+
parameters:
49+
${{ if eq(parameters.buildPlatform, 'arm64') }}:
50+
# The ARM64 agents do not seem to have NuGet installed
51+
forceNugetInstallation: true
4852

4953
- powershell: |-
5054
$Package = 'Microsoft.Internal.Windows.Terminal.TestContent'

build/pipelines/templates-v2/pipeline-onebranch-full-release-build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ extends:
210210
ob_createvpack_taskLogVerbosity: Detailed
211211
ob_createvpack_verbose: true
212212
ob_createvpack_vpackdirectory: '$(JobOutputDirectory)\vpack'
213+
ob_createvpack_versionAs: string
214+
ob_createvpack_version: '$(XES_APPXMANIFESTVERSION)'
213215
ob_updateOSManifest_gitcheckinConfigPath: '$(Build.SourcesDirectory)\build\config\GitCheckin.json'
214216
# We're skipping the 'fetch' part of the OneBranch rules, but that doesn't mean
215217
# that it doesn't expect to have downloaded a manifest directly to some 'destination'
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
parameters:
2+
- name: forceNugetInstallation
3+
type: boolean
4+
default: false
5+
16
steps:
2-
- ${{ if eq(variables['System.CollectionId'], 'cb55739e-4afe-46a3-970f-1b49d8ee7564') }}:
7+
- ${{ if and(ne(parameters.forceNugetInstallation, true), eq(variables['System.CollectionId'], 'cb55739e-4afe-46a3-970f-1b49d8ee7564')) }}:
38
- pwsh: |-
49
Write-Host "Assuming NuGet is already installed..."
510
& nuget.exe help
611
displayName: Assume NuGet is fine
712
813
- ${{ else }}:
914
- task: NuGetToolInstaller@1
10-
displayName: Use NuGet 6.6.1
15+
displayName: Use NuGet 7.0.1
1116
inputs:
12-
versionSpec: 6.6.1
17+
versionSpec: 7.0.1

src/cascadia/TerminalApp/MinMaxCloseControl.cpp

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,18 @@ namespace winrt::TerminalApp::implementation
8888
CloseClick.raise(*this, e);
8989
}
9090

91+
bool MinMaxCloseControl::Focused() const
92+
{
93+
return _focused;
94+
}
95+
96+
void MinMaxCloseControl::Focused(bool focused)
97+
{
98+
_focused = focused;
99+
100+
ReleaseButtons();
101+
}
102+
91103
void MinMaxCloseControl::SetWindowVisualState(WindowVisualState visualState)
92104
{
93105
// Look up the heights we should use for the caption buttons from our
@@ -169,25 +181,25 @@ namespace winrt::TerminalApp::implementation
169181
// animate the fade in/out transition between colors.
170182
case CaptionButton::Minimize:
171183
VisualStateManager::GoToState(MinimizeButton(), L"PointerOver", true);
172-
VisualStateManager::GoToState(MaximizeButton(), L"Normal", true);
173-
VisualStateManager::GoToState(CloseButton(), L"Normal", true);
184+
VisualStateManager::GoToState(MaximizeButton(), _normalState(), true);
185+
VisualStateManager::GoToState(CloseButton(), _normalState(), true);
174186

175187
_displayToolTip->Run(MinimizeButton());
176188
closeToolTipForButton(MaximizeButton());
177189
closeToolTipForButton(CloseButton());
178190
break;
179191
case CaptionButton::Maximize:
180-
VisualStateManager::GoToState(MinimizeButton(), L"Normal", true);
192+
VisualStateManager::GoToState(MinimizeButton(), _normalState(), true);
181193
VisualStateManager::GoToState(MaximizeButton(), L"PointerOver", true);
182-
VisualStateManager::GoToState(CloseButton(), L"Normal", true);
194+
VisualStateManager::GoToState(CloseButton(), _normalState(), true);
183195

184196
closeToolTipForButton(MinimizeButton());
185197
_displayToolTip->Run(MaximizeButton());
186198
closeToolTipForButton(CloseButton());
187199
break;
188200
case CaptionButton::Close:
189-
VisualStateManager::GoToState(MinimizeButton(), L"Normal", true);
190-
VisualStateManager::GoToState(MaximizeButton(), L"Normal", true);
201+
VisualStateManager::GoToState(MinimizeButton(), _normalState(), true);
202+
VisualStateManager::GoToState(MaximizeButton(), _normalState(), true);
191203
VisualStateManager::GoToState(CloseButton(), L"PointerOver", true);
192204

193205
closeToolTipForButton(MinimizeButton());
@@ -210,17 +222,17 @@ namespace winrt::TerminalApp::implementation
210222
{
211223
case CaptionButton::Minimize:
212224
VisualStateManager::GoToState(MinimizeButton(), L"Pressed", true);
213-
VisualStateManager::GoToState(MaximizeButton(), L"Normal", true);
214-
VisualStateManager::GoToState(CloseButton(), L"Normal", true);
225+
VisualStateManager::GoToState(MaximizeButton(), _normalState(), true);
226+
VisualStateManager::GoToState(CloseButton(), _normalState(), true);
215227
break;
216228
case CaptionButton::Maximize:
217-
VisualStateManager::GoToState(MinimizeButton(), L"Normal", true);
229+
VisualStateManager::GoToState(MinimizeButton(), _normalState(), true);
218230
VisualStateManager::GoToState(MaximizeButton(), L"Pressed", true);
219-
VisualStateManager::GoToState(CloseButton(), L"Normal", true);
231+
VisualStateManager::GoToState(CloseButton(), _normalState(), true);
220232
break;
221233
case CaptionButton::Close:
222-
VisualStateManager::GoToState(MinimizeButton(), L"Normal", true);
223-
VisualStateManager::GoToState(MaximizeButton(), L"Normal", true);
234+
VisualStateManager::GoToState(MinimizeButton(), _normalState(), true);
235+
VisualStateManager::GoToState(MaximizeButton(), _normalState(), true);
224236
VisualStateManager::GoToState(CloseButton(), L"Pressed", true);
225237
break;
226238
}
@@ -233,14 +245,21 @@ namespace winrt::TerminalApp::implementation
233245
void MinMaxCloseControl::ReleaseButtons()
234246
{
235247
_displayToolTip->Run(nullptr);
236-
VisualStateManager::GoToState(MinimizeButton(), L"Normal", true);
237-
VisualStateManager::GoToState(MaximizeButton(), L"Normal", true);
238-
VisualStateManager::GoToState(CloseButton(), L"Normal", true);
248+
VisualStateManager::GoToState(MinimizeButton(), _normalState(), true);
249+
VisualStateManager::GoToState(MaximizeButton(), _normalState(), true);
250+
VisualStateManager::GoToState(CloseButton(), _normalState(), true);
239251

240252
closeToolTipForButton(MinimizeButton());
241253
closeToolTipForButton(MaximizeButton());
242254
closeToolTipForButton(CloseButton());
243255

244256
_lastPressedButton = std::nullopt;
245257
}
258+
259+
const winrt::param::hstring& MinMaxCloseControl::_normalState() const
260+
{
261+
static const winrt::param::hstring normal = L"Normal";
262+
static const winrt::param::hstring unfocused = L"Unfocused";
263+
return (_focused ? normal : unfocused);
264+
}
246265
}

src/cascadia/TerminalApp/MinMaxCloseControl.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ namespace winrt::TerminalApp::implementation
2121
void PressButton(CaptionButton button);
2222
void ReleaseButtons();
2323

24+
bool Focused() const;
25+
void Focused(bool focused);
26+
2427
void _MinimizeClick(const winrt::Windows::Foundation::IInspectable& sender,
2528
const winrt::Windows::UI::Xaml::RoutedEventArgs& e);
2629
void _MaximizeClick(const winrt::Windows::Foundation::IInspectable& sender,
@@ -32,8 +35,12 @@ namespace winrt::TerminalApp::implementation
3235
til::typed_event<TerminalApp::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs> MaximizeClick;
3336
til::typed_event<TerminalApp::MinMaxCloseControl, winrt::Windows::UI::Xaml::RoutedEventArgs> CloseClick;
3437

38+
bool _focused{ false };
3539
std::shared_ptr<ThrottledFunc<winrt::Windows::UI::Xaml::Controls::Button>> _displayToolTip{ nullptr };
3640
std::optional<CaptionButton> _lastPressedButton{ std::nullopt };
41+
42+
private:
43+
const winrt::param::hstring& _normalState() const;
3744
};
3845
}
3946

src/cascadia/TerminalApp/MinMaxCloseControl.idl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ namespace TerminalApp
1414
void HoverButton(CaptionButton button);
1515
void PressButton(CaptionButton button);
1616
void ReleaseButtons();
17+
Boolean Focused { get; set; };
1718

1819
event Windows.Foundation.TypedEventHandler<MinMaxCloseControl, Windows.UI.Xaml.RoutedEventArgs> MinimizeClick;
1920
event Windows.Foundation.TypedEventHandler<MinMaxCloseControl, Windows.UI.Xaml.RoutedEventArgs> MaximizeClick;

src/cascadia/TerminalApp/MinMaxCloseControl.xaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
ResourceKey="SystemControlForegroundBaseHighBrush" />
3333
<StaticResource x:Key="CaptionButtonForegroundPressed"
3434
ResourceKey="SystemControlForegroundBaseHighBrush" />
35+
<StaticResource x:Key="CaptionButtonForegroundUnfocusedColor"
36+
ResourceKey="TextFillColorDisabled" />
37+
<SolidColorBrush x:Key="CaptionButtonForegroundUnfocused"
38+
Color="{ThemeResource CaptionButtonForegroundUnfocusedColor}" />
3539
<SolidColorBrush x:Key="CaptionButtonBackground"
3640
Color="Transparent" />
3741
<Color x:Key="CaptionButtonBackgroundColor">Transparent</Color>
@@ -66,6 +70,10 @@
6670
ResourceKey="SystemControlForegroundBaseHighBrush" />
6771
<StaticResource x:Key="CaptionButtonForegroundPressed"
6872
ResourceKey="SystemControlForegroundBaseHighBrush" />
73+
<StaticResource x:Key="CaptionButtonForegroundUnfocusedColor"
74+
ResourceKey="TextFillColorDisabled" />
75+
<SolidColorBrush x:Key="CaptionButtonForegroundUnfocused"
76+
Color="{ThemeResource CaptionButtonForegroundUnfocusedColor}" />
6977
<SolidColorBrush x:Key="CaptionButtonBackground"
7078
Color="Transparent" />
7179
<Color x:Key="CaptionButtonBackgroundColor">Transparent</Color>
@@ -103,6 +111,10 @@
103111
Color="{ThemeResource SystemColorHighlightTextColor}" />
104112
<SolidColorBrush x:Key="CaptionButtonForegroundPressed"
105113
Color="{ThemeResource SystemColorHighlightTextColor}" />
114+
<SolidColorBrush x:Key="CaptionButtonForegroundUnfocused"
115+
Color="{ThemeResource SystemColorButtonTextColor}" />
116+
<StaticResource x:Key="CaptionButtonForegroundUnfocusedColor"
117+
ResourceKey="SystemColorButtonTextColor" />
106118
<SolidColorBrush x:Key="CloseButtonBackgroundPointerOver"
107119
Color="{ThemeResource SystemColorHighlightColor}" />
108120
<SolidColorBrush x:Key="CloseButtonForegroundPointerOver"
@@ -189,6 +201,20 @@
189201
Duration="0:0:0.1" />
190202
</Storyboard>
191203
</VisualTransition>
204+
205+
<VisualTransition From="PointerOver"
206+
To="Unfocused">
207+
<Storyboard>
208+
<ColorAnimation Storyboard.TargetName="ButtonBaseElement"
209+
Storyboard.TargetProperty="(UIElement.Background).(SolidColorBrush.Color)"
210+
To="{ThemeResource CaptionButtonBackgroundColor}"
211+
Duration="0:0:0.15" />
212+
<ColorAnimation Storyboard.TargetName="ButtonIcon"
213+
Storyboard.TargetProperty="(UIElement.Foreground).(SolidColorBrush.Color)"
214+
To="{ThemeResource CaptionButtonForegroundUnfocusedColor}"
215+
Duration="0:0:0.1" />
216+
</Storyboard>
217+
</VisualTransition>
192218
</VisualStateGroup.Transitions>
193219

194220
<VisualState x:Name="Normal">
@@ -198,6 +224,13 @@
198224
</VisualState.Setters>
199225
</VisualState>
200226

227+
<VisualState x:Name="Unfocused">
228+
<VisualState.Setters>
229+
<Setter Target="ButtonBaseElement.Background" Value="{ThemeResource CaptionButtonBackground}" />
230+
<Setter Target="ButtonIcon.Foreground" Value="{ThemeResource CaptionButtonForegroundUnfocused}" />
231+
</VisualState.Setters>
232+
</VisualState>
233+
201234
<VisualState x:Name="PointerOver">
202235
<VisualState.Setters>
203236
<Setter Target="ButtonBaseElement.Background" Value="{ThemeResource CaptionButtonBackgroundPointerOver}" />

0 commit comments

Comments
 (0)