Commit graph

164 commits

Author SHA1 Message Date
Andreas Kling
247717431d LibGUI: Make GUI::Widget::event() protected 2021-03-28 11:25:40 +02:00
Linus Groh
e8aa998cdc LibGUI: Return symlink fallback icon if target icon cannot be determined
This is the case for symlinks that point to themselves, for example -
previously the returned icon would be empty.

Fixes #5978.
Fixes #5979.
2021-03-27 19:43:36 +01:00
Federico Guerinoni
49a062f81d LibGUI: Show human readable size in filemanager
The size is visible only in TableView mode of the filemanager.
2021-03-26 22:59:09 +01:00
Timothy Flynn
990e362a17 LibGUI: Allow assigning a value to a specific index in JsonArrayModel 2021-03-26 22:58:31 +01:00
Andreas Kling
e9db10e3a9 WindowServer+LibGUI: Remove the global menubar :^)
This leaves menu applets running but invisible, and that's a regression
we need to take care of obviously. But not today, because it's getting
too late.
2021-03-25 23:27:11 +01:00
Andreas Kling
32c6e31f4c LibGUI: Make it possible to tweak icon spacing on a GUI::Button
This is the space between the icon and the text on buttons that have
both icon and text.
2021-03-25 22:41:40 +01:00
Andreas Kling
78b12e1521 Userland: Turn all application menus into window menus :^) 2021-03-25 22:14:09 +01:00
Andreas Kling
e76771bfad WindowServer+LibGfx: Show menus in windows! :^)
This patch begins the transition away from the global menu towards
per-window menus instead.

The global menu looks neat, but has always felt clunky, and there
are a number of usability problems with it, especially in programs
with multiple windows.

You can now call GUI::Window::set_menubar() to add a menubar to
your window. It will be specific to that one window only.
2021-03-25 22:14:09 +01:00
Andreas Kling
1daaa4f38d LibGUI: Add GUI::MenuBar::menubar_id()
Just exposing the menubar ID on the WindowServer side.
2021-03-25 22:14:09 +01:00
lucastarche
6d3d097832 TextEditor: Visualize leading whitespace 2021-03-25 11:01:49 +01:00
lucastarche
0071dc7be4 TextEditor: Added a setter for soft_tab_width 2021-03-25 11:01:49 +01:00
Tom
7626f9e0bb LibGUI: Process pending window updates after handling input events
Since input events may trigger window portions to be invalidated,
rather than making a round trip to WindowServer to get paint events
we can simply fake an immediate paint event and update the window
contents more quickly.

Improves #5881
2021-03-24 21:03:29 +01:00
Andreas Kling
d20e3dbe8b LibGUI: Remove one ancient GMENU_DEBUG debug log 2021-03-23 20:37:39 +01:00
Itamar
84e34d76d8 HackStudio+LanguageServers/Cpp: Show scope of symbols in Locator 2021-03-23 18:32:39 +01:00
Nick Johnson
ddcef0452a NotificationServer: Close connection on notification close
When the notification was closed, the connection was kept around. This
caused the core event loop to take up nearly all CPU, so instead of
checking the connection we clear it on close and add state variables
to check state.
2021-03-22 12:46:16 +01:00
Nick Johnson
c7f00717c3 Notification: Use RefPtr for connection
With this RefPtr, we can initialize the connection to the
NotificationServer upon showing the notification. With this, we can
prevent double shows and updates or closes before showing.
2021-03-22 12:46:16 +01:00
Nick Johnson
8f6894d250 LibGUI+Notification: Add mutable notifications
This commit puts all of the remaining pieces in place. This adds a
mechanism to update the text, title, and icon of an image. If an image
is not provided, the default ladybug will be shown.
2021-03-22 12:46:16 +01:00
Nick Johnson
147a2c4ca2 Notification: Prevent showing a closed window
If a notification was closed, the connection will now be dead. To
prevent inconsistencies between when a user closes a notification and
when an application closes an applicated, check if the notification has
been closed before allowing any action.
2021-03-22 12:46:16 +01:00
Nick Johnson
0fd1e6f062 LibGUI+Notification: Add notification closing
Closing a notification will now allow it to be shown again, as
m_showing being false means it can be re-shown.
2021-03-22 12:46:16 +01:00
Nick Johnson
7351c77a42 LibGUI+Notification: Use lifetime connection
In order to allow notifications to be updated, we will create a persistent connection for the lifetime of the notification.
2021-03-22 12:46:16 +01:00
AnotherTest
39f3f3be94 LibGUI: Allow ItemListModel to have 2D items
This makes it possible to use it as a model for e.g. TableViews.
2021-03-22 07:43:58 +01:00
AnotherTest
6eeb8225f8 LibGUI: Add a few missing classes to the forwarding header 2021-03-22 07:43:58 +01:00
AnotherTest
714ce4741d LibGUI: Allow a wizard page to return null as its next page 2021-03-22 07:43:58 +01:00
AnotherTest
b072cb725f LibGUI: Allow constructing a string Variant from StringView 2021-03-22 07:43:58 +01:00
Yuval Tasher
d2b7500c65 LibGUI: remove empty TODO. 2021-03-22 07:43:26 +01:00
Cesar Torres
b7d726e226 LibGUI: Fix crash when getting text of selected line after a line delete 2021-03-21 11:45:22 +01:00
Itamar
3cc7b00e24 LibGUI: Allow TextDocument::set_text to fail 2021-03-21 09:46:21 +01:00
thankyouverycool
b02be11a6f LibGUI: Add corresponding padding to ListView content width
Fixes clipped text in list items
2021-03-19 22:56:36 +01:00
thankyouverycool
cfaf97a463 LibGUI: Walk all visible rows when updating TreeView column sizes
Previously only rows containing root nodes were considered. Fixes
offset content drift and columns failing to resize in multi-column
TreeViews
2021-03-19 22:56:36 +01:00
thankyouverycool
bf86676272 LibGUI: Support double-click resizing multi-column TreeViews 2021-03-19 22:56:36 +01:00
thankyouverycool
3cc7862487 LibGUI: Support double-click resizing column headers
Columns can now be best-fit resized by double-clicking their
grabbable edges. When a default width is set and all data is empty,
double-clicking will restore the column to its original state.
2021-03-18 07:49:55 +01:00
Linus Groh
10843a2c8c QuickShow: Animate animated images :^)
With a little help (read: copy & paste) from ImageWidget, QuickShow will
now cycle through the frames of animated images - enjoy the cat GIFs!

Future improvement: cache decoded images like LibWeb's ImageResource to
waste less CPU - the same applies to LibGUI though, maybe we can put
something shared in LibGfx.

Closes #5837.
2021-03-17 12:37:48 +01:00
Linus Groh
41e5155467 LibGUI: Animate any image in ImageWidget, not just *.gif
The image decoder already tells us whether the image is animated and it
can provide more than one frame, let's not put this behind an artificial
"file path must end with lowercase .gif" barrier.
2021-03-17 12:37:48 +01:00
thankyouverycool
d2d69f3efb LibGUI: Remove has_visible_list members from TextEditor
This was a kludge to paint ComboBox editors before the advent of
accessory windows, isn't being used anymore, and was inadvertently
letting two ComboBoxes paint as if both had focus.
2021-03-16 17:58:24 +01:00
Andreas Kling
e0f32626bc LibGfx: Rename 32-bit BitmapFormats to BGRA8888 and BGRx888x
The previous names (RGBA32 and RGB32) were misleading since that's not
the actual byte order in memory. The new names reflect exactly how the
color values get laid out in bitmap data.
2021-03-16 11:50:03 +01:00
Cesar Torres
2b269b27e7 LibGUI: Fix crash when text_in_range() was called on an empty document 2021-03-15 09:08:15 +01:00
Itamar
7bf6eca9d8 LanguageServers/Cpp: Complete Preprocessor definitions
Preprocessor definitions now appear in the AutoComplete suggestions box
as well as in the Locator.
2021-03-13 10:17:02 +01:00
Andreas Kling
ef1e5db1d0 Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)
Good-bye LogStream. Long live AK::Format!
2021-03-12 17:29:37 +01:00
thankyouverycool
0fc81d23f4 LibGUI: Add variable padding and center bitmaps in TableViews
This lets us make nicer looking bitmap tables and fixes a content
rect issue in TreeView. Also makes key column highlighting optional
2021-03-12 09:59:03 +01:00
thankyouverycool
bc26d1093f LibGUI: Clear inactive selections in DisplayOnly TextEditors 2021-03-12 09:59:03 +01:00
thankyouverycool
bf432f8a3a LibGUI: Add opacity to ImageWidget 2021-03-12 09:59:03 +01:00
thankyouverycool
0e63141a19 LibGUI: Set override cursor to none when widget is disabled 2021-03-12 09:59:03 +01:00
thankyouverycool
cf866cc75a LibGUI: Register more GML properties and widgets
Register "placeholder" for TextEditor and ComboBox; "models_only"
for ComboBox; Vertical/HorizontalSeparator for SeparatorWidget
2021-03-12 09:59:03 +01:00
thankyouverycool
5806630cf4 LibGfx+LibGUI: Add support for vertical ProgressBars 2021-03-12 09:59:03 +01:00
thankyouverycool
bd34cdbbb3 LibGUI: Ignore scroll length multiplier in SpinBoxes & Sliders
Prevents discrete values from being skipped when using the mouse
wheel on SpinBoxes and proportional Sliders. Wheel delta can be
accelerated by holding Ctrl.
2021-03-12 09:59:03 +01:00
Andreas Kling
38f11cc1ba Everywhere: Rename "logo" key to "super" key
This seems to be the most common way to refer to this key, so let's
call it what people actually call it.
2021-03-11 18:55:16 +01:00
Brian Gianforcaro
bac0dd5e3d LibGUI: Use AK_ENUM_BITWISE_OPERATORS for the FocusPolicy enum 2021-03-08 18:47:40 +01:00
speles
d64d2e4d09 LibGUI: Scroll selection into view when the IconView is first laid out
If we set selection before the IconView is laid out, it has no size.
So it can't correctly calculate where to scroll. Forcing scroll after
the first resize fixes that.
2021-03-07 11:00:36 +01:00
thankyouverycool
af581cbd91 LibGUI: Increase row height in Table/ColumnViews and center icons
16x16 icons are now guaranteed at least 1px margins between rows
2021-03-04 16:28:12 +01:00
AnotherTest
0d17cf121c LibGUI: Handle some edge cases in the spanned text drawing algorithm
This commit makes it skip invalid ranges and whine about overlapping
spans before ignoring them (instead of crashing).
2021-03-04 11:21:43 +01:00