Commit Graph

17 Commits

Author SHA1 Message Date
Andreas Kling
235f39e449 LibGfx: Use ErrorOr<T> for Bitmap::try_load_from_file()
This was used in a lot of places, so this patch makes liberal use of
ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
2021-11-08 00:35:27 +01:00
Sam Atkins
885ca2f968 LibGfx+WindowServer: Move shadow-painting code to StylePainter
Specifically, this is to make it accessible to ThemeEditor, but there's
nothing about it that is especially window-specific.
2021-10-28 11:23:44 +02:00
Sam Atkins
cf188df86c LibGfx: Make style painters use east const and virtual specifiers 2021-10-28 11:23:44 +02:00
Andreas Kling
b8416df173 LibGUI+LibGfx: Make scrollbar buttons a little bit thicker
The common thin-cap button look (1px highlight, 2px shadow) looks nice
on regular buttons, but the scrollbar didn't feel quite right.
This patch adds 1px of offset to the highlight, giving it a thick-cap
look (which I have named Gfx::ButtonStyle::ThickCap) :^)
2021-08-31 01:35:08 +02:00
Andreas Kling
410b3c85b6 LibGUI+LibGfx: Highlight currently active tab button with accent color
Use the new "Accent" color role to emphasize the currently active tab
within a GUI::TabWidget. :^)
2021-07-28 20:25:14 +02:00
Andreas Kling
03cca20699 LibGfx: Remove unused StylePainter::paint_surface() 2021-07-28 19:13:08 +02:00
Andreas Kling
c7d891765c LibGfx: Use "try_" prefix for static factory functions
Also mark them as [[nodiscard]].
2021-07-21 18:02:15 +02:00
Linus Groh
d60ebbbba6 Revert "Userland: static vs non-static constexpr variables"
This reverts commit 800ea8ea96.

Booting the system no longer worked after these changes.
2021-05-21 10:30:52 +01:00
Lenny Maiorani
800ea8ea96 Userland: static vs non-static constexpr variables
Problem:
- `static` variables consume memory and sometimes are less
  optimizable.
- `static const` variables can be `constexpr`, usually.
- `static` function-local variables require an initialization check
  every time the function is run.

Solution:
- If a global `static` variable is only used in a single function then
  move it into the function and make it non-`static` and `constexpr`.
- Make all global `static` variables `constexpr` instead of `const`.
- Change function-local `static const[expr]` variables to be just
  `constexpr`.
2021-05-21 10:07:06 +01:00
Matthew Olsson
88cfaf7bf0 LibGfx: Unify Rect, Point, and Size
This commit unifies methods and method/param names between the above
classes, as well as adds [[nodiscard]] and ALWAYS_INLINE where
appropriate. It also renamed the various move_by methods to
translate_by, as that more closely matches the transformation
terminology.
2021-05-02 22:48:06 +02:00
Linus Groh
5459c744f1 Everywhere: Add missing comma between copyright year and name 2021-04-29 00:59:26 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
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-22 11:22:27 +02:00
Luke
dfb23babbb LibGfx: Make top highlight of classic buttons fit to the top left corner 2021-04-17 09:56:22 +02:00
Andreas Kling
a2baab38fd Everywhere: It's now "Foobar", not "FooBar", and not "foo bar"
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-13 16:58:15 +02:00
Andreas Kling
11bea5d633 LibGfx+Base: Add Tray/TrayText theme colors and Gfx::ButtonStyle::Tray
A "Tray" is a sunken container area for widgets. The first intended
client of this style is the GUI::FilePicker's common locations frame.

Thanks to @nvella for coming up with the term "Tray" :^)
2021-04-09 21:53:43 +02:00
thankyouverycool
5806630cf4 LibGfx+LibGUI: Add support for vertical ProgressBars 2021-03-12 09:59:03 +01:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00