Commit graph

27 commits

Author SHA1 Message Date
Ali Mohammad Pur
5e1499d104 Everywhere: Rename {Deprecated => Byte}String
This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).

This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
2023-12-17 18:25:10 +03:30
Karol Kosek
3944c39b3a LibGUI: Port tooltip in Breadcrumbbar to String 2023-10-06 08:20:11 +02:00
camc
d978dd4af8 LibGUI: Add deprecated suffix to {set_,}tooltip in Widget 2023-08-18 10:43:37 +01:00
Sam Atkins
5b77346f53 LibGUI: Allow double-clicking PathBreadcrumbbar buttons to edit path
When viewing a deeply nested path, there may be very little of the
PathBreadcrumbbar itself visible to double-click on. This solves that
by allowing double-clicks on its segment buttons to behave the same.
(With the caveat that it first selects the double-clicked segment.)

In order to make this work, `on_double_click` now takes the modifiers
instead of the MouseEvent. In this case we don't use it so that's fine,
but maybe we should make all mouse callbacks consistently take the
MouseEvent& as a parameter.
2023-02-19 01:09:09 +01:00
Sam Atkins
77ad0fdb07 Userland: Specify margins and spacing in the GUI::Layout constructor 2023-02-18 16:56:56 +00:00
Karol Kosek
e39adc4772 Userland: Set Button text using the new String class 2023-02-13 00:45:09 +00:00
Karol Kosek
d32b052f22 LibGUI+Userland: Add _deprecated suffix to AbstractButton::{set_,}text 2023-02-13 00:45:09 +00:00
Andreas Kling
5577d5f789 LibGUI: Use the correct font when relayouting Breadcrumbbar
When the system is broadcasting a "system font changed" notification,
the Breadcrumbbar will be notified before its button children. This
means that we have to use the Breadcrumbbar's font() for calculations
inside Breadcrumbbar as the buttons themselves still have the old font
at this point.
2023-02-02 14:49:54 +01:00
Andreas Kling
63ac6ced31 LibGUI: Merge two loops over the segments in Breadcrummbar::relayout() 2023-02-02 14:49:54 +01:00
Andreas Kling
be3a9048be LibGUI: Relayout Breadcrumbbar on font change 2023-02-02 13:15:03 +01:00
Andreas Kling
3407ab0fd1 LibGfx: Make Font::width() return a float 2023-01-03 15:25:02 +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
29a3ff22d7 LibGUI: Make Breadcrumbbar resizable below current size
By making proper use of the dynamic layout system, the Breadcrumbbar can
now shrink below its current (grown) size again, while still ensuring
that no icon gets cut off.
2022-10-06 12:17:38 +01:00
networkException
2161f20aa6 LibGUI: Call on_segment_change handler from on_{click,focus_change}
The on_segment_change handler introduced in
a00fa793b3 was only getting called by
programmatically setting the segment, not by clicking a button or using
tab navigation.
2022-08-23 12:50:20 +02:00
networkException
c1c11df3b8 LibGUI: Don't call on_segment_change handler if the index did not change
This patch makes the handler's behavior closer to what can be expected
from it's name by not handling set_selected_segment if the segment is
already selected.
2022-08-23 12:50:20 +02:00
Jannis Weis
32205495e6 LibGUI: Clear selected index of Breadcrumbbar if segment is removed
If the segment corresponding to the selected index is removed the index
is no longer valid.
2022-08-22 12:48:11 +02:00
Jannis Weis
a00fa793b3 LibGUI: Add on_segment_change handler to Breadcrumbbar
This allows programs to respond to any selection changes of the
Breadcrumbbar, not just ones made by clicking one of the buttons.
2022-08-22 12:48:11 +02:00
Andreas Kling
ff37ce7408 LibGUI: Make Breadcrumbbar remember the selected segment index
We had a selected_segment() accessor, but the member it returned was
never actually updated.
2022-08-18 20:43:39 +02:00
Simon Wanner
206d6ece55 LibGfx: Move other font-related files to LibGfx/Font/ 2022-04-09 23:48:18 +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
networkException
4dc23c9b24 LibGUI: Allow breadcrumbbar segment activation using the keyboard
We now interpret a breadcrumbbar segment gaining focus just as clicking
on the segment, allowing keyboard navigation using the arrow keys.
2022-02-13 12:39:44 +01:00
Sam Atkins
e2c32a6c65 Everywhere: Use my shiny new serenityos.org email :^) 2021-09-03 12:22:36 +02:00
Marcus Nilsson
71f345bbb8 LibGUI: Adjust BreadcrumbButtons width on resize
This commit relayouts the BreadcrumbButtons on resize to a shrunken
state if they don't fit. It also caps the button width to 100px to
avoid overflowing the widget.
2021-09-01 01:21:51 +02:00
Sam Atkins
d8e0535116 LibGUI: Add search/removal methods to Breadcrumbbar
Both are used by FileManager in the next commit.

find_segment_with_data() was previously a single-use lambda in
FileManager, but making it a method of Breadcrumbbar means we can
re-use it more easily.
2021-07-01 17:15:26 +04:30
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
a2baab38fd Everywhere: It's now "Foobar", not "FooBar", and not "foo bar"
I hereby declare these to be full nouns that we don't split,
neither by space, nor by underscore:

- Breadcrumbbar
- Coolbar
- Menubar
- Progressbar
- Scrollbar
- Statusbar
- Taskbar
- Toolbar

This patch makes everything consistent by replacing every other variant
of these with the proper one. :^)
2021-04-13 16:58:15 +02:00
Renamed from Userland/Libraries/LibGUI/BreadcrumbBar.cpp (Browse further)