Commit graph

58 commits

Author SHA1 Message Date
Tim Ledbetter 2331d2bafa Userland: Propagate errors with TRY() where possible 2024-02-14 17:46:06 -05:00
Tim Ledbetter f961a0eb61 TerminalSettings: Ensure automark setting is reverted on cancel 2024-02-07 13:35:49 +01:00
Tim Ledbetter 5c8962b8f1 LibVT+TerminalSettings: Move settings parsing functions to LibVT
This change moves the automark and bell settings parsing functions to
LibVT, so that they can be shared between Terminal and TerminalSettings.
2024-02-07 13:35:49 +01:00
Tim Ledbetter 2850bb881a TerminalSettings: Provide default values for terminal settings
The change ensures that functions that parse string values for terminal
settings fall back to a default value, if there is no value present or
the value is invalid.
2024-02-07 13:35:49 +01:00
Tim Ledbetter 1df31e426d TerminalSettings: Use correct name for the automark_off radio button
This was causing a segfault when opening the Terminal Settings window.
2024-02-07 13:35:49 +01:00
Ali Mohammad Pur 54ab6fe5b9 LibVT+Everywhere: Introduce 'automarks' and 'clear previous command'
Automarks are similar to bookmarks placed by the terminal, allowing the
user to selectively remove a single command and its output from the
terminal scrollback.
This commit implements a single way to add marks: automatically placing
them when the shell becomes interactive.

To make sure the shell behaves correctly after its expected prompt
position changes, the terminal layer forces a resize event to be passed
to the shell on such (possibly) partial clears; this also has the nice
side effect of fixing the disappearing prompt on the preexisting "clear
including history" action: Fixes #4192.
2024-02-07 00:43:11 +01:00
Mr.UNIX 2440a2f83f TerminalSettings: Port to GML Compiler 2024-01-19 17:05:53 +01:00
Mr.UNIX 3b73064497 TerminalSettings: Split TerminalSettingsWidget into different files 2024-01-19 17:05:53 +01:00
Ali Mohammad Pur 5e1499d104 Everywhere: Rename {Deprecated => Byte}String
This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).

This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
2023-12-17 18:25:10 +03:30
Andreas Kling 545d8336b8 LibGfx: Convert Font APIs to return String instead of DeprecatedString 2023-09-06 11:29:03 -04:00
kleines Filmröllchen 1e67435ff5 Meta: Rename compile_gml to stringify_gml
This is what this function really does, it doesn't compile anything.
2023-08-11 21:33:48 +02:00
Lucas CHOLLET 3f35ffb648 Userland: Prefer _string over _short_string
As `_string` can't fail anymore (since 3434412), there are no real
benefits to use the short variant in most cases.
2023-08-08 07:37:21 +02:00
Andreas Kling 34344120f2 AK: Make "foo"_string infallible
Stop worrying about tiny OOMs.

Work towards #20405.
2023-08-07 16:03:27 +02:00
Karol Kosek 1ad81687e7 TerminalSettings: Convert setting widgets to a failable factory 2023-06-10 07:19:06 +02:00
Lucas CHOLLET 1a97382305 LibGUI: Make Application's construction fallible
The pattern to construct `Application` was to use the `try_create`
method from the `C_OBJECT` macro. While being safe from an OOM
perspective, this method doesn't propagate errors from the constructor.
This patch make `Application` use the `C_OBJECT_ABSTRACT` and manually
define a `create` method that can bubble up errors from the
construction stage.

This commit also removes the ability to use `argc` and `argv` to
create an `Application`, only `Main`'s `Arguments` can be used.

From a user point of view, the patch renames `try_create` => `create`,
hence the huge number of modified files.
2023-05-05 16:41:21 +01:00
thankyouverycool f7e034d4b2 LibGfx+Userland: Merge FrameShape and FrameShadow into FrameStyle
Previously, Frames could set both these properties along with a
thickness to confusing effect: Most shapes of the same shadowing only
differentiated at a thickness >= 2, and some not at all. This led
to a lot of creative but ultimately superfluous choices in the code.

Instead let's streamline our options, automate thickness, and get
the right look without so much guesswork.

Plain shadowing has been consolidated into a single Plain style,
and 0 thickness can be had by setting style to NoFrame.
2023-04-30 05:49:46 +02:00
thankyouverycool 91bafc2653 LibGUI+Userland: Port Labels to String 2023-04-30 05:48:14 +02:00
Karol Kosek 446c600d09 LibGUI+Applications: Port SettingsWindow::add_tab() to the new string 2023-03-16 09:58:42 +01:00
Andreas Kling f6f62d7ff6 TerminalSettings: Move scrollback settings from "Terminal" to "View"
The scrollback is really a property of the view, not the terminal.
2023-03-03 15:38:59 +01:00
Andreas Kling 3823f77d20 TerminalSettings: Spruce up the "Terminal" tab a bit
- Use sentence style capitalization for CheckBox and GroupBox titles
- Remove excessive explanation of bell mode.
- Put a "lines" label after the scrollback history length input instead
  of saying "(Lines)" in the GroupBox title.
- Tweak bell mode titles to make them self explanatory.
- Tweak language for exit confirmation.
2023-03-03 15:38:59 +01:00
Andreas Kling 880504e51d TerminalSettings: Spruce up the "View" tab a bit
- Use sentence style capitalization for CheckBox and GroupBox titles.
- Move the terminal font to the top.
- Split the cursor settings into two GroupBoxes (one for the shape,
  and one for the blinking behavior).
2023-03-03 15:38:59 +01:00
Andreas Kling df0bf51441 TerminalSettings: Adjust layouts
Remove assymmetric vertical padding in various places.
2023-03-03 15:38:59 +01:00
Andreas Kling 165b077815 TerminalSettings: Change tab order
Let's put the "View" tab first, since the most common reason to open
TerminalSettings is to adjust something about the appearance.
2023-03-03 15:38:59 +01:00
Andreas Kling 33e87d1627 Userland: Fix remaining smart pointer const-correctness issues 2023-02-21 00:54:04 +01:00
Tim Schumacher d43a7eae54 LibCore: Rename File to DeprecatedFile
As usual, this removes many unused includes and moves used includes
further down the chain.
2023-02-13 00:50:07 +00:00
Sam Atkins f0395a2042 LibGUI+Userland: Rename try_load_from_gml() -> load_from_gml() :^)
It's the only one, so the `try` prefix is unnecessary now.
2023-01-07 14:39:30 +01:00
Sam Atkins 54b1326165 Userland: Replace all uses of load_from_gml with try_load_from_gml
MOAR FIXMES! ;^)
2023-01-07 14:39:30 +01:00
implicitfield 800c292be8 Terminal+LibVT: Get the color scheme from the system theme 2022-12-31 04:20:59 -07:00
implicitfield 4aec8491d6 Everywhere: Move Base/res/terminal-colors to Base/res/color-schemes 2022-12-31 04:20:59 -07:00
FrHun 59028515c0 LibGUI: Split OpacitySlider into vertical and horizontal helper classes 2022-12-09 00:25:30 +01: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 4fd9e3ab08 Userland: Remove workarounds for LibIPC include order sensitivity 2022-11-15 13:25:51 -05:00
Tim Schumacher ce2f1b845f Everywhere: Mark dependencies of most targets as PRIVATE
Otherwise, we end up propagating those dependencies into targets that
link against that library, which creates unnecessary link-time
dependencies.

Also included are changes to readd now missing dependencies to tools
that actually need them.
2022-11-01 14:49:09 +00:00
Ali Mohammad Pur 166a905951 Userland: Properly populate GENERATED_SOURCES
We previously put the generated headers in SOURCES, which did not mark
them as GENERATED (and did not produce a proper dependency).
This commit moves all generated headers into GENERATED_SOURCES, and
removes useless header SOURCES.
2022-10-12 15:55:15 +01:00
Timothy Flynn 08ce8cb996 Applications: Use title-case for group box titles in settings
Capitalization was quite inconsistent, even amongst single settings
applications. This aligns group box titles to all be title case.
2022-10-04 18:19:45 +01:00
sin-ack 3f3f45580a Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).

No functional changes.
2022-07-12 23:11:35 +02:00
DexesTTP 7ceeb74535 AK: Use an enum instead of a bool for String::replace(all_occurences)
This commit has no behavior changes.

In particular, this does not fix any of the wrong uses of the previous
default parameter (which used to be 'false', meaning "only replace the
first occurence in the string"). It simply replaces the default uses by
String::replace(..., ReplaceMode::FirstOnly), leaving them incorrect.
2022-07-06 11:12:45 +02:00
FrHun f59c167bb0 Applications+Games+LibGUI: Fix layout problems 2022-06-30 11:51:25 +02:00
FrHun a6ec2b9d0a LibGUI+Applications: Use the new layout system in the settings screens 2022-06-28 17:52:42 +01:00
Michał Lach e9dae38f38 Terminal+TerminalSettings: Add caret customization 2022-06-22 12:12:00 +01:00
Sam Atkins cdffe556c8 LibGUI+Userland: Make Dialog::ExecResult an enum class 2022-05-13 16:27:43 +02:00
Sam Atkins af01c6be0c TerminalSettings: Set window modified state 2022-05-12 13:10:49 +02:00
MacDue e268659d32 Terminal+TerminalSettings: Allow disabling close confirmations 2022-05-06 02:12:51 +04:30
Sam Atkins 5702f016f0 LibGUI+Applications: Add --open-tab option to FooSettings applications
Similar to SystemMonitor's option of the same name, this allows you to
launch the given application with the specific tab open.
2022-04-21 17:24:42 +02:00
Sam Atkins ded5ba1f87 LibGUI+Applications: Give SettingsWindow tabs a string ID
This gives us a convenient way to refer to them, which will be used in
the following commit.
2022-04-21 17:24:42 +02:00
Simon Wanner 206d6ece55 LibGfx: Move other font-related files to LibGfx/Font/ 2022-04-09 23:48:18 +02:00
Itamar 935d023967 Userland: Rename WindowServerConnection=>ConnectionToWindowServer
This was done with CLion's automatic rename feature.
2022-02-25 22:35:12 +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
Vitaly Dyachkov 32b8795091 LibConfig: Rename pledge_domains(String) => pledge_domain(String)
pledge_domains() that takes only one String argument was specifically
added as a shortcut for pledging a single domain. So, it makes sense to
use singular here.
2022-02-11 18:06:39 +01: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