mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-10 05:06:36 +02:00
Fix colors in KBM UI and add support for light/dark theme (#2256)
* Fixed colors for Edit Keyboard * Fixed colors for Edit Shortcuts
This commit is contained in:
@@ -153,8 +153,8 @@ void KeyboardManagerState::AddKeyToLayout(const StackPanel& panel, const hstring
|
|||||||
|
|
||||||
border.Padding({ 20, 10, 20, 10 });
|
border.Padding({ 20, 10, 20, 10 });
|
||||||
border.Margin({ 0, 0, 10, 0 });
|
border.Margin({ 0, 0, 10, 0 });
|
||||||
border.Background(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::LightGray() });
|
// Use the base low brush to be consistent with the theme
|
||||||
remapKey.Foreground(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::Black() });
|
border.Background(Windows::UI::Xaml::Application::Current().Resources().Lookup(box_value(L"SystemControlBackgroundBaseLowBrush")).as<Windows::UI::Xaml::Media::SolidColorBrush>());
|
||||||
remapKey.FontSize(20);
|
remapKey.FontSize(20);
|
||||||
border.HorizontalAlignment(HorizontalAlignment::Left);
|
border.HorizontalAlignment(HorizontalAlignment::Left);
|
||||||
border.Child(remapKey);
|
border.Child(remapKey);
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ void createEditKeyboardWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMan
|
|||||||
|
|
||||||
// Creating the Xaml content. xamlContainer is the parent UI element
|
// Creating the Xaml content. xamlContainer is the parent UI element
|
||||||
Windows::UI::Xaml::Controls::StackPanel xamlContainer;
|
Windows::UI::Xaml::Controls::StackPanel xamlContainer;
|
||||||
xamlContainer.Background(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::LightGray() });
|
|
||||||
|
|
||||||
// Header for the window
|
// Header for the window
|
||||||
Windows::UI::Xaml::Controls::StackPanel header;
|
Windows::UI::Xaml::Controls::StackPanel header;
|
||||||
@@ -86,14 +85,11 @@ void createEditKeyboardWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMan
|
|||||||
// Header text
|
// Header text
|
||||||
TextBlock headerText;
|
TextBlock headerText;
|
||||||
headerText.Text(winrt::to_hstring("Remap Keyboard"));
|
headerText.Text(winrt::to_hstring("Remap Keyboard"));
|
||||||
headerText.Foreground(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::Black() });
|
|
||||||
headerText.FontSize(30);
|
headerText.FontSize(30);
|
||||||
headerText.Margin({ 0, 0, 1000, 0 });
|
headerText.Margin({ 0, 0, 1000, 0 });
|
||||||
|
|
||||||
// Header Cancel button
|
// Header Cancel button
|
||||||
Button cancelButton;
|
Button cancelButton;
|
||||||
cancelButton.Background(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::LightGray() });
|
|
||||||
cancelButton.Foreground(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::Black() });
|
|
||||||
cancelButton.Content(winrt::box_value(winrt::to_hstring("Cancel")));
|
cancelButton.Content(winrt::box_value(winrt::to_hstring("Cancel")));
|
||||||
cancelButton.Click([&](winrt::Windows::Foundation::IInspectable const& sender, RoutedEventArgs const&) {
|
cancelButton.Click([&](winrt::Windows::Foundation::IInspectable const& sender, RoutedEventArgs const&) {
|
||||||
// Close the window since settings do not need to be saved
|
// Close the window since settings do not need to be saved
|
||||||
@@ -103,25 +99,21 @@ void createEditKeyboardWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMan
|
|||||||
// Text block for information about remap key section.
|
// Text block for information about remap key section.
|
||||||
TextBlock keyRemapInfoHeader;
|
TextBlock keyRemapInfoHeader;
|
||||||
keyRemapInfoHeader.Text(winrt::to_hstring("Select the key you want to remap, original key, and it's new output when pressed, the new key"));
|
keyRemapInfoHeader.Text(winrt::to_hstring("Select the key you want to remap, original key, and it's new output when pressed, the new key"));
|
||||||
keyRemapInfoHeader.Foreground(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::Black() });
|
|
||||||
keyRemapInfoHeader.Margin({ 10, 0, 0, 10 });
|
keyRemapInfoHeader.Margin({ 10, 0, 0, 10 });
|
||||||
|
|
||||||
// Table to display the key remaps
|
// Table to display the key remaps
|
||||||
Windows::UI::Xaml::Controls::StackPanel keyRemapTable;
|
Windows::UI::Xaml::Controls::StackPanel keyRemapTable;
|
||||||
keyRemapTable.Background(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::LightGray() });
|
|
||||||
keyRemapTable.Margin({ 10, 10, 10, 20 });
|
keyRemapTable.Margin({ 10, 10, 10, 20 });
|
||||||
keyRemapTable.Spacing(10);
|
keyRemapTable.Spacing(10);
|
||||||
|
|
||||||
// Header row of the keys remap table
|
// Header row of the keys remap table
|
||||||
Windows::UI::Xaml::Controls::StackPanel tableHeaderRow;
|
Windows::UI::Xaml::Controls::StackPanel tableHeaderRow;
|
||||||
tableHeaderRow.Background(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::LightGray() });
|
|
||||||
tableHeaderRow.Spacing(100);
|
tableHeaderRow.Spacing(100);
|
||||||
tableHeaderRow.Orientation(Windows::UI::Xaml::Controls::Orientation::Horizontal);
|
tableHeaderRow.Orientation(Windows::UI::Xaml::Controls::Orientation::Horizontal);
|
||||||
|
|
||||||
// First header textblock in the header row of the keys remap table
|
// First header textblock in the header row of the keys remap table
|
||||||
TextBlock originalKeyRemapHeader;
|
TextBlock originalKeyRemapHeader;
|
||||||
originalKeyRemapHeader.Text(winrt::to_hstring("Original Key:"));
|
originalKeyRemapHeader.Text(winrt::to_hstring("Original Key:"));
|
||||||
originalKeyRemapHeader.Foreground(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::Black() });
|
|
||||||
originalKeyRemapHeader.FontWeight(Text::FontWeights::Bold());
|
originalKeyRemapHeader.FontWeight(Text::FontWeights::Bold());
|
||||||
originalKeyRemapHeader.Margin({ 0, 0, 0, 10 });
|
originalKeyRemapHeader.Margin({ 0, 0, 0, 10 });
|
||||||
tableHeaderRow.Children().Append(originalKeyRemapHeader);
|
tableHeaderRow.Children().Append(originalKeyRemapHeader);
|
||||||
@@ -129,7 +121,6 @@ void createEditKeyboardWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMan
|
|||||||
// Second header textblock in the header row of the keys remap table
|
// Second header textblock in the header row of the keys remap table
|
||||||
TextBlock newKeyRemapHeader;
|
TextBlock newKeyRemapHeader;
|
||||||
newKeyRemapHeader.Text(winrt::to_hstring("New Key:"));
|
newKeyRemapHeader.Text(winrt::to_hstring("New Key:"));
|
||||||
newKeyRemapHeader.Foreground(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::Black() });
|
|
||||||
newKeyRemapHeader.FontWeight(Text::FontWeights::Bold());
|
newKeyRemapHeader.FontWeight(Text::FontWeights::Bold());
|
||||||
newKeyRemapHeader.Margin({ 0, 0, 0, 10 });
|
newKeyRemapHeader.Margin({ 0, 0, 0, 10 });
|
||||||
tableHeaderRow.Children().Append(newKeyRemapHeader);
|
tableHeaderRow.Children().Append(newKeyRemapHeader);
|
||||||
@@ -195,8 +186,6 @@ void createEditKeyboardWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMan
|
|||||||
|
|
||||||
// Main Header Apply button
|
// Main Header Apply button
|
||||||
Button applyButton;
|
Button applyButton;
|
||||||
applyButton.Background(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::LightGray() });
|
|
||||||
applyButton.Foreground(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::Black() });
|
|
||||||
applyButton.Content(winrt::box_value(winrt::to_hstring("Apply")));
|
applyButton.Content(winrt::box_value(winrt::to_hstring("Apply")));
|
||||||
applyButton.Flyout(applyFlyout);
|
applyButton.Flyout(applyFlyout);
|
||||||
applyButton.Click([&](winrt::Windows::Foundation::IInspectable const& sender, RoutedEventArgs const&) {
|
applyButton.Click([&](winrt::Windows::Foundation::IInspectable const& sender, RoutedEventArgs const&) {
|
||||||
@@ -269,8 +258,6 @@ void createEditKeyboardWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMan
|
|||||||
|
|
||||||
// Add remap key button
|
// Add remap key button
|
||||||
Windows::UI::Xaml::Controls::Button addRemapKey;
|
Windows::UI::Xaml::Controls::Button addRemapKey;
|
||||||
addRemapKey.Background(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::LightGray() });
|
|
||||||
addRemapKey.Foreground(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::Black() });
|
|
||||||
FontIcon plusSymbol;
|
FontIcon plusSymbol;
|
||||||
plusSymbol.FontFamily(Xaml::Media::FontFamily(L"Segoe MDL2 Assets"));
|
plusSymbol.FontFamily(Xaml::Media::FontFamily(L"Segoe MDL2 Assets"));
|
||||||
plusSymbol.Glyph(L"\xE109");
|
plusSymbol.Glyph(L"\xE109");
|
||||||
|
|||||||
@@ -76,11 +76,9 @@ void createEditShortcutsWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMa
|
|||||||
|
|
||||||
// Creating the Xaml content. xamlContainer is the parent UI element
|
// Creating the Xaml content. xamlContainer is the parent UI element
|
||||||
Windows::UI::Xaml::Controls::StackPanel xamlContainer;
|
Windows::UI::Xaml::Controls::StackPanel xamlContainer;
|
||||||
xamlContainer.Background(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::LightGray() });
|
|
||||||
|
|
||||||
// Header for the window
|
// Header for the window
|
||||||
Windows::UI::Xaml::Controls::StackPanel header;
|
Windows::UI::Xaml::Controls::StackPanel header;
|
||||||
header.Background(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::LightGray() });
|
|
||||||
header.Orientation(Windows::UI::Xaml::Controls::Orientation::Horizontal);
|
header.Orientation(Windows::UI::Xaml::Controls::Orientation::Horizontal);
|
||||||
header.Margin({ 10, 10, 10, 30 });
|
header.Margin({ 10, 10, 10, 30 });
|
||||||
header.Spacing(10);
|
header.Spacing(10);
|
||||||
@@ -101,13 +99,11 @@ void createEditShortcutsWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMa
|
|||||||
|
|
||||||
// Table to display the shortcuts
|
// Table to display the shortcuts
|
||||||
Windows::UI::Xaml::Controls::StackPanel shortcutTable;
|
Windows::UI::Xaml::Controls::StackPanel shortcutTable;
|
||||||
shortcutTable.Background(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::LightGray() });
|
|
||||||
shortcutTable.Margin({ 10, 10, 10, 20 });
|
shortcutTable.Margin({ 10, 10, 10, 20 });
|
||||||
shortcutTable.Spacing(10);
|
shortcutTable.Spacing(10);
|
||||||
|
|
||||||
// Header row of the shortcut table
|
// Header row of the shortcut table
|
||||||
Windows::UI::Xaml::Controls::StackPanel tableHeaderRow;
|
Windows::UI::Xaml::Controls::StackPanel tableHeaderRow;
|
||||||
tableHeaderRow.Background(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::LightGray() });
|
|
||||||
tableHeaderRow.Spacing(100);
|
tableHeaderRow.Spacing(100);
|
||||||
tableHeaderRow.Orientation(Windows::UI::Xaml::Controls::Orientation::Horizontal);
|
tableHeaderRow.Orientation(Windows::UI::Xaml::Controls::Orientation::Horizontal);
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ void ShortcutControl::AddNewShortcutControlRow(StackPanel& parent, std::vector<s
|
|||||||
{
|
{
|
||||||
// Parent element for the row
|
// Parent element for the row
|
||||||
Windows::UI::Xaml::Controls::StackPanel tableRow;
|
Windows::UI::Xaml::Controls::StackPanel tableRow;
|
||||||
tableRow.Background(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::LightGray() });
|
|
||||||
tableRow.Spacing(100);
|
tableRow.Spacing(100);
|
||||||
tableRow.Orientation(Windows::UI::Xaml::Controls::Orientation::Horizontal);
|
tableRow.Orientation(Windows::UI::Xaml::Controls::Orientation::Horizontal);
|
||||||
|
|
||||||
@@ -27,7 +26,6 @@ void ShortcutControl::AddNewShortcutControlRow(StackPanel& parent, std::vector<s
|
|||||||
// ShortcutControl for the new shortcut
|
// ShortcutControl for the new shortcut
|
||||||
tableRow.Children().Append(keyboardRemapControlObjects[keyboardRemapControlObjects.size() - 1][1]->getShortcutControl());
|
tableRow.Children().Append(keyboardRemapControlObjects[keyboardRemapControlObjects.size() - 1][1]->getShortcutControl());
|
||||||
|
|
||||||
|
|
||||||
// Delete row button
|
// Delete row button
|
||||||
Windows::UI::Xaml::Controls::Button deleteShortcut;
|
Windows::UI::Xaml::Controls::Button deleteShortcut;
|
||||||
FontIcon deleteSymbol;
|
FontIcon deleteSymbol;
|
||||||
@@ -61,7 +59,6 @@ void ShortcutControl::AddNewShortcutControlRow(StackPanel& parent, std::vector<s
|
|||||||
// Initialize both shortcuts as empty shortcuts
|
// Initialize both shortcuts as empty shortcuts
|
||||||
shortcutRemapBuffer.push_back(std::vector<Shortcut>{ Shortcut(), Shortcut() });
|
shortcutRemapBuffer.push_back(std::vector<Shortcut>{ Shortcut(), Shortcut() });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to add a shortcut to the shortcut control as combo boxes
|
// Function to add a shortcut to the shortcut control as combo boxes
|
||||||
@@ -106,8 +103,6 @@ void ShortcutControl::createDetectShortcutWindow(winrt::Windows::Foundation::IIn
|
|||||||
// ContentDialog for detecting shortcuts. This is the parent UI element.
|
// ContentDialog for detecting shortcuts. This is the parent UI element.
|
||||||
ContentDialog detectShortcutBox;
|
ContentDialog detectShortcutBox;
|
||||||
|
|
||||||
// TODO: Hardcoded light theme, since the app is not theme aware ATM.
|
|
||||||
detectShortcutBox.RequestedTheme(ElementTheme::Light);
|
|
||||||
// ContentDialog requires manually setting the XamlRoot (https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.contentdialog#contentdialog-in-appwindow-or-xaml-islands)
|
// ContentDialog requires manually setting the XamlRoot (https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.contentdialog#contentdialog-in-appwindow-or-xaml-islands)
|
||||||
detectShortcutBox.XamlRoot(xamlRoot);
|
detectShortcutBox.XamlRoot(xamlRoot);
|
||||||
detectShortcutBox.Title(box_value(L"Press the keys in shortcut:"));
|
detectShortcutBox.Title(box_value(L"Press the keys in shortcut:"));
|
||||||
@@ -172,7 +167,8 @@ void ShortcutControl::createDetectShortcutWindow(winrt::Windows::Foundation::IIn
|
|||||||
detectShortcutBox.Dispatcher().RunAsync(
|
detectShortcutBox.Dispatcher().RunAsync(
|
||||||
Windows::UI::Core::CoreDispatcherPriority::Normal,
|
Windows::UI::Core::CoreDispatcherPriority::Normal,
|
||||||
[primaryButton] {
|
[primaryButton] {
|
||||||
primaryButton.Background(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::DarkGray() });
|
// Use the base medium low brush to be consistent with the theme
|
||||||
|
primaryButton.Background(Windows::UI::Xaml::Application::Current().Resources().Lookup(box_value(L"SystemControlBackgroundBaseMediumLowBrush")).as<Windows::UI::Xaml::Media::SolidColorBrush>());
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[onAccept, detectShortcutBox](DWORD) {
|
[onAccept, detectShortcutBox](DWORD) {
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ public:
|
|||||||
|
|
||||||
ShortcutControl(const size_t rowIndex, const size_t colIndex)
|
ShortcutControl(const size_t rowIndex, const size_t colIndex)
|
||||||
{
|
{
|
||||||
shortcutDropDownStackPanel.RequestedTheme(ElementTheme::Light);
|
|
||||||
shortcutDropDownStackPanel.Spacing(10);
|
shortcutDropDownStackPanel.Spacing(10);
|
||||||
shortcutDropDownStackPanel.Orientation(Windows::UI::Xaml::Controls::Orientation::Horizontal);
|
shortcutDropDownStackPanel.Orientation(Windows::UI::Xaml::Controls::Orientation::Horizontal);
|
||||||
KeyDropDownControl::AddDropDown(shortcutDropDownStackPanel, rowIndex, colIndex, shortcutRemapBuffer, keyDropDownControlObjects);
|
KeyDropDownControl::AddDropDown(shortcutDropDownStackPanel, rowIndex, colIndex, shortcutRemapBuffer, keyDropDownControlObjects);
|
||||||
@@ -43,7 +42,6 @@ public:
|
|||||||
createDetectShortcutWindow(sender, sender.as<Button>().XamlRoot(), shortcutRemapBuffer, *keyboardManagerState, rowIndex, colIndex);
|
createDetectShortcutWindow(sender, sender.as<Button>().XamlRoot(), shortcutRemapBuffer, *keyboardManagerState, rowIndex, colIndex);
|
||||||
});
|
});
|
||||||
|
|
||||||
shortcutControlLayout.Background(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::LightGray() });
|
|
||||||
shortcutControlLayout.Margin({ 0, 0, 0, 10 });
|
shortcutControlLayout.Margin({ 0, 0, 0, 10 });
|
||||||
shortcutControlLayout.Spacing(10);
|
shortcutControlLayout.Spacing(10);
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ void SingleKeyRemapControl::AddNewControlKeyRemapRow(StackPanel& parent, std::ve
|
|||||||
{
|
{
|
||||||
// Parent element for the row
|
// Parent element for the row
|
||||||
Windows::UI::Xaml::Controls::StackPanel tableRow;
|
Windows::UI::Xaml::Controls::StackPanel tableRow;
|
||||||
tableRow.Background(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::LightGray() });
|
|
||||||
tableRow.Spacing(100);
|
tableRow.Spacing(100);
|
||||||
tableRow.Orientation(Windows::UI::Xaml::Controls::Orientation::Horizontal);
|
tableRow.Orientation(Windows::UI::Xaml::Controls::Orientation::Horizontal);
|
||||||
|
|
||||||
@@ -51,8 +50,6 @@ void SingleKeyRemapControl::AddNewControlKeyRemapRow(StackPanel& parent, std::ve
|
|||||||
|
|
||||||
// Delete row button
|
// Delete row button
|
||||||
Windows::UI::Xaml::Controls::Button deleteRemapKeys;
|
Windows::UI::Xaml::Controls::Button deleteRemapKeys;
|
||||||
deleteRemapKeys.Background(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::LightGray() });
|
|
||||||
deleteRemapKeys.Foreground(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::Black() });
|
|
||||||
FontIcon deleteSymbol;
|
FontIcon deleteSymbol;
|
||||||
deleteSymbol.FontFamily(Xaml::Media::FontFamily(L"Segoe MDL2 Assets"));
|
deleteSymbol.FontFamily(Xaml::Media::FontFamily(L"Segoe MDL2 Assets"));
|
||||||
deleteSymbol.Glyph(L"\xE74D");
|
deleteSymbol.Glyph(L"\xE74D");
|
||||||
@@ -83,8 +80,6 @@ void SingleKeyRemapControl::createDetectKeyWindow(winrt::Windows::Foundation::II
|
|||||||
// ContentDialog for detecting remap key. This is the parent UI element.
|
// ContentDialog for detecting remap key. This is the parent UI element.
|
||||||
ContentDialog detectRemapKeyBox;
|
ContentDialog detectRemapKeyBox;
|
||||||
|
|
||||||
// TODO: Hardcoded light theme, since the app is not theme aware ATM.
|
|
||||||
detectRemapKeyBox.RequestedTheme(ElementTheme::Light);
|
|
||||||
// ContentDialog requires manually setting the XamlRoot (https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.contentdialog#contentdialog-in-appwindow-or-xaml-islands)
|
// ContentDialog requires manually setting the XamlRoot (https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.contentdialog#contentdialog-in-appwindow-or-xaml-islands)
|
||||||
detectRemapKeyBox.XamlRoot(xamlRoot);
|
detectRemapKeyBox.XamlRoot(xamlRoot);
|
||||||
detectRemapKeyBox.Title(box_value(L"Press a key on selected keyboard:"));
|
detectRemapKeyBox.Title(box_value(L"Press a key on selected keyboard:"));
|
||||||
@@ -147,7 +142,8 @@ void SingleKeyRemapControl::createDetectKeyWindow(winrt::Windows::Foundation::II
|
|||||||
detectRemapKeyBox.Dispatcher().RunAsync(
|
detectRemapKeyBox.Dispatcher().RunAsync(
|
||||||
Windows::UI::Core::CoreDispatcherPriority::Normal,
|
Windows::UI::Core::CoreDispatcherPriority::Normal,
|
||||||
[primaryButton] {
|
[primaryButton] {
|
||||||
primaryButton.Background(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::DarkGray() });
|
// Use the base medium low brush to be consistent with the theme
|
||||||
|
primaryButton.Background(Windows::UI::Xaml::Application::Current().Resources().Lookup(box_value(L"SystemControlBackgroundBaseMediumLowBrush")).as<Windows::UI::Xaml::Media::SolidColorBrush>());
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[onAccept, detectRemapKeyBox](DWORD) {
|
[onAccept, detectRemapKeyBox](DWORD) {
|
||||||
|
|||||||
@@ -26,15 +26,12 @@ public:
|
|||||||
singleKeyRemapDropDown(rowIndex, colIndex, singleKeyRemapBuffer)
|
singleKeyRemapDropDown(rowIndex, colIndex, singleKeyRemapBuffer)
|
||||||
{
|
{
|
||||||
typeKey.Content(winrt::box_value(winrt::to_hstring("Type Key")));
|
typeKey.Content(winrt::box_value(winrt::to_hstring("Type Key")));
|
||||||
typeKey.Background(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::LightGray() });
|
|
||||||
typeKey.Foreground(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::Black() });
|
|
||||||
typeKey.Click([&, rowIndex, colIndex](winrt::Windows::Foundation::IInspectable const& sender, RoutedEventArgs const&) {
|
typeKey.Click([&, rowIndex, colIndex](winrt::Windows::Foundation::IInspectable const& sender, RoutedEventArgs const&) {
|
||||||
keyboardManagerState->SetUIState(KeyboardManagerUIState::DetectSingleKeyRemapWindowActivated, EditKeyboardWindowHandle);
|
keyboardManagerState->SetUIState(KeyboardManagerUIState::DetectSingleKeyRemapWindowActivated, EditKeyboardWindowHandle);
|
||||||
// Using the XamlRoot of the typeKey to get the root of the XAML host
|
// Using the XamlRoot of the typeKey to get the root of the XAML host
|
||||||
createDetectKeyWindow(sender, sender.as<Button>().XamlRoot(), singleKeyRemapBuffer, *keyboardManagerState, rowIndex, colIndex);
|
createDetectKeyWindow(sender, sender.as<Button>().XamlRoot(), singleKeyRemapBuffer, *keyboardManagerState, rowIndex, colIndex);
|
||||||
});
|
});
|
||||||
|
|
||||||
singleKeyRemapControlLayout.Background(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::LightGray() });
|
|
||||||
singleKeyRemapControlLayout.Margin({ 0, 0, 0, 10 });
|
singleKeyRemapControlLayout.Margin({ 0, 0, 0, 10 });
|
||||||
singleKeyRemapControlLayout.Spacing(10);
|
singleKeyRemapControlLayout.Spacing(10);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user