summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
AgeCommit message (Collapse)Author
2021-09-29LibGUI: Implement automatic scrolling in AbstractViewMarcus Nilsson
This adds automatic scrolling when dragging items in TreeViews and other widgets that inherit from AbstractView when the overloaded accepts_drag() returns true. This is implemented in FileSystemModel to allow directories and files to be dragged.
2021-09-29LibGUI: Account for scrollbar width when calculating autoscroll deltaMarcus Nilsson
2021-09-29Browser: Use CommonActions where possible and various fixesMarcus Nilsson
This replaces some actions with CommonActions and also adds '...' to menu items that require user input.
2021-09-27LibGUI: Refine AbstractButton pressing behaviourFrHun
Previously the code couldn't handle leaving the AbstractButton through tab, while having it pressed through space or enter.
2021-09-27LibGUI: Add 'on_rename_successful' callback to FileSystemModelMarco Cutecchia
2021-09-24LibGUI: Categorize font families by variant instead of weightthankyouverycool
FontPickerWeightModel is no longer necessary as variants contain weight as part of a complete typeface description. This fixes fonts not inventorying correctly in picker when they contained more than bold and regular typefaces. Weight mapping has been moved into LibGfx/FontStyleMapping.h
2021-09-22LibGUI: Calculate unclamped_scrubber_size() as floatthankyouverycool
Large enough content ranges produced unclamped scrubbers sized zero, effectively clamped by their integer type. This led to zero sized page_increments and scrubbers which didn't budge on gutter events. This fixes broken gutters in FontEditor and TextEditor for large files.
2021-09-22LibGUI: Rename CallOnChange => AllowCallback and implement elsewherethankyouverycool
This is a helpful option to prevent unwanted side effects, distinguish between user and programmatic input, etc. Sliders and SpinBoxes were implementing it idiosyncratically, so let's generalize the API and give Buttons and TextEditors the same ability.
2021-09-20LibGUI: Update the window cursor if it was provided as a bitmapKarol Kosek
This condition rejected almost every bitmap cursor change.
2021-09-19LibGUI: Add option to disable on_change call for sliders set_value()David Isaksson
This makes it possible to avoid messy situations where a slider controlled value can be changed from multiple sources.
2021-09-19LibGUI: Add number_of_words() to TextEditorsthankyouverycool
Returns the total number of words in a document.
2021-09-18AK: Make Utf8View constructors inline and remove C string constructorAndreas Kling
Using StringView instead of C strings is basically always preferable. The only reason to use a C string is because you are calling a C API.
2021-09-16LibGUI: Add a AutoScroll timer to AbstractScrollableWidgetMarcus Nilsson
This commit adds a timer to AbstractScrollableWidget that can be used when implementing automatic scrolling. By overriding on_automatic_scrolling_timer_fired() we can calculate the scrolling delta when dragging objects, and redraw as needed. A helper function, automatic_scroll_delta_from_position() gives us a delta that we can use to calculate speed and direction. By default m_autoscroll_threshold is 20 pixels from the edge, and gives a linear change in scroll delta.
2021-09-16LibGUI: Implement is_min() & is_max() helpers to AbstractSliderMarcus Nilsson
2021-09-16LibGUI: Use default instead of an empty constructor/destructorBrian Gianforcaro
Default implementations allow for more optimizations. See: https://pvs-studio.com/en/docs/warnings/v832/
2021-09-12LibGUI: Remove Indices with dangling FileSystemModel::Node on deletionItamar
When a file deletion event happens, we now iterate over all views of the FileSystemModel and remove any selection & cursor indices that hold dangling references do the deleted filesystem node. This fixes #9602.
2021-09-12LibGUI: Make the Open button always active in the OpenFolder modeKarol Kosek
We can just use the current opened directory as a path in that mode. :^)
2021-09-12LibGUI: Enable/Disable the Open button on text change in FilePickerKarol Kosek
Prior this change, the button was updated on user selection change in the file view. This isn't quite right, as you could remove the text from the text box or (even worse) start typing a filename there and the button state wouldn't change.
2021-09-11LibGUI+TextEditor: Allow cursor line highlighting to be toggledthankyouverycool
2021-09-11ColorPicker: Add ability to select a color on the screenMustafa Quraish
This commit adds a `ColorSelectOverlay` class, and uses it to allow the user to pick a color from the screen. The API for `ColorSelectOverlay` is inspired from the `SelectableOverlay` in `Utilities/shot.cpp`. In particular, it opens up it's own window, so that we can have control over the cursor over the whole screen. There's one thing notably different: In addition to returning the final selected color from the `exec()` function, it also provides an `on_color_changed()` hook, which can be used to (optionally) get live updated as the mouse is moving around. This is a bit odd, but allows us to use the preview widget of the color picker to see the current color under the mouse (which will be selected upon clicking). When trying to select the color from text / other small elements, this is very useful.
2021-09-10AK+Everywhere: Reduce the number of template parameters of IntrusiveListAli Mohammad Pur
This makes the user-facing type only take the node member pointer, and lets the compiler figure out the other needed types from that.
2021-09-09LibGUI: Disable Open/Save button in FilePicker when nothing is selectedJohn Diamond
The existing behaviour is that filename_textbox is cleared if a node of the wrong type is selected. Here we reflect that state update in the state of the ok_button. This change helps the user to avoid confirming (and seeing an alert) if they press "Open" after clicking on an invalid node.
2021-09-08LibGUI: West Const to East Const refactorDawid Wolosowicz
2021-09-08LibGUI: Remove an unnecessarily specific inline capacityDawid Wolosowicz
2021-09-08LibGUI: Sync the highlighting after each model updateDawid Wolosowicz
Without this, the highlighting would stay on the initial index even if the matching row is no longer there.
2021-09-08LibGUI: Refactor AbstractView::do_search() into two standalone stepsDawid Wolosowicz
This change splits the do_search() into find_next_search_match() and highlight_search() to allow the given index be independently highlighted when needed.
2021-09-08LibGUI: Remove barely used AbstractView::is_searching()Dawid Wolosowicz
2021-09-08LibGUI: Unify naming of searching timer related membersDawid Wolosowicz
2021-09-08LibGUI: Rename AbstractView::m_searching => m_highlighted_searchDawid Wolosowicz
2021-09-08LibGUI: Remove barely used AbstractView::is_highlighting_searching()Dawid Wolosowicz
2021-09-08LibGUI: Remove barely used AbstractView::searching()Dawid Wolosowicz
2021-09-08LibGUI: Make AbstractView::is_searching protectedDawid Wolosowicz
2021-09-08LibGUI+WindowServer: Remove now-obsolete cursor tracking featureBen Wiederhake
This feature was problematic for several reasons: - Tracking *all* the user activity seems like a privacy nightmare. - LibGUI actually only supports one globally tracking widget per window, even if no window is necessary, or if multiple callbacks are desired. - Widgets can easily get confused whether an event is actually directed at it, or is actually just the result of global tracking. The third item caused an issue where right-clicking CatDog opened two context menus instead of one.
2021-09-08LibGUI+WindowServer: Introduce new mouse tracking mechanismBen Wiederhake
2021-09-07Everywhere: Behaviour => BehaviorAndreas Kling
2021-09-06LibGUI: Dynamically resize editing content rect in IconViewMarcus Nilsson
This makes IconView aware of the text width of the ModelEditingDelegate widget when editing an index and allows us to resize the content rect as needed. This also removes the border from the textbox since it could collide with the icon in ColumnsView. While editing we also skip painting the inactive selection rect since it would otherwise show when the content rect gets smaller.
2021-09-06LibGUI: Add Gfx::ColorRole to VariantKarol Kosek
For Theme Editor. :^)
2021-09-06Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safeAli Mohammad Pur
2021-09-04LibGUI: Fixes modified indicator behavior after savingluiz
Pior to this change when the user added text after having saved the file the Text Editor wouldn't enable the modified flag, unless this new text was a new line. This happened because the UndoStack was merging the Command added by the new text with the old text one, and when is_current_modified() was called, the m_stack_index would not have been incremented, and it would return false. In this change was added a condition to verify if the modified tag is active, and the merge is only done if the document is already modified.
2021-09-03Everywhere: Use my shiny new serenityos.org email :^)Sam Atkins
2021-09-03LibGUI: Set correct value on click with set jump_to_cursor() in SliderKarol Kosek
Prior this change, clicking on a slider with set jump_to_cursor() flag didn't exactly match the knob to the mouse position, and therefore the slider values were a bit off in the corners. The calculation used the whole widget size to set new values, which isn't correct as the track slider has margins on both ends. I noticed this while seeking in the Sound Player.
2021-09-03LibGUI: Add track_margin() to SlidersKarol Kosek
Less magic numbers! :^)
2021-09-02AboutDialog: Accept a version stringMahmoud Mandour
This allows applications to specify a version string to appear in the `AboutDialog`.
2021-09-02LibCore+LibGUI: Define a Serenity version in LibCoreMahmoud Mandour
Before, `AboutDialog` and `ArgsParser` read from a build-time created file called `/res/version.ini`. This caused problems with utilities unveiling specific paths leaving the version file unaccessible. This commit hard-codes a serenity version in `LibCore`, and use it in `ArgsParser` and `AboutDialog`. The previous version contained the hash of the last GIT commit, this is omitted for the default use for the sake of simplicity.
2021-09-02Userland: Migrate to argument-less deferred_invokesin-ack
Only one place used this argument and it was to hold on to a strong ref for the object. Since we already do that now, there's no need to keep this argument around since this can be easily captured. This commit contains no changes.
2021-09-01LibGUI: Don't draw Scrollbar scrubber when scrubber rect is nullthankyouverycool
Fixes null scrubbers drawing over the decrement button when window dimensions dictate they disappear.
2021-09-01LibGUI:: Style Combo and SpinBox buttons as ThickCapsthankyouverycool
These suffered the same visual defect as scrollbars when styled as normal buttons: against backgrounds with the same color as their highlighting, aspect was lost.
2021-09-01LibGUI: Show an error message box in the FilePicker on no permissionsKarol Kosek
The first attempt in #9037 used a special label as a view, if it wanted to communicate any kind of error, but that sure did look a bit ugly. Here, we are just showing a message box right before setting the new path as: - the contents of the previous directory will be visible in background, which I find pretty nice, and - I don't have to deal with adding a path history vector to reopen the previous directory (which might not even exist then). :^)
2021-09-01LibGUI: Adjust BreadcrumbButtons width on resizeMarcus Nilsson
This commit relayouts the BreadcrumbButtons on resize to a shrunken state if they don't fit. It also caps the button width to 100px to avoid overflowing the widget.
2021-08-31LibGUI/Desktop: Use LibConfig instead of Core::ConfigFileMustafa Quraish