Commit Graph

12 Commits

Author SHA1 Message Date
Andreas Kling
c5bd9d4ed1 LibGUI: Put all classes in the GUI namespace and remove the leading G
This took me a moment. Welcome to the new world of GUI::Widget! :^)
2020-02-02 15:15:33 +01:00
Sergey Bugaev
b6aae25244 LibGUI: Rename GAbstractColumnView to GAbstractTableView
This is to prevent confusion with GColumnsView, which is unrelated.
2020-01-22 21:22:23 +01:00
Andreas Kling
94ca55cefd Meta: Add license header to source files
As suggested by Joshua, this commit adds the 2-clause BSD license as a
comment block to the top of every source file.

For the first pass, I've just added myself for simplicity. I encourage
everyone to add themselves as copyright holders of any file they've
added or modified in some significant way. If I've added myself in
error somewhere, feel free to replace it with the appropriate copyright
holder instead.

Going forward, all new source files should include a license header.
2020-01-18 09:45:54 +01:00
Andreas Kling
d4a570d576 LibGUI: Fix GTreeView not showing the context menu
This logic is all taken care of by GAbstractColumnView now, so we can
simply delete GTreeView::context_menu_event(). :^)

Fixes an issue mentioned in #826
2019-12-15 17:02:44 +01:00
Andreas Kling
0ac74d3778 LibGUI: Make GTreeView inherit from GAbstractColumnView
This makes GTreeView able to support multi-column models!

Only one column can be the "tree column", this is column 0 by default
but can be changed by overriding GModel::tree_column().
2019-12-13 23:36:36 +01:00
Tommy Nguyen
f26548395e LibGUI: Add context_menu_event to GTreeView 2019-12-12 11:19:02 +01:00
Andreas Kling
efb8f9d538 LibGUI: Convert GTreeView to ObjectPtr 2019-09-21 16:06:43 +02:00
Andreas Kling
64b1e9deec GTreeView: Make double-clicking toggle openable items 2019-09-07 21:45:06 +02:00
Andreas Kling
5c7bb09a73 GTreeView: Support multiple root-level items
Previously it was only possible to have a single root-level item in a
GTreeView. This was an oversight and I didn't realize it because this
code was only ever used in the FileManager, which has one root ("/").

Also factored out item toggling into a separate function, and increase
the base indentation level so that root items can be toggled as well.

Finally, let the user toggle the selected item with the spacebar. :^)
2019-08-18 10:17:00 +02:00
Andreas Kling
a599317624 LibCore: Introduce a C_OBJECT macro.
This macro goes at the top of every CObject-derived class like so:

class SomeClass : public CObject {
    C_OBJECT(SomeClass)
public:
    ...

At the moment, all it does is create an override for the class_name() getter
but in the future this will be used to automatically insert member functions
into these classes.
2019-07-25 19:49:28 +02:00
Andreas Kling
93489fbc4c Convert HashMap<Key, OwnPtr<T>> to HashMap<Key, NonnullOwnPtr<T>>.
In every case I found, we never wanted to support null entry values.
With NonnullOwnPtr, we can encode that at the type level. :^)
2019-07-24 08:42:55 +02:00
Andreas Kling
04b9dc2d30 Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch
moves the Lib*/ directories into Libraries/.
2019-07-04 16:16:50 +02:00