[haiku-commits] haiku: hrev45270 - src/apps/webpositive

  • From: jscipione@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 11 Feb 2013 05:37:19 +0100 (CET)

hrev45270 adds 2 changesets to branch 'master'
old head: 855a423a5ea107bdb3b78b2d309c18cd0136e4fc
new head: eaa6b633db54e30ddda3c460ffc9cb5d7fa4fc90
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=eaa6b63+%5E855a423

----------------------------------------------------------------------------

2d278e9: Update Web+ find bar close button.
  
  * 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.

eaa6b63: Use default spacing for find bar controls

                                     [ John Scipione <jscipione@xxxxxxxxx> ]

----------------------------------------------------------------------------

1 file changed, 10 insertions(+), 7 deletions(-)
src/apps/webpositive/BrowserWindow.cpp | 17 ++++++++++-------

############################################################################

Commit:      2d278e9c842c26c974e7fd0784081aefc21b8676
URL:         http://cgit.haiku-os.org/haiku/commit/?id=2d278e9
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Mon Feb 11 04:28:17 2013 UTC

Update Web+ find bar close button.

* 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.

----------------------------------------------------------------------------

diff --git a/src/apps/webpositive/BrowserWindow.cpp 
b/src/apps/webpositive/BrowserWindow.cpp
index 9f5e3e7..63f401b 100644
--- a/src/apps/webpositive/BrowserWindow.cpp
+++ b/src/apps/webpositive/BrowserWindow.cpp
@@ -39,6 +39,7 @@
 #include <Catalog.h>
 #include <CheckBox.h>
 #include <Clipboard.h>
+#include <ControlLook.h>
 #include <Directory.h>
 #include <Entry.h>
 #include <File.h>
@@ -56,6 +57,7 @@
 #include <Roster.h>
 #include <Screen.h>
 #include <SeparatorView.h>
+#include <Size.h>
 #include <SpaceLayoutItem.h>
 #include <StatusBar.h>
 #include <StringView.h>
@@ -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);
        }
 }
-
-

############################################################################

Revision:    hrev45270
Commit:      eaa6b633db54e30ddda3c460ffc9cb5d7fa4fc90
URL:         http://cgit.haiku-os.org/haiku/commit/?id=eaa6b63
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Mon Feb 11 04:36:38 2013 UTC

Use default spacing for find bar controls

----------------------------------------------------------------------------

diff --git a/src/apps/webpositive/BrowserWindow.cpp 
b/src/apps/webpositive/BrowserWindow.cpp
index 63f401b..ee9e6b8 100644
--- a/src/apps/webpositive/BrowserWindow.cpp
+++ b/src/apps/webpositive/BrowserWindow.cpp
@@ -442,7 +442,7 @@ BrowserWindow::BrowserWindow(BRect frame, SettingsMessage* 
appSettings,
        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(BGroupLayoutBuilder(B_HORIZONTAL, B_USE_DEFAULT_SPACING)
                        .Add(fFindCloseButton)
                        .Add(fFindTextControl)
                        .Add(fFindPreviousButton)


Other related posts: