summaryrefslogtreecommitdiff
path: root/Userland/Applications/Calculator
AgeCommit message (Collapse)Author
2021-08-26Calculator: The equal key will now also finish the operationScott R. Parish
Prior to this if you typed "1+2=" you would not get the answer, instead you'd be left with "2" on the screen; Calculator wanted you to hit the enter key to get the answer. Now you can either use the enter or the equal key to finish the operation and get the answer.
2021-08-18Userland+LibGUI: Add shorthand versions of the Margins constructorsin-ack
This allows for typing [8] instead of [8, 8, 8, 8] to specify the same margin on all edges, for example. The constructors follow CSS' style of specifying margins. The added constructors are: - Margins(int all): Sets the same margin on all edges. - Margins(int vertical, int horizontal): Sets the first argument to top and bottom margins, and the second argument to left and right margins. - Margins(int top, int vertical, int bottom): Sets the first argument to the top margin, the second argument to the left and right margins, and the third argument to the bottom margin.
2021-08-03Calculator: Use KeypadValue class instead of doublecreator1creeper1
Calculator now uses the KeypadValue class instead of double in its internal calculations. By not constantly converting to double back-and-forth, we do not use precision simply by, for example, negating a number. This fixes #7484.
2021-08-03Calculator: Add KeypadValue classcreator1creeper1
This commit adds a basic KeypadValue class which abstracts away Keypad's internal representation in a slightly simpler format. This will allow arithmetic operations in the Calculator to not lose any precision. In cases where losing precision is necessary, an explicit conversion operator to double is provided, as well as an explicit constructor from double.
2021-07-31Calculator: Add menus before showing the windowLuK1337
Otherwise, space is reserved but menus aren't shown.
2021-07-27Calculator: Improve UI margin consistencyFrHun
2021-07-21Userland: Add GUI::Window::add_menu() and use it everywhereAndreas Kling
Applications previously had to create a GUI::Menubar object, add menus to it, and then call GUI::Window::set_menubar(). This patch introduces GUI::Window::add_menu() which creates the menubar automatically and adds items to it. Application code becomes slightly simpler as a result. :^)
2021-07-19Everywhere: Use AK/Math.h if applicableHendiadyoin1
AK's version should see better inlining behaviors, than the LibM one. We avoid mixed usage for now though. Also clean up some stale math includes and improper floatingpoint usage.
2021-07-04Everywhere: Prefer using "..."sv over StringView { "..." }Gunnar Beutner
2021-06-17Everywhere: Add component declarationsGunnar Beutner
This adds component declarations so that users can select to not build certain parts of the OS.
2021-06-13Calculator: Fix offensive button misalignmentAndreas Kling
The UI of this application is still quite bad/uneven, but this at least fixes the most egregious button misalignment.
2021-05-23Calculator: Remove unused headersMax Wipfli
2021-05-23Calculator: Fix behavior when entering number starting with decimalMax Wipfli
This fixes a bug where entering a number like ".15" would result in "15" instead of "0.15"
2021-05-23Calculator: Use Checked to ensure entered values do not overflowMax Wipfli
This replaces the types of m_int_value and m_frac_value with Checked<u64> which makes it possible to check if the value overflowed when entering a digit. If that happens, the digit will just be ignored. This fixes #1263.
2021-05-23Calculator: Show decimal point immediately when typedMax Wipfli
2021-05-23Calculator: Handle keydown events correctly with all keyboard layoutsMax Wipfli
This changes the keydown_event handler to use codepoints instead of key codes for comparison if possible. This is so the functionality still works as intended with keyboard layouts where e.g. typing '+' actually results in KeyCode::Key_ExclamationPoint rather than KeyCode::Key_Plus. This also removes the unnecessary call to atoi().
2021-05-13Userland: Tighten a *lot* of pledges! :^)Andreas Kling
Since applications using Core::EventLoop no longer need to create a socket in /tmp/rpc/, and also don't need to listen for incoming connections on this socket, we can remove a whole bunch of pledges!
2021-05-01Everywhere: Rename app_menu to file_menu or game_menuAndreas Kling
2021-04-29Everywhere: Add missing comma between copyright year and nameLinus Groh
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-13Everywhere: It's now "Foobar", not "FooBar", and not "foo bar"Andreas Kling
I hereby declare these to be full nouns that we don't split, neither by space, nor by underscore: - Breadcrumbbar - Coolbar - Menubar - Progressbar - Scrollbar - Statusbar - Taskbar - Toolbar This patch makes everything consistent by replacing every other variant of these with the proper one. :^)
2021-04-10Calculator: Alt shortcuts and book title capitalization in menusAndreas Kling
2021-04-10Calculator: Add a separator line between the menu and the main UIAndreas Kling
2021-03-29Everywhere: Change font properties to be described in GMLEdgar Araújo
2021-03-29Everywhere: Remove empty {} from GML objectsEdgar Araújo
2021-03-25Userland: Turn all application menus into window menus :^)Andreas Kling
2021-03-12Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)Andreas Kling
Good-bye LogStream. Long live AK::Format!
2021-02-24Calculator: Add support for copy+paste using system clipboardBrendan Coles
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
2021-02-23AK+Kernel+Userland: Enable some more compiletime format string checksAnotherTest
This enables format string checks for three more functions: - String::formatted() - Builder::appendff() - KBufferBuilder::appendff()
2021-02-08Everywhere: Fix weird includesBen Wiederhake
2021-01-30Everywhere: Add missing parent window to about dialogsLinus Groh
Partially addresses #5177.
2021-01-22Calculator: Give the '9' button a blue foreground color as wellLinus Groh
2021-01-16Everywhere: Drop "shared_buffer" in most GUI programs, pledge "recvfd"Andreas Kling
Now that WindowServer broadcasts the system theme using an anonymous file, we need clients to pledge "recvfd" so they can receive it. Some programs keep the "shared_buffer" pledge since it's still used for a handful of things.
2021-01-15Everywhere: Pledge "sendfd" in WindowServer client programsAndreas Kling
This is needed for the new way we transfer window backing stores.
2021-01-12Applications: Move to Userland/Applications/Andreas Kling