Commit graph

1622 commits

Author SHA1 Message Date
thankyouverycool
60872a7c5a DevTools+Apps: Set correct icons for ThemeEditor and VisualBuilder
VB appears deprecated in favor of HackStudio, but until it's
officially gone-no app left behind!
2020-08-31 09:14:18 +02:00
Ben Wiederhake
c587db387c TextEditor: Don't try to move(lambda)
The move constructor of a lambda just copies it anyway.

Even if the first move() left an 'empty' closure behind, then
'm_editor->on_cursor_change' would only be able to see an empty
closure, which is certainly not what was intended.
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
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
bc1dc2b688 IRCClient: Unbreak building with extra debug macros 2020-08-30 09:43:49 +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
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
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
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
c43f0f012d Spreadsheet: Enable the "any key pressed" edit trigger in spreadsheets 2020-08-28 20:49:51 +02:00
Andreas Kling
ccea1b2376 Spreadsheet: Let GUI::TableView paint the grid and cursor :^) 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
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
0a7d9319af ChessEngine: Move from Applications to Services
This is not a stand-alone application. :^)
2020-08-28 12:53:02 +02:00
AnotherTest
e0b7833078 Spreadsheet: Do not clear cells when ctrl-selecting 2020-08-28 09:22:17 +02:00
Andreas Kling
9f3b1b8e21 Spreadsheet: Draw cell borders as 1px thin line :^) 2020-08-27 19:28:04 +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
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
thankyouverycool
ebba297b42 Base: Move 16x16 common icons to /res/icons/16x16/
Drops the '16' suffix from filenames. Resizes inconsistent
audio-volume icons to intended size.
2020-08-27 15:38:02 +02:00
thankyouverycool
61ba39dfa0 Base: Create /res/graphics/ and relocate system art assets 2020-08-27 15:38:02 +02:00
Andreas Kling
d876c49ec7 Spreadsheet: Don't advertise the SpreadsheetModel as sortable 2020-08-27 10:38:36 +02:00
AnotherTest
a5a3e5a178 Spreadsheet: Add support for changing multiple cells at once
Just select many cells and use the cell editor! so easy!
2020-08-27 10:27:20 +02:00
AnotherTest
7465c51ef2 Base+LibGUI+Spreadsheet: Add icons for Spreadsheet
Also adds a Spreadsheet.af.
2020-08-27 10:27:20 +02:00
AnotherTest
dd4bd0943a Spreadsheet: Track selections across sheet switches 2020-08-27 10:27:20 +02:00
AnotherTest
8db5057dc4 Spreadsheet: Show errors and make them red 2020-08-27 10:27:20 +02:00
AnotherTest
cb7fe4fe7c Spreadsheet: Add support for multiple sheets
This also refactors the js integration stuff to allow sheets to
reference each other safely.
2020-08-27 10:27:20 +02:00
AnotherTest
e1f5f709ee Spreadsheet: Move sheet management to a Workbook class 2020-08-27 10:27:20 +02:00
Ben Wiederhake
9f7ec33180 Meta: Force semi-colon after MAKE_AK_NONXXXABLE()
Before, we had about these occurrence counts:
COPY: 13 without, 33 with
MOVE: 12 without, 28 with

Clearly, 'with' was the preferred way. However, this introduced double-semicolons
all over the place, and caused some warnings to trigger.

This patch *forces* the usage of a semi-colon when calling the macro,
by removing the semi-colon within the macro. (And thus also gets rid
of the double-semicolon.)
2020-08-27 10:12:04 +02:00
Andreas Kling
368dc8ad08 Spreadsheet: Tweak row height slightly
Add 2px of height to the rows. This makes editing a cell inline look
better since we no longer cut off the text while editing.
2020-08-26 20:35:09 +02:00
Andreas Kling
d125c624c6 Spreadsheet: Use a fixed-width font in the cell editor 2020-08-26 17:00:40 +02:00
Andreas Kling
c5278dac99 Spreadsheet: Don't ignore selections in the A column :^)
This was a leftover from when the first column contained row numbers.
2020-08-26 17:00:40 +02:00
Andreas Kling
8cacac32b5 Spreadsheet: Enable row headers for the spreadsheet TableView 2020-08-26 17:00:40 +02:00
Andreas Kling
695b283b8c Spreadsheet: Get rid of the "row numbers" column
Let's use TableView's row headers for this instead. :^)
2020-08-26 17:00:40 +02:00
AnotherTest
394e4c04cd LibJS: Add a helper for calling JS::Function's with arguments
The fact that a `MarkedValueList` had to be created was just annoying,
so here's an alternative.
This patchset also removes some (now) unneeded MarkedValueList.h includes.
2020-08-26 08:45:01 +02:00
Ben Wiederhake
cd93fb9656 LibC: Deduplicate declaration of strcasecmp 2020-08-26 00:55:13 +02:00
Andreas Kling
cfc30b11ba LibGUI: Rename table view's "cell painting delegate" to "column *"
What you install with this API is a delegate that manages painting of
all the items in a specific column, so let's make the API reflect that.
2020-08-26 00:51:35 +02:00
Andreas Kling
44e371635e LibGUI: Move table view headers into their own widget
This patch introduces the HeaderView class, which is a widget that
implements the column headers of TableView and TreeView.

This greatly simplifies event management in the view implementations
and also makes it much easier to eventually implement row headers.
2020-08-26 00:51:35 +02:00
Andreas Kling
965ccf5242 Spreadsheet: Focus the spreadsheet table on startup 2020-08-26 00:51:35 +02:00
Linus Groh
9ea6ef4ed1 LibJS: Make Interpreter::throw_exception() a void function
The motivation for this change is twofold:

- Returning a JS::Value is misleading as one would expect it to carry
  some meaningful information, like maybe the error object that's being
  created, but in fact it is always empty. Supposedly to serve as a
  shortcut for the common case of "throw and return empty value", but
  that's just leading us to my second point.
- Inconsistent usage / coding style: as of this commit there are 114
  uses of throw_exception() discarding its return value and 55 uses
  directly returning the call result (in LibJS, not counting LibWeb);
  with the first style often having a more explicit empty value (or
  nullptr in some cases) return anyway.
  One more line to always make the return value obvious is should be
  worth it.

So now it's basically always these steps, which is already being used in
the majority of cases (as outlined above):

- Throw an exception. This mutates interpreter state by updating
  m_exception and unwinding, but doesn't return anything.
- Let the caller explicitly return an empty value, nullptr or anything
  else itself.
2020-08-25 18:30:31 +02:00
AnotherTest
3320bb45d1 Spreadsheet: Add "Save As" 2020-08-25 09:46:28 +02:00
AnotherTest
fdf0660064 Spreadsheet: Implement state-preserving saves and loads 2020-08-25 09:46:28 +02:00
Luke
694b86a4bf LibDebug: Move everything into the "Debug" namespace 2020-08-25 09:46:06 +02:00