1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 18:07:34 +00:00

LibGUI: Add IncrementalSearchBanner

Compared to traditional modal search, incremental search begins
matching as soon as the user starts typing, highlighting results
immediately. This refactors Itamar's work for HackStudio into a
common LibGUI widget to be used in all multi-line TextEditors.
This commit is contained in:
thankyouverycool 2022-11-28 17:58:17 -05:00 committed by Sam Atkins
parent 3c4a563415
commit 8231bd9bc3
6 changed files with 267 additions and 1 deletions

View file

@ -0,0 +1,81 @@
@GUI::Widget {
fill_with_background_color: true
visible: false
layout: @GUI::HorizontalBoxLayout {
margins: [4]
}
@GUI::TextBox {
name: "search_textbox"
max_width: 250
preferred_width: "grow"
placeholder: "Find"
}
@GUI::Widget {
preferred_width: "shrink"
layout: @GUI::HorizontalBoxLayout {
spacing: 0
}
@GUI::Button {
name: "next_button"
icon: "/res/icons/16x16/go-down.png"
fixed_width: 18
button_style: "Coolbar"
focus_policy: "NoFocus"
}
@GUI::Button {
name: "previous_button"
icon: "/res/icons/16x16/go-up.png"
fixed_width: 18
button_style: "Coolbar"
focus_policy: "NoFocus"
}
}
@GUI::Label {
name: "index_label"
text_alignment: "CenterLeft"
}
@GUI::Layout::Spacer {}
@GUI::Widget {
preferred_width: "shrink"
layout: @GUI::HorizontalBoxLayout {
spacing: 0
}
@GUI::Button {
name: "wrap_search_button"
fixed_width: 24
icon: "/res/icons/16x16/reload.png"
tooltip: "Wrap Search"
checkable: true
checked: true
button_style: "Coolbar"
focus_policy: "NoFocus"
}
@GUI::Button {
name: "match_case_button"
fixed_width: 24
icon: "/res/icons/16x16/app-font-editor.png"
tooltip: "Match Case"
checkable: true
button_style: "Coolbar"
focus_policy: "NoFocus"
}
}
@GUI::VerticalSeparator {}
@GUI::Button {
name: "close_button"
fixed_size: [15, 16]
button_style: "Coolbar"
focus_policy: "NoFocus"
}
}