Skip to content

Commit

Permalink
ScrollViewer supports UISettings' AutoHideScrollBars property (#731)
Browse files Browse the repository at this point in the history
* ScrollViewer control: Support non-auto-hiding ScrollBars on RS4+.

* Scroller control: Fixing typo in when calling RaiseViewportChanged.

* Applying some PR feedback.

* Applying PR feedback.

* Addressing CR feedback and adding Windows SDK installation options so MinCore.lib is found on the build machines.

* Replacing test class ScrollViewerWithVisualStateCounts with ScrollViewerVisualStateCounts.

* Skipping VerifyVisualStates test when system animations are turned off.

* Fixing missed calls to ScrollBarController::HookScrollBarPropertyChanged/UnhookScrollBarPropertyChanged in debug builds.

* Fixing debug output of GoToState's state name.

* Moving ScrollViewer common resources out of ResourceDictionary.ThemeDictionaries.
  • Loading branch information
RBrid authored Jun 7, 2019
1 parent 9f7deae commit 0eb29e6
Show file tree
Hide file tree
Showing 26 changed files with 1,133 additions and 291 deletions.
2 changes: 1 addition & 1 deletion build/Install-WindowsSdkISO.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ param([Parameter(Mandatory=$true, Position=0)]
$ErrorActionPreference = 'Stop'

# Constants
$WindowsSDKOptions = @("OptionId.UWPCpp")
$WindowsSDKOptions = @("OptionId.UWPCpp", "OptionId.DesktopCPPx64", "OptionId.DesktopCPPx86", "OptionId.DesktopCPPARM64", "OptionId.DesktopCPPARM")
$WindowsSDKRegPath = "HKLM:\Software\Microsoft\Windows Kits\Installed Roots"
$WindowsSDKRegRootKey = "KitsRoot10"
$WindowsSDKVersion = "10.0.$buildNumber.0"
Expand Down
15 changes: 1 addition & 14 deletions dev/CommandBarFlyout/CommandBarFlyoutCommandBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CommandBarFlyoutCommandBar::CommandBarFlyoutCommandBar()

if (firstCommandAsFrameworkElement)
{
if (IsFrameworkElementLoaded(firstCommandAsFrameworkElement))
if (SharedHelpers::IsFrameworkElementLoaded(firstCommandAsFrameworkElement))
{
FocusCommand(
commands,
Expand Down Expand Up @@ -926,19 +926,6 @@ void CommandBarFlyoutCommandBar::OnKeyDown(
__super::OnKeyDown(args);
}

bool CommandBarFlyoutCommandBar::IsFrameworkElementLoaded(
winrt::FrameworkElement const& frameworkElement)
{
if (SharedHelpers::IsRS5OrHigher())
{
return frameworkElement.IsLoaded();
}
else
{
return winrt::VisualTreeHelper::GetParent(frameworkElement) != nullptr;
}
}

bool CommandBarFlyoutCommandBar::IsControlFocusable(
winrt::Control const& control,
bool checkTabStop)
Expand Down
2 changes: 0 additions & 2 deletions dev/CommandBarFlyout/CommandBarFlyoutCommandBar.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ class CommandBarFlyoutCommandBar :
void EnsureAutomationSetCountAndPosition();
void EnsureFocusedPrimaryCommand();

static bool IsFrameworkElementLoaded(
winrt::FrameworkElement const& frameworkElement);
static bool IsControlFocusable(
winrt::Control const& control,
bool checkTabStop);
Expand Down
330 changes: 303 additions & 27 deletions dev/ScrollViewer/APITests/ScrollViewerTests.cs

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions dev/ScrollViewer/ScrollBarController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ ScrollBarController::~ScrollBarController()
SCROLLVIEWER_TRACE_INFO(nullptr, TRACE_MSG_METH, METH_NAME, this);

UnhookScrollBarEvent();
#ifdef _DEBUG
UnhookScrollBarPropertyChanged();
#endif //_DEBUG
}

void ScrollBarController::SetScrollBar(const winrt::ScrollBar& scrollBar)
Expand All @@ -36,9 +34,7 @@ void ScrollBarController::SetScrollBar(const winrt::ScrollBar& scrollBar)
m_scrollBar = scrollBar;

HookScrollBarEvent();
#ifdef _DEBUG
HookScrollBarPropertyChanged();
#endif //_DEBUG
}

#pragma region IScrollController
Expand Down
Loading

0 comments on commit 0eb29e6

Please sign in to comment.