Commit Graph

12704 Commits

Author SHA1 Message Date
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
Andreas Kling
c43f0f012d Spreadsheet: Enable the "any key pressed" edit trigger in spreadsheets 2020-08-28 20:49:51 +02:00
Andreas Kling
5daa19fdab LibGUI: Implement a basic "any key pressed" edit trigger for TableView
This trigger allows you to initiate cell editing by simply starting to
type something into the cell. :^)
2020-08-28 20:47:02 +02:00
Andreas Kling
f3e4b62be9 LibGUI: Add AbstractView "edit triggers" to improve editing control
This API allows the embedder of a view to decide which actions upon
the view will begin editing the current item.

To maintain the old behavior, we will begin editing when an item is
either double-clicked, or when the "edit key" (return) is pressed.
2020-08-28 20:40:12 +02:00
AnotherTest
383ee279ee Spreadsheet: Add a whole bunch of basic statistical functions 2020-08-28 20:30:31 +02:00
AnotherTest
facd7fe05b Spreadsheet: Document the behaviour of the 'R' function/tag 2020-08-28 20:30:31 +02:00
AnotherTest
a2113909c3 LibJS: Do not consider un-labeled Block scopes as breakable 2020-08-28 20:19:56 +02:00
AnotherTest
8e89233bba LibJS: Demonstrate weird behaviour with 'break' 2020-08-28 20:19:56 +02:00
Andreas Kling
ccea1b2376 Spreadsheet: Let GUI::TableView paint the grid and cursor :^) 2020-08-28 17:09:30 +02:00
Andreas Kling
2222fc5e08 LibGUI: Add optional grid and cursor styles to TableView 2020-08-28 17:09:30 +02:00
AnotherTest
6614ee703b Spreadsheet: Setup and prepare for cell types
This commit adds a generic interface for cell types and hooks it up.
There is no way to set these from the UI, and so they're not saved
anywhere yet.
Also implicitly converts numeric values (strictly integers) to numeric
javascript values, as numbery-looking + numbery-looking === string is
not very interesting. :^)
2020-08-28 17:08:09 +02:00
AnotherTest
5715ed3dd6 Spreadsheet: Reorganise the sources a bit
This commit just moves some code around:
- Give Cell its own file
- Pull all forward-declared classes/structs into Forward.h
- Clean up the order of member functions a bit
2020-08-28 17:08:09 +02:00
Itamar
b6c34c0521 Ext2FS: Make reported file_type values match up with those in dirent
This fixes an issue we had in the git port where git would not
recognize untracked files (for example in 'git status').
When git used readdir, the 'd_type' field in the dirent struct contained
bad values (Specifically, it contained the values defiend in
Kernel/FileSystem/ext2_fs.h instead of the ones in LibC/dirent.h).

After this fix, we can create a new git repository with 'git init', and
then stage and commit files as usual.
2020-08-28 16:06:55 +02:00
Andreas Kling
6cf064e4c6 Spreadsheet: Open help pages immediately when selecting them 2020-08-28 13:56:26 +02:00
Andreas Kling
60cf97726f Spreadsheet: Don't store help window's widgets in raw pointers
We can just use RefPtr for these and lighten the cognitive burden.
2020-08-28 13:56:19 +02:00
Andreas Kling
3c73b6d531 ls: Fix issue with too-narrow columns in "ls" output
There was a logic mistake in the code that computes the offset between
columns, forgetting to account for the extra characters after a name.

The comment was accurate, but the code didn't match the comment.
2020-08-28 12:58:05 +02:00
Andreas Kling
0a7d9319af ChessEngine: Move from Applications to Services
This is not a stand-alone application. :^)
2020-08-28 12:53:02 +02:00
Ben Wiederhake
1d638c6a78 Meta: Enable -Wmissing-declarations
Concludes #3096.

Phew! From here on, build system and CI will ensure that all new code
defines compilation-unit-only code as 'static', and that dead code can
be found more easily. Also, this style encourages type checking
by suggesting that you put a proper declaration in a shared header.
2020-08-28 11:37:33 +02:00
Ben Wiederhake
d063dc1e71 HackStudio: Mark compilation-unit-only functions as static 2020-08-28 11:37:33 +02:00
Ben Wiederhake
1c60ea235e LibCrypto: Do not silently ignore key size mismatch
Before, when the actually passed key was too long, the extra bytes were silently
ignored. This can lead to all sorts of trouble, so ... don't do that.

The original intention was maybe to support non-integer amounts of key bytes.
But that doesn't happen anyway with AES.
2020-08-28 11:36:57 +02:00
AnotherTest
e0b7833078 Spreadsheet: Do not clear cells when ctrl-selecting 2020-08-28 09:22:17 +02:00
Tom
67dbb56444 Kernel: Release page tables when no longer needed
When unmapping regions, check if page tables can be freed.

This is a follow-up change for #3254.
2020-08-28 09:21:24 +02:00
Nico Weber
88319b188e Userland: Stop passing ignored timezones to gettimeofday 2020-08-28 09:17:01 +02:00
Liav A
ab87d42200 Kernel: Remove the enabled concept of IRQ handlers
An IRQ handler should always be ready to respond to any IRQ.
We must remember that hardware can generate IRQs without any interaction
from our code at all. Ignoring IRQs in such cases is obviously not the
right thing to do.
2020-08-28 09:16:18 +02:00
Liav A
a431108ab6 Kernel: Add and remove explicit keyword where needed 2020-08-28 09:16:18 +02:00
Ben Wiederhake
6020a4f274 LibGUI: Remove unused String member 2020-08-28 09:15:47 +02:00
Andreas Kling
d2d2361152 LibGUI: Unbreak PageUp/PageDown in AbstractTableView
These key events need to trigger a move_cursor() as well.
2020-08-27 19:29:50 +02:00
Andreas Kling
9f3b1b8e21 Spreadsheet: Draw cell borders as 1px thin line :^) 2020-08-27 19:28:04 +02:00
Andreas Kling
9947262eaa LibGUI: Ctrl+clicking on an AbstractView should move cursor
Don't just toggle the selection of the index, also move the cursor to
where the user is clicking.
2020-08-27 18:41:54 +02:00
Andreas Kling
56e80fafd6 Spreadsheet: Draw cell cursor and selected cells differently
Now that the table view has a cursor, we can distinguish it from the
selected cells. Draw the cells with a nice variant of the selection
color as background.
2020-08-27 18:38:39 +02:00
Andreas Kling
9cf37901cd LibGUI: Add a cursor to AbstractView, separate from the selection
Views now have a cursor index (retrievable via cursor_index()) which
is separate from the selection.

Until now, we've been using the first entry in the selection as
"the cursor", which gets messy whenever you want to select more than
one index in the model.

When setting the cursor, the selection is implicitly updated as well
to maintain the old behavior (for the most part.)

Going forward, this will make it much easier to implement things like
shift-select (extend selection from cursor) and such. :^)
2020-08-27 18:36:31 +02:00
Andreas Kling
76a0acb5bc Themes: Update text cursor color in "Default" theme
I never liked the sharp red text cursor. Replace it with the same color
we use to start off the active window title bar gradient. :^)
2020-08-27 18:35:20 +02:00
Andreas Kling
cd2c82a380 LibGUI: Remove unused variables in AbstractTableView::mousedown_event() 2020-08-27 18:13:47 +02:00
Andreas Kling
0b9d765f6b LibGUI: Add AbstractView::move_cursor() and share some movement logic
A view can now be told to move its cursor in one of multiple directions
as specified by the CursorMovement enum.

View subclasses can override move_cursor(CursorMovement) to implement
their own cursor behavior. By default, AbstractView::move_cursor() is
a no-op.

This patch improves code sharing between TableView and TreeView. :^)
2020-08-27 17:47:19 +02:00
asynts
1b3169f405 AK: Define MakeUnsigned and MakeSigned for char.
For some weird reason the C++ standard considers char, signed char and
unsigned char *three* different types. On the other hand int is just an
alias for signed int, meaning that int, signed int and unsigned int are
just *two* different types.

https://stackoverflow.com/a/32856568/8746648
2020-08-27 15:49:01 +02:00
thankyouverycool
8a364c503d Base: Rename icon subdirectories by explicit app name
Renames widgets/ to hackstudio/, vbwidgets/ to visualbuilder/ and
paintbrush/ to pixelpaint/.
2020-08-27 15:38:02 +02:00