Commit Graph

30 Commits

Author SHA1 Message Date
Karol Kosek
66402b0666 LibGUI+Userland: Port TabWidget set_tab_title to new string 2023-03-16 09:58:42 +01:00
Karol Kosek
4f08a05a3b LibGUI: Store Tab titles using the new string class 2023-03-16 09:58:42 +01:00
Karol Kosek
797968c310 LibGUI+Userland: Make TabWidget::*add_tab() take title using new string 2023-03-16 09:58:42 +01:00
Karol Kosek
3805e4e3a9 LibGUI+HackStudio+PixelPaint: Port Widget title to the new String
I had to add a set_title(String) helper function for ImageEditor because
TabWidget requires it. This is a temporary fix and will be handled in
subsequent commit.
2023-03-16 09:58:42 +01:00
Andreas Kling
faa1a09042 LibGUI: Fix const-correctness issues 2023-02-21 00:54:04 +01:00
Baitinq
61789de11d LibGUI: Add GUI::TabWidget::add_tab() that takes a constructed tab
This patch adds a new add_tab() function in GUI::TabWidget that takes
an already created NonnullRefPtr<Widget> object. This allows us to
handle errors while creating the Tab object and then pass it to this
function to actually add the object to the TabWidget.
2022-12-16 09:58:51 +01:00
meiskam
b79be56bed LibGUI: Add modified bool to TabWidget
This will allow application with multiple tabs to track modifications
per-tab, not just if the entire window has been modified
2022-12-15 00:14:35 -07:00
MacDue
27fae78335 Meta+Userland: Pass Gfx::IntSize by value
Just two ints like Gfx::IntPoint.
2022-12-07 11:48:27 +01:00
Linus Groh
6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00
FrHun
ccdccadc24 LibGUI: Implement calculated min/preferred sizes for TabWidget 2022-07-04 11:15:40 +02:00
networkException
52ee5026ea LibGUI+Browser: Fix crash when activating a "Tab n" action
Previously we would try setting the tab index regardless if that tab
actually existed, resulting in Browser crashing by either pressing
Control + N or using the CommandPalette.
2022-06-05 13:46:52 +01:00
Cameron Youell
5b82bd719e LibGUI: TabWidget add vertical tabs
Add vertical tabs to TabWidget, this can be set using
the ```TabWidget::set_tab_position``` function or in the GML
2022-05-21 22:25:16 +02:00
Sam Atkins
0e1c8e702c LibGUI: Expose more TabWidget properties to GML
- close_button_enabled
- show_tab_bar
- reorder_allowed
2022-05-11 20:16:43 +02:00
kleines Filmröllchen
7e34b88ed4 LibGUI: Fully support TabWidget in GML
TabWidgets couldn't be used in GML properly, as the GML creation
routines didn't actually call the necessary functions in the TabWidget
to get a new tab added. This commit fixes that by making the name of the
tab a normal property, the previously introduced "title", which can be
trivially set from GML. Therefore, try_add_widget() loses an argument
(while try_add_tab doesn't, because it newly constructs the widget).
This allows us to get rid of the silly "fixing my widget tree after the
fact" code in Help and will make it super easy to use TabWidget in
future GML. :^)
2022-04-03 12:21:05 +02:00
Olivier De Cannière
1b7850f511 LibGUI: Add TabWidget::activate_last_tab() 2022-04-02 23:38:32 +02:00
Idan Horowitz
086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Lenny Maiorani
fe3b846ac8 Libraries: Use default constructors/destructors in LibGUI
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-12 14:44:43 -08:00
Erik Biederstadt
0cfe446d3f LibGUI: Allow double clicking on tabwidgets 2021-12-01 00:44:26 +03:30
Andreas Kling
8359975ff3 LibGUI: Make GUI::TabWidget tab creation APIs take String
Ultimately we'd like the caller to provide a String if possible (instead
of a StringView) as we're going to end up storing it.
2021-11-28 08:10:53 +01:00
Andreas Kling
47b6339025 LibGUI: Add GUI::TabWidget::try_add_tab<T>(...)
This is a fallible variant of add_tab<T>(...) that returns ErrorOr.
2021-11-24 13:52:01 +01:00
Andreas Kling
8b1108e485 Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Peter Elliott
e1684860a3 LibGUI: Support drag-to-reorder in TabWidget 2021-10-07 12:19:27 +02:00
TheFightingCatfish
8a0d465fbc LibGUI: Allow TabWidget to remove all tabs except one 2021-08-06 21:03:34 +02:00
Luke
3ec4ad8a73 LibGUI: Convert indexes to size_t and use Optional in TabWidget
Previously it was using int for indexes and using the -1 magic value.
Supersedes b9d51b8601
2021-07-28 11:03:27 +02:00
Marcus Nilsson
49d40a908c LibGUI/TabWidget: Add close button to tabs
This adds an optional close button to tabs, useful in
for example browser and pixelpaint.
2021-06-20 15:16:26 +02:00
Andreas Kling
a1eadc755d LibGUI: Allow tweaking each edge of TabWidget's content margins
Instead of having a single uniform margin around the child content of
a TabWidget, use a GUI::Margins to allow individual per-edge margins.
2021-06-15 14:28:39 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Andreas Kling
bcd05e199b LibGUI: Fix uniform TabWidget tabs bleeding outside the widget
The last uniform-sized tab button would bleed outside the tab bar area
due to us not taking the bar margin into account.
2021-04-09 22:30:41 +02:00
Andreas Kling
c8ff507534 LibGUI: Add TabWidget::on_tab_count_change hook 2021-04-09 22:23:14 +02:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00