mirror of
https://github.com/RGBCube/serenity
synced 2025-10-25 14:12:32 +00:00
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')
45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2023, Sam Atkins <atkinssj@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/NonnullRefPtr.h>
|
|
#include <LibGUI/Forward.h>
|
|
#include <LibGUI/Widget.h>
|
|
|
|
namespace GUI {
|
|
|
|
class PathBreadcrumbbar : public Widget {
|
|
C_OBJECT_ABSTRACT(PathBreadcrumbbar)
|
|
public:
|
|
static ErrorOr<NonnullRefPtr<PathBreadcrumbbar>> try_create();
|
|
virtual ~PathBreadcrumbbar() override;
|
|
|
|
void set_current_path(ByteString const&);
|
|
|
|
void show_location_text_box();
|
|
void hide_location_text_box();
|
|
|
|
bool has_parent_segment() const;
|
|
bool has_child_segment() const;
|
|
|
|
void select_parent_segment();
|
|
void select_child_segment();
|
|
|
|
Function<void(StringView path)> on_path_change;
|
|
Function<void(StringView path, GUI::DropEvent const&)> on_paths_drop;
|
|
Function<void()> on_hide_location_box;
|
|
|
|
private:
|
|
PathBreadcrumbbar(NonnullRefPtr<GUI::TextBox>, NonnullRefPtr<GUI::Breadcrumbbar>);
|
|
|
|
NonnullRefPtr<GUI::TextBox> m_location_text_box;
|
|
NonnullRefPtr<GUI::Breadcrumbbar> m_breadcrumbbar;
|
|
|
|
ByteString m_current_path;
|
|
};
|
|
|
|
}
|