Commit graph

19 commits

Author SHA1 Message Date
Andreas Kling
3f4df354cb LibGUI: Make TabWidget unfocusable when tab-less
If there are no tab buttons or tab children, don't participate in the
focus chain.
2020-10-30 17:03:29 +01:00
Andreas Kling
e2f32b8f9d LibCore: Make Core::Object properties more dynamic
Instead of everyone overriding save_to() and set_property() and doing
a pretty asymmetric job of implementing the various properties, let's
add a bit of structure here.

Object properties are now represented by a Core::Property. Properties
are registered with a getter and setter (optional) in constructors.
I've added some convenience macros for creating and registering
properties, but this does still feel a bit bulky. We'll have to
iterate on this and see where it goes.
2020-09-15 21:46:26 +02:00
Andreas Kling
3355a3e179 LibGUI: Add TabWidget::set_property() and handle some properties 2020-09-14 19:55:17 +02:00
Andreas Kling
116cf92156 LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSize
This fits nicer with FloatRect,FloatPoint,FloatSize and gives a much
better visual clue about what type of metric is being used.
2020-06-10 10:59:04 +02:00
FalseHonesty
bf2e6325a4 LibGUI: Add hook when a context menu is requested on a tab 2020-05-21 21:53:17 +02:00
Linus Groh
4ab4de7810 LibGUI: Add ability to hide GUI::TabWidget's tab bar 2020-05-19 17:42:48 +02:00
FalseHonesty
bb6258229a LibGUI: Add hook when a tab is middle clicked 2020-05-09 23:54:20 +02:00
Andreas Kling
f2cdef5c47 LibGUI: Cycle through TabWidget tabs with Ctrl+Tab / Ctrl+Shift+Tab
Fixes #2022.
2020-04-30 09:04:39 +02:00
Andreas Kling
d6bbf12b7c LibGUI: Add "uniform tabs" mode to TabWidget (all tabs have same width)
...and enable this in the main Browser UI. :^)
2020-04-24 22:36:25 +02:00
Andreas Kling
53cb5325ee LibGUI: Allow TabWidget tabs to have icons and custom text alignment 2020-04-24 22:27:46 +02:00
Andreas Kling
1587b53001 LibGUI: Allow overriding the padding inside a TabWidget 2020-04-24 20:42:34 +02:00
Andreas Kling
4087e3cfb9 LibGUI: Add TabWidget functions to activate next/previous tab 2020-04-23 21:43:08 +02:00
Andreas Kling
ee7e7e6d55 LibGUI: Add TabWidget::set_tab_title(Widget&, StringView)
This lets you change the title of a tab after creating it.
2020-04-23 21:13:47 +02:00
Oriko
12c7375cdd LibGUI: Add remove_tab and on_change to TabWidget 2020-04-06 09:01:42 +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
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
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
6a9cc66b97 LibGUI: Remove leading G from filenames 2020-02-06 20:33:02 +01:00
Renamed from Libraries/LibGUI/GTabWidget.h (Browse further)