Skip to content

Commit

Permalink
Add close button to search box
Browse files Browse the repository at this point in the history
This patch add a close button to the search box, adding to pressing `esc`
while on the search box input and the toggle button on the Window, to close
the Search box area.

Fixes #2131
  • Loading branch information
Andrea Agosti authored and ximion committed Nov 6, 2023
1 parent d281190 commit 8735dd0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion source/gx/tilix/terminal/search.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
* distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
Expand Down Expand Up @@ -151,6 +151,16 @@ private:

bSearch.add(bButtons);

Button btnClose = new Button("window-close-symbolic", IconSize.MENU);
btnClose.setTooltipText(_("Close search box"));
btnClose.setRelief(ReliefStyle.NONE);
btnClose.setFocusOnClick(true);
btnClose.addOnClicked(delegate(Button) {
setRevealChild(false);
vte.grabFocus();
});
bSearch.packEnd(btnClose, false, false, 0);

Frame frame = new Frame(bSearch, null);
frame.setShadowType(ShadowType.NONE);
frame.getStyleContext().addClass("tilix-search-frame");
Expand Down

0 comments on commit 8735dd0

Please sign in to comment.