Commit graph

15 commits

Author SHA1 Message Date
Andreas Kling 44e371635e LibGUI: Move table view headers into their own widget
This patch introduces the HeaderView class, which is a widget that
implements the column headers of TableView and TreeView.

This greatly simplifies event management in the view implementations
and also makes it much easier to eventually implement row headers.
2020-08-26 00:51:35 +02:00
Andreas Kling ce48de9845 LibGUI: Add WidgetClassRegistration to Forward.h 2020-08-17 18:05:35 +02:00
Andreas Kling f882424869 LibGUI: Add ModelIndex::data(ModelRole)
This is a convenience API that makes accessing model data easier.
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 3dd15da7b1 LibGUI: Move file icon lookup into a separate FileIconProvider
Let's get it out of FileSystemModel so you can look up a nice icon for
a path without needing a model.
2020-08-12 20:41:13 +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
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
Emanuele Torre 937d0be762 Meta: Add a script check the presence of "#pragma once" in header files
.. and make travis run it.

I renamed check-license-headers.sh to check-style.sh and expanded it so
that it now also checks for the presence of "#pragma once" in .h files.

It also checks the presence of a (single) blank line above and below the
"#pragma once" line.

I also added "#pragma once" to all the files that need it: even the ones
we are not check.
I also added/removed blank lines in order to make the script not fail.

I also ran clang-format on the files I modified.
2020-05-29 07:59:45 +02:00
Ben Wiederhake ef433cb367 LibGUI: The UI calls it 'Icon view', fix the name in the code 2020-05-02 14:12:36 +02:00
Andreas Kling dc6b61dbcc LibGUI: Add ToolBar and ToolBarContainer to Forward.h 2020-04-25 17:20:10 +02: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 00bf68adc6 LibGUI: Reduce header dependencies of ComboBox 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 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