Andreas Kling
31b5047894
LibGUI: Allow override the font on a per-index basis in GListView
...
This should be ported to all of the GAbstractView subclasses.
2019-10-22 21:38:04 +02:00
Andreas Kling
b89f64cb55
LibGUI: Make it possible to wrap a Font in a GVariant
2019-10-22 21:37:11 +02:00
Andreas Kling
0a0dfeee8b
LibGUI: Make GTextEditor::set_cursor() public
...
Also clamp the cursor value to the possible range instead of asserting
when trying to set a cursor past the end of the document.
2019-10-21 19:01:27 +02:00
Brandon Scott
efc2fc6888
LibGUI: Fix GMenu submenu shortcut bug.
...
I was encountering an entire system crash when the window server
attempted to do something with the shortcut text on a submenu. This
bug only seemed to appear when I had a lone submenu inside of a menu.
2019-10-13 08:45:49 +02:00
Andreas Kling
76266862d1
LibGUI+WindowServer: Add a "Hand" cursor to the standard cursors
2019-10-10 21:35:12 +02:00
Andreas Kling
33043941f9
LibGUI: Add GScrollableWidget::to_widget_position()
...
This is a complement to to_content_position() :^)
2019-10-09 21:16:49 +02:00
Andreas Kling
75b5638f1c
LibGUI: Let's say that Alt+Home is the "go home" keyboard shortcut
2019-10-08 21:45:29 +02:00
Andreas Kling
ac3079b433
LibGUI: Add "Go home" to GCommonActions
2019-10-06 22:00:04 +02:00
Andreas Kling
03725c6135
GFilePicker: Fix crash in get_save_filepath()
...
Oops, don't create GFilePickers on the stack! Spotted by Sergey ^)
2019-10-06 21:01:03 +02:00
Conrad Pankoff
c4da2a49a5
LibGUI: Define supported functions for using command line arguments
2019-10-06 14:25:58 +02:00
Andreas Kling
4f47146433
LibGUI: Add a "reload" action to GCommonActions
2019-10-05 10:14:09 +02:00
Andreas Kling
7dd03b7846
LibGUI: Add back/forward actions to GCommonActions
2019-10-05 09:21:55 +02:00
Andreas Kling
a181cae3e0
GScrollableWidget: Add to_content_position(Point)
...
A handy helper function for converting a widget space coordinate into a
content space coordinate.
2019-10-03 09:15:57 +02:00
Sergey Bugaev
f02c9aaac4
LibGUI: Remove GModel::on_selection_changed
...
The selection is no longer managed by the model.
2019-10-03 08:23:54 +02:00
Brandon Scott
17597f4681
LibGUI: Fix GDirectoryModel lifetime bug.
...
Thumbnail generation callbacks were getting called after the class was already being destroyed causing a crash to occur.
2019-10-03 08:17:41 +02:00
Andreas Kling
183f7c9830
LibGUI: Add GLazyWidget, a convenience widget for lazily-built UI's
...
Here's how you can use this to speed up startup time:
auto widget = GLazyWidget::construct();
widget->on_first_show = [](auto& self) {
self.set_layout(...);
...
};
Basically, it allows you to delay building the widget subtree until
it's shown for the first time.
2019-10-02 20:24:29 +02:00
Andreas Kling
7e2b9c3c40
GWidget: Dispatch Show and Hide events when widget visibility changes
2019-10-02 20:24:03 +02:00
Brandon Scott
08a1fb8f1a
LibGUI+PaintBrush: Fix to GFilePicker and PaintBrush enhancements.
...
GFilePicker
- Fixed GFilePicker to use new ref-counted construct method to stop crashing on open dialog.
- PaintBrush is still crashing on open dialog due to an unrelated issue.
PaintBrush
- Created 16x16 icon for PaintBrush
- Moved Open option into App menu.
- Changed help menu to make use of the standardized About dialog.
2019-10-01 09:17:56 +02:00
Andreas Kling
1a279c5b2a
GMessageBox: Hide the constructor and fix broken usages
...
We no longer support creating CObjects on the stack. Use construct().
2019-09-30 17:20:53 +02:00
Andreas Kling
3900eebf15
FileManager+LibGUI+html: Add an icon to represent HTML files
...
This also becomes the app icon for the little "html" program. :^)
2019-09-29 21:00:41 +02:00
Andreas Kling
e38b454e11
LibGUI: Fix crash in GAboutDialog::show()
...
It needed some updating to the new ref-counted CObject ways.
2019-09-29 20:37:02 +02:00
Andreas Kling
34d0e96aec
LibCore+LibGUI: Remove GEventLoop and use CEventLoop everywhere
...
GEventLoop was just a dummy subclass of CEventLoop anyway. The only
thing it actually did was make sure a GWindowServerConnectionw was
instantiated. We now take care of that in GApplication instead.
CEventLoop is now non-virtual and a little less confusing. :^)
2019-09-22 20:50:39 +02:00
Andreas Kling
bd1e8bf166
GDialog: Remove self from parent when the nested event loop returns
...
This ensures that we close (and don't leak) the dialog during the
typical usage pattern.
2019-09-22 00:46:29 +02:00
Andreas Kling
d6abfbdc5a
LibCore: Remove ObjectPtr in favor of RefPtr
...
Now that CObject is fully ref-counted, just use RefPtr everywhere! :^)
2019-09-22 00:31:54 +02:00
Andreas Kling
bc319d9e88
LibCore: Make CObject reference-counted
...
Okay, I've spent a whole day on this now, and it finally kinda works!
With this patch, CObject and all of its derived classes are reference
counted instead of tree-owned.
The previous, Qt-like model was nice and familiar, but ultimately also
outdated and difficult to reason about.
CObject-derived types should now be stored in RefPtr/NonnullRefPtr and
each class can be constructed using the forwarding construct() helper:
auto widget = GWidget::construct(parent_widget);
Note that construct() simply forwards all arguments to an existing
constructor. It is inserted into each class by the C_OBJECT macro,
see CObject.h to understand how that works.
CObject::delete_later() disappears in this patch, as there is no longer
a single logical owner of a CObject.
2019-09-22 00:25:25 +02:00
Andreas Kling
8d550c174e
LibCore: Convert CFile to ObjectPtr
2019-09-21 20:50:06 +02:00
Andreas Kling
31b38ed88f
LibGUI: Don't create GMessageBox and GInputBox on the stack
...
We need to get rid of all instances of widgets-on-the-stack since that
will no longer work in the ref-counting world.
2019-09-21 20:32:31 +02:00
Andreas Kling
409494193e
LibGUI: Convert remaining random little things to ObjectPtr
2019-09-21 19:40:14 +02:00
Andreas Kling
81a5c4fc56
GButton: Make the constructors protected in favor of construct()
2019-09-21 19:37:38 +02:00
Andreas Kling
45cfd57f6e
GButton: Convert most code to using ObjectPtr for GButton
2019-09-21 19:28:28 +02:00
Andreas Kling
55a6e4ac0b
LibGUI: Convert GFrame to ObjectPtr
2019-09-21 19:21:36 +02:00
Andreas Kling
7b5342b2e3
LibGUI: Convert GCheckBox to ObjectPtr
2019-09-21 18:58:48 +02:00
Andreas Kling
f8d751440b
LibGUI: Convert GRadioButton to ObjectPtr
2019-09-21 18:58:03 +02:00
Andreas Kling
870bc2a4d1
LibGUI: Get rid of GWindow's destroy-on-close mechanism
...
Since we're moving to a world of ref-counting, we can't have weird
behaviors like "windows delete themselves when you close them."
The "close app when there are no more windows" mechanism is moved
to GWindow::hide(). Now, we close the app when it has no more
windows on screen.
2019-09-21 18:53:17 +02:00
Andreas Kling
7584480f62
LibGUI: Convert GWindow to ObjectPtr
2019-09-21 18:34:06 +02:00
Andreas Kling
f4b51a63ec
LibCore: Remove CTimer::create() overloads in favor of construct()
2019-09-21 18:13:17 +02:00
Andreas Kling
ff6ce422dd
LibGUI: Convert GWidget to ObjectPtr
2019-09-21 17:05:35 +02:00
Andreas Kling
e4e92980a1
LibGUI: Convert GComboBox to ObjectPtr
2019-09-21 16:35:11 +02:00
Andreas Kling
7aaad27778
LibGUI: Convert GSlider to ObjectPtr
2019-09-21 16:33:53 +02:00
Andreas Kling
ceb5508fea
LibGUI: Convert GProgressBar to ObjectPtr
2019-09-21 16:31:12 +02:00
Andreas Kling
3476a63415
LibGUI: Convert GStatusBar to ObjectPtr
2019-09-21 16:29:47 +02:00
Andreas Kling
f4531c976c
LibGUI: Convert GToolBar to ObjectPtr
2019-09-21 16:27:54 +02:00
Andreas Kling
b78225941d
LibGUI: Convert GSpinBox to ObjectPtr
2019-09-21 16:15:11 +02:00
Andreas Kling
83b5f6c11a
LibGUI: Convert GGroupBox to ObjectPtr
2019-09-21 16:13:33 +02:00
Andreas Kling
4f4438c04c
LibGUI: Convert GSplitter to ObjectPtr
2019-09-21 16:11:02 +02:00
Andreas Kling
efb8f9d538
LibGUI: Convert GTreeView to ObjectPtr
2019-09-21 16:06:43 +02:00
Andreas Kling
e7b55037f4
LibGUI: Convert GTableView to ObjectPtr
2019-09-21 16:03:59 +02:00
Andreas Kling
c13b9e2214
LibGUI: Convert GItemView to ObjectPtr
2019-09-21 15:47:58 +02:00
Andreas Kling
93851c3832
LibGUI: Convert GTextBox, GTextEditor and GResizeCorner to ObjectPtr
2019-09-21 15:46:47 +02:00
Andreas Kling
4ea229accd
LibCore: Convert CTCPServer to ObjectPtr
...
Also get rid of the custom CNotifier::create() in favor of construct().
2019-09-21 15:25:08 +02:00