Skip to content

Commit

Permalink
chore: Additional required dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Aug 2, 2024
1 parent aebf8ae commit cd4c24c
Show file tree
Hide file tree
Showing 5 changed files with 236 additions and 146 deletions.
58 changes: 58 additions & 0 deletions src/Uno.UI/DirectUI/ElevationHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
// MUX Reference dxaml\phone\lib\ElevationHelper.cpp, tag winui3/release/1.5.4, commit 98a60c8

using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;

namespace DirectUI;

internal static class ElevationHelper
{
//// The initial Z offset applied to all elevated controls
//private const float s_elevationBaseDepth = 32.0f;
//// This additional Z offset will be applied for each tier of logically parented controls
//private const float s_elevationIterativeDepth = 8.0f;

//internal static void ApplyThemeShadow(UIElement target)
//{
// var themeShadow = new ThemeShadow();
// target.Shadow = themeShadow;
//}

//internal static void ApplyElevationEffect(UIElement target, int depth)
//{
// // Calculate the Z offset based on the depth of the shadow
// var calculatedZDepth = s_elevationBaseDepth + (depth * s_elevationIterativeDepth);

// var endTranslation = new Vector3(0.0f, 0.0f, calculatedZDepth);

// // Apply a translation facade value
// target.Translation = endTranslation;

// // Apply a shadow to the element
// ApplyThemeShadow(target);
//}

// Move the control forward in Z and apply a shadow effect to it.
// If the control is part of a tier of elevated controls (for example a MenuFlyoutSubItem),
// you may provide an additional "depth" value that provides an additional Z offset.
internal static void ApplyElevationEffect(UIElement target, int depth = 0, int? baseElevation = null)
{
}

// Remove any shadow applied with ApplyElevationEffect
internal static void ClearElevationEffect(UIElement target)
{
}

// Checks if the "IsDefaultShadowEnabled" resource is defined as True or not, determining
// if a control should enable a shadow by default.
internal static bool IsDefaultShadowEnabled(FrameworkElement resourceTarget) => false;
}
10 changes: 5 additions & 5 deletions src/Uno.UI/UI/Xaml/Controls/ComboBox/ComboBox.Properties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,6 @@ public Style TextBoxStyle
typeof(ComboBox),
new FrameworkPropertyMetadata(null));

/// <summary>
/// Occurs when the user submits some text that does not correspond to an item in the ComboBox dropdown list.
/// </summary>
public event TypedEventHandler<ComboBox, ComboBoxTextSubmittedEventArgs> TextSubmitted;

/// <summary>
/// Occurs when the drop-down portion of the ComboBox closes.
/// </summary>
Expand All @@ -222,4 +217,9 @@ public Style TextBoxStyle
/// Occurs when the drop-down portion of the ComboBox opens.
/// </summary>
public event EventHandler<object> DropDownOpened;

/// <summary>
/// Occurs when the user submits some text that does not correspond to an item in the ComboBox dropdown list.
/// </summary>
public event TypedEventHandler<ComboBox, ComboBoxTextSubmittedEventArgs> TextSubmitted;
}
2 changes: 2 additions & 0 deletions src/Uno.UI/UI/Xaml/Controls/ComboBox/ComboBox.custom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,8 @@ Point getChildLocation()
#endif

child.Arrange(frame);

combo.m_bPopupHasBeenArrangedOnce = true;
}
}
}
19 changes: 18 additions & 1 deletion src/Uno.UI/UI/Xaml/Controls/ComboBox/ComboBox.partial.h.mux.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Text;
using System.Threading.Tasks;
using Microsoft.UI.Xaml.Documents;
using Microsoft.UI.Xaml.Media.Animation;
using Uno.Disposables;
using Uno.UI.Xaml.Input;
using Windows.Foundation;
Expand All @@ -12,10 +13,18 @@ namespace Microsoft.UI.Xaml.Controls;

partial class ComboBox
{
#pragma warning disable CS0067 // Unused only in reference API.
#pragma warning disable CS0649 // Unused only in reference API.
#pragma warning disable CS0169 // Unused only in reference API.
#pragma warning disable CS0168 // Unused only in reference API.
#pragma warning disable CS0414 // Unused only in reference API.
internal bool IsSearchResultIndexSet() => m_searchResultIndexSet;

internal int GetSearchResultIndex() => m_searchResultIndex;

private bool m_bIsPopupPannable;
private bool m_bShouldCarousel;
private bool m_bShouldCenterSelectedItem;
private bool m_handledGamepadOrRemoteKeyDown;
private bool m_ignoreCancelKeyDowns;
private bool m_isEditModeConfigured;
Expand Down Expand Up @@ -44,12 +53,18 @@ partial class ComboBox
// Editable ComboBox is designed to set the focus on TextBox when ComboBox is focused, there are some cases when we don't want
// this behavior eg(Shift+Tab).
private bool m_shouldMoveFocusToTextBox;
private bool m_isClosingDueToCancel;
private bool m_isExpanded;
private bool m_isOverlayVisible;
private bool m_restoreIndexSet;
private bool m_isClosingDueToCancel;

private bool m_IsPointerOverDropDownOverlay;

private InputDeviceType m_inputDeviceTypeUsedToOpen;
private InputDeviceType m_previousInputDeviceTypeUsedToOpen;

private FrameworkElement m_tpElementPopupChild;
private FrameworkElement m_tpElementPopupContent;

private readonly SerialDisposable m_spEditableTextPointerPressedEventHandler = new();
private readonly SerialDisposable m_spEditableTextTappedEventHandler = new();
Expand All @@ -65,6 +80,7 @@ partial class ComboBox
private TextBlock m_tpEditableContentPresenterTextBlock;
private ComboBoxItem m_tpSwappedOutComboBoxItem;

private Storyboard m_tpClosedStoryboard;
private DependencyObject m_tpGeneratedContainerForContentPresenter;
private int m_iLastGeneratedItemIndexforFaceplate;
private object m_customValueRef;
Expand All @@ -78,6 +94,7 @@ partial class ComboBox

private bool IsFullMode => IsSmallFormFactor && m_itemCount > s_itemCountThreshold;

private IAsyncInfo m_tpAsyncSelectionInfo;
private int m_itemCount;

Check notice on line 98 in src/Uno.UI/UI/Xaml/Controls/ComboBox/ComboBox.partial.h.mux.cs

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Uno.UI/UI/Xaml/Controls/ComboBox/ComboBox.partial.h.mux.cs#L98

Remove unassigned field 'm_itemCount', or set its value.

private int m_indexToRestoreOnCancel = -1;

Check warning on line 100 in src/Uno.UI/UI/Xaml/Controls/ComboBox/ComboBox.partial.h.mux.cs

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Uno.UI/UI/Xaml/Controls/ComboBox/ComboBox.partial.h.mux.cs#L100

Make 'm_indexToRestoreOnCancel' 'readonly'.
Expand Down
Loading

0 comments on commit cd4c24c

Please sign in to comment.