Commit Graph

166 Commits

Author SHA1 Message Date
Brian Gianforcaro
e54cc055ac HackStudio: pledge "thread" to fix opening files
It looks like HackStudio got broken when clicking on
a folder in the open file dialog. The thumbnail icons
appear to be loaded on a new thread.
2020-04-07 12:14:35 +02:00
Oriko
795067e08c HackStudio: Add new Terminals 2020-04-06 09:01:42 +02:00
Andreas Kling
26eeaef0a8 LibGUI: Add MenuBar::add_menu(name)
This allows us to construct menus in a more natural way:

    auto& file_menu = menubar->add_menu("File");
    file_menu.add_action(...);

Instead of the old way:

    auto file_menu = GUI::Menu::construct();
    file_menu->add_action(...);
    menubar->add_menu(file_menu);
2020-04-04 12:58:05 +02:00
Andreas Kling
2463a285ee LibGUI: Make GUI::TabWidget::add_tab<T>() return a T&
Since the newly constructed sub-widget is owned by the TabWidget,
we can simply return a T& here. :^)
2020-04-04 11:10:07 +02:00
Tibor Nagy
9e855376dd HackStudio: Move the "Find in files" button in line with the search box 2020-04-01 11:35:21 +02:00
Tibor Nagy
f221771717 HackStudio: Add icon for the Find action 2020-03-30 13:03:53 +02:00
Tibor Nagy
c7f3d72a6a HackStudio: Add an upscaled 32x32 icon to the About dialog 2020-03-30 13:03:53 +02:00
Tibor Nagy
f15e9ee0fc HackStudio: Fix the labels of project opening menu and dialog 2020-03-30 13:03:53 +02:00
Oriko
a115702746 HackStudio: Expand project tree view by default 2020-03-18 16:33:54 +01:00
Oriko
b6e1c1b516 HackStudio: Use Javascript syntax highlighter 2020-03-13 22:53:13 +01:00
Oriko
8285102b6d HackStudio: Add Javascript projects 2020-03-13 20:19:01 +01:00
Oriko
792a709765 HackStudio: Fix the wrong cursor being drawn 2020-03-13 20:19:01 +01:00
Oriko
137d68a2ae HackStudio: Abstract over syntax highlighter 2020-03-12 19:04:59 +01:00
Oriko
bacd3dd57a HackStudio: Underline header links 2020-03-12 19:04:59 +01:00
Oriko
879bf3e97b HackStudio: Add header navigation 2020-03-12 12:37:13 +01:00
Andreas Kling
37fc6c117c Userspace: Add missing #includes now that AK/StdLibExtras.h is smaller 2020-03-08 13:06:51 +01:00
Andreas Kling
830a57c6b2 LibWeb: Rename directory LibHTML => LibWeb
Let's rename this to LibWeb since it aims to provide more parts of the
web platform than just HTML. :^)
2020-03-07 10:32:51 +01:00
Andreas Kling
7a6c4a72d5 LibWeb: Move everything into the Web namespace 2020-03-07 10:27:02 +01:00
Shannon Booth
6a3b12664a LibGUI: Move Icon and FontDatabase into the GUI namespace
We also clean up some old references to the old G prefixed GUI classes

This also fixes a potential bug with using: C_OBJECT_ABSTRACT(GAbstractButton)
instead of C_OBJECT_ABSTRACT(AbstractButton)
2020-03-07 01:33:53 +01:00
Andreas Kling
b29ff7b821 LibGUI: Don't use Core::Object::add() to instantiate dialogs
Now that add() returns a WidgetType&, we can't rely on the parent of a
GUI::Dialog to still keep it alive after exec() returns. This happens
because exec() will call remove_from_parent() on itself before
returning.

And so we go back to the old idiom for creating a GUI::Dialog centered
above a specific window. Just call GUI::Dialog::construct(), passing
the "parent" window as the last parameter.
2020-03-04 21:04:06 +01:00
Andreas Kling
028c011760 LibCore: Make Core::Object::add<ChildType> return a ChildType&
Since the returned object is now owned by the callee object, we can
simply vend a ChildType&. This allows us to use "." instead of "->"
at the call site, which is quite nice. :^)
2020-03-04 21:04:06 +01:00
Andreas Kling
0f3e57a6fb LibGUI: Use GUI::Window::set_main_widget<WidgetType>() in clients 2020-03-04 14:26:16 +01:00
Andreas Kling
4697195645 LibGUI: Use set_layout<LayoutType>() in lots of client code 2020-03-04 13:49:48 +01:00
Andreas Kling
a26b63a958 LibGUI: Remove Button& parameter from Button::on_click hook
There was but a single user of this parameter and it's a bit tedious
to write it out every time, so let's get rid of it.
2020-03-03 17:02:38 +01:00
Andreas Kling
686ade6b5a AK: Make quick_sort() a little more ergonomic
Now it actually defaults to "a < b" comparison, instead of forcing you
to provide a trivial less-than comparator. Also you can pass in any
collection type that has .begin() and .end() and we'll sort it for you.
2020-03-03 16:02:58 +01:00
Andreas Kling
ceec1a7d38 AK: Make Vector use size_t for its size and capacity 2020-02-25 14:52:35 +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
3d20da9ee4 Userspace: Use Core::Object::add() when building interfaces 2020-02-23 11:10:52 +01:00
Andreas Kling
0bb4111735 HackStudio: Unbreak the form editor's widget icons
This is breakage from the GFoo => GUI::Foo rename.
2020-02-17 21:49:17 +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
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
34c7322d77 LibGUI: Remove some header dependencies from Widget.h 2020-02-14 23:53:11 +01:00
Andreas Kling
8f7333f080 LibCore: Add a forward declaration header
This patch adds <LibCore/Forward.h> and uses it in various places to
shrink the header dependency graph.
2020-02-14 23:31:18 +01:00
Andreas Kling
d217d3ff6f HackStudio: Disallow invalid indices when typing into the locator
The locator was a bit crashy since it would allow you to navigate
to invalid indices.
2020-02-07 20:58:44 +01:00
Andreas Kling
bb8e65be41 LibGUI+HackStudio: Move syntax highlighting from HackStudio to LibGUI
This patch introduces the GUI::SyntaxHighlighter class, which can be
attached to a GUI::TextEditor to provide syntax highlighting.

The C++ syntax highlighting from HackStudio becomes a new class called
GUI::CppSyntaxHighlighter. This will make it possible to get C++ syntax
highlighting in any app that uses a GUI::TextEditor. :^)

Sidenote: It does feel a bit weird having a C++ lexer in a GUI toolkit
library, and we'll probably end up moving this out to a separate place
as this functionality grows larger.
2020-02-07 20:07:15 +01:00
Andreas Kling
6a9cc66b97 LibGUI: Remove leading G from filenames 2020-02-06 20:33:02 +01:00
Andreas Kling
d17e23bd27 LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
Andreas Kling
799b0a4fa8 LibGUI: Rename {H,V}BoxLayout => {Horizontal,Vertical}BoxLayout 2020-02-06 14:44:13 +01:00
Andreas Kling
6a71ba1deb LibGUI: Add HorizontalSplitter and VerticalSplitter convenience classes 2020-02-06 14:40:59 +01:00
Andreas Kling
9b87843af1 LibGfx: Unpublish Gfx::Point from global namespace 2020-02-06 13:08:32 +01:00
Andreas Kling
20cfd2a6bf LibGfx: Unpublish Gfx::Rect from global namespace 2020-02-06 13:02:38 +01:00
Andreas Kling
9ac94d393e LibGfx: Rename from LibDraw :^) 2020-02-06 12:04:00 +01:00
Andreas Kling
11580babbf LibDraw: Put all classes in the Gfx namespace
I started adding things to a Draw namespace, but it somehow felt really
wrong seeing Draw::Rect and Draw::Bitmap, etc. So instead, let's rename
the library to LibGfx. :^)
2020-02-06 11:56:38 +01:00
Andreas Kling
f2a087126c LibC: Add posix_openpt(), grantpt() and unlockpt()
This makes getting a pseudoterminal pair a little bit more portable.
Note that grantpt() and unlockpt() are currently no-ops, since we've
already granted the pseudoterminal slave to the calling user.

We also accept O_CLOEXEC to posix_openpt(), unlike some systems. :^)
2020-02-05 21:17:41 +01:00
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
Andreas Kling
2d39da5405 LibCore: Put all classes in the Core namespace and remove the leading C
I've been wanting to do this for a long time. It's time we start being
consistent about how this stuff works.

The new convention is:

- "LibFoo" is a userspace library that provides the "Foo" namespace.

That's it :^) This was pretty tedious to convert and I didn't even
start on LibGUI yet. But it's coming up next.
2020-02-02 15:15:30 +01:00
Andreas Kling
d67da8c101 LibGUI: Add GHBoxLayout and GVBoxLayout convenience classes 2020-02-02 15:09:48 +01:00