Commit Graph

145 Commits

Author SHA1 Message Date
Sam Atkins
28a8e4a105 ThemeEditor: Correct GroupBox margins
Now that GroupBoxes have intrinsic margins, we don't need to provide
such large margin values in the GML.
2021-11-13 17:59:51 +00:00
Andreas Kling
235f39e449 LibGfx: Use ErrorOr<T> for Bitmap::try_load_from_file()
This was used in a lot of places, so this patch makes liberal use of
ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
2021-11-08 00:35:27 +01:00
Sam Atkins
7613586097 ThemeEditor: Offset the preview vertically to center it better
Previously, the active window being centered, and then the inactive one
being higher, meant having an awkward gap at the bottom. This is a
simple fix, and not perfect, but it helps. :^)
2021-11-05 23:34:22 +01:00
Sam Atkins
b51d2fee05 ThemeEditor: Add support for FlagRoles
The GUI for this is a bit odd, especially since we only have one flag,
but otherwise adding new flags would require modifying ThemeEditor. At
least it is consistent with the other theme properties.
2021-11-05 23:34:22 +01:00
Sam Atkins
c1d26c884d ThemeEditor: Display the theme's window icons in the preview
If the icons could not be loaded, we fall back to the defaults (which
are the bitmaps that were always used before.)
2021-10-28 11:23:44 +02:00
Sam Atkins
dbeff9ad84 ThemeEditor: Add PathRole editing
This allows both typing the path, and selecting it with a file-open
dialog.
2021-10-28 11:23:44 +02:00
Sam Atkins
e58db5592e ThemeEditor: Update value edit boxes when loading a theme file
Previously, these would continue to show the previously entered values,
until you interacted with the ComboBoxes.
2021-10-28 11:23:44 +02:00
Sam Atkins
684f8a6b15 ThemeEditor: Add MetricRole editing
The editing UI at the bottom is now split into two groups, one for
colors and one for metrics.
2021-10-28 11:23:44 +02:00
Sam Atkins
c885722a94 ThemeEditor: Convert layout to GML 2021-10-28 11:23:44 +02:00
Sam Atkins
daaf5890a6 ThemeEditor: Display window shadows in preview :^) 2021-10-28 11:23:44 +02:00
Sam Atkins
ab1ce13eea ThemeEditor: Give both preview windows a background color
The inactive window previously didn't have a background fill, so it
looked odd.
2021-10-28 11:23:44 +02:00
Karol Kosek
1803c5966d ThemeEditor: Show currently opened theme path in the window title
You can open files since #9979, so let's show the path there
to distinguish open theme files more easily!
2021-09-26 12:44:51 +02:00
Karol Kosek
8f36429cb5 ThemeEditor: Save theme metrics and paths to file
Prior this change, custom title metrics seen in the Basalt theme
and custom icon paths in Redmond themes were dropped when saving a file.

Now any entry, even empty, will be saved.  This may end up with slightly
larger files, but on other hand, users will be able to see every option
in a text editor, without a need to look at the code/docs.
2021-09-16 16:52:55 +02:00
Karol Kosek
a9ec98028b ThemeEditor: Accept drop events 2021-09-12 11:49:52 +02:00
Karol Kosek
4e1a794abe ThemeEditor: Update theme path on theme load
Prior to this change, the 'Save' action was saving a file to the startup
path (or just showed a File Picker dialog) if a file has been opened
by the Open action or by drag-n-dropping a file to the program.
2021-09-12 11:49:52 +02:00
Karol Kosek
be7ae76829 ThemeEditor: Rename main()'s preview_palette to startup_preview_palette
This is to avoid ambiguity from the preview_widget.preview_palette().
2021-09-12 11:49:52 +02:00
Karol Kosek
483db9334e ThemeEditor: Use preview_palette from the PreviewWidget
Prior this change, when you opened a file using the brand new Open
action and tried to change the Color Role or save it, then it would just
go back to the startup palette.
2021-09-12 11:49:52 +02:00
Karol Kosek
23137f0a8d ThemeEditor: Add 'Open file' menu action 2021-09-12 11:49:52 +02:00
Karol Kosek
09314ad611 ThemeEditor: Open files from an argument
This commit allows you to open a theme file from an argument, i.e.
`ThemeEditor Theme.ini`.
2021-09-12 11:49:52 +02:00
Karol Kosek
8c47f38ca5 ThemeEditor: Reference FileSystemAccessClient::Result in save_to_result
Found by clazy. It says the size is 32 bytes.
2021-09-12 11:49:52 +02:00
Karol Kosek
6995e428db ThemeEditor: Create menu contents after creating widgets
My next commits will be more readable that way. :^)
2021-09-12 11:49:52 +02:00
Karol Kosek
cbc4c98a87 ThemeEditor: Make the model derived from ItemListModel
This will make the Combo Box list searchable as you type, because
ItemListModel has already that implemented.
2021-09-06 14:05:10 +04:30
Andreas Kling
087bd7f767 Userland: Use Rect::centered_within() where useful 2021-08-31 01:35:08 +02:00
Karol Kosek
04694ae682 ThemeEditor: Place menu quit action as the last item
No other applications put this action as the first item.
2021-08-26 00:51:40 +02:00
networkException
d51072629d ThemeEditor: Add Actions to save preview_palette to theme file
This patch adds a save and save as Action to the file menu allowing
to export all colors into an ini file.
2021-08-22 01:32:25 +02:00
sin-ack
ca2c81251a Everywhere: Replace Model::update() with Model::invalidate()
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-06 19:14:31 +02:00
LuK1337
a50b937632 ThemeEditor: Initialize color input to Gfx::ColorRole::Window 2021-07-28 19:07:15 +02:00
Andreas Kling
687a12d7fb Userland: Add GUI::Window::add_menu() and use it everywhere
Applications previously had to create a GUI::Menubar object, add menus
to it, and then call GUI::Window::set_menubar().

This patch introduces GUI::Window::add_menu() which creates the menubar
automatically and adds items to it. Application code becomes slightly
simpler as a result. :^)
2021-07-21 21:24:26 +02:00
Andreas Kling
c7d891765c LibGfx: Use "try_" prefix for static factory functions
Also mark them as [[nodiscard]].
2021-07-21 18:02:15 +02:00
Marcus Nilsson
205c8a12ed ThemeEditor: Disable focus for demo widgets
Pressing tab would focus on the demo widgets instead of switching
between the combo box and color input field. Instead set the focus
policy to NoFocus for all the widgets.
2021-07-17 01:30:33 +02:00
LuK1337
b94931e7f6 ThemeEditor: Set window size to 480x385 and disable resizing 2021-07-16 20:43:04 +02:00
LuK1337
12f0602379 ThemeEditor: Add menu bar with quit and about items 2021-07-16 20:43:04 +02:00
Gunnar Beutner
631d36fd98 Everywhere: Add component declarations
This adds component declarations so that users can select to not build
certain parts of the OS.
2021-06-17 11:03:51 +02:00
Andreas Kling
31d4bcf5bf Userland: Tighten a *lot* of pledges! :^)
Since applications using Core::EventLoop no longer need to create a
socket in /tmp/rpc/, and also don't need to listen for incoming
connections on this socket, we can remove a whole bunch of pledges!
2021-05-13 23:28:40 +02:00
Andreas Kling
20dd5735ce WindowServer+LibGfx: Automatic "modified" markers in window titles
You can now add the string "[*]" to a window title and it will be
replaced with " (*)" if the window is modified, and with "" otherwise.
2021-05-01 19:42:29 +02:00
Linus Groh
dbe72fd962 Everywhere: Remove empty line after function body opening curly brace 2021-04-25 20:20:00 +02:00
Andreas Kling
b91c49364d AK: Rename adopt() to adopt_ref()
This makes it more symmetrical with adopt_own() (which is used to
create a NonnullOwnPtr from the result of a naked new.)
2021-04-23 16:46:57 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Andreas Kling
12546259ff Everywhere: Rename title_bar => titlebar 2021-04-18 16:35: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
e76771bfad WindowServer+LibGfx: Show menus in windows! :^)
This patch begins the transition away from the global menu towards
per-window menus instead.

The global menu looks neat, but has always felt clunky, and there
are a number of usability problems with it, especially in programs
with multiple windows.

You can now call GUI::Window::set_menubar() to add a menubar to
your window. It will be specific to that one window only.
2021-03-25 22:14:09 +01:00
Andreas Kling
ef1e5db1d0 Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)
Good-bye LogStream. Long live AK::Format!
2021-03-12 17:29:37 +01:00
Andreas Kling
d312011708 Everywhere: Drop "shared_buffer" in most GUI programs, pledge "recvfd"
Now that WindowServer broadcasts the system theme using an anonymous
file, we need clients to pledge "recvfd" so they can receive it.

Some programs keep the "shared_buffer" pledge since it's still used for
a handful of things.
2021-01-16 19:30:32 +01:00
Andreas Kling
20915795a8 Everywhere: Pledge "sendfd" in WindowServer client programs
This is needed for the new way we transfer window backing stores.
2021-01-15 14:10:32 +01:00
Andreas Kling
dc28c07fa5 Applications: Move to Userland/Applications/ 2021-01-12 12:05:23 +01:00