From 2d278e9c842c26c974e7fd0784081aefc21b8676 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Sun, 10 Feb 2013 23:28:17 -0500 Subject: [PATCH] Update Web+ find bar close button. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Put the button on the left and label it with × to indicate close. * Make the button just wide enough to fit the label. Tested with font sizes 8pt to 18pt. --- src/apps/webpositive/BrowserWindow.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/apps/webpositive/BrowserWindow.cpp b/src/apps/webpositive/BrowserWindow.cpp index 9f5e3e7e5e..63f401bb7a 100644 --- a/src/apps/webpositive/BrowserWindow.cpp +++ b/src/apps/webpositive/BrowserWindow.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -56,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -424,6 +426,12 @@ BrowserWindow::BrowserWindow(BRect frame, SettingsMessage* appSettings, const float kElementSpacing = 5; // Find group + fFindCloseButton = new BButton("\xc3\x97", // multiplication sign + new BMessage(EDIT_HIDE_FIND_GROUP)); + fFindCloseButton->SetExplicitMinSize( + BSize(be_control_look->DefaultItemSpacing() * 3, B_SIZE_UNSET)); + fFindCloseButton->SetExplicitMaxSize( + BSize(be_control_look->DefaultItemSpacing() * 3, B_SIZE_UNSET)); fFindTextControl = new BTextControl("find", B_TRANSLATE("Find:"), "", new BMessage(EDIT_FIND_NEXT)); fFindTextControl->SetModificationMessage(new BMessage(FIND_TEXT_CHANGED)); @@ -431,18 +439,15 @@ BrowserWindow::BrowserWindow(BRect frame, SettingsMessage* appSettings, new BMessage(EDIT_FIND_PREVIOUS)); fFindNextButton = new BButton(B_TRANSLATE("Next"), new BMessage(EDIT_FIND_NEXT)); - fFindCloseButton = new BButton(B_TRANSLATE("Close"), - new BMessage(EDIT_HIDE_FIND_GROUP)); fFindCaseSensitiveCheckBox = new BCheckBox(B_TRANSLATE("Match case")); BGroupLayout* findGroup = BLayoutBuilder::Group<>(B_VERTICAL, 0.0) .Add(new BSeparatorView(B_HORIZONTAL, B_PLAIN_BORDER)) .Add(BGroupLayoutBuilder(B_HORIZONTAL, kElementSpacing) + .Add(fFindCloseButton) .Add(fFindTextControl) .Add(fFindPreviousButton) .Add(fFindNextButton) .Add(fFindCaseSensitiveCheckBox) - .Add(BSpaceLayoutItem::CreateGlue()) - .Add(fFindCloseButton) .SetInsets(kInsetSpacing, kInsetSpacing, kInsetSpacing, kInsetSpacing) ) @@ -2332,5 +2337,3 @@ BrowserWindow::_HandlePageSourceResult(const BMessage* message) alert->Go(NULL); } } - -