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
Merged

Always-on-Top mode implemented #579

merged 36 commits into from
Jul 31, 2019

Conversation

greedyAI
Copy link
Contributor

@greedyAI greedyAI 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 July 11, 2019 00:20
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/CalculatorStandardOperators.xaml.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
grochocki
grochocki previously approved these changes Jul 25, 2019
Copy link
Contributor

@grochocki grochocki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
grochocki
grochocki previously approved these changes Jul 30, 2019
joseartrivera
joseartrivera previously approved these changes Jul 30, 2019
joseartrivera
joseartrivera previously approved these changes Jul 30, 2019
Copy link

@liangchen07 liangchen07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve from the PM perspective.

@joseartrivera joseartrivera merged commit 796d171 into microsoft:master Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the ability for users to pin Calculator on top of other windows
8 participants