Commit Graph

134 Commits

Author SHA1 Message Date
electrikmilk
44a5deff40 TextEditor: Add Insert Emoji action
This adds the Insert Emoji action to Text Editor.
2022-09-08 23:08:54 +01:00
Timothy Flynn
fc8bf7ac3e LibUnicode+Userland: Migrate generated CLDR data to LibLocaleData
Currently, LibUnicodeData contains the generated UCD and CLDR data. Move
the UCD data to the main LibUnicode library, and rename LibUnicodeData
to LibLocaleData. This is another prepatory change to migrate to
LibLocale.
2022-09-05 14:37:16 -04:00
thankyouverycool
cce9172cd4 Applications+DevTools: Remove fixed sizes from Splitters
And adjust some GML properties. Since a808cfa, splitters grow
opportunistically. Setting them to fixed sizes now quite literally
fixes them in place. Fixes immovable splitters missed in the
aforementioned commit.
2022-08-30 16:28:44 +01:00
huttongrabiel
279caade73 TextEditor: Correct typo in MainWidget.{cpp,h} 2022-08-16 09:53:30 +01:00
huttongrabiel
27abbfdf09 TextEditor: Display widget when needle not found in replace all
When the given needle is not found, replace displays a widget that says
the needle is not found, but replace all does not.

This change adds that widget to replace all.
2022-08-15 13:09:56 +02:00
Lucas CHOLLET
e8115bfdb1 Base: Launch FileSystemAccessServer at session start-up 2022-08-14 21:52:35 +01:00
Lucas CHOLLET
ac7b0e69e5 Base: Launch WebContent at session start-up 2022-08-14 21:52:35 +01:00
Lucas CHOLLET
bee5bcda73 Everywhere: Replace hardcoded anon's uid in unveil path with %uid 2022-08-14 21:52:35 +01:00
Lucas CHOLLET
c5b7c9f479 LibCore+LaunchServer: Move portal directory to /tmp/user/%uid
The `/tmp/user` directory is owned by root, this solution prevents
malicious users to interfere with other users' portals.

This commit also moves `launch`'s portal in the user directory.
2022-08-14 21:52:35 +01:00
Lucas CHOLLET
70846d701c LaunchServer+SystemServer: Move the portal to a user-specific directory
Various changes are needed to support this:
 - The directory is created by Core::Account on login (and located in
   /tmp).
 - Service's sockets are now deleted on exit (to allow re-creation)
 - SystemServer needs to handle SIGTERM to correctly destroy services.
2022-07-19 11:15:14 +01:00
MacDue
8266ebf3c6 TextEditor: Debounce update_preview() in on_change event
This avoids lag spikes when undoing/redoing large chunks of HTML/CSS
with the HTML preview open. This had been bugging me when reducing
LibWeb issues in the text editor. The debounce timeout is 100ms
so the delay should not be noticeable.
2022-07-19 11:10:02 +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
dcbbbf5b4a LibWebView: Move OutOfProcessWebView to a new LibWebView library
Also moves WebContentClient and the references to the generated IPC
descriptions, since they are all components of OutOfProcessWebView.

This patch has no functional changes.
2022-05-15 12:17:36 +02:00
Sam Atkins
cdffe556c8 LibGUI+Userland: Make Dialog::ExecResult an enum class 2022-05-13 16:27:43 +02:00
Simon Wanner
206d6ece55 LibGfx: Move other font-related files to LibGfx/Font/ 2022-04-09 23:48:18 +02:00
Ali Chraghi
0eaed09517 TextEditor: Update file argument parser regex pattern 2022-04-03 18:54:47 +04:30
Itamar
de902ab659 TextEditor: Use the search API of GUI::TextEditor
This enables us to remove some code duplication and also makes the
search results highlighted.
2022-03-29 17:45:36 +02:00
thankyouverycool
76157594a9 TextEditor: Save wrapping mode settings 2022-02-26 22:54:25 +01:00
thankyouverycool
e5f7032fb8 TextEditor: Add missing syntax Alt-menu shortcuts 2022-02-26 22:54:25 +01:00
thankyouverycool
b9f81b91a6 TextEditor: Update status bar to use clickable Segments
Adds two new Segments to TextEditor's status bar to quickly
change and display syntax highlighting and line and column info.
2022-02-24 19:09:41 +01:00
thankyouverycool
3aa95dd4d5 LibGUI+Apps: Convert Statusbar Labels to Segments
Segments inherit from Button and let us add clickable widgets
to status bars. This patch also adds proportional, fixed and
autosized modes for segments and lets the status bar consume
all non-clickable segments for override text.
2022-02-24 19:09:41 +01:00
thankyouverycool
fe864af0dc LibGUI+Apps: Prevent Splitter children from being unresizable
Splitters could be resized in such an order that all their remaining
children were fixed size, leading to unfillable gaps on resize events.

HackStudio and TextEditor already had logic to handle this edge case,
so this patch factors it into a general solution for all Splitters.
At least one widget is now guaranteed to be resizeable after a child
is removed.
2022-02-23 18:56:22 +02:00
thankyouverycool
c3ce562240 LibGUI+Apps: Let Splitters select which resizee to set fixed
This gives Splitters more versatility when the right resizee is
intended to remain fixed or be toggled on and off.
2022-02-23 18:56:22 +02:00
Karol Kosek
c9c55d86a4 Userland: Ask first for unsaved changes after clicking an "Open" action
Previously there was some inconsistency between the apps when clicking
the "Open" action while the file wasn't saved.

Some programs (Font Editor) immediately asked you if you wanted to save
the modified file, while others (Text Editor, Hex Editor and Playground)
would show the save dialog only *after* you selected a file.

I think it's better to ask a user right away if they want to save file,
because a dialog after selecting a file should be generally related to
that selected file, like an error opening a file, an import window etc.
2022-02-21 18:30:32 +01:00
Lenny Maiorani
160bda7228 Applications: Use default constructors/destructors
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-02-14 22:06:55 +00: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
kleines Filmröllchen
4931c88b13 LibGUI: Remove GML prefix in favor of proper namespace
Prefixes are very much a C thing which we don't need in C++. This commit
moves all GML-related classes in LibGUI into the GUI::GML namespace, a
change somewhat overdue.
2022-02-07 18:39:50 +01:00
thankyouverycool
f35a6c13ab LibGUI+TextEditor: Highlight the entire current line
And fix Line Highlighting's duplicate alt-menu shortcut.

Previously only text on the cursor's line was highlighted. This makes
discerning cursor focus on empty lines easier.
2022-02-07 15:05:22 +00:00
Rummskartoffel
c93dfe8097 TextEditor: Fix crash on startup when file specified cannot be opened
Due to a bug introduced in f674102, TE would attempt to access the value
of an ErrorOr that didn't hold one, hitting an assertion.
2022-01-23 00:27:41 +00:00
Mustafa Quraish
f674102447 TextEditor: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Brian Gianforcaro
974e36e7a9 TextEditor: Hookup git commit message detection and highlighting 2022-01-18 09:01:16 +01:00
creator1creeper1
de82901d4c TextEditor: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
Andreas Kling
5c68e91dd7 TextEditor: Use early return style in "save" action callback 2022-01-04 21:49:44 +01:00
Andreas Kling
7178c39a78 TextEditor: Show time-since-last-save in "unsaved changes" dialogs :^) 2022-01-04 21:49:44 +01:00
Andreas Kling
c08872f5da TextEditor: Use GUI::MessageBox::ask_about_unsaved_changes() 2022-01-04 21:49:44 +01:00
Timothy Flynn
565a880ce5 Userland: Link directly against LibUnicodeData where needed
This is partially a revert of commits:
    10a8b6d411
    561b67a1ad

Rather than adding the prot_exec pledge requried to use dlopen(), we can
link directly against LibUnicodeData in applications that we know need
that library.

This might make the dlopen() dance a bit unnecessary. The same purpose
might now be fulfilled with weak symbols. That can be revisted next, but
for now, this at least removes the potential security risk of apps like
the Browser having prot_exec privileges.
2021-12-30 14:18:12 +01:00
Maciej
00d1dbb95b TextEditor: Highlight AF files as INI 2021-12-28 11:36:12 +01:00
Timothy Flynn
10a8b6d411 Userland: Add unveil/pledge requisites for dynamic Unicode data loading
Loading libunicodedata.so will require dlopen(), which in turn requires
mmap(). The 'prot_exec' pledge is needed for this.

Further, the .so itself must be unveiled for reading. The "real" path is
unveiled (libunicodedata.so.serenity) as the symlink (libunicodedata.so)
itself cannot be unveiled.
2021-12-21 13:09:49 -08:00
scwfri
8d0143a380 HackStudio+TextEditor: Persist EditingEngineType across editors
Persist EditingEngine mode in HackStudio and TextEditor when opening new
files or editing splits. Previously, the EditingEngine defaulted to a
RegularEditingEngine for a new Editor, even if Vim Emulation had been
selected in the existing Editor.
2021-12-09 21:31:06 +01:00
Brian Gianforcaro
cf4fa936be Everywhere: Use default execpromises argument for Core::System::pledge 2021-11-28 08:04:57 +01:00
Andreas Kling
6536198693 TextEditor: Port to LibMain :^)
This opens up using TRY() for syscalls and Core::Object creation.
2021-11-23 15:44:59 +01:00
Andrew January
22e80bae29 LibGUI: Change delete key handling from action to keydown_event
Having the delete key handling be done via an action limits our ability
to support key modifiers (e.g. ctrl+delete deleting the word in front of
the cursor).

The fact that it was an action _did_ allow us to have a delete button in
the TextEditor UI. However, this is an odd choice in the first place
that isn't common in other text editors, so I just removed it.
2021-11-13 12:53:29 +01:00
Andreas Kling
8b1108e485 Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01: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
Davi
0d459553fd TextEditor: Fix hang on "Replace All" 2021-11-06 12:25:15 +01:00
FrHun
54605794f9 Applications: Remove border from GroupBox margins 2021-11-03 16:13:19 +01:00
Sam Atkins
d2690e551c TextEditor: Add syntax-highlighting for CSS files 2021-10-23 19:07:44 +02:00
thankyouverycool
4540c1ffab TextEditor: Show total character and word count without selection 2021-09-19 00:21:37 +02:00