Commit graph

513 commits

Author SHA1 Message Date
Andreas Kling
ceec1a7d38 AK: Make Vector use size_t for its size and capacity 2020-02-25 14:52:35 +01:00
Andreas Kling
9c6f7d3e7d LibGUI: Actually store the column in MultiView::set_model_column()
We were only forwarding the value to the subviews, but not storing it
in m_model_column. This would cause MultiView::model_column() to return
the wrong value.

Thanks to Daniel Bos for spotting this! :^)
2020-02-25 10:47:30 +01:00
Andreas Kling
ab9a0780e3 LibGUI: Show the columns view action in the toolbar (but disable it)
We'll enable it once ColumnsView is less crashy. :^)
2020-02-24 21:23:00 +01:00
Andreas Kling
2ad405c789 LibGUI: Complain in SortingProxyModel::data() if map_to_target() fails
There is some sort of issue with using a SortingProxyModel together
with ColumnsView. This is a workaround to allow FilePicker to use a
MultiView for now, but this needs to be fixed separately somehow.
2020-02-24 20:54:27 +01:00
Andreas Kling
a5d7ea24e9 LibGUI: Use MultiView in FilePicker
This allows the user to switch between different view modes.

Fixes #1283.
2020-02-24 20:50:21 +01:00
Andreas Kling
1b2b35cc40 LibGUI: Add a MultiView widget, based on FileManager's "DirectoryView"
A MultiView is a combination of ItemView, TableView and ColumnsView
smashed into a single widget. You can switch between the view modes
by calling MultiView::set_view_mode().

Note that MultiView inherits from StackWidget, not AbstractView.
That's purely for practical reasons, although I'm not entirely sure
if there would be some benefit to having it inherit from AbstractView.
2020-02-24 20:48:42 +01:00
Andreas Kling
bc64f8c502 LibGUI: Make AbstractView::set_model() take a RefPtr<Model>
Let's face it: Taking RefPtr<T>&& arguments is obnoxious and puts too
much unnecessary burden on the caller.
2020-02-24 20:47:16 +01:00
Andreas Kling
ab6f694905 WindowServer+LibGUI: Allow changing a window's base size and increment
Previously it was only possible to change these window attributes when
creating a new window. This patch adds an IPC message that allows you
to change them at runtime.
2020-02-24 19:23:57 +01:00
Tibor Nagy
0086daf9b0 LibGUI: Scroll selected treeview entries into view 2020-02-24 15:12:47 +01:00
Tibor Nagy
5f913c67d9 LibGUI: Implement keyboard and mouse wheel events for SpinBox 2020-02-24 10:40:32 +01:00
Andreas Kling
3252a6925e LibGUI: Fix silly nullptr dereference in MessageBox::show()
Since we take the parent object as a raw pointer, we should handle the
case where it's null.
2020-02-24 09:15:51 +01:00
Andreas Kling
6c5100b644 LibGUI: Add helper for constructing new TabWidget tabs
This patch adds the following convenience helper:

    auto tab_widget = GUI::TabWidget::construct();
    auto my_widget = tab_widget->add_tab<GUI::Widget>("My tab", ...);

The above is equivalent to:

    auto tab_widget = GUI::TabWidget::construct();
    auto my_widget = GUI::Widget::construct(...);
    tab_widget->add_widget("My tab", my_widget);
2020-02-23 12:27:53 +01:00
Andreas Kling
c5d913970a LibGUI: Remove parent parameter to GUI::Widget constructor 2020-02-23 12:27:53 +01:00
Andreas Kling
bfd86c4631 LibGUI: Make GUI::Frame have the 2px sunken container look by default
The overwhelming majority of GUI::Frame users set the same appearance,
so let's just make it the default.
2020-02-23 11:10:52 +01:00
Andreas Kling
00bf68adc6 LibGUI: Reduce header dependencies of ComboBox 2020-02-23 11:10:52 +01:00
Andreas Kling
45c25ffecd LibGUI: Use Core::Object::add() a whole bunch 2020-02-23 11:10:52 +01:00
Andreas Kling
428582e805 LibGUI: Don't require passing a parent to widget constructors
This is a step towards using Core::Object::add<T> more, which takes
care of parenting the newly created child automatically.
2020-02-23 11:10:52 +01:00
Andreas Kling
66bf10acef LibGUI: Add some missing widget classes to Forward.h 2020-02-23 11:10:52 +01:00
Andreas Kling
a406a8c7d2 LibGUI: Remove debug spam when resizing table columns 2020-02-22 21:27:08 +01:00
Andreas Kling
99978b771d LibGUI: Take scroll offset into account when manipulating table headers
Fixes #1271.
2020-02-22 15:04:02 +01:00
Tibor Nagy
2eb9620415 LibGUI: Improve TreeView keyboard navigation
This commit adds two new behaviour to the key event handler of
the TreeView widget:

Pressing left now jumps to the parent node if the current treenode
is closed or has no children.

Pressing right now jumps to the first children node if the current
treenode is open.
2020-02-21 20:18:44 +01:00
Tibor Nagy
6e2a16c8a8 LibGfx+LibGUI: Allow theming the focus outline of AbstractButton 2020-02-20 14:19:30 +01:00
Tibor Nagy
c8bc53e987 LibGfx+LibGUI: Allow theming the text cursor 2020-02-20 14:19:30 +01:00
Andreas Kling
eaa680ab8e WindowServer+LibGUI: Force full window repaints after theme change
We were not repainting windows that were occluded at the time of the
theme changing. This patch adds a way to bypass occlusion testing when
invalidating window rects.

Fixes #1249.
2020-02-19 16:46:28 +01:00
Tibor Nagy
33864ab715 LibGUI: Update TextEditor to use ruler colors from the system theme 2020-02-19 12:24:39 +01:00
Andreas Kling
ef38c49619 WindowServer+LibGUI+LibHTML: Fix build with -std=c++2a 2020-02-19 12:03:01 +01:00
Andreas Kling
189fa68c0b LibGUI: Expose GUI::Menu::menu_id() and also allow forced realization
Menu realization is when we instruct WindowServer to create the
server-side menu objects on our behalf.
2020-02-17 20:04:05 +01:00
thatlittlegit
4755f355c6 LibGUI: Add Yes/No and Yes/No/Cancel MessageBoxes 2020-02-17 16:28:21 +01:00
Andreas Kling
a78bc5e6fc LibGUI: Generate NotificationServer IPC messages during build
I hacked this to skip using flock since NotificationServer and LibGUI
depend on each other. There's probably a better solution.
2020-02-16 22:37:04 +01:00
Andreas Kling
30549502ca LibGUI: Generate NotificationServerEndpoint.h if needed 2020-02-16 22:28:48 +01:00
Andreas Kling
9f54ea9bcd NotificationServer: Add a system service for desktop notifications
This patch adds NotificationServer, which runs as the "notify" user
and provides an IPC API for desktop notifications.

LibGUI gains the GUI::Notification class for showing notifications.

NotificationServer is spawned on demand and will unspawn after
dimissing all visible notifications. :^)

Finally, this also comes with a small /bin/notify utility.
2020-02-16 21:58:17 +01:00
Tibor Nagy
c7f549ba19 LibGUI: Add mouse wheel event and step property to Slider 2020-02-16 21:58:01 +01:00
Andreas Kling
fe343a0497 LibGUI: ItemView painting was not respecting the frame thickness
Fixes #1112.
2020-02-16 09:50:38 +01:00
Andreas Kling
2143da6434 LibGUI: Add forwarding header
This patch adds <LibGUI/Forward.h> and uses it a bunch.
It also dragged various header dependency reduction changes into it.
2020-02-16 09:41:56 +01:00
Tibor Nagy
9041e95e79 LibGUI: Render ScrollBar buttons as pressed when they are being pressed 2020-02-16 09:41:40 +01:00
Tibor Nagy
fc24b2b57d LibGUI: Make ResizeCorner theme-aware 2020-02-16 08:01:20 +01:00
Tibor Nagy
7ec1b2e44b LibGUI: Unfocused TextEditors should use inactive selection colors 2020-02-15 18:42:13 +01:00
Tibor Nagy
4d95163400 LibGUI: Use inactive selection colors from palette instead of hardcoding them 2020-02-15 18:42:13 +01:00
Andreas Kling
0e3a9d8e9d LibCore: Reduce header dependencies of EventLoop 2020-02-15 02:09:00 +01:00
Andreas Kling
b011ea9962 LibGUI: Reduce menu-related header dependencies 2020-02-15 01:56:30 +01:00
Andreas Kling
9e83bbe1cd LibGUI: Reduce header dependencies of GUI::Action 2020-02-15 01:34:00 +01:00
Andreas Kling
10ccc9e11c LibGUI: Don't leak every tooltip window ever :^) 2020-02-15 01:27:37 +01:00
Andreas Kling
dcb0766d3f LibGUI: Remove some header dependencies from Application.h 2020-02-15 01:18:32 +01:00
Andreas Kling
9c0c677d57 LibGfx: Reduce header dependencies of Bitmap and Font 2020-02-15 01:03:37 +01:00
Andreas Kling
e1ff4fa034 LibGUI: Remove more header dependencies from Widget.h 2020-02-15 00:24:14 +01:00
Andreas Kling
69400c2ca1 LibCore: Replace manual forward declarations with <LibCore/Forward.h> 2020-02-15 00:13:44 +01:00
Andreas Kling
6a3cd11a80 AK: Remove manual forward declarations with <AK/Forward.h> 2020-02-15 00:12:31 +01:00
Andreas Kling
a368cf7d51 LibGfx: Replace manual forward declarations with <LibGfx/Forward.h> 2020-02-15 00:10:34 +01:00
Andreas Kling
34c7322d77 LibGUI: Remove some header dependencies from Widget.h 2020-02-14 23:53:11 +01:00
Andreas Kling
08cae2773d LibGfx: More work on header dependency reduction 2020-02-14 23:33:21 +01:00