summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
AgeCommit message (Collapse)Author
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
2021-08-31WindowServer: Add message to notify clients of applet area resizeJoe Bentley
Applets and windows would like to be able to know when the applet area has been resized. For example, this happens asynchronously after an applet has been resized, so we cannot then rely on the applet area position synchronously after resizing. This adds a new message applet_area_rect_changed and associated Event AppletAreaRectChange, and the appropriate virtual functions.
2021-08-31LibGUI: Reuse draw_item_text function in ListViewKarol Kosek
This commit will highlight searched text!
2021-08-31LibGUI: Enable searching through ListView items by keyboardKarol Kosek
ComboBoxes and a FontPicker window will now react to keyboard press.
2021-08-31LibGUI: Make ItemListModel searchableKarol Kosek
2021-08-31LibGUI: Bias text towards bottom when tabs at top have uneven spacingsin-ack
This makes the text on inactive tabs in Browser look a lil' bit nicer. :^)
2021-08-31LibGUI: Adjust content area and focus rect of tab buttonssin-ack
This improves the look of tabs and their focus rects. In particular, the concept of a "text rect" is removed, and whatever tab content area is left over after the icon and close button are added is used as the area to draw the text into. This approach is simpler than having a separate text rect.
2021-08-31LibGUI: Rename FileSystemModel's "Owner" column to "User"Andreas Kling
A file is owned by a User+Group, not an Owner+Group.
2021-08-31LibGUI: Tweak scrollbar arrowsAndreas Kling
Remove the base, leaving only the pointy triangle part. :^)
2021-08-31LibGUI+LibGfx: Make scrollbar buttons a little bit thickerAndreas Kling
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-31Userland: Use Rect::centered_within() where usefulAndreas Kling
2021-08-28LibGUI: Select common location on Filepicker startupSimon Danner
2021-08-27Everywhere: Use the Optional<T>::operator==(T) operatorMustafa Quraish
In general, I think `opt == x` looks much nicer than `opt.has_value() && opt.value() == x`, so I'm updating the remaining few instances I could find with some regex magic in my search.
2021-08-22LibGUI: Make Ctrl+Shift+Right select textAndrew January
Ctrl+Shift+Left would add the word before the cursor to the selection, but for some reason Ctrl+Shift+Right didn't add the word after the cursor to the selection.
2021-08-22LibGUI: Always resize the mapping rows when sortingKarol Kosek
Prior this change, creating a file or directory on Desktop crashed the desktop instance of FileManager. Closes: #9560
2021-08-22Everywhere: Rename get in ConfigFile::get_for_{lib,app,system} to opennetworkException
This patch brings the ConfigFile helpers for opening lib, app and system configs more inline with the regular ConfigFile::open functions.
2021-08-22Everywhere: Use Core::ConfigFile::AllowWriting::Yes to allow writingnetworkException
2021-08-20LibGUI: Reduce amount we init for FileIconProvider::filetype_image_iconAndrew January
Instead of loading every icon, only load the filetype image icon if it hasn't been already. This icon is used by IconViews that need to lazily load thumbnails, which don't need any of the other icon types. Spending the time to load the unneeded images was causing delays to first paint in BackgroundSettings.
2021-08-20LibGUI: Pass context menu events through normal event dispatchAndreas Kling
Previously we'd synthesize an event and invoke context_menu_event() directly. This prevented the event from bubbling even if ignored.
2021-08-19LibGUI: Move common action definitions to CommonActions.cppsin-ack
This makes Action.cpp itself only talk about the Action object, and makes it easier to navigate.
2021-08-18LibGUI+Browser: Add UrlBox classRob Ryan
This allows the address bar to "select all" when initially gaining focus as Firefox and Chrome do. A future improvement on this would be for the Widget class to mange and provide focus transition as part of the events instead of the UrlBox class. Currently focus is updated before the event is provided to the UrlBox class.
2021-08-18LibGUI: Allow widgets to make themselves non-auto-focusableRob Ryan
This patchs adds a way for widgets exclude themselves from being a focus candidate in Window::focus_a_widget_if_possible(). This is to allow the URL box to not get auto-focused when the browser is loaded.
2021-08-18Userland+LibGUI: Add shorthand versions of the Margins constructorsin-ack
This allows for typing [8] instead of [8, 8, 8, 8] to specify the same margin on all edges, for example. The constructors follow CSS' style of specifying margins. The added constructors are: - Margins(int all): Sets the same margin on all edges. - Margins(int vertical, int horizontal): Sets the first argument to top and bottom margins, and the second argument to left and right margins. - Margins(int top, int vertical, int bottom): Sets the first argument to the top margin, the second argument to the left and right margins, and the third argument to the bottom margin.
2021-08-18Userland+LibGUI: Make Margins arguments match CSS orderingsin-ack
Previously the argument order for Margins was (left, top, right, bottom). To make it more familiar and closer to how CSS does it, the argument order is now (top, right, bottom, left).
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.