Commit Graph

19 Commits

Author SHA1 Message Date
thankyouverycool
ca8918f310 LibGUI: Add a numeric input type to InputBox
This should be a more convenient API and a better UX for apps that
want simple integer input from the user.
2023-04-18 10:05:21 +02:00
thankyouverycool
7c314f3855 LibGUI: Let InputBox display an ImageWidget
InputBox can now be given a bitmap to display alongside its
prompt and editor. Prompts are now optional to allow for
compact dialogs.
2023-04-18 10:05:21 +02:00
thankyouverycool
02a9e5d3f6 LibGUI+Userland: Improve error and font handling for InputBox
Adds fallible factories, ports DeprecatedString, and rebuilds the
layout to accomodate system font changes.
2023-04-18 10:05:21 +02:00
Karol Baraniecki
71f5bbab42 LibGUI: Verify NonemptyText InputBox doesn't result in an empty string 2023-02-04 18:46:39 -07:00
Karol Baraniecki
506c26acce LibGUI+Userland: Switch order of parameters for InputBox::show
Because usage of the input_type parameter is now higher than of the
placeholder parameter, this makes for a cleaner API.
2023-02-04 18:46:39 -07:00
Karol Baraniecki
55dbfd24c0 LibGUI: Allow the InputBox to be of NonemptyText type
It seems like a lot (most?) places where InputBoxes are used check if
the retrieved string isn't empty anyway - make this be reflected in
the user interface, by disabling (graying out) the "OK" button when
nothing is entered, so empty input isn't a viable option at all.
2023-02-04 18:46:39 -07:00
Linus Groh
6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00
Timothy Flynn
5b31a3dbc7 LibGUI: Allow more programmatic control over GUI::InputBox
This will be needed for WebDriver, which will require constructing and
controlling dialogs manually. Currently, InputBox will only set its text
value when the OK button is pressed. This changes InputBox to update its
text when done(ExecResult::OK) is invoked in any way.

This also makes the text_value() method public, allows for setting the
text value, and allows for moving-in the initial text value.
2022-11-16 17:23:56 +00:00
networkException
802cf9bc69 Everywhere: Use my very shiny serenityos.org email :^) 2022-09-12 15:13:12 +01:00
Sam Atkins
cdffe556c8 LibGUI+Userland: Make Dialog::ExecResult an enum class 2022-05-13 16:27:43 +02:00
Lenny Maiorani
fe3b846ac8 Libraries: Use default constructors/destructors in LibGUI
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-12 14:44:43 -08:00
Andreas Kling
8b1108e485 Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Tom
81c183e06a LibGUI: Add InputType enum to allow creating a password InputBox dialog 2021-07-26 21:55:18 +04:30
networkException
3fce0e58e5 LibGUI: Use east const style in InputBox.{cpp,h} 2021-07-07 15:29:03 +02:00
networkException
72776b2f61 LibGUI: Allow InputBox to show placeholder
If passed as an argument, showing an InputBox now supports to
set a placeholder text which will be shown in its TextBox.
2021-07-07 15:29:03 +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
Linus Groh
f10967e364 LibGUI: Set InputBox initial value to text_value string 2021-02-20 12:19:46 +01:00
Linus Groh
3583b62ad3 LibGUI: Swap order of InputBox value and parent window args
This is now consistent with the other dialog classes.
2021-02-20 12:19:46 +01:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00