Commit graph

74 commits

Author SHA1 Message Date
Marcin Gasperowicz
3039c36836 AudioApplet: Make the slider exponential for finer volume control
The volume slider was linear, which is not ideal for an audio volume 
control. Perceived volume would not change much within 30-100% range
and would change in leaps within 0-30% range where the resolution is
not sufficient for fine grained control.

The simplest solution is to bring the value into 0.0-1.0 range and 
square it to obtain an exponential curve. This is a decent 
approximation of the logarithmic taper used in audio potentiometers.
2020-10-15 13:47:27 +02:00
Ben Wiederhake
42dd0675c0 Meta+MenuApplets: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
Linus Groh
724c5bd8d9 ResourceGraph: Fix graph line position calculation
The calculation was only taking the rect's inner height, but not its top
offset into account.

Fixes #3540.
2020-09-19 00:32:06 +02:00
Andreas Kling
40e6a3dcc3 ClipboardHistory: Copy metadata when reusing a historical clipping 2020-09-05 17:06:34 +02:00
Andreas Kling
2e446b662b ClipboardHistory: Show bitmap width/height/bpp for bitmap clippings 2020-09-05 17:05:22 +02:00
Andreas Kling
0b051a5e15 ClipboardHistory: Show the size (in bytes) of each remembered clipping 2020-09-05 17:02:25 +02:00
Andreas Kling
b8d73e259c ClipboardHistory: Cap the history at 20 entries for now
Now that we can copy bitmaps, we need some kind of cap here or memory
usage quickly skyrockets.

This could probably be improved or made adaptive somehow, this is just
a simple hard cap for now.
2020-09-05 17:00:18 +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
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
0359a5ce27 MenuApplets: Add a mini calendar to Clock applet 2020-08-22 11:54:30 +02:00
Andreas Kling
b36ac88349 ResourceGraph: Keep the graph inside the GUI::Frame rect
Part of the graph was hidden under the frame rect, which had the effect
of delaying the appearance of spikes (well, all changes really.)
2020-08-21 16:13:19 +02:00
Nico Weber
c0c7b4a098 Clock MenuApplet: Use Core::DateTime to simplify the code 2020-08-17 21:23:11 +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
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
Nico Weber
d5b2233f2e ResourceGraph: add tooltips to cpu and memory graphs
The tooltip doesn't update while it's visible.
2020-08-14 16:09:58 +02:00
Andreas Kling
8cf818e7c7 ResourceGraph.MenuApplet: Disown child processes after spawning 2020-08-04 18:17:16 +02:00
Andreas Kling
9e81b93ab9 Clock.MenuApplet: Disown child process after spawning 2020-08-04 18:17:16 +02:00
thankyouverycool
bbcdab2baa Base+MenuApplet: Add new controls and icons for AudioApplet
Adds a classic volume slider to the AudioApplet. Percent text
and mute state can now be toggled via checkboxes. Left click opens,
right click mutes. Updates existing icons and adds unique icons for
muted vs zero volume states.
2020-07-26 11:32:12 +02:00
Andreas Kling
299824de73 LibGUI: Rename GUI::Image => GUI::ImageWidget
"Image" was a bit too vague, "ImageWidget" is obviously a widget of
some sort.
2020-07-23 17:31:08 +02:00
Benoît Lormeau
0e172f8ed7 Base: rename audio volume icons with descriptive names 2020-07-21 19:02:25 +02:00
Benoît Lormeau
4916cfa3a3 AudioApplet: Scrolling the Audio applet will adjust the main mix volume
The Audio applet now dislays the main mix volume next to the speaker
icon. A click on the applet still mutes the global mixer. By scrolling
the mouse wheel while on the applet, you can decrease/increase the mixer
volume. Different icons will be painted depending on the volume and the
mute state.

Happy listening :^)
2020-07-21 19:02:25 +02:00
Nico Weber
9cc32d6e95 Userland+MenuApplets: Replace two more fork/exec with posix_spawn 2020-07-05 16:03:23 +02:00
Andreas Kling
1dd1595043 LibGUI: Make GUI::Application a Core::Object
Having this on the stack makes whole-program teardown iffy. Turning it
into a Core::Object allows anyone who needs it to extends its lifetime.
2020-07-04 14:05:57 +02:00
Nico Weber
12cbc4ad0d Everywhere: Replace some uses of fork/exec with posix_spawn
It's less code, and it's potentially more efficient once
posix_spawn is a real syscall.
2020-06-29 12:04:27 +02:00
Andreas Kling
d480944f6a ClipboardHistory: Use pledge() and unveil() :^) 2020-06-18 22:34:15 +02:00
Hüseyin ASLITÜRK
3a676c6fd2 ClipboardHistory: Replace IconWidget with GUI::Image 2020-06-18 16:35:57 +02:00
Matthew Olsson
e8e728454c AK: JsonParser improvements
- Parsing invalid JSON no longer asserts
    Instead of asserting when coming across malformed JSON,
    JsonParser::parse now returns an Optional<JsonValue>.
- Disallow trailing commas in JSON objects and arrays
- No longer parse 'undefined', as that is a purely JS thing
- No longer allow non-whitespace after anything consumed by the initial
  parse() call. Examples of things that were valid and no longer are:
    - undefineddfz
    - {"foo": 1}abcd
    - [1,2,3]4
- JsonObject.for_each_member now iterates in original insertion order
2020-06-13 12:43:22 +02:00
Sergey Bugaev
62d1ac63e8 MenuApplets: Fix using OwnPtr<> with RefCounted types 2020-06-12 16:08:45 +02:00
Andreas Kling
2adb0a07e5 LibGUI: Get rid of Model::ColumnMetadata and always use auto-sizing
Auto-sizing of view columns is now enabled by default. This removes the
last remaining need for ColumnMetadata, so this patch gets rid of it.
2020-05-21 19:55:44 +02:00
Andreas Kling
ff4eaa12b4 ClipboardHistory: Always place the applet at the same location :^) 2020-05-20 20:24:44 +02:00
Andreas Kling
21cfa9acd4 ResourceGraph: Add a thin frame around the graphs
Make the graph widgets into 1px GUI::Frames for a pleasant 90's feel.
2020-05-20 20:22:22 +02:00
Sergey Bugaev
f7ae66cee3 ClipboardHistory: Add a clipboard history applet :^)
It will listen for clipboard content changes in the backgroud. Once you click
on its icon, it will pop up a window listing all recorded clipboard contents.
You can then double-click on an item to copy it again.
2020-05-16 09:13:25 +02:00
Sergey Bugaev
450a2a0f9c Build: Switch to CMake :^)
Closes https://github.com/SerenityOS/serenity/issues/2080
2020-05-14 20:15:18 +02:00
Ben Wiederhake
da837fe46e Meta: Fix Makefile permissions (not executable) 2020-05-03 14:24:08 +02:00
Linus Groh
54fc972a72 MenuApplets: Support memory usage and custom colors in ResourceGraph
The ResourceGraph menu applet now supports a few command line options:

--cpu / -C to display a CPU usage graph
--memory / -M to display a memory usage graph
--name / -n to set a name which is used to order applets
--color / -c to set the graph color (supports anything
Gfx::Color::from_string() understands)

The SystemServer.ini and WindowServer.ini config files have been updated
to spawn and show two ResourceGraph menu applets, one for CPU usage
(green) and one for memory usage (cyan) - this matches the colors in the
SystemMonitor graphs.
2020-04-11 10:03:12 +02:00
Linus Groh
b46a8d7335 MenuApplets: Rename CPUGraph to ResourceGraph
The plan is to extend what currently is known as "CPUGraph" and let the
SystemServer spawn multiple instances of it - which then can show memory
or network usages as well :^)

Simply renaming the applet is the first step.
2020-04-11 10:03:12 +02:00
AnotherTest
9ba9bba529 Clock menu applet: launch the new Calendar on click 2020-04-01 10:42:33 +02:00
Andreas Kling
0f3e57a6fb LibGUI: Use GUI::Window::set_main_widget<WidgetType>() in clients 2020-03-04 14:26:16 +01:00
joshua stein
0d2bfe5c65 Build: Only look at SUBDIRS with Makefiles
If a directory is renamed or deleted before 'make clean', git will
delete the Makefile but leave all of the object and dependency files
around.  When make would try to recurse into that directory from the
wildcard, it would error out since there is no Makefile.
2020-02-25 19:56:48 +01:00
Andreas Kling
c5d913970a LibGUI: Remove parent parameter to GUI::Widget constructor 2020-02-23 12:27:53 +01:00
Andreas Kling
3d20da9ee4 Userspace: Use Core::Object::add() when building interfaces 2020-02-23 11:10:52 +01:00
Andreas Kling
34c7322d77 LibGUI: Remove some header dependencies from Widget.h 2020-02-14 23:53:11 +01:00
Andreas Kling
3fe2640c8c LibGfx: Add forward declaration header
This patch adds <LibGfx/Forward.h> with forward declarations for Gfx.
2020-02-14 23:31:18 +01:00
=
e5e162fe5a Audio.MenuApplet: Add window title. 2020-02-10 18:33:28 +01:00
=
aadcc9c34e CPUGraph.MenuApplet: Add window title. 2020-02-10 18:33:28 +01:00
=
afb37b66cc Clock.MenuApplet: Add window title. 2020-02-10 18:33:28 +01:00
=
fcee5075e9 UserName.MenuApplet: Add window title. 2020-02-10 18:33:28 +01:00
asliturk
57edcb54c2 MenuApplets: Add UserName applet.
Move code from WindowServer.WSMenuManager to the applet.
2020-02-09 10:37:35 +01:00
Andreas Kling
6a9cc66b97 LibGUI: Remove leading G from filenames 2020-02-06 20:33:02 +01:00
Andreas Kling
97edc82a26 LibAudio: Remove leading A from filenames 2020-02-06 15:18:03 +01:00