Commit Graph

21 Commits

Author SHA1 Message Date
Marcus Nilsson
be464c357a LibGUI: Add allowed file types to FilePicker
This patch adds a ComboBox to `FilePicker` where the user can select
which file types to show, all files that doesn't have an
extension that's in the selected file type will be hidden.

When creating a FilePicker with `FilePicker::construct` or
`FilePicker::get_open_filepath`, allowed file types can be
specified as the last argument.

If no file types are provided then there will be no visual change in the
GUI.

'All Files' and 'Image Files' have shorthands with
`GUI::FileTypeFilter::all_files()` and
`GUI::FileTypeFilter::image_files()`, respectively.
2023-02-02 04:05:42 -07:00
FrHun
1d6d074536 LibGUI: Use new layout system in FilePickerDialog 2022-06-28 17:52:42 +01:00
FrHun
992ff4bd63 LibGUI: Use new DialogButton for consistency 2022-06-10 23:02:07 +01:00
FrHun
8081a8a5de LibGUI: Add layout spacer support to GML
This is a bit of a hack, but it is an easy way to finally get spacers
into GML.
This will translate well if spacers are later to become child objects of
the continer widget.
2022-06-10 21:26:06 +01:00
Idan Horowitz
c8ab45e79f Userland: Run gml-format
This brings the existing GML files up to spec with the new requirements
2022-02-13 02:36:35 +02:00
kleines Filmröllchen
6ee597369d Meta+Userland: Run the GML formatter on CI and pre-commit
Now that the GML formatter is both perserving comments and also mostly
agrees to the existing GML style, it can be used to auto-format all the
GML files in the system. This commit does not only contain the scripts
for running the formatting on CI and the pre-commit hook, but also
initially formats all the existing GML files so that the hook is
successfull.
2022-02-07 18:39:50 +01:00
Andreas Kling
c1576aca11 LibGUI: Use the new GUI::Tray widget in GUI::FilePicker
This removes all the extra entries from the keyboard focus chain and
makes FilePicker actually pleasant to navigate with the keyboard.
2021-10-21 23:23:24 +02:00
sin-ack
e11d177618 Userland+LibGUI: Add shorthand versions of the Margins constructor
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-18 10:30:50 +02:00
sin-ack
9c9a5c55cb Userland+LibGUI: Make Margins arguments match CSS ordering
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-18 10:30:50 +02:00
LuK1337
3bbab9eb47 LibGUI: Align FilePickerDialog's common locations with file list view 2021-07-28 11:15:48 +02:00
FrHun
aa3dd0721a FilePicker: Fix button margins and size 2021-07-27 22:17:23 +02:00
Valtteri Koskivuori
8fac7a1d5d
LibGUI: Bump up common locations width from 90 to 95
The Documents directory shows up properly now when selected.
Previously the bold text would not fit horizontally, causing an
ellipsis at the end.
2021-04-30 23:27:29 +02:00
Andreas Kling
7ae7170d61 Everywhere: "file name" => "filename" 2021-04-29 22:16:18 +02:00
Andreas Kling
a2baab38fd Everywhere: It's now "Foobar", not "FooBar", and not "foo bar"
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-04-13 16:58:15 +02:00
Andreas Kling
58106f57de LibGUI: Remove 2px of vertical space around FilePicker common places
The extra margin is not needed with the new "Tray" look. :^)
2021-04-09 23:58:04 +02:00
Andreas Kling
2de1f32433 LibGUI: Yet another FilePicker UI tweak
Make sure the "Look in:" label is vertically centered within its
corresponding location box.
2021-04-09 23:09:52 +02:00
Andreas Kling
2aaf12e9cd LibGUI: More tweaks for the FilePicker UI layout 2021-04-09 21:53:43 +02:00
Andreas Kling
3e43b1f173 LibGUI: Tweak FilePickerDialog UI layout 2021-04-09 21:53:43 +02:00
Andreas Kling
33d9b592cd LibGUI: Make FilePicker's common location buttons checkable
We now use the checked state of these buttons to indicate that you are
in that specific folder. The checked state is updated automagically
no matter how you navigate the file system. :^)
2021-04-06 21:07:04 +02:00
Andreas Kling
25de655d43 LibGUI: Add shortcuts to common locations in GUI::FilePicker
This patch adds a handy set of buttons on the left hand side that can
take you to common locations such as:

- Your home directory
- Your desktop directory
- The root directory
2021-04-06 21:07:04 +02:00
Andreas Kling
a8e0671344 LibGUI: Port GUI::FilePicker to GML and improve the layout
Also remove the image preview feature as it was rather ugly.
If we bring it back we should it should look good.
2021-02-19 23:03:47 +01:00