Commit graph

1767 commits

Author SHA1 Message Date
AnotherTest
e7f5090808 Spreadsheet: Always keep the workbook interpreter in VM scope
Fixes #3570.
2020-09-21 00:10:19 +02:00
Tibor Nagy
cba5a69f07 FontEditor: Draw the baseline in the glyph editor widget 2020-09-20 23:23:56 +02:00
Andreas Kling
1c43442be4 LibJS+Clients: Add JS::VM object, separate Heap from Interpreter
Taking a big step towards a world of multiple global object, this patch
adds a new JS::VM object that houses the JS::Heap.

This means that the Heap moves out of Interpreter, and the same Heap
can now be used by multiple Interpreters, and can also outlive them.

The VM keeps a stack of Interpreter pointers. We push/pop on this
stack when entering/exiting execution with a given Interpreter.
This allows us to make this change without disturbing too much of
the existing code.

There is still a 1-to-1 relationship between Interpreter and the
global object. This will change in the future.

Ultimately, the goal here is to make Interpreter a transient object
that only needs to exist while you execute some code. Getting there
will take a lot more work though. :^)

Note that in LibWeb, the global JS::VM is called main_thread_vm(),
to distinguish it from future worker VM's.
2020-09-20 19:24:44 +02:00
Andreas Kling
95eeb321f9 LibGfx+FontEditor+Base: Add "baseline" value to all fonts
This does nothing at the moment but will soon allow us to improve the
vertical positioning of text.
2020-09-19 19:16:22 +02:00
Andreas Kling
e1965a5a8e FileManager: Prevent feedback loop between treeview and directory view
When opening something in the left-side treeview, it also opens in the
right-side directory view. That triggers the "path changed" hook in the
directory view, which causes us to fully reveal the opened directory
in the left-side treeview.

This feedback loop made the UI feel weird since it caused directories
to expand just by selecting them in the left-side treeview. So let's
break that loop.
2020-09-19 14:09:59 +02:00
Andreas Kling
eb24603da0 FileManager: Properly reveal newly opened directories in the treeview
Use the new TreeView::expand_all_parent_of() API to ensure that newly
opened directories are revealed and scrolled-into-view in the left-side
treeview. :^)
2020-09-18 21:29:01 +02:00
Andreas Kling
56328409d9 FileManager: Update GUI when "entering" an inaccessible directory
When we enter an inaccessible directory, we still allow that directory
to become selected in the left-side treeview, so we need to update the
location box and window title to reflect the new current path.

This is not perfectly factored and there's a bit of duplication between
the model's on_error and on_complete hook callbacks in DirectoryView.
Needs more work. :^)
2020-09-18 21:29:01 +02:00
Andreas Kling
8075db683b FileManager: Show an inline error message for inaccessible directories
Instead of popping up a message box whenever we can't read an opened
directory, show the error message inside the DirectoryView (as a label)
instead.

This fixes a visual inconsistency where an inaccessible directory would
be selected in the left-side treeview while the previous directory's
contents were still showing on the right.

This also makes keyboard navigation a bit more pleasant since you're
not suddenly interrupted by a message box.
2020-09-18 21:29:01 +02:00
Andreas Kling
65b246aaf4 FileManager: Remove an unused enum in DirectoryView 2020-09-18 21:29:01 +02:00
Andreas Kling
07d4b41bac FileManager: Move DirectoryView into the FileManager namespace 2020-09-17 17:23:37 +02:00
Andreas Kling
8055f7a1f5 FileManager: Move the DesktopWidget to its own compilation unit 2020-09-17 14:34:47 +02:00
Andreas Kling
4e8c50d92d FileManager: Handle drop events in DirectoryView
This makes it possible to drag & drop files to/from the desktop! :^)
2020-09-17 14:30:00 +02:00
Andreas Kling
e1e58d5bc9 FileManager: Use GUI::FileIconProvider for the location box icon 2020-09-16 21:08:55 +02:00
Andreas Kling
17ae1c37bb FileManager: Show the root (/) directory in the treeview on the left
This gives you something to click on if you actually want to open
the root directory. Previously, if you wanted to get to /, you had to
use the "to parent directory" repeatedly. Silly. :^)
2020-09-16 21:08:55 +02:00
Andreas Kling
95b6c98435 LibGUI: Fix TreeView scrolling to top when clicking sub-items
This code was confusing two different versions of scroll_into_view that
were getting mixed up due to member function shadowing.

Adding an "override" to the subclass declaration exposed the problem.

With this fixed, we no longer lose our scroll position wildly when
using the mouse to select TreeView items.
2020-09-16 16:37:28 +02:00
Andreas Kling
d67b421628 Browser: Move the basic Tab UI skeleton to JSON GUI 2020-09-14 19:55:17 +02:00
Andreas Kling
1307f7292c Browser: Set tab text alignment from JSON GUI 2020-09-14 19:55:17 +02:00
Andreas Kling
856f683dc9 Browser: Generate the main browser window UI from JSON :^) 2020-09-14 19:55:17 +02:00
Andreas Kling
f67c876df0 Build+TextEditor: Add a compile_json_gui() CMake helper
This makes it easier to include JSON GUI declarations in any app. :^)
2020-09-14 16:16:36 +02:00
Andreas Kling
119a0c5dee TextEditor: Move the find/replace buttons to JSON GUI 2020-09-14 16:16:36 +02:00
Andreas Kling
89822c5ae7 TextEditor: Set initial widget visibilities from JSON 2020-09-14 16:16:36 +02:00
Andreas Kling
8a7935a29f TextEditor: Move the "find" and "replace" widget containers to JSON GUI 2020-09-14 16:16:36 +02:00
Andreas Kling
2e547ce7a3 TextEditor: Move the main window UI to JSON
This is our first client of the new JSON GUI declaration thingy.
The skeleton of the TextEditor app GUI is now declared separately from
the C++ logic, and we use the Core::Object::name() of widgets to locate
them once they have been instantiated by the GUI builder.
2020-09-14 16:16:36 +02:00
Andreas Kling
67dca51f47 FileManager: Use the correct delete action in the treeview context menu 2020-09-13 21:48:16 +02:00
Andreas Kling
ef50e5aaee FileManager: Move delete and force-delete actions to DirectoryView
This is a little bit messy since the left-side treeview also has a
delete action. Because of that, we have to put a focus-dependent action
that delegates to the relevant view-specific action in the tool bar
and menu bar.

I'm not sure yet what a good abstraction would be for this. We'll see
what we can think of.
2020-09-13 21:41:45 +02:00
Andreas Kling
174527b580 KeyboardMapper: Avoid using [&] captures for persistent lambdas
These are not bugfixes, just improving the hygiene.
2020-09-13 21:41:45 +02:00
Andreas Kling
825fcb8292 FileManager: Move "Open Terminal here" action to DirectoryView 2020-09-13 21:41:45 +02:00
AnotherTest
d103686261 Spreadsheet: Implement a specialised version of printf for formatting
Now all format values will format a single double, cast to the
appropriate types.
2020-09-12 15:01:19 +02:00
AnotherTest
c2228b669d Spreadsheet: Allow customising the cell foreground and background colors 2020-09-12 15:01:19 +02:00
AnotherTest
8fa385f774 Spreadsheet: Allow cells to optionally have static fg/bg colors 2020-09-12 15:01:19 +02:00
Ben Wiederhake
83b85e5578 IRCClient: Remove unused dump() logic
A 'FIXME' asked for this to be removed, so I did.
2020-09-12 13:46:15 +02:00
Ben Wiederhake
9c3a33762b LibGfx: Saner memory usage of indexed bitmaps
Indexed bitmaps used to allocate four times the required amount of memory.

Also, we should acknowledge that the underlying data is not always RGBA32,
and instead cast it only when the true type is known.
2020-09-12 00:13:29 +02:00
Andreas Kling
8f5b92865d HexEditor: Use widget override cursors 2020-09-11 14:37:30 +02:00
Andreas Kling
b4f307f982 LibGUI+WindowServer: Rename window "override cursor" to just "cursor"
Let's just say each window has a cursor, there's not really overriding
going on.
2020-09-11 14:26:37 +02:00
Andreas Kling
0f9be82826 LibGfx: Move StandardCursor enum to LibGfx
This enum existed both in LibGUI and WindowServer which was silly and
error-prone.
2020-09-10 19:25:13 +02:00
Andreas Kling
4e0df06f86 IRCClient: Use NonnullRefPtr<IRCClient> throughout
To protect against mishaps during app exit teardown, make sure everyone
who needs to be is a co-owner of the IRCClient object.

Fixes #3451.
2020-09-10 18:45:00 +02:00
Andreas Kling
b4bfc3ed54 Spreadsheet: Add "final" to JS objects and tweak declarations 2020-09-08 14:11:43 +02:00
asynts
9c83d6ff46 Refactor: Replace usages of FixedArray with Array. 2020-09-08 14:01:21 +02:00
Andreas Kling
c460f4a3cb IRCClient: Add the "/me" command to send CTCP ACTION emotes :^)
You can now express your feelings and actions with our IRC client by
using the /me command.
2020-09-07 20:49:35 +02:00
Andreas Kling
3c49a82ae9 Terminal: Use utmpupdate to update /var/run/utmp
We now put entries for interactive terminal sessions in the utmp file.
They are removed when you exit the terminal.
2020-09-06 16:15:51 +02:00
Andreas Kling
f405cd3830 PixelPaint: Update "paste" action enabled state based on clipboard
This action should only be enabled when there's a pastable bitmap
on the system clipboard. :^)
2020-09-05 16:57:03 +02:00
Andreas Kling
6aa7f59608 PixelPaint: Allow pasting a copied bitmap as a new layer :^) 2020-09-05 16:53:51 +02:00
Andreas Kling
00bdb74c84 QuickShow: Allow copying the current bitmap to the clipboard :^) 2020-09-05 16:53:30 +02:00
Andreas Kling
51146e3075 LibGUI: Make the Clipboard API deal in raw byte buffers a bit more
To open up for putting not just text/plain content on the clipboard,
let's make the GUI::Clipboard API a bit more raw-data-friendly. :^)
2020-09-05 16:16:01 +02:00
Avery
1da38eeb3c DisplaySettings: Remove unnecessary file open for non-paths
Currently, every time the wallpaper picker changes, an additional
attempted file load happens on top of the file load to create the
bitmap. The only values that the wallpaper picker can take on are
filenames that can never be valid when loaded without the /res/wallpaper
prefix. To reduce the amount of log spam and speed up wallpaper picking,
this patch only attempts to load wallpapers with slash-prefixed names,
assumed to be the absolute path to that wallpaper. Additional wallpapers
outside of /res/wallpapers/ should still be accessible with this patch,
and the experience is improved for the more common case of selecting a
built-in wallpaper.
2020-09-03 11:03:16 +02:00
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
AnotherTest
4c65bd3731 Spreadsheet: Add back the menubar 2020-08-24 19:15:07 +02:00
AnotherTest
1e14b93407 Spreadsheet: Fix crash when a row number is selected 2020-08-24 19:15:07 +02:00
AnotherTest
e65d54a2fa Spreadsheet: Avoid crashing when a cell is created mid-update
To reproduce:
- make sure A0, A1, A2 do not exist (i.e. have not been selected or
  written to)
- select A0
- type in =A1+A2
- see crash
2020-08-24 19:15:07 +02:00
AnotherTest
de13c6939d Spreadsheet: Add a syntax highlighter to the cell editor 2020-08-24 19:15:07 +02:00
Andreas Kling
50bca8fcef SystemMonitor: Tweak processor feature display a little bit
Flatten the CPU features array instead of showing it as raw JSON data.
2020-08-24 18:22:09 +02:00
AnotherTest
682b2fdb75 LibWeb: Move OutOfProcessWebView into the Web namespace 2020-08-24 18:21:33 +02:00
AnotherTest
3a07f6e345 Spreadsheet: Document runtime functions and add a help window
...that can automatically generate documentation pages from the objects.
2020-08-24 18:21:33 +02:00
AnotherTest
12cf3e13c0 Spreadsheet: Add a topbar with a text editor 2020-08-24 18:21:33 +02:00
AnotherTest
a6ebd29aa5 Spreadsheet: Start making a spreadsheet application 2020-08-24 18:21:33 +02:00
Andreas Kling
4eb1fd6ea3 SystemMonitor: Use bottom-side tabs for the per-process info tabs
Let's try this out and see how it feels! :^)
2020-08-23 23:53:45 +02:00
Andreas Kling
1b075ffe3b ThemeEditor: Paint the minimize/maximize/close window button icons 2020-08-23 15:02:44 +02:00
Andreas Kling
26cc733f93 ThemeEditor: Add window buttons (no bitmaps yet) 2020-08-23 14:58:15 +02:00
Andreas Kling
690c736c3a ThemeEditor: Add a handful of widgets to the preview
This needs to be spruced up a bit, but having a set of common widgets
gives you a quick idea of what the theme will look like. :^)
2020-08-23 14:12:42 +02:00
Emanuele Torre
553889b2f5 ThemeEditor: Use m_inactive_window_icon when painting the inactive..
..window

`m_inactive_window_icon` wasn't being used.
2020-08-23 10:20:52 +02:00
thankyouverycool
ab3fff4211 LibGUI+Calendar: Make Calendar a common widget in LibGUI
Refactors the Calendar widget into LibGUI and updates the Calendar
app interface. Calendar widget lets layout engine manage most of
its geometry now and has a few new features like tile click
navigation, hover highlighting and a togglable year/month mode.
2020-08-22 11:54:30 +02:00
Itamar
0e69ebbce4 Meta: Add missing license header to ThemeEditor 2020-08-22 09:48:59 +02:00
Andreas Kling
dd9d5d6c72 ThemeEditor: Tweak the main UI layout 2020-08-21 21:16:13 +02:00
Andreas Kling
84a272ad2a ThemeEditor: Set window icon and title 2020-08-21 21:16:13 +02:00
Andreas Kling
7703dad36b ThemeEditor: Allow editing of theme colors one at a time
This is not perfect and kinda clunky to use, but these are the best
input widgets we have available at the moment, so let's make do with
what we have. :^)
2020-08-21 21:16:13 +02:00
Andreas Kling
dfe8adde3f ThemeEditor: Start working on a window theme editor :^) 2020-08-21 21:16:13 +02:00
Peter Elliott
1e57e32a93 ChessEngine: Add ChessEngine
This engine is pretty bad, but doesn't let itself get checkmated
2020-08-21 12:26:30 +02:00
Luke
4dfe797263 SystemMonitor: Add a Processors tab 2020-08-21 12:01:36 +02:00
Jake Wilson
0f6de0c45a Browser: add urls to browser history on load start
urls were previously added to history in the Tab::load()
function, which excluded the setter on window.location.href.
This commit adds all urls to browser history when the page loads,
as long as the load_type is not LoadType::HistoryNavigation.
Closes #3148
2020-08-19 21:11:10 +02:00
Abu Sakib
8abf5048b8 Calendar: Add help menuitem 2020-08-18 17:24:14 +02:00
Andreas Kling
d1e83b4f6e FileManager: Make DirectoryView vend indexes from view model
Instead of translating between the sorting proxy and the underlying
file system model at all the DirectoryView API boundaries, just hand
out indexes into the sorting proxy model.

The only thing those indexes are used for on the outside is to
retrieve a GUI::FileSystemModel::Node for an index, so add a nice
helper on DirectoryView that turns a ModelIndex into a Node&.
2020-08-17 22:49:52 +02:00
Andreas Kling
f0349323c4 LibGUI: Don't require passing model to FileSystemModel::Node APIs
The Node API was obnoxiously requiring you to pass the model into it
all the time, simply because nodes could not find their way back to
the containing model. This patch adds a back-reference to the model
and simplifies the API.
2020-08-17 22:02:21 +02:00
Andreas Kling
38d8426f32 FileManager: Move the "create new file" action into DirectoryView
This makes it available in both desktop and windowed modes. :^)
2020-08-17 21:34:14 +02:00
Andreas Kling
be48f58d41 FileManager: Move "create new directory" action into DirectoryView
This makes it available in both desktop and windowed mode. :^)
2020-08-17 21:34:14 +02:00
Andreas Kling
0ffd319bda FileManager: Partially bring back the desktop context menu 2020-08-17 21:34:14 +02:00
Andreas Kling
66cedfa13b FileManager: Don't pass DirectoryView subview to hooks that don't care 2020-08-17 21:34:14 +02:00
Andreas Kling
0083fe0118 FileManager: Use DirectoryView for both windowed and desktop mode
This patch begins the process of converting FileManager's desktop mode
to using the DirectoryView class.

This will allow us to share most of the code between the two different
runtime modes of FileManager.

We lose a bit of functionality in this patch, but we'll bring it back!
2020-08-17 21:34:14 +02:00
Andreas Kling
b6e18133ae LibWeb: Rename WebContentView => OutOfProcessWebView 2020-08-17 18:05:35 +02:00
Andreas Kling
56c3748dcc LibWeb: Rename PageView => InProcessWebView 2020-08-17 18:05:35 +02:00
Luke
c434a91c91 FileManager: Apply wallpaper on startup
I noticed that nothing actually applies the wallpaper on startup.
I wasn't sure where to put the responsibility, so I gave it to
the desktop mode file manager.

Also adds a save_config option to set_wallpaper so it doesn't
needlessly save the config.
2020-08-17 17:47:14 +02:00
Andreas Kling
a27d782dd6 FileManager: Don't close() twice when copying a file 2020-08-17 13:12:46 +02:00
Brian Gianforcaro
73ab030f88 FileManager: Fix descriptor leak in copy_file, found by Coverity 2020-08-17 09:17:57 +02:00
Brian Gianforcaro
e43d5d5eaa FileManger: Fix file descriptor leak in copy_file_or_directory, found by Coverity 2020-08-17 09:17:57 +02:00
Brian Gianforcaro
f7b1591a5c SystemMonitor: Uninitialized struct member in ProcessModel, found by Coverity
This is really a nop, as the cpu_percent is computed later. Zero the
value just to keep things sane.
2020-08-17 09:17:57 +02:00
Brian Gianforcaro
3ee0917dcb SoundPlayer: Uninitialized variable in SoundPlayerWidget, found by Coverity 2020-08-17 09:17:57 +02:00
Brian Gianforcaro
e160181a73 Piano: Uninitialized member variables in RollWidet, found by Coverity
This seem like they wouldn't cause any problems in reality,
but it's nice to fix them to avoid any future misuse.
2020-08-17 09:17:57 +02:00
Andreas Kling
154a184c1b Browser: Add a debug menu action for triggering a JS garbage collection
Triggering a GC this way will print a report afterwards so you can see
how much memory is currently used by the JS heap. :^)
2020-08-16 20:35:03 +02:00
thankyouverycool
15cb4207fc TextEditor: Put fonts in exclusive action group 2020-08-16 19:39:06 +02:00
thankyouverycool
5558b2cf9f Base: Rename Pebbleton to reflect actual height
And update programs loading it from file.
2020-08-16 19:38:21 +02:00
Andreas Kling
9102b624ac LibGUI+DevTools+Applications: Use ModelIndex::data() in many places
This way you don't have to keep track of which model it came from.
2020-08-16 16:44:09 +02:00
Andreas Kling
96f98b1fc9 LibGUI: Simplify TableCellPaintingDelegate API slightly
No need to pass the Model *and* a ModelIndex, the index knows which
model it belongs to anyway.
2020-08-16 16:44:09 +02:00
Andreas Kling
a1e381a0f8 LibGUI: Move GUI::Model::Role to GUI::ModelRole
This is preparation for using ModelRole in the ModelIndex API.
2020-08-16 16:44:09 +02:00
Andreas Kling
b9ae937279 SystemMonitor: Invalidate ProcessModel indexes when necessary
If the process table grows or shrinks, we need to invalidate all the
ProcessModel indexes. This is not great, but it's the most precise
invalidation we can do at the moment.
2020-08-16 16:44:09 +02:00
Andreas Kling
e1ed71ef9e LibGUI: Make model sorting imperative and move order to AbstractView
Instead of SortingProxyModel having a column+order, we move that state
to AbstractView. When you click on a column header, the view tells the
model to resort the relevant column with the new order.

This is implemented in SortingProxyModel by simply walking all the
reified source/proxy mappings and resorting their row indexes.
2020-08-16 16:44:09 +02:00
Andreas Kling
7b110fad56 FileManager: Use one SortingProxyModel for all DirectoryView subviews
This removes one major source of confusion in DirectoryView. It's still
weird that we mix sorting model indexes with filesystem model indexes
a bit willy-nilly but we'll improve that separately.
2020-08-16 16:44:09 +02:00
Nico Weber
af96cfe9ef SystemMonitor: Move memory graph caption from KB to KiB
This changes the graph caption from KB to KiB, but it keeps just "K"
instead of "KiB" for all the numbers in columns in the table, since "K"
is fairly well-established as abbreviation of "KiB" (the SI prefix is
lower-case), and space is at a premium here.
2020-08-16 16:33:28 +02:00
Nico Weber
aa97166739 Everywhere: Consolidate human_readable_size() implementations
Let's use the one in AK/NumberFormat.h everywhere.

It has slightly different behavior than some of the copies this
removes, but it's probably nice to have uniform human readable
size outputs across the system.
2020-08-16 16:33:28 +02:00
Nico Weber
430b265cd4 AK: Rename KB, MB, GB to KiB, MiB, GiB
The SI prefixes "k", "M", "G" mean "10^3", "10^6", "10^9".
The IEC prefixes "Ki", "Mi", "Gi" mean "2^10", "2^20", "2^30".

Let's use the correct name, at least in code.

Only changes the name of the constants, no other behavior change.
2020-08-16 16:33:28 +02:00
Linus Groh
2e5c434e22 Misc: Use automatic window positioning in more applications
This is a follow up to #2936 / d3e3b4ae56aa79d9bde12ca1f143dcf116f89a4c.

Affected programs:
- Applications: Browser (Download, View source, Inspect DOM tree, JS
  console), Terminal (Settings)
- Demos: Cube, Eyes, Fire, HelloWorld, LibGfxDemo, WebView,
  WidgetGallery
- DevTools: HackStudio, Inspector, Profiler
- Games: 2048, Minesweeper, Snake, Solitaire
- Userland: test-web

A few have been left out where manual positioning is done on purpose,
e.g. ClipboardManager (to be close to the menu bar) or VisualBuilder (to
preserve alignment of the multiple application windows).
2020-08-15 17:38:19 +02:00
Linus Groh
0cab3bca2f LibGUI: Add and use Window::center_on_screen()
Various applications were using the same slightly verbose code to center
themselves on the screen/desktop:

Gfx::IntRect window_rect { 0, 0, width, height };
window_rect.center_within(GUI::Desktop::the().rect());
window->set_rect(window_rect);

Which now becomes:

window->resize(width, height);
window->center_on_screen();
2020-08-15 17:38:19 +02:00
Ben Wiederhake
cebf8ae3b7 SystemMonitor: ProcessStack is now ThreadStack
This is a follow-up to #3095. In particular:
    https://github.com/SerenityOS/serenity/pull/3095#discussion_r469113354
2020-08-15 13:38:24 +02:00