From 8735dd0086715e16af206b60ad23b2108dfdddaa Mon Sep 17 00:00:00 2001 From: Andrea Agosti Date: Sun, 23 Apr 2023 10:25:51 +0200 Subject: [PATCH] Add close button to search box 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 --- source/gx/tilix/terminal/search.d | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source/gx/tilix/terminal/search.d b/source/gx/tilix/terminal/search.d index 85fcee2f..2b39f71e 100644 --- a/source/gx/tilix/terminal/search.d +++ b/source/gx/tilix/terminal/search.d @@ -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/. */ @@ -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");