summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
diff options
context:
space:
mode:
authorDawid Wolosowicz <d@1823.pl>2021-09-04 15:00:18 +0200
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-09-08 15:48:02 +0430
commit9225b45c2d71e93b5f064505926cbd380ed2947a (patch)
tree401464d7f19107c7c0c9b466ad9068cf9f392e2b /Userland/Libraries/LibGUI
parentaeffd9024e6d9550e8846c674ca81087d8936ef3 (diff)
downloadserenity-9225b45c2d71e93b5f064505926cbd380ed2947a.zip
LibGUI: Rename AbstractView::m_searching => m_highlighted_search
Diffstat (limited to 'Userland/Libraries/LibGUI')
-rw-r--r--Userland/Libraries/LibGUI/AbstractView.cpp10
-rw-r--r--Userland/Libraries/LibGUI/AbstractView.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Libraries/LibGUI/AbstractView.cpp b/Userland/Libraries/LibGUI/AbstractView.cpp
index 88c563775d..56e4f68e71 100644
--- a/Userland/Libraries/LibGUI/AbstractView.cpp
+++ b/Userland/Libraries/LibGUI/AbstractView.cpp
@@ -566,7 +566,7 @@ void AbstractView::keydown_event(KeyEvent& event)
//if (event.modifiers() == Mod_Ctrl) {
// TODO: delete last word
//}
- Utf8View view(m_searching);
+ Utf8View view(m_highlighted_search);
size_t n_code_points = view.length();
if (n_code_points > 1) {
n_code_points--;
@@ -595,7 +595,7 @@ void AbstractView::keydown_event(KeyEvent& event)
}
} else if (event.key() != KeyCode::Key_Tab && !event.ctrl() && !event.alt() && event.code_point() != 0) {
StringBuilder sb;
- sb.append(m_searching);
+ sb.append(m_highlighted_search);
sb.append_code_point(event.code_point());
do_search(sb.to_string());
start_searching_timer();
@@ -610,7 +610,7 @@ void AbstractView::keydown_event(KeyEvent& event)
void AbstractView::cancel_searching()
{
- m_searching = nullptr;
+ m_highlighted_search = nullptr;
if (m_searching_timer)
m_searching_timer->stop();
if (m_highlighted_search_index.is_valid()) {
@@ -643,7 +643,7 @@ void AbstractView::do_search(String&& searching)
if (!found_indices.is_empty() && found_indices[0].is_valid()) {
auto& index = found_indices[0];
m_highlighted_search_index = index;
- m_searching = move(searching);
+ m_highlighted_search = move(searching);
set_selection(index);
scroll_into_view(index);
update();
@@ -677,7 +677,7 @@ void AbstractView::draw_item_text(Gfx::Painter& painter, const ModelIndex& index
else
text_color = index.data(ModelRole::ForegroundColor).to_color(palette().color(foreground_role()));
if (index == m_highlighted_search_index) {
- Utf8View searching_text(m_searching);
+ Utf8View searching_text(m_highlighted_search);
auto searching_length = searching_text.length();
if (searching_length > search_highlighting_offset)
searching_length -= search_highlighting_offset;
diff --git a/Userland/Libraries/LibGUI/AbstractView.h b/Userland/Libraries/LibGUI/AbstractView.h
index 717fe77240..ea9968908b 100644
--- a/Userland/Libraries/LibGUI/AbstractView.h
+++ b/Userland/Libraries/LibGUI/AbstractView.h
@@ -162,7 +162,7 @@ protected:
void activate_selected();
void update_edit_widget_position();
- bool is_searching() const { return !m_searching.is_null(); }
+ bool is_searching() const { return !m_highlighted_search.is_null(); }
void cancel_searching();
void start_searching_timer();
void do_search(String&&);
@@ -192,7 +192,7 @@ private:
RefPtr<Model> m_model;
ModelSelection m_selection;
- String m_searching;
+ String m_highlighted_search;
RefPtr<Core::Timer> m_searching_timer;
SelectionBehavior m_selection_behavior { SelectionBehavior::SelectItems };
SelectionMode m_selection_mode { SelectionMode::SingleSelection };