1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 16:15:08 +00:00
Commit graph

1120 commits

Author SHA1 Message Date
Nico Weber
598b5e4595 CppLexer: Add token types for "&", "&&", "&=", "|", "||", "|=" 2020-07-27 01:04:17 +02:00
Nico Weber
345b303262 CppLexer: Add token types for ">", ">=", ">>", ">>=" 2020-07-27 01:04:17 +02:00
Nico Weber
97c4344f33 CppLexer: Add token types for "<", "<=", "<<", "<<=", "<>" 2020-07-27 01:04:17 +02:00
Andreas Kling
3e389f4cdc LibGUI: Remove accidentally committed file :^) 2020-07-26 20:05:15 +02:00
Nico Weber
96d13f75cf CppLexer: Add token types for "+", "+=", "-", "-=", "=", "==", "/", "/="
Mostly so that TextEdit doesn't emit logspam when I write `int a = 4`
in a test program.
2020-07-26 19:52:26 +02:00
Nico Weber
5a36d8acb8 CppLexer: Add token type for "*=" 2020-07-26 19:52:26 +02:00
Andreas Kling
e0b8b4ac67 LibCore+LibGUI: Switch to using AK::is and AK::downcast 2020-07-26 17:51:00 +02:00
thankyouverycool
c50f258b7a LibGUI+WindowServer: Allow applets to retrieve their location
MenuApplet windows can now call rect_in_menubar to return their
location in the MenuBar.
2020-07-26 11:32:12 +02:00
Andreas Kling
a655cf5b41 LibGUI: Break up Window::event() into many smaller functions
This function was unbearably huge. Handle each event type in its own
function instead so you can see what's going on.
2020-07-24 01:03:24 +02:00
Andreas Kling
0a95f8d346 LibGUI: Add {Horizontal,Vertical}Slider to the forwarding header 2020-07-23 19:59:38 +02:00
Andreas Kling
4392413cd1 LibGUI: Make window-parented actions actually scoped to the window
We were relying on Core::is<Window>() to tell us whether the parent
of an action is a window. This didn't work since we only saw a forward
declaration of GUI::Window in Action.cpp.

This is an unfortunate flaw in the is<T> pattern and we should solve
it somehow but not in this patch.
2020-07-23 19:52:18 +02:00
Andreas Kling
9d4cd565e3 LibGUI: Fix build after renaming Image => ImageWidget 2020-07-23 17:43:44 +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
Sasan Hezarkhani
a2bbacbfc8 TextEditor: Jump to word break when deleting and holding Ctrl modifier 2020-07-23 13:08:55 +02:00
AnotherTest
c9c7069f9e LibGUI: Remove unnecessary LibHTTP #include
This closes #2848.
2020-07-22 17:48:11 +02:00
thankyouverycool
c90fe7ce93 LibGUI: Use ControlBoxButtons in SpinBox and ComboBox
Converts the buttons of these widgets into ControlBoxButtons.
2020-07-20 21:03:48 +02:00
thankyouverycool
bf59cd7ca5 LibGUI: Add ControlBoxButton to LibGUI
ControlBoxButton consolidates the paint_event for buttons
used in composite box widgets like ComboBox and SpinBox. Its
button bitmaps are built with create_from_ascii like WindowFrame
and ScrollBar controls, making theming more uniform.
2020-07-20 21:03:48 +02:00
Andreas Kling
76523a3d2d LibGUI: Show the special home directory icon in GUI::FilePicker 2020-07-19 21:42:00 +02:00
Andreas Kling
dc696ba85c LibGUI: Show a special icon for the home directory in FileSystemModel 2020-07-19 21:37:19 +02:00
Andreas Kling
9710c9742c LibGUI+FileManager: Add setting for showing/hiding dotfiles
GUI::FileSystemModel can now be told to display (or not display) files
whose name start with a dot (other than . and ..)
2020-07-19 21:15:00 +02:00
thankyouverycool
a4b2d6cf1e LibGUI: Set parent icon, margins and disable resize for InputBox
Gives a more compact, uniform appearance to input boxes.
2020-07-18 16:27:57 +02:00
thankyouverycool
d976b31ef6 LibGUI: Paint slider knob as indented when disabled
Better visual feedback when sliders won't budge.
2020-07-18 16:27:57 +02:00
Andreas Kling
5f0d24cab2 LibGUI: Turn a heap-allocated event into a stack-allocated one 2020-07-16 20:46:44 +02:00
Tom
65a11fb5f9 LibGUI: Add InputBox::show with required parent window argument
Similar to MessageBox::show, this encourages passing in a window.
2020-07-16 16:10:21 +02:00
Tom
27bd2eab22 LibWeb: Require parent window argument for MessageBox
Since the vast majority of message boxes should be modal, require
the parent window to be passed in, which can be nullptr for the
rare case that they don't. By it being the first argument, the
default arguments also don't need to be explicitly stated in most
cases, and it encourages passing in a parent window handle.

Fix up several message boxes that should have been modal.
2020-07-16 16:10:21 +02:00
Tom
6568765e8f LibGUI: Add parent window argument to FilePicker functions
Since FilePicker almost always should be modal, add the parent
window as mandatory first argument.
2020-07-16 16:10:21 +02:00
Tom
9844088964 LibGUI: Clear previous main widget's window 2020-07-16 16:10:21 +02:00
Tom
bbdf0665fc WindowServer: Expose window parent information and more modal improvements
* The parent information is necessary by the Taskbar to be able to
  determine a modal window's parent
* Minimize and maximize modal window stacks together
2020-07-16 16:10:21 +02:00
thankyouverycool
1f8e9727ec LibGUI: Remove on_activity_change from ComboBox
Unnecessary since the inclusion of window accessories.
2020-07-16 00:45:35 +02:00
thankyouverycool
a038f82326 LibGUI: Disallow typing in DisplayOnly TextEditors 2020-07-16 00:06:18 +02:00
Tom
ec3737510d WindowServer: Add accessory windows
Accessory windows are windows that, when activated, will activate
their parent and bring all other accessory windows of that parent
to the front of the window stack. Accessory windows can only be
active input windows. The accessory window's parent is always the
active window regardless of whether it is also the active input
window.

In order to route input correctly, input is now sent to the active
input window, which can be any accessory window or their parent,
or any regular window.
2020-07-15 17:15:45 +02:00
Sergey Bugaev
5fd8dbacb1 LibGUI+FileManager: Fix forgetting to map sorting proxy model indexes
Also assert indexes are valid in a few more places.

Finally fixes https://github.com/SerenityOS/serenity/issues/1440 and
https://github.com/SerenityOS/serenity/issues/2787 :^)
2020-07-15 13:41:46 +02:00
thankyouverycool
6a78db07f1 LibGUI: Add hover highlighting and keyboard controls to ComboBox
Adds a new highlighting effect to the actively selected row in
ComboBox ListView. ComboBoxEditor can now be controlled with
page up, page down, and the up and down arrow keys. ESC and loss
of focus now cause comboboxes to close. Now activates on mouseup
as well as return.
2020-07-15 13:19:44 +02:00
thankyouverycool
b2783a234a LibGUI: Use enum for TextEditor modes & add new DisplayOnly mode
Adds a new, more restrictive read-only state to TextEditor which
forbids copying, selecting, editor cursors, and context menus.
Provides a unique appearance on focus which accomodates ComboBox
widgets. All TextEditor modes are now accessed by enum and
set_mode() which sets the editor to Editable, ReadOnly or
DisplayOnly. Updates applications still using set_readonly().
2020-07-15 13:19:44 +02:00
thankyouverycool
dc716194c8 LibGUI: Add on_activity_change function to Window
Reports changes on the active/inactive state of a window.
2020-07-15 13:19:44 +02:00
Tom
8ae37bccf1 LibGUI: Fix menu leak when default action changed 2020-07-15 00:11:30 +02:00
Tom
50903fd88c FileManager: Add "Open with" menu if alternative applications are available 2020-07-15 00:11:30 +02:00
thankyouverycool
4970c448bf LibGUI: Draw contiguous frame if GroupBox title is left empty 2020-07-14 17:55:39 +02:00
Tom
c8d3f8cdeb LibGUI: Add Options flags and OpenMultiple mode for FilePicker
If the application can't open more than one file, we should not
allow the user to select multiple.
2020-07-13 19:49:34 +02:00
Tom
d4c6ae8263 LibGUI: Add ability to disable multiselect for views 2020-07-13 19:49:34 +02:00
Tom
f266f0e880 LibGUI: Improve IconView performance with large selections
This implements the following optimizations:

* Rather than clearing a HashTable of selected items and re-populating
  it every time the selection rectangle changes, determine the delta
  by only examining the items that might be in the area where the
  selection may have changed compared to the previous area. Then
  only add/remove selection items as needed.

* When painting, only query and paint the items actually visible.
  Also, keep a local cache of item information such as calculated
  rectangles and selection state, so it doesn't have to be calculated
  over and over again.
2020-07-13 19:49:34 +02:00
Tom
b778804d20 LibGUI: Add ModelClient abstract class and allow registering clients
This solves a problem where the SortingProxyModel doesn't
receive the on_update call because other code overwrote
the handler later on.
2020-07-13 19:49:34 +02:00
thankyouverycool
332f349e07 LibGUI: Fix keybind conflicts in TreeView
Changes the shortcut to expand and collapse subtrees from alt to
ctrl+right/left arrows in TreeView. The current shortcuts conflict
with applications that already have navigation controls bound to alt
like file manager.
2020-07-13 14:27:23 +02:00
thankyouverycool
366d7e6d05 LibGUI: Only report toggled directories once on subtree collapse/expansion
This prevents redundant calls to on_toggle for the same indices when
subtrees are collapsed or expanded.
2020-07-13 14:27:23 +02:00
Peter Elliott
0fd31ef598 LibGUI: Ignore KeyUp events by default
fixed #2576
2020-07-11 18:51:41 +02:00
Tom
1c1ab71692 WindowServer/LibGUI: Add default menu items and allow default action for context menu
By specifying an optional Action for Menu::popup an application
can specify what item should be displayed as a default item.
2020-07-11 11:45:49 +02:00
thankyouverycool
deceb91c48 FileManager: Show an open folder icon for the selected directory
The currently selected directory now displays an open folder icon
in the directory tree.
2020-07-10 19:44:18 +02:00
thankyouverycool
e6ddc7e022 LibGUI: Add missing on_toggle hook to TreeView
Alt+arrow toggles are now captured.
2020-07-10 19:44:18 +02:00
Tom
fc568ea13a LibGUI: Make scrollbar thumb size relative to content size
In order to calculate a thumb size that is a representation
of the visible portion (page) of the content, that information
needs to be taken into account.
2020-07-09 21:56:45 +02:00
Tom
d4b87fb18e LibGUI: Implement IconView auto-scrolling when trying to select items out of view
If selecting in a large icon view, and dragging the mouse outside
of the widget, or close to the border of it, start scrolling
automatically. This allows for selecting large amount of items
that exceed the amount that can be displayed.
2020-07-09 21:51:01 +02:00