summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
AgeCommit message (Collapse)Author
2021-08-15LibGUI: Simplify AboutDialog::version_string()Nico Weber
No behavior change.
2021-08-10LibGUI: Draw a focus rect over the row when sel. behavior is SelectRowssin-ack
2021-08-10LibGUI: Partially restore original TreeView column painting behaviorsin-ack
TreeView now prints columns mostly like it used to. The paddings are now properly applied, though. focus_rect drawing has been gated behind a selection_behavior() check to make sure we don't draw a focus rect around the column text when we're supposed to draw it over the entire row.
2021-08-10LibGUI: Default TreeView to SelectionBehavior::SelectItemssin-ack
AbstractTableView (which TreeView inherits from) sets the selection behavior of the view to SelectRows. This is not how TreeViews are used in most of the system, and TreeView::paint_event actually always draws with the assumption of selecting individual items. This commit defines the expected selection behavior for TreeViews. Users of TreeView can still override this via TreeView::set_selection_behavior.
2021-08-08LibGUI: Implement granular updates for FileSystemModelsin-ack
FileSystemModel will now react to specific events from Core::FileWatcher in order to granularly update its data based on addition or removal of files from the tree. Metadata changes are currently not handled, but in the future they can be used to re-stat() a file to get its updated statistics.
2021-08-08LibGUI: Prefix some private FileSystemModel::Node members with m_sin-ack
This commit has no functional changes.
2021-08-08LibGUI: Resize the mapping rows during sortsin-ack
SortingProxyModel always expected the source model to have the same number of rows as long as it has not been invalidated. Now that we have granular updates, this assumption is no longer true, and we need to resize the source/proxy_rows vectors to the new size. This is safe since the values in the vector are overwritten right afterwards.
2021-08-08LibGUI: Implement granular operations for Model subclassessin-ack
These can be used by Model subclasses to signal the exact operations that happened to a model, so that persistent model indices in that area are not invalidated.
2021-08-08LibGUI: Implement persistent indices for modelssin-ack
This patch adds persistent indices to models. A PersistentModelIndex is a ModelIndex that will survive most model updates (provided that the data the PersistentModelIndex points to has not been removed by the model's data store). PersistentModelIndex objects can be safely held by objects outside the model they originated from.
2021-08-08LibGUI: Do not allow tree column to shrink beyond indent and iconsin-ack
We always display the tree indent and the icon, so we shouldn't allow the tree column to shrink beyond that size.
2021-08-08LibGUI: Let the table view tell HeaderView about the min. section sizesin-ack
Previously HeaderView would just assume that each column or row could have a minimum size of 2. This makes it so that AbstractTableView subclasses can provide a new minimum value for a specific column.
2021-08-08LibGUI: Correctly call update() in ProcessChoosersin-ack
After the update -> invalidate change a couple places broke when update() was supposed to be manually called. This instance was not marked virtual or override, which made it hard to detect. This commit makes sure that update() on the original model is called when the RunningProcessesModel needs an update.
2021-08-08LibGUI: Add `break` even before empty default labelDaniel Bertalan
Clang is a bit more pedantic than GCC when diagnosing implicit fallthroughs, and doesn't care if the succeeding label only contains a single break statement.
2021-08-08LibGUI: TreeView tree column text painting adjustmentssin-ack
The text was painted with the assumption that no other column would be present after the tree column, which won't always be true. Additionally, some alignment and focus rect-related issues have been fixed.
2021-08-08LibGUI: Add show_tooltip_immediately()Tobias Christiansen
This allows an application to display a tooltip without waiting for a timer to fire first.
2021-08-07LibGUI: Don't assume GUI::Icon has 16x16 bitmap in AbstractTableViewAndreas Kling
An empty GUI::Icon would cause the column auto-sizing logic to crash.
2021-08-06LibGUI: Add ValueSlider widgetMarcus Nilsson
ValueSlider is a more generalized version of OpacitySlider when we need a slider with values displayed. It will always show the current value with a user defined suffix.
2021-08-06LibGUI+Applications: Rename Model::is_valid to is_within_rangesin-ack
The previous name did not describe what the function checked, and was easy to confuse with ModelIndex::is_valid.
2021-08-06LibGUI: Allow TabWidget to remove all tabs except oneTheFightingCatfish
2021-08-06Everywhere: Replace Model::update() with Model::invalidate()sin-ack
Most of the models were just calling did_update anyway, which is pointless since it can be unified to the base Model class. Instead, code calling update() will now call invalidate(), which functions identically and is more obvious in what it does. Additionally, a default implementation is provided, which removes the need to add empty implementations of update() for each model subclass. Co-Authored-By: Ali Mohammad Pur <ali.mpfard@gmail.com>
2021-08-05LibGUI: Add on_active_window_change function object to the Window classKarol Kosek
2021-08-03LibGUI: Redraw button on Key_{Return,Space} up eventLuK1337
Fixes buttons not getting redrawn after pressing them with return or space key.
2021-08-02LibGUI: Ensure that edit actions are disabled for password boxesGunnar Beutner
This ensures that the user can't copy/cut text from password boxes which would reveal the password. It also makes sure that the undo/redo actions stay disabled because it's difficult to reason about what these do exactly without being able to see the result.
2021-08-02LibGUI: Remove redundant codeGunnar Beutner
2021-08-02LibGUI: Add a simple GUI::PasswordInputDialogAndreas Kling
Asking the user for a password is a fairly common thing, so let's have a reusable GUI dialog for it! This first iteration only supports having pre-filled "server" and "username" fields. This can obviously be made more flexible as needs arise. :^)
2021-08-02LibGUI: Register GUI::PasswordBox to make it availble in GMLAndreas Kling
2021-08-02LibGUI, WindowServer: Greatly simplify menubar logicsin-ack
Currently, any number of menubars can be plugged in and out of a window. This is unnecessary complexity, since we only need one menubar on a window. This commit removes most of the logic for dynamically attaching and detaching menubars and makes one menubar always available. The menubar is only considered existent if it has at least a single menu in it (in other words, an empty menubar will not be shown). This commit additionally fixes a bug wherein menus added after a menubar has been attached would not have their rects properly setup, and would therefore appear glitched out on the top left corner of the menubar.
2021-08-01LibGUI: Remove unused header includesBrian Gianforcaro
2021-07-30LibGui: Add bounding of rubber band to IconViewFrHun
This ensures the selection rubber band in icon views stays within the visible area.
2021-07-29LibGUI: Do not wrap text in statusbar segmentssin-ack
This commit adds a new property to Label which allows one to enable or disable text wrapping. Statusbar now uses this property to disable text wrapping in its segments, since text wrapping in statusbars doesn't make sense.
2021-07-29LibGUI+Playground: Move GMLAutocompleteProvider to LibGUIConor Byrne
2021-07-29LibGUI: Allow to specify FilePicker window positionLuK1337
2021-07-29LibGUI: Allow to specify position on screen for Dialog windowLuK1337
This change allows us to specify where on screen we'd like the Dialog window to be drawn. By default it's set to CenterWithinParent which may fall back to Center if parent window is unset or not visible on screen.
2021-07-28Revert "LibGUI: Only dispatch Leave if the now-hovered widget isn't a child"Andreas Kling
This reverts commit cfc9ee6f16b9c4d2b246bb2832dd436637cbeaad. This change was wrong: The parent *does* lose hover when the mouse cursor enters a child widget. Hover is not hierarchical, there is only a hovered window and a hovered widget within that window. This fixes an issue with GUI::TabWidget buttons appearing hovered despite the mouse cursor not being over the buttons.
2021-07-28Revert "LibGUI: Ignore the Enter event by default"Andreas Kling
This reverts commit a5a32fbccef8f8f663001363a278f80ef6320efe. This change was wrong: it's fine for a child widget to receive an enter event despite its parent never getting one. Only the widget directly under the mouse cursor is considered hovered for enter/leave purposes.
2021-07-28LibGUI+LibGfx: Highlight currently active tab button with accent colorAndreas Kling
Use the new "Accent" color role to emphasize the currently active tab within a GUI::TabWidget. :^)
2021-07-28LibGUI: Update windows when they become active/inactiveAndreas Kling
Since interfaces may look different depending on the window active state we need to update them when it changes.
2021-07-28LibGUI: Align FilePickerDialog's common locations with file list viewLuK1337
2021-07-28LibGUI: Convert indexes to size_t and use Optional in TabWidgetLuke
Previously it was using int for indexes and using the -1 magic value. Supersedes b9d51b86015e8410a2082c42f95651c0599ec7ae
2021-07-28LibGUI: Always reset pressed close button index on mouse up in TabWidgetLuke
Previously it would only do this if the mouse was over the close button. If you released the mouse outside the close button, the close button would appear permanently depressed afterwards.
2021-07-28LibGUI: Add GUI_HOVER_DEBUG runtime debugging flag (environment)Andreas Kling
You can now see the outline of GUI widgets when hovering them. For example: $ export GUI_HOVER_DEBUG=1 $ FileManager Then move the mouse around in the file manager. :^)
2021-07-28LibGUI: Make Label padding work with left/right aligned textAndreas Kling
The previous text_rect() algorithm only produced the right result for horizontally centered labels. This adds some missing padding to GUI::Statusbar which we've apparently needed for some time. :^)
2021-07-27LibGUI: Add a ClipboardClient for GUI::ClipboardTheFightingCatfish
Anyone who inherits from `GUI::Clipboard::ClipboardClient` will receive clipboard notifications via `clipboard_content_did_change()`. Update ClipboardHistoryModel, TextEditor and TerminalWidget to inherit from this class.
2021-07-27AboutDialog: Fix inconsistent marginsFrHun
2021-07-27FilePicker: Fix button margins and sizeFrHun
2021-07-27ProcessChooser: Fix button margins and sizeFrHun
2021-07-27Userland: Make TextWrapping::Wrap opt-insin-ack
This was breaking many places which didn't expect text to wrap. Now, the only place where text currently wraps is in GUI::Label.
2021-07-27LibGUI: Disable changing the view on error in the FilePickerKarol Kosek
Prior to this change, changing the view would hide the error label and show an empty directory.
2021-07-27LibGUI: Show an error message on open error in the FilePickerKarol Kosek
2021-07-27LibGUI: Add some "fudge factor" around IconView item rectsAndreas Kling
Previously there was a dead zone between the item icon and its text in IconViews. This meant that you could click between the icon and the text label and hit nothing. This patch improves the situation by inflating both rects so that they both overlap and become a bit easier to hit.