Commit Graph

12939 Commits

Author SHA1 Message Date
Ben Wiederhake
db422fa499 LibJS: Avoid unnecessary lambda
Especially when it's evaluated immediately and unconditionally.
2020-08-30 10:31:04 +02:00
Ben Wiederhake
737c9f0a14 Kernel: Explain correctness of reference to local lambda 2020-08-30 10:31:04 +02:00
Ben Wiederhake
70a2adaace Calendar: Avoid unnecessary lambda
Especially when a constant is passed as a boolean that contradicts the default value.
2020-08-30 10:31:04 +02:00
Ben Wiederhake
c9bafa9467 FontEditor: Cannot take reference to local lambda
Under the hood, a lambda is just a struct full of pointers/references/copies and whatever else
the compiler deems necessary. In the case of 'update_demo', the struct lives on the stack
frame of FontEditorWidget::FontEditorWidget(). Hence it is still alive when it's called
during the constructor.

However, when 'fixed_width_checkbox.on_checked' fires, that stack frame is no longer alive,
and thus the *reference* to the (struct of) the lambda is invalid\! This meant that
'update_demo' silently read invalid data, tried to call '.update()' on some innocent arbitrary
memory address, and it crashed somewhere unrelated.

Passing 'update_demo' by value (like with all the other event handlers) fixes this issue.
Note that this solution only works because 'update_demo' itself has no state; otherwise
the various copies of 'update_demo' might notice that they are, in fact, independent copies
of the original lambda. But that doesn't matter here.
2020-08-30 10:31:04 +02:00
Ben Wiederhake
61521315ed FontEditor: Enforce boundaries of GlyphEditorWidget
Drawing out of bounds no longer affects any neighboring glyphs.
2020-08-30 10:31:04 +02:00
Peter Nelson
b742d593dd LibGfx: use Gfx::Color instead of local struct for GIF colour map 2020-08-30 10:27:36 +02:00
Peter Nelson
c8eccc00b1 LibGfx: only cache last decoded GIF frame
GIFLoader now uses a single frame buffer to cache the last decoded
frame. This drastically reduces memory usage at the small expense of
re-decoding frames on each loop.
2020-08-30 10:27:36 +02:00
Peter Nelson
786872e4c9 LibGfx: add support for interlaced GIFs 2020-08-30 10:27:36 +02:00
Peter Nelson
1341025da7 LibGfx: correctly handle GIF frame disposal modes
RestoreBackground disposal mode is now a transparent fill to allow
background to show through.

RestorePrevious disposal mode now restores the previous frame.
2020-08-30 10:27:36 +02:00
Linus Groh
3ae55770c8 LibGfxDemo: Set window icon to app-libgfx-demo.png 2020-08-30 10:02:52 +02:00
Linus Groh
d61ea0da5f HelloWorld: Set window icon to app-hello-world.png 2020-08-30 10:02:52 +02:00
asynts
c288b499aa Userland: add gunzip utility. 2020-08-30 09:56:10 +02:00
asynts
3f1dfc2e97 LibCompress: Implement gzip. 2020-08-30 09:56:10 +02:00
asynts
9664453739 LibCore: Add InputFileStream and OutputFileStream. 2020-08-30 09:56:10 +02:00
asynts
e7df17d146 AK: Stream operators for String for generic streams.
I think this should really be a member function of InputStream instead,
but I don't want to include String in Stream.h. This will do for now...
2020-08-30 09:56:10 +02:00
asynts
deb85c47b5 AK: Add Optional::emplace method. 2020-08-30 09:56:10 +02:00
Ben Wiederhake
b2de1ba779 Browser: Mark default action in context menu of hyperlinks 2020-08-30 09:47:49 +02:00
Ben Wiederhake
a5f7b7e3e7 Browser: Mark default action in context menu of bookmarks 2020-08-30 09:47:49 +02:00
Ben Wiederhake
e59c415ae3 LibVT+Terminal: Mark default action in context menu 2020-08-30 09:47:49 +02:00
Ben Wiederhake
f36c67c960 HackStudio: Mark default action in context menu 2020-08-30 09:47:49 +02:00
Ben Wiederhake
735b0d05d3 Travis: Automatically test ALL debug code
This avoids silly problems like broken debug code. When debugging, I don't first
want to have to debug the debug code! :P

With all debug options enabled, `test-js` outputs 858081 lines. This is too much
for Travis, so we need to throw the debug output away on Travis. Note that
this still preserves information like *which* test failed, as well as the
precise error message.
2020-08-30 09:43:49 +02:00
Ben Wiederhake
86e2703123 Tests: Optionally switch off 858081 lines of dbg() in test-js 2020-08-30 09:43:49 +02:00
Ben Wiederhake
1ef26e0c09 AK: Provide off-switch for dbg() output 2020-08-30 09:43:49 +02:00
Ben Wiederhake
b29f4add6b Meta: Provide option to build with ALL debug macros 2020-08-30 09:43:49 +02:00
Ben Wiederhake
ec842b21cf WindowServer: Unbreak building with extra debug macros 2020-08-30 09:43:49 +02:00
Ben Wiederhake
d8e22fedc3 Libraries: Unbreak building with extra debug macros 2020-08-30 09:43:49 +02:00
Ben Wiederhake
081bb29626 Kernel: Unbreak building with extra debug macros, part 2 2020-08-30 09:43:49 +02:00
Ben Wiederhake
eac3bbdcee Kernel: Unbreak building with extra debug macros, part 1 2020-08-30 09:43:49 +02:00
Ben Wiederhake
8c1888811f IPCCompiler: Unbreak building with extra debug macros 2020-08-30 09:43:49 +02:00
Ben Wiederhake
bc1dc2b688 IRCClient: Unbreak building with extra debug macros 2020-08-30 09:43:49 +02:00
Ben Wiederhake
184b454e2f AK: Unbreak building with extra debug macros 2020-08-30 09:43:49 +02:00
Itamar
33138900de FileSystem: Convert file types to DT_* types at a later stage
A change introduced in 5e01234 made it the resposibility of each
filesystem to have the file types returned from
'traverse_as_directory' match up with the DT_* types.
However, this caused corruption of the Ext2FS file format because
the Ext2FS uses 'traverse_as_directory' internally when manipulating
 the file system. The result was a mixture between EXT2_FT_* and DT_*
file types in the internal Ext2FS structures.

Starting with this commit, the conversion from internal filesystem file
types to the user facing DT_* types happens at a later stage,
in the 'FileDescription::get_dir_entries' function which is directly
used by sys$get_dir_entries.
2020-08-29 20:54:06 +02:00
asynts
e68b158a52 AK: Don't swap endianness when writing endian wrappers to stream. 2020-08-29 17:44:34 +02:00
AnotherTest
054638c355 Spreadsheet: Add (limited) support for custom cell formatting 2020-08-29 17:42:03 +02:00
AnotherTest
e75247a75b DisplaySettings+LibGUI: Move ItemListModel into LibGUI
Without this model, comboboxes are abysmal to work with, so let's not
redefine it every time.
2020-08-29 17:42:03 +02:00
thankyouverycool
2f9a071072 Base+LibGUI: Refresh filetype icons for consistency
Improves ini icon depth and adds complementary 16x16/32x32 icons
for music and sound filetypes.
2020-08-29 16:19:02 +02:00
thankyouverycool
45b6825a4b Base: Add new SystemMenu icons
Adds new SystemMenu icons for all general categories and refreshes
existing ones for a more consistent look.
2020-08-29 16:19:02 +02:00
Andreas Kling
b084411258 LibGUI: Make Del/Backspace clear cell w/ "any key pressed" edit trigger
This doesn't feel 100% right but it's better than inserting some goofy
whitespace when pressing these keys.
2020-08-29 01:04:22 +02:00
Andreas Kling
87f36b0852 Spreadsheet: Make cells right-aligned by default
Until we have better control over cell content alignment, let's make
them all right-aligned by default since that makes numbers look nice,
and numbers are the bread & butter of spreadsheets. :^)
2020-08-29 00:49:15 +02:00
Andreas Kling
c3b3a078f3 LibGUI: Make SortingProxyModel update all view cursors on resort
Otherwise they will be stale indexes, which is no good. :^)
2020-08-29 00:18:35 +02:00
Andreas Kling
fed53e19c7 LibGUI: Make AbstractView::set_cursor() scrolling into view optional
Sometimes you just want to set the cursor programmatically without
scrolling the view to make the cursor visible.
2020-08-29 00:17:42 +02:00
Andreas Kling
734035857e LibGUI: Allow AbstractView::set_cursor(ModelIndex(), ...)
This should be a valid way to clear the cursor.
2020-08-29 00:16:58 +02:00
Andreas Kling
64e448eef0 Spreadsheet: Treat Return as a cursor key in the cell editing delegate
This allows you to enter many rows of cells like so:

    1<return>2<return>3<return>...

Very cool! :^)
2020-08-28 21:29:59 +02:00
Andreas Kling
c3b2495320 Spreadsheet: Have cursor movement keys commit and stop cell editing
Customize the cell editing delegate to stop editing when one of the
various cursor movement keys is hit. This allows you to type into a
cell and then move to an adjacent cell by simply pressing an arrow.

This may not be the best factoring for this feature, but it's pretty
dang cool and we'll see how it evolves over time. :^)
2020-08-28 21:26:16 +02:00
Andreas Kling
057d04d98f Spreadsheet: Enable "tab key navigation" in the spreadsheet tables
Moving left/right with the tab key is a classic spreadsheet behavior.
2020-08-28 21:10:12 +02:00
Andreas Kling
6316525d50 LibGUI: Add optional "tab key navigation" to AbstractView
If enabled, the view cursor will move right/left when pressing
tab/shift+tab.
2020-08-28 21:09:38 +02:00
Andreas Kling
cd930e0f3d Spreadsheet: Make Return move the cursor one step down
This seems to be a common behavior in spreadsheet applications,
so let's replicate it here by hooking the activation signal.
2020-08-28 21:03:09 +02:00
Andreas Kling
70d3dd5b87 LibGUI: Make TableView::move_cursor() public
It was already public in the base class, so hiding it here was just
a mistake.
2020-08-28 21:02:46 +02:00
Andreas Kling
1847219cbf LibGUI: Let's make F2 the standard "edit key"
This matches what other systems do, and allows Return to become
the unambiguous "activation key" instead. :^)
2020-08-28 20:55:25 +02:00
Andreas Kling
12dfeb9845 LibGUI: Allow rollback of model editing delegate input
In the StringModelEditingDelegate convenience class, we simply hook up
the escape key to editor rollback. This means you can cancel an ongoing
cell edit by pressing escape. :^)
2020-08-28 20:50:12 +02:00