Age | Commit message (Collapse) | Author |
|
Previously, changing a system theme with Calculator opened made buttons
with custom color not to update to the new theme - the background color
remained from the previous one.
This is because when setting the color, the widget has to copy the
current palette and modify the foreground color there, which means it
will no longer refer to the system theme and any change there will not
happen here.
Using colors from a system palette fixes this issue and makes buttons
look slightly different from what was here before. But that is because
they're now somewhat more integrated with the system themes! :^)
Type | Old color | New color role
---- | --------- | --------------
Numbers | "blue" | SyntaxNumber
Functions (sqrt, %) | "blue" | SyntaxFunction
Operators (+ - * /) | text-default | SyntaxOperator
Backspace, CE and C | "brown" | SyntaxControlKeyword
Memory operators, = | "red" | SyntaxPreprocessorValue
|
|
This prevents us from needing a sv suffix, and potentially reduces the
need to run generic code for a single character (as contains,
starts_with, ends_with etc. for a char will be just a length and
equality check).
No functional changes.
|
|
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).
No functional changes.
|
|
This is meant to address #14234 by renaming the "Euler's Constant"
menu item to "Euler's Number". This commit removes the existing
"eulers.png" and replaces with a new "eulers_number.png" for clarity.
|
|
|
|
|
|
|
|
|
|
|
|
Having the return key sometimes press the equal button when nothing is
focused and press a different button when there is focus felt confusing.
The equal button is still able to be focused for the tab cycle to have
something to go to in order to jump out of the textbox but no other
keypad button can be focused now.
|
|
|
|
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules
"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
|
|
Adds icons for Pi and Euler's Constant to the Constants menu.
|
|
This brings the existing GML files up to spec with the new requirements
|
|
|
|
|
|
Small numbers (smaller than 1e-19) can't be displayed in the calculator.
They provoke a division by zero in Keypad::set_value(), as 10^20
overflows.
|
|
This method was declared but not implemented, and will probably never be
useful.
|
|
This patch prevents zero to be displayed as "0.00". The value is now
always printed with only one character.
|
|
At this point, the double conversions should really only be
implementation details of the KeypadValue class. Therefore,
the constructor-from double and conversion-operator-to
double of KeypadValue are made private. Instead, the
required functionality is provided by KeypadValue itself.
The internal implementation is still done using doubles.
However, this opens us up to the possibility of having
loss-free square root, inversion and division in the future.
|
|
Previously, we would use lossy strtod() conversion. This was bad,
especially since we switched from internally storing Calculator
state in a double to storing it in the KeypadValue class
some time ago. This commit adds a constructor for the KeypadValue
class that is not lossy by using strtoll(). It handles numbers
with and without decimal points as well as negative numbers
correctly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
Otherwise, space is reserved but menus aren't shown.
|
|
|
|
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. :^)
|
|
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.
|
|
|
|
This adds component declarations so that users can select to not build
certain parts of the OS.
|
|
The UI of this application is still quite bad/uneven, but this at
least fixes the most egregious button misalignment.
|
|
|
|
This fixes a bug where entering a number like ".15" would result in "15"
instead of "0.15"
|
|
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.
|
|
|
|
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().
|
|
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!
|
|
|
|
|
|
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 *
|
|
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. :^)
|
|
|
|
|