Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always-on-Top mode implemented #579

Merged
merged 36 commits into from Jul 31, 2019

Conversation

@greedyAI
Copy link
Member

commented Jul 10, 2019

Implemented the 2nd most user requested new feature: the ability for users to pin Calculator on top of other windows.

Description of the changes:

  • A Button has been added to TitleBar and styled identical to the other TitleBar buttons. This button only appears in Standard calculator mode. Clicking on this button calls ViewModePreferences API to switch the window into CompactOverlay mode (and back, when exiting from Always-on-Top mode).
  • The ViewModel is updated accordingly when the button is pressed. These updates propagate dependency properties and observable variables back to the UI to show/hide and enable/disable certain UI elements (eg. buttons) and keyboard shortcuts.
  • The screen size is stored in LocalSettings whenever the user resizes the screen in Always-on-Top mode. This is used for restoring the last used screen size when the user enters Always-on-Top mode.
  • AdaptiveTriggers and SizedChanged event handlers are used to implement a responsive UI: certain buttons are hidden when the screen shrinks and the font sizes vary based on the screen size as well.
  • The main expression in the Always-on-Top mode combines an ItemsControl and a TextBlock to render the desired mathematical result/expression. This scrollable expression shows the full mathematical expression when edited. When the user presses the "=" button, it shows the final computed result.
  • The resulting functionality matches that as specified in the PM spec here.

How changes were validated:

  • Manual testing.

Fixes #78

@greedyAI greedyAI marked this pull request as ready for review Jul 11, 2019

src/CalcViewModel/ApplicationViewModel.cpp Outdated Show resolved Hide resolved
src/CalcViewModel/ApplicationViewModel.cpp Outdated Show resolved Hide resolved
src/CalcViewModel/ApplicationViewModel.cpp Outdated Show resolved Hide resolved
src/Calculator/Views/TitleBar.xaml.h Outdated Show resolved Hide resolved
src/CalcViewModel/StandardCalculatorViewModel.cpp Outdated Show resolved Hide resolved

greedyAI added some commits Jul 24, 2019

@grochocki
Copy link
Contributor

left a comment

Approving UX

src/CalcViewModel/Common/KeyboardShortcutManager.cpp Outdated Show resolved Hide resolved
src/CalcViewModel/StandardCalculatorViewModel.cpp Outdated Show resolved Hide resolved
src/CalcViewModel/StandardCalculatorViewModel.cpp Outdated Show resolved Hide resolved
src/CalcViewModel/StandardCalculatorViewModel.cpp Outdated Show resolved Hide resolved
src/Calculator/Views/MainPage.xaml.cpp Outdated Show resolved Hide resolved
src/Calculator/Views/MainPage.xaml.cpp Outdated Show resolved Hide resolved

@greedyAI greedyAI force-pushed the greedyAI:always-on-top branch from fc3f050 to 40fd2d6 Jul 30, 2019

greedyAI added some commits Jul 30, 2019

greedyAI added some commits Jul 31, 2019

@liangchen07
Copy link

left a comment

Approve from the PM perspective.

@joseartrivera joseartrivera merged commit 796d171 into microsoft:master Jul 31, 2019

7 checks passed

Calculator-CI Build #0.1907.3103.0 succeeded
Details
Calculator-CI (Build x64) Build x64 succeeded
Details
Calculator-CI (CleanUpUnitTestsx64) CleanUpUnitTestsx64 succeeded
Details
Calculator-CI (Package) Package succeeded
Details
Calculator-CI (UITests x64) UITests x64 succeeded
Details
Calculator-CI (UnitTests x64) UnitTests x64 succeeded
Details
license/cla All CLA requirements met.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.