Commit graph

123 commits

Author SHA1 Message Date
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
djwisdom
27f5a18ce6 HexEditor: Add Help->Manual entry in Menu 2022-08-29 09:25:29 +01:00
Jannis Weis
8fa34b43ce HexEditor: Fix utf16 validation
Previously the utf8_view was validated for the utf16 valude instead
of the utf16_view.
2022-08-22 12:48:47 +02:00
Lucas CHOLLET
e8115bfdb1 Base: Launch FileSystemAccessServer at session start-up 2022-08-14 21:52:35 +01:00
James Puleo
8c11786145 HexEditor: Rename camel case variable names in HexEditor::save_as
This also changes those variables to be references to the casted
document type, instead of pointers.
2022-08-03 10:12:11 -04:00
James Puleo
88cf40179d HexEditor: Make HexEditor::open_new_file fallible and reduce branching
Returning a `bool` is meaningless, so let's make it more expresive :^)
2022-08-03 10:12:11 -04:00
James Puleo
035d63f528 HexEditor: Remove unused readonly flag
`HexEditor::set_readonly` was never called, even though
`HexEditor::is_readonly` was occasionally queried -- so it's entirely
been removed.
2022-08-03 10:12:11 -04:00
James Puleo
8695ae4c50 HexEditor: Don't spam debug output when finding all strings
For each string found we would output it, which was way too much noise
:^)
2022-08-03 10:12:11 -04:00
James Puleo
0bfcbf0b0a HexEditor: Change Find All Strings shortcut to Ctrl + Shift + F
The previous shortcut of `Ctrl + Shift + S` conflicted with `Save As...`
action shortcut.
2022-08-03 10:12:11 -04: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
Karol Kosek
ff0b4bf360 HexEditor: Gray-out null bytes
This should improve an overall visibility of "meaningful" data. :^)
2022-07-11 18:11:11 +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
Karol Kosek
9f1f1b8472 Userland: Use default buttons instead of manually handling return press
Besides simplifying the code, this will also draw outline for these
buttons as a cue for a user!
2022-06-02 22:33:00 +02:00
Sam Atkins
cdffe556c8 LibGUI+Userland: Make Dialog::ExecResult an enum class 2022-05-13 16:27:43 +02:00
kleines Filmröllchen
19f6ef3a0c HexEditor: Add UTF16 to the value inspector 2022-04-27 00:02:24 +02:00
kleines Filmröllchen
ef113b2f91 HexEditor: Add UTF8 to the value inspector 2022-04-27 00:02:24 +02:00
kleines Filmröllchen
e5736cdf2f HexEditor: Add ASCII to the value inspector
This is kind of redundant but probably easier to read than the ASCII
column. Also, it seems appropriate after we add other character
encodings.
2022-04-27 00:02:24 +02:00
kleines Filmröllchen
da7a8a8711 HexEditor: Don't require the ValueInspectorModel's value size to be i32 2022-04-27 00:02:24 +02:00
Eli Youngs
d20ff6c891 HexEditor: Show endianness in the value inspector 2022-04-18 09:25:38 +04:30
Simon Wanner
206d6ece55 LibGfx: Move other font-related files to LibGfx/Font/ 2022-04-09 23:48:18 +02:00
Timothy Slater
6a4fdae575 HexEditor: Add Value Inspector
This adds a value inspector window to the Hex Editor. This window shows
the data at the current cursor position (or selection start if a range
is selected) interpreted as a variety of data types.

Currently supported values include 8, 16, 32, and 64 bit signed and
unsigned values as well as float and double.

The inspector can operate in both little endian and big endian modes.
This is switched between by options in the View menu.
2022-04-07 16:55:20 +04:30
Timothy Slater
604557c71b HexEditor: Add get_byte() method to HexEditor class 2022-04-07 16:55:20 +04:30
Timothy Slater
1b70c5f605 HexEditor: Add ability to set a selection range 2022-04-07 16:55:20 +04:30
Idan Horowitz
086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Samu698
a39c921421 HexEditor: Selection follows cursor while pressing shift
This patch makes the HexEditor behaviour similar to the one of the
text editor, this can be seen by pressing shift and the arrow keys
2022-03-14 22:48:16 +01:00
Samu698
61b8834b1a HexEditor: Disable selection dependent actions when no selection is made
This applies for the "copy as hex", "copy as text", "copy as C code",
"fill selection" actions
2022-03-14 22:48:16 +01:00
Samu698
d694af8be0 HexEditor: Offset segment in status bar opens goto offset dialog 2022-03-14 22:48:16 +01:00
Samu698
a562518ad7 HexEditor: Fill selection sets only bytes inside selection
Before this patch the fill selection command would set the selection
and one byte after it
2022-03-14 22:48:16 +01:00
Samu698
7bf4ed98d7 HexEditor: Copy as C code doesn't add trailing spaces 2022-03-14 22:48:16 +01:00
Lenny Maiorani
064cfd6cb7 Applications: Fix undefined behavior capturing non-static constexpr 2022-03-02 22:01:58 -08:00
Lenny Maiorani
1dd70a6f49 Applications: Change static constexpr variables to constexpr
Function-local `static constexpr` variables can be `constexpr`. This
can reduce memory consumption, binary size, and offer additional
compiler optimizations.
2022-02-28 13:54:27 +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
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
Liav A
6a998c1a8b HexEditor: Add support for handling PageUp and PageDown key events
In such case, move the cursor up or down the amount of bytes per row,
multiplied by the visible content rectangle height, if possible.
2022-02-20 15:44:36 +01:00
Liav A
c8e691f917 HexEditor: Reduce code duplication when handling key down events
Instead of having the same update block for each event we can use lambda
functions to help updating the cursor when handling key down events.
2022-02-20 15:44:36 +01:00
Karol Kosek
42d19977b3 HexEditor: Use the system-wide unsaved changes dialog 2022-02-20 08:40:26 -05:00
Karol Kosek
f18ae27fe9 HexEditor: Display dirty close icon when the file is changed 2022-02-20 00:06:14 -05: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
Federico Guerinoni
334ed9225a HexEditor: Fix copy {text/hex} to clipboard
Now the copy action takes exactly the selected chars and not one more.
2022-02-14 11:42:04 +01:00
Federico Guerinoni
932ce93fd7 HexEditor: Fix crash of copy action when selection is empty
Closes: #11925
2022-02-14 11:42:04 +01:00
electrikmilk
62102e3130 Base+HexEditor: Add icons 2022-02-13 21:24:46 +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
145eeb57ab Userland: Remove a bunch of unnecessary Vector imports
How silly :^)
2022-01-28 23:40:25 +01:00
kleines Filmröllchen
cab6384966 HexEditor: Use Array in FindDialog's options 2022-01-28 23:40:25 +01:00
Sam Atkins
f590cd1850 AK+Userland: Make AK::decode_hex() return ErrorOr
This lets us propagate the reason why it failed up to the caller. :^)
2022-01-24 22:36:09 +01:00
Sam Atkins
45cf40653a Everywhere: Convert ByteBuffer factory methods from Optional -> ErrorOr
Apologies for the enormous commit, but I don't see a way to split this
up nicely. In the vast majority of cases it's a simple change. A few
extra places can use TRY instead of manual error checking though. :^)
2022-01-24 22:36:09 +01:00
Mustafa Quraish
aae96af812 HexEditor: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Conor Byrne
e92b6047ad HexEditor: Port HexEditor to LibMain 2022-01-01 14:47:15 +01:00