summaryrefslogtreecommitdiff
path: root/Userland/Demos
AgeCommit message (Collapse)Author
2021-05-03Userland: Update IPC calls to use proxiesGunnar Beutner
This updates all existing code to use the auto-generated client methods instead of post_message/send_sync.
2021-05-01WindowServer+LibGfx: Automatic "modified" markers in window titlesAndreas Kling
You can now add the string "[*]" to a window title and it will be replaced with " (*)" if the window is modified, and with "" otherwise.
2021-05-01Everywhere: Rename app_menu to file_menu or game_menuAndreas Kling
2021-05-01Demos: Added Alt+F4 funtionality to demos that lacked itinalone
The Fire, LibGfxDemo and LibGfxScaleDemo demos did not have Alt+F4 functionality as they lacked menubars - I just added basic menubars with Quit entries to allow this shortcut with the demos that didn't have it.
2021-04-29Userland: Fix two misaligned copyright headersLinus Groh
2021-04-29Everywhere: Use "the SerenityOS developers." in copyright headersLinus Groh
We had some inconsistencies before: - Sometimes "The", sometimes "the" - Sometimes trailing ".", sometimes no trailing "." I picked the most common one (lowecase "the", trailing ".") and applied it to all copyright headers. By using the exact same string everywhere we can ensure nothing gets missed during a global search (and replace), and that these inconsistencies are not spread any further (as copyright headers are commonly copied to new files).
2021-04-28Screensaver: Implement mouse hysteresisJelle Raaijmakers
Allow the mouse to move a bit before actually closing the app. Fixes #6692
2021-04-26Demos: Add Starfield screensaver demoJagger De Leo
2021-04-23AK: Rename adopt() to adopt_ref()Andreas Kling
This makes it more symmetrical with adopt_own() (which is used to create a NonnullOwnPtr from the result of a naked new.)
2021-04-23WidgetGallery: Split cursor/icon names based on full pathsthankyouverycool
Fixes [null] icons since switching to next_full_path iteration
2021-04-22Everywhere: Use linusg@serenityos.org for my copyright headersLinus 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-22WidgetGallery: Fix bogus return type from FileIconsModel::create()Andreas Kling
2021-04-21Userland: Use Core::DirIterator::next_full_path()Andreas Kling
Simplify some code by using this instead of concatenating the full path ourselves at the call site.
2021-04-16Everywhere: Add `-Wdouble-promotion` warningNicholas-Baron
This warning informs of float-to-double conversions. The best solution seems to be to do math *either* in 32-bit *or* in 64-bit, and only to cross over when absolutely necessary.
2021-04-15LibGfxDemo: Add an elliptic arc next to the Bezier curvesAnotherTest
Because why not.
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-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-25WindowServer+LibGfx: Show menus in windows! :^)Andreas Kling
This patch begins the transition away from the global menu towards per-window menus instead. The global menu looks neat, but has always felt clunky, and there are a number of usability problems with it, especially in programs with multiple windows. You can now call GUI::Window::set_menubar() to add a menubar to your window. It will be specific to that one window only.
2021-03-16LibGfx: Rename 32-bit BitmapFormats to BGRA8888 and BGRx888xAndreas Kling
The previous names (RGBA32 and RGB32) were misleading since that's not the actual byte order in memory. The new names reflect exactly how the color values get laid out in bitmap data.
2021-03-12Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)Andreas Kling
Good-bye LogStream. Long live AK::Format!
2021-03-12WidgetGallery: Convert layout to GML and add new Icons gallerythankyouverycool
2021-03-03Cube: Add an argument for the "frameless cube" optionone-some
2021-02-27WidgetGallery: add a simple Wizard demo :^)Nick Vella
The sample Wizard subclasses WizardDialog and demonstrates a front and back cover, as well as extracting user input from a Wizard page to display in the interface which spawned the Wizard.
2021-02-27LibGUI: add a rudimentary framework for Wizards.Nick Vella
This patch provides the basic components needed for developers to create consistent wizard interface experiences in their applications. `WizardDialog` provides the dialog frame for the wizard, handling navigation and presentation. `AbstractWizardPage`s form the base class of Wizard pages, which are pushed onto the `WizardDialog` page stack via `WizardDialog::push_page`. `CoverWizardPage` and `WizardPage` are provided to ease the creation of Wizard interfaces consistent with the Serenity visual language.
2021-02-26Everywhere: Remove a bunch of redundant 'AK::' namespace prefixesLinus Groh
This is basically just for consistency, it's quite strange to see multiple AK container types next to each other, some with and some without the namespace prefix - we're 'using AK::Foo;' a lot and should leverage that. :^)
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-21CatDog: Fix wake-sleep "loop" when cursor is over right-top of headTom
Because re-evaluation of the hovered window may trigger sending a MouseMove event to a window we should only wake it if the mouse position actually has changed.
2021-02-21Cube: Add an option to render a frameless cubeTom
2021-02-20LibGUI: Swap order of InputBox value and parent window argsLinus Groh
This is now consistent with the other dialog classes.
2021-02-15CatDog: Set window hit testing to opaque pixels onlyTom
2021-02-15LibGfx: Remove static load_from_file() from abstract Font classStephan Unverwerth
2021-01-25LibGfx: Implement scaling support for Painter::blit_filtered()Nico Weber
...and functions implemented in terms of it: blit_brightened(), blit_dimmed(), blit_disabled(). In theory, this should stop the window server from asserting when an application becomes unresponsive, but that feature seems to be broken for unrelated reasons atm (#5111).
2021-01-25LibGfx: Fix opacity handling in Painter::draw_scaled_bitmapNico Weber
If the source image had no alpha channel we'd ignore opacity < 1.0 and blit the image as if it was fully opaque. With this fix, adjusting the opacity of windows with mousewheel while holding super works in hidpi mode.
2021-01-25LibGfx:: Implement scale support for blit_with_opacity()Nico Weber
Now we no longer crash on mousewheel over Terminal while holding the super key. The terminal window doesn't yet correctly become transparent in hidpi mode (needs more investigation), but it works in LibGfxScaleDemo, so maybe that's a problem elsewhere. Also add a FIXME for a pre-existing bug.
2021-01-23WindowServer: Don't crash on wallpapers smaller than the desktop with fill ↵Nico Weber
mode 'simple' blit() calls draw_scaled_bitmap() behind the scenes in scaled contexts, and that doesn't like src_rect to be outside of the source bitmap's bounds. Implicitly clip with the source rect, like the non-scaled codepath already does. Fixes #5017 even more.
2021-01-23LibGfx: Make draw_tiled_bitmap() in scaled contexts actually workNico Weber
2021-01-22LibGfx: Add a draw_scaled_bitmap() variant that takes a FloatRect as src_rectNico Weber
Consider draw_scaled_bitmap({0, 0, 10, 10}, source, {0, 0, 5, 5}). Imagine wanting to split that up into two calls, like e.g. the compositor when redrawing the background with damage rects. You really want to be able to say draw_scaled_bitmap({0, 0, 5, 10}, source, {0, 0, 2.5, 5}) but up to now you couldn't. Now you can. This makes painting very low-res images (such as tile.png) in mode "stretch" work much better.
2021-01-22LibGUI: Resolve cyclic inclusionBen Wiederhake
Application.h includes Widget.h which includes Application.h. I'm not entirely sure what the semantics are in this case, but avoiding this seems to be the safer approach. In this case, Widget does not actually use Application, so let's just remove the unused include.
2021-01-22LibGfx: Remove Painter::blit_scaled() in favor of Painter::draw_scaled_bitmap()Nico Weber
draw_scaled_bitmap() has a clearer API (just source and dest rects -- blit_scaled() took those and scale factors and then ignored width and height on the source rect and it was less clear what it was supposed to do), and they do mostly the same thing. The draw_scaled_bitmap() API takes an IntRect as source rect, so it's currently not always possible to split a big draw_scaled_bitmap() into two (or more) smaller draw_scaled_bitmap() calls that do the same thing -- that'd require FloatRects. The compositor kind of wants this to be possible, but there's already a FIXME about this not looking quite right with the previous approach either. draw_scaled_bitmap() handles transparent sources, so after this change wallpapers with transparency will be blended instead of copied. But that seems fine, and if not, the Right Fix for that is to remove the alpha channel from wallpapers after loading them anyways. As an added bonus, draw_scaled_bitmap() already handles display scale, so this fixes window server asserts for background images that are shown as "stretch" (#5017). The window server still asserts for "tile" and "offset" for now though. Calling draw_scaled_bitmap() here exposed a bug in it fixed by #5041. Before that is merged, this change here will cause smearing on the background image when moving windows around.
2021-01-22LibGfx: Correctly handle source rect offset in draw_scaled_bitmapNico Weber
The do_draw_integer_scaled_bitmap() fastpath already handled this correctly, but the arbitrary scale path did not.
2021-01-20LibGfxScaleDemo: Add coverage for blit_with_alphaNico Weber
2021-01-20LibGfx: Give Bitmap a scale factorNico Weber
Gfx::Bitmap can now store its scale factor. Normally it's 1, but in high dpi mode it can be 2. If a Bitmap with a scale factor of 2 is blitted to a Painter with scale factor of 2, the pixels can be copied over without any resampling. (When blitting a Bitmap with a scale factor of 1 to a Painter with scale factor of 2, the Bitmap is painted at twice its width and height at paint time. Blitting a Bitmap with a scale factor of 2 to a Painter with scale factor 1 is not supported.) A Bitmap with scale factor of 2 reports the same width() and height() as one with scale factor 1. That's important because many places in the codebase use a bitmap's width() and height() to layout Widgets, and all widget coordinates are in logical coordinates as well, per Documentation/HighDPI.md. Bitmap grows physical_width() / physical_height() to access the actual pixel size. Update a few callers that work with pixels to call this instead. Make Painter's constructor take its scale factor from the target bitmap that's passed in, and update its various blit() methods to handle blitting a 2x bitmap to a 2x painter. This allows removing some gnarly code in Compositor. (In return, put some new gnarly code in LibGfxScaleDemo to preserve behavior there.) No intended behavior change.
2021-01-17LibGfx: Make Painter take the scale factor as constructor argumentNico Weber
I want to give Bitmap an intrinsic scale factor and this is a step in that direction. No behavior change.
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-16Everywhere: Convert a handful of String::format() => formatted()Andreas Kling
2021-01-15LibGfxScaleDemo: Add Emoji to window title barNico Weber
I thought this wouldn't work yet, but it already does.
2021-01-15LibGfx: Make Painter::draw_rect() scale-awareNico Weber
Needed for the window server minimize animation. draw_rect() can't just call draw_line() because that isn't draw_op()-aware. The draw_op()-awareness in Painter looks a bit ad-hoc, but that's for another day.