forked from microsoft/terminal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use events when picked color changes, adjust the preset colors (micro…
- Loading branch information
Showing
7 changed files
with
273 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,26 @@ | ||
#pragma once | ||
#include "ColorPickupFlyout.g.h" | ||
#include "../cascadia/inc/cppwinrt_utils.h" | ||
|
||
namespace winrt::TerminalApp::implementation | ||
{ | ||
struct ColorPickupFlyout : ColorPickupFlyoutT<ColorPickupFlyout> | ||
{ | ||
ColorPickupFlyout(); | ||
void ColorButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args); | ||
void CustomColorButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args); | ||
ColorPickupFlyout(); | ||
|
||
winrt::Windows::UI::Color SelectedColor() | ||
{ | ||
return winrt::unbox_value<winrt::Windows::UI::Color>(GetValue(m_SelectedColorProperty)); | ||
} | ||
void ColorButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args); | ||
void ShowColorPickerButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args); | ||
void CustomColorButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args); | ||
void ClearColorButton_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args); | ||
|
||
void SelectedColor(winrt::Windows::UI::Color const& color) | ||
{ | ||
SetValue(m_SelectedColorProperty, winrt::box_value(color)); | ||
} | ||
|
||
static Windows::UI::Xaml::DependencyProperty SelectedColorProperty() { return m_SelectedColorProperty; } | ||
static void OnSelectedColorChanged(Windows::UI::Xaml::DependencyObject const&, Windows::UI::Xaml::DependencyPropertyChangedEventArgs const&); | ||
|
||
private: | ||
static Windows::UI::Xaml::DependencyProperty m_SelectedColorProperty; | ||
DECLARE_EVENT(ColorSelected, _colorSelected, TerminalApp::ColorSelectedArgs); | ||
DECLARE_EVENT(ColorCleared, _colorCleared, TerminalApp::ColorClearedArgs); | ||
}; | ||
} | ||
|
||
namespace winrt::TerminalApp::factory_implementation | ||
{ | ||
struct ColorPickupFlyout : ColorPickupFlyoutT<ColorPickupFlyout, implementation::ColorPickupFlyout> | ||
{ | ||
|
||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
// BgLabelControl.idl | ||
namespace TerminalApp | ||
{ | ||
[default_interface] | ||
runtimeclass ColorPickupFlyout : Windows.UI.Xaml.Controls.Flyout | ||
{ | ||
ColorPickupFlyout(); | ||
Windows.UI.Color SelectedColor{ get; }; | ||
static Windows.UI.Xaml.DependencyProperty SelectedColorProperty{ get; }; | ||
} | ||
delegate void ColorSelectedArgs(Windows.UI.Color color); | ||
delegate void ColorClearedArgs(); | ||
|
||
[default_interface] runtimeclass ColorPickupFlyout : Windows.UI.Xaml.Controls.Flyout | ||
{ | ||
ColorPickupFlyout(); | ||
event ColorSelectedArgs ColorSelected; | ||
event ColorClearedArgs ColorCleared; | ||
} | ||
} |
Oops, something went wrong.