WebPositive: layout ceanup for URL bar.
- Less strict sizing constraints for the button so it can always occupy the full height of the URL bar - Use "draw after children" for the URL bar border so it is drawn above the button and icon edges - Remove insets that were there to attempt to make the outline visible (I think) - Use negative spacing to make the button border collapse into the text control border so they look visually as a single control Fixes #20124 Change-Id: I4be0c422c00acbc37a4197406a86a73c3193b9f5
This commit is contained in:
@@ -593,7 +593,8 @@ URLInputGroup::URLInputGroup(BMessage* goMessage)
|
||||
fWindowActive(false),
|
||||
fURLLocked(false)
|
||||
{
|
||||
GroupLayout()->SetInsets(2, 2, 2, 2);
|
||||
GroupLayout()->SetInsets(2, 0, 0, 0);
|
||||
GroupLayout()->SetSpacing(-2);
|
||||
|
||||
fIconView = new PageIconView();
|
||||
GroupLayout()->AddView(fIconView, 0.0f);
|
||||
@@ -604,12 +605,12 @@ URLInputGroup::URLInputGroup(BMessage* goMessage)
|
||||
AddChild(new BSeparatorView(B_VERTICAL, B_PLAIN_BORDER));
|
||||
|
||||
fGoButton = new BButton("⏎", goMessage);
|
||||
fGoButton->SetExplicitMaxSize(BSize(StringWidth("⏎") * 3, StringWidth("⏎") * 2));
|
||||
fGoButton->SetExplicitMinSize(BSize(StringWidth("⏎") * 3, StringWidth("⏎") * 2));
|
||||
fGoButton->SetExplicitPreferredSize(BSize(StringWidth("⏎") * 3, B_SIZE_UNLIMITED));
|
||||
fGoButton->SetExplicitMaxSize(BSize(StringWidth("⏎") * 3, B_SIZE_UNLIMITED));
|
||||
fGoButton->SetExplicitPreferredSize(BSize(StringWidth("⏎") * 3, B_SIZE_UNSET));
|
||||
GroupLayout()->AddView(fGoButton, 0.0f);
|
||||
|
||||
SetFlags(Flags() | B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE);
|
||||
SetFlags(Flags() | B_WILL_DRAW | B_DRAW_ON_CHILDREN | B_FULL_UPDATE_ON_RESIZE);
|
||||
SetLowColor(ViewColor());
|
||||
SetViewColor(fTextView->ViewColor());
|
||||
|
||||
@@ -651,7 +652,7 @@ URLInputGroup::MarkAsInvalid(bool invalid)
|
||||
|
||||
|
||||
void
|
||||
URLInputGroup::Draw(BRect updateRect)
|
||||
URLInputGroup::DrawAfterChildren(BRect updateRect)
|
||||
{
|
||||
BRect bounds(Bounds());
|
||||
rgb_color base(LowColor());
|
||||
|
||||
@@ -16,10 +16,10 @@ public:
|
||||
URLInputGroup(BMessage* goMessage);
|
||||
virtual ~URLInputGroup();
|
||||
|
||||
virtual void AttachedToWindow();
|
||||
virtual void WindowActivated(bool active);
|
||||
virtual void Draw(BRect updateRect);
|
||||
virtual void MakeFocus(bool focus = true);
|
||||
virtual void AttachedToWindow() override;
|
||||
virtual void WindowActivated(bool active) override;
|
||||
virtual void DrawAfterChildren(BRect updateRect) override;
|
||||
virtual void MakeFocus(bool focus = true) override;
|
||||
|
||||
|
||||
BTextView* TextView() const;
|
||||
|
||||
Reference in New Issue
Block a user