Commit graph

18 commits

Author SHA1 Message Date
Tom
27bd2eab22 LibWeb: Require parent window argument for MessageBox
Since the vast majority of message boxes should be modal, require
the parent window to be passed in, which can be nullptr for the
rare case that they don't. By it being the first argument, the
default arguments also don't need to be explicitly stated in most
cases, and it encourages passing in a parent window handle.

Fix up several message boxes that should have been modal.
2020-07-16 16:10:21 +02:00
Tom
6568765e8f LibGUI: Add parent window argument to FilePicker functions
Since FilePicker almost always should be modal, add the parent
window as mandatory first argument.
2020-07-16 16:10:21 +02:00
Linus Groh
caa11503b1 DisplaySettings: Fix a typo 2020-07-11 20:24:02 +02:00
Andreas Kling
e8a59ef842 DisplaySettings: Fix crash on exit (due to Core::Object on the stack) 2020-07-05 21:17:14 +02:00
Andreas Kling
ca93c22ae2 LibGUI: Turn GUI::Application::the() into a pointer
During app teardown, the Application object may be destroyed before
something else, and so having Application::the() return a reference was
obscuring the truth about its lifetime.

This patch makes the API more honest by returning a pointer. While
this makes call sites look a bit more sketchy, do note that the global
Application pointer only becomes null during app teardown.
2020-07-04 16:54:55 +02:00
Andreas Kling
1dd1595043 LibGUI: Make GUI::Application a Core::Object
Having this on the stack makes whole-program teardown iffy. Turning it
into a Core::Object allows anyone who needs it to extends its lifetime.
2020-07-04 14:05:57 +02:00
devashish
9f58624802 DisplaySettings: Allow setting wallpapers from outside /res/wallpapers
Ideally, we would copy the file to `/res/wallpapers`, add an entry to
`ComboBox` model and set the index to this entry. I didn't want to
touch anything outside of `DisplaySettings`, so this is more of a
workaround :^)
2020-06-28 00:06:09 +02:00
Andreas Kling
fdfda6dec2 AK: Make string-to-number conversion helpers return Optional
Get rid of the weird old signature:

- int StringType::to_int(bool& ok) const

And replace it with sensible new signature:

- Optional<int> StringType::to_int() const
2020-06-12 21:28:55 +02:00
Andreas Kling
116cf92156 LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSize
This fits nicer with FloatRect,FloatPoint,FloatSize and gives a much
better visual clue about what type of metric is being used.
2020-06-10 10:59:04 +02:00
Andreas Kling
2adb0a07e5 LibGUI: Get rid of Model::ColumnMetadata and always use auto-sizing
Auto-sizing of view columns is now enabled by default. This removes the
last remaining need for ColumnMetadata, so this patch gets rid of it.
2020-05-21 19:55:44 +02:00
Andreas Kling
2e03bded43 LibGUI: Add Model::Role::TextAlignment and remove from ColumnMetadata 2020-05-21 19:55:44 +02:00
Sergey Bugaev
450a2a0f9c Build: Switch to CMake :^)
Closes https://github.com/SerenityOS/serenity/issues/2080
2020-05-14 20:15:18 +02:00
Andreas Kling
977863ea07 LibGUI: Include keyboard modifier state with button on_click calls
This will allow you us to implement special behavior when Ctrl+clicking
a button.
2020-05-12 20:31:16 +02:00
Ben Wiederhake
5d3ac4ec9e DisplaySettings: Don't crash after 'pape'
Running 'pape' without arguments (or just editing the WindowServer.ini by hand)
can confuse DisplaySettings. Specifically, if the 'Wallpaper' is set to
'/res/wallpapers/', then DisplaySettings used to crash because 'name_parts'
wouldn't contain any trailing element.

It's hard to define desired behavior, but this is better than crashing
and confusing the user.
2020-05-02 14:12:36 +02:00
Andreas Kling
5bdd05024f DisplaySettings: Tweak label "Color Name" => "Color" 2020-04-30 22:15:16 +02:00
Andreas Kling
bf727eb44c DisplaySettings: Arrange buttons in "OK, Cancel, Apply" order 2020-04-29 16:25:02 +02:00
Andreas Kling
e8a044390e DisplaySettings: Don't allow desktop background color with alpha 2020-04-29 16:22:29 +02:00
Andreas Kling
51df4bdbfc DisplaySettings: Rename from DisplayProperties 2020-04-29 15:53:51 +02:00