diff --git a/src/runner/Resources.resx b/src/runner/Resources.resx index 92703d2675..902e3a0874 100644 --- a/src/runner/Resources.resx +++ b/src/runner/Resources.resx @@ -106,8 +106,13 @@ PowerToys Update + + Quick access\tLeft-click + Don't localize "\t" as that is what separates the click portion to be right aligned in the menu. + - Settings + Settings\tDouble-click + Don't localize "\t" as that is what separates the click portion to be right aligned in the menu. Documentation diff --git a/src/runner/resource.base.h b/src/runner/resource.base.h index f85cea50f5..22d040cc82 100644 --- a/src/runner/resource.base.h +++ b/src/runner/resource.base.h @@ -19,4 +19,5 @@ #define ID_SETTINGS_MENU_COMMAND 40002 #define ID_ABOUT_MENU_COMMAND 40003 #define ID_REPORT_BUG_COMMAND 40004 -#define ID_DOCUMENTATION_MENU_COMMAND 40005 \ No newline at end of file +#define ID_DOCUMENTATION_MENU_COMMAND 40005 +#define ID_QUICK_ACCESS_MENU_COMMAND 40006 \ No newline at end of file diff --git a/src/runner/runner.base.rc b/src/runner/runner.base.rc index 10a4555db8..5737649c37 100644 Binary files a/src/runner/runner.base.rc and b/src/runner/runner.base.rc differ diff --git a/src/runner/tray_icon.cpp b/src/runner/tray_icon.cpp index 6987a6d1cc..015fb158b8 100644 --- a/src/runner/tray_icon.cpp +++ b/src/runner/tray_icon.cpp @@ -68,6 +68,11 @@ void change_menu_item_text(const UINT item_id, wchar_t* new_text) SetMenuItemInfoW(h_menu, item_id, false, &menuitem); } +void open_quick_access_flyout_window(const POINT flyout_position) +{ + open_settings_window(std::nullopt, true, flyout_position); +} + void handle_tray_command(HWND window, const WPARAM command_id, LPARAM lparam) { switch (command_id) @@ -105,6 +110,13 @@ void handle_tray_command(HWND window, const WPARAM command_id, LPARAM lparam) RunNonElevatedEx(L"https://aka.ms/PowerToysOverview", L"", L""); break; } + case ID_QUICK_ACCESS_MENU_COMMAND: + { + POINT mouse_pointer; + GetCursorPos(&mouse_pointer); + open_quick_access_flyout_window(mouse_pointer); + break; + } } } @@ -113,7 +125,7 @@ void click_timer_elapsed() double_click_timer_running = false; if (!double_clicked) { - open_settings_window(std::nullopt, true, tray_icon_click_point); + open_quick_access_flyout_window(tray_icon_click_point); } } @@ -181,10 +193,12 @@ LRESULT __stdcall tray_icon_window_proc(HWND window, UINT message, WPARAM wparam static std::wstring exit_menuitem_label = GET_RESOURCE_STRING(IDS_EXIT_MENU_TEXT); static std::wstring submit_bug_menuitem_label = GET_RESOURCE_STRING(IDS_SUBMIT_BUG_TEXT); static std::wstring documentation_menuitem_label = GET_RESOURCE_STRING(IDS_DOCUMENTATION_MENU_TEXT); + static std::wstring quick_access_menuitem_label = GET_RESOURCE_STRING(IDS_QUICK_ACCESS_MENU_TEXT); change_menu_item_text(ID_SETTINGS_MENU_COMMAND, settings_menuitem_label.data()); change_menu_item_text(ID_EXIT_MENU_COMMAND, exit_menuitem_label.data()); change_menu_item_text(ID_REPORT_BUG_COMMAND, submit_bug_menuitem_label.data()); change_menu_item_text(ID_DOCUMENTATION_MENU_COMMAND, documentation_menuitem_label.data()); + change_menu_item_text(ID_QUICK_ACCESS_MENU_COMMAND, quick_access_menuitem_label.data()); } if (!h_sub_menu) { diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Flyout/LaunchPage.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Flyout/LaunchPage.xaml index 8bb57e9e9f..0949b813bd 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Flyout/LaunchPage.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/Flyout/LaunchPage.xaml @@ -40,7 +40,7 @@