summaryrefslogtreecommitdiff
path: root/Userland/Applications/ImageViewer
AgeCommit message (Collapse)Author
2023-05-23Base+Userland: Apply Human Interface Guidelines to Object textthankyouverycool
Corrects a slew of titles, buttons, labels, menu items and status bars for capitalization, ellipses and punctuation. Rewords a few actions and dialogs to use uniform language and punctuation.
2023-05-19ImageViewer: Add support for box sampling scalingJelle Raaijmakers
2023-05-19Revert "ImageViewer: Add support for box sampling scaling"Andreas Kling
This reverts commit 032c2a882aee23ea4ac79ac907e9594ba311764d.
2023-05-19ImageViewer: Add support for box sampling scalingJelle Raaijmakers
2023-05-05LibGUI: Make `Application`'s construction fallibleLucas CHOLLET
The pattern to construct `Application` was to use the `try_create` method from the `C_OBJECT` macro. While being safe from an OOM perspective, this method doesn't propagate errors from the constructor. This patch make `Application` use the `C_OBJECT_ABSTRACT` and manually define a `create` method that can bubble up errors from the construction stage. This commit also removes the ability to use `argc` and `argv` to create an `Application`, only `Main`'s `Arguments` can be used. From a user point of view, the patch renames `try_create` => `create`, hence the huge number of modified files.
2023-04-30LibGfx+Userland: Merge FrameShape and FrameShadow into FrameStylethankyouverycool
Previously, Frames could set both these properties along with a thickness to confusing effect: Most shapes of the same shadowing only differentiated at a thickness >= 2, and some not at all. This led to a lot of creative but ultimately superfluous choices in the code. Instead let's streamline our options, automate thickness, and get the right look without so much guesswork. Plain shadowing has been consolidated into a single Plain style, and 0 thickness can be had by setting style to NoFrame.
2023-04-25Applications: Update man page links for applicationsTim Ledbetter
This commit updates all application man page links to point to the Applications subdirectory.
2023-04-19LibGUI+Userland: Make Menu::*add_submmenu take name using new stringKarol Kosek
2023-04-19LibGUI+Userland: Make Window::*add_menu take name using new stringKarol Kosek
2023-04-15AK+Everywhere: Change URL::path() to serialize_path()MacDue
This now defaults to serializing the path with percent decoded segments (which is what all callers expect), but has an option not to. This fixes `file://` URLs with spaces in their paths. The name has been changed to serialize_path() path to make it more clear that this method will generate a new string each call (except for the cannot_be_a_base_url() case). A few callers have then been updated to avoid repeatedly calling this function.
2023-04-03ImageViewer: Fix crash when setting wallpaperjustus2510
When trying to set the wallpaper from the menu, ImageViewer would crash because setting the wallpaper requires the program to pledge to the WindowManager domain. This patch adds that pledge.
2023-03-24Applications: Convert `DeprecatedFile` usages to `LibFileSystem`Cameron Youell
2023-03-24ImageViewer: Use `LibFileSystemAccessClient`Caoimhe
This commit also starts the adoption of ErrorOr<T> and the String class in ImageViewer. However, there is still a few more changes that could be made. Since the actions of using LibFSAC and using String in more places are tightly coupled, I decided to put them in one commit.
2023-03-23ImageViewer: Fix crash when opening ImageViewer without an imageCaoimhe
Seems like a thing which slipped through the cracks... We shouldn't try to scale the image to the window's size if the bitmap doesn't exist.
2023-03-22ImageViewer: Scale image to window on resizeLucas CHOLLET
2023-03-22ImageViewer: Scale image to window on startupLucas CHOLLET
We used to do the opposite, meaning that a huge images make the window bigger than the screen. We now define a range for the window size and scale the image if it doesn't fit un the current scope.
2023-03-22ImageViewer: Scale image to window size on image changeLucas CHOLLET
2023-03-22ImageViewer: Don't resize window on image rotation or flipLucas CHOLLET
2023-03-05ImageViewer: Migrate to Directory::for_each_entry()Sam Atkins
2023-03-01LibCore+Everywhere: Remove ArgsParser::add*(char const*&)Ali Mohammad Pur
This is not guaranteed to always work correctly as ArgsParser deals in StringViews and might have a non-properly-null-terminated string as a value. As a bonus, using StringView (and DeprecatedString where necessary) leads to nicer looking code too :^)
2023-02-28Everywhere: Use '_{short_,}string' literals moreLinus Groh
This mostly updates code what was written before but merged after these were added.
2023-02-28ImageViewer: Add list of recently open files to the File menu :^)Andreas Kling
2023-02-21Userland: Fix remaining smart pointer const-correctness issuesAndreas Kling
2023-02-18Userland: Specify margins and spacing in the GUI::Layout constructorSam Atkins
2023-02-16ImageViewer: Rename "Go Back" and "Go Forward" actionsTim Ledbetter
This commit renames "Go Back" to "Go to Previous" and "Go Forward" to "Go to Next". This better reflects what the actions do.
2023-02-16ImageViewer: Make arrow key shortcuts workTim Ledbetter
The user can now navigate to the previous and next image using the left and right arrow keys respectively. These shortcuts were previously not working.
2023-02-13LibCore: Rename `File` to `DeprecatedFile`Tim Schumacher
As usual, this removes many unused includes and moves used includes further down the chain.
2023-01-26LibGfx: Remove `try_` prefix from bitmap creation functionsTim Schumacher
Those don't have any non-try counterpart, so we might as well just omit it.
2023-01-20LibGfx: Re-work the abstractions of sending image for decoding over IPCLiav A
Originally I simply thought that passing file paths is quite OK, but as Linus pointed to, it turned out that passing file paths to ensure some files are able to be decoded is awkward because it does not work with images being served over HTTP. Therefore, ideally we should just use the MIME type as an optional argument to ensure that we can always fallback to use that in case sniffing for the correct image type has failed so we can still detect files like with the TGA format, which has no magic bytes.
2023-01-18LibGfx+Ladybird+Userland: Don't sniff for TGA images with only raw bytesLiav A
Because TGA images don't have magic bytes as a signature to be detected, instead assume a sequence of ReadonlyBytes is a possible TGA image only if we are given a path so we could check the extension of the file and see if it's a TGA image. When we know the path of the file being loaded, we will try to first check its extension, and only if there's no match to a known decoder, based on simple extension lookup, then we would probe for other formats as usual with the normal sniffing method.
2023-01-12Userland: Replace remaining Core::Timer::construct()s with try_create()Sam Atkins
2023-01-06LibGUI+Everywhere: Use fallible Window::set_main_widget() everywhere :^)Sam Atkins
Rip that bandaid off! This does the following, in one big, awkward jump: - Replace all uses of `set_main_widget<Foo>()` with the `try` version. - Remove `set_main_widget<Foo>()`. - Rename the `try` version to just be `set_main_widget` because it's now the only one. The majority of places that call `set_main_widget<Foo>()` are inside constructors, so this unfortunately gives us a big batch of new `release_value_but_fixme_should_propagate_errors()` calls.
2023-01-02Base+Userland: Add menu item iconsBrandon Jordan
Base+Userland: Add menu item icons This adds missing icons to Presenter Presentation menu. This adds missing icon to Image Viewer View menu. This adds a scale icon for the Image Viewer and Font Editor. This moves the Fit Image to View icon to the 16x16 folder as it's now used by Image Viewer and not only Pixel Paint. This improves the fullscreen and play icons so that they fit together better.
2022-12-06Everywhere: Rename to_{string => deprecated_string}() where applicableLinus Groh
This will make it easier to support both string types at the same time while we convert code, and tracking down remaining uses. One big exception is Value::to_string() in LibJS, where the name is dictated by the ToString AO.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-11-13Userland: Accept drag_enter events for widgets supporting file dropsKarol Kosek
This patch will switch cursor to DragCopy when a user enters a widget while dragging file(s), giving them a visual clue that it *might* be dropped into this widget. This is a rather naive approach, as the cursor icon will change for any kind of file, as currently programs don't know the drag contents before dropping it. But after all I think it's better than nothing. :^)
2022-11-01Everywhere: Mark dependencies of most targets as PRIVATETim Schumacher
Otherwise, we end up propagating those dependencies into targets that link against that library, which creates unnecessary link-time dependencies. Also included are changes to readd now missing dependencies to tools that actually need them.
2022-10-25Userland: Let applications make use of make_command_palette_action()demostanis
2022-09-29AK+Everywhere: Replace "protocol" with "scheme" url helpersnetworkException
URL had properly named replacements for protocol(), set_protocol() and create_with_file_protocol() already. This patch removes these function and updates all call sites to use the functions named according to the specification. See https://url.spec.whatwg.org/#concept-url-scheme
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
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.
2022-06-16ImageViewer: Add Smooth Pixels image scaling optionKarol Kosek
2022-05-13LibGUI+Userland: Make Dialog::ExecResult an enum classSam Atkins
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-22Applications: Do not crash if decoded bitmap is nullJelle Raaijmakers
ImageViewer and PixelPaint would crash when the ImageDecoderClient returns a frame without a bitmap. This can happen with `.ico` files with an unsupported BPP, for example.
2022-02-14Applications: Use default constructors/destructorsLenny Maiorani
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."
2022-02-14WindowServer+Userland: Pass wallpapers as `Gfx::Bitmap` instead of pathJames Puleo
The WindowServer _really_ does not need to know the filesystem path to it's wallpaper, and allows setting arbitrary wallpapers (those outside of `/res/wallpapers`). The GUI::Desktop will keep track of the path to the wallpaper (if any), and save it to config if desired (to be persisted). This avoids the need to `unveil` paths to the wallpaper, fixing #11158
2022-02-14ImageViewer: Add "Fit Image to View" actionMustafa Quraish
This is analogous to PixelPaint, it resizes the image so that it fits in the view (with some padding).
2022-02-14ImageViewer: Fix window resizing on first imageMustafa Quraish
The logic in place for this no longer worked since we abstracted away the logic for zooming / panning (which changed how scale is stored). This commit fixes the behaviour so when the first image is opened, the window resizes to fit it.
2022-01-15LibCore+LibIPC+Everywhere: Return Stream::LocalSocket from LocalServersin-ack
This change unfortunately cannot be atomically made without a single commit changing everything. Most of the important changes are in LibIPC/Connection.cpp, LibIPC/ServerConnection.cpp and LibCore/LocalServer.cpp. The notable changes are: - IPCCompiler now generates the decode and decode_message functions such that they take a Core::Stream::LocalSocket instead of the socket fd. - IPC::Decoder now uses the receive_fd method of LocalSocket instead of doing system calls directly on the fd. - IPC::ConnectionBase and related classes now use the Stream API functions. - IPC::ServerConnection no longer constructs the socket itself; instead, a convenience macro, IPC_CLIENT_CONNECTION, is used in place of C_OBJECT and will generate a static try_create factory function for the ServerConnection subclass. The subclass is now responsible for passing the socket constructed in this function to its ServerConnection base; the socket is passed as the first argument to the constructor (as a NonnullOwnPtr<Core::Stream::LocalServer>) before any other arguments. - The functionality regarding taking over sockets from SystemServer has been moved to LibIPC/SystemServerTakeover.cpp. The Core::LocalSocket implementation of this functionality hasn't been deleted due to my intention of removing this class in the near future and to reduce noise on this (already quite noisy) PR.
2022-01-14ImageViewer: Inherit from `AbstractZoomPanWidget`Mustafa Quraish