Commit graph

1563 commits

Author SHA1 Message Date
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
Andreas Kling
75b8f4e4e6 LibGUI: Make focus events more aware of why focus is changing
This patch adds GUI::FocusEvent which has a GUI::FocusSource.
The focus source is one of three things:

- Programmatic
- Mouse
- Keyboard

This allows receivers of focus events to implement different behaviors
depending on how they receive/lose focus.
2020-08-15 00:05:45 +02:00
Andreas Kling
b97e42dcaa LibGUI: Make ModelSelection non-copyable and non-movable
These are meant to be attached to an AbstractView at all times.
2020-08-14 12:15:11 +02:00
Andreas Kling
686ee2bf04 LibGUI: Rename ModelClient::on_model_update() => model_did_update()
This follows the typical client callback naming scheme used elsewhere
and doesn't collide with the "on_foo" Function hook convention.
2020-08-13 20:18:11 +02:00
Andreas Kling
4088beb8eb LibGUI: Remove Model::sibling() since it's the same as index()
... I'm not sure what the idea was here, but since these functions do
the same thing, let's only have index().
2020-08-13 20:18:11 +02:00