Closed
Bug 337802
Opened 19 years ago
Closed 19 years ago
Rollover tracking should not "highlight" the close button if only one tab is visible
Categories
(Camino Graveyard :: Tabbed Browsing, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
Camino1.5
People
(Reporter: bugzilla-graveyard, Assigned: aschulm)
Details
(Keywords: fixed1.8.1)
Attachments
(1 file, 2 obsolete files)
1.66 KB,
patch
|
stuart.morgan+bugzilla
:
review+
mikepinkerton
:
superreview+
|
Details | Diff | Splinter Review |
If "Always Show Tab Bar" is checked in prefs and all tabs but one are closed, mousing over the close box will cause a highlight. This shouldn't happen, since the close box is disabled in that case.
This was caused by the checkin for bug 235864.
Comment 1•19 years ago
|
||
This will be easy to fix by just bailing out where appropriate if the button isn't enabled.
Assignee | ||
Comment 2•19 years ago
|
||
Not sure about the neccesarness of the extra #import "RolloverImageButton.h" waiting for trunk to compile to find this out
Reporter | ||
Comment 3•19 years ago
|
||
Comment on attachment 221894 [details] [diff] [review]
RolloverImageButton WIP Patch
>+- (void)setEnabled:inStatus
inStatus needs to be cast as a BOOL.
>@@ -171,21 +180,23 @@
> }
>
> @end
>
> @implementation RolloverImageButton (Private)
>
> - (void)updateImage:(BOOL)inIsInside
> {
>+ if ([self isEnabled]) {
> if (inIsInside)
> [super setImage:mHoverImage];
> else
> [super setImage:mImage];
>+ }
> }
>
> - (BOOL)isMouseInside
> {
> NSPoint mousePointInWindow = [[self window] convertScreenToBase:[NSEvent mouseLocation]];
> NSPoint mousePointInView = [[self superview] convertPoint:mousePointInWindow fromView:nil];
> return NSMouseInRect(mousePointInView, [self frame], NO);
> }
This hunk of the patch failed to apply here. You didn't hand-edit it, did you?
r=me with the above fixes addressed. Please upload a fresh patch when you've fixed it so I can double-check that it applies properly. :)
cl
Attachment #221894 -
Flags: review-
Comment 4•19 years ago
|
||
It didn't apply because it was -w; the four lines that were shifted to the right changed, but aren't actually shown as such in the patch.
>+ [(RolloverImageButton*)[[[self tabViewItems] objectAtIndex:0] closeButton] setEnabled:initialCloseButtonEnabled];
Why are you adding this cast? There's nothing specific to your subclass here; setEnabled is part of all NSControls
>+ if ([self isEnabled])
>+ [self updateTrackingRectInSuperview];
>+ else
>+ [self removeTrackingRectFromView:[self superview]];
If a button is disabled while hovered, won't this wedge it in hover mode?
Assignee | ||
Comment 5•19 years ago
|
||
(In reply to comment #4)
> It didn't apply because it was -w; the four lines that were shifted to the
> right changed, but aren't actually shown as such in the patch.
>
> >+ [(RolloverImageButton*)[[[self tabViewItems] objectAtIndex:0] closeButton] setEnabled:initialCloseButtonEnabled];
>
> Why are you adding this cast? There's nothing specific to your subclass here;
There was an issue with a warning issued on this line. This cast seems to get rid of it, but I do not understand why it would be issued at all because closeButton returns an object of type RolloverImageButton*. I will get rid of this cast for now and once my recompile of the trunk finnishes I will add it in.
>
> >+ if ([self isEnabled])
> >+ [self updateTrackingRectInSuperview];
> >+ else
> >+ [self removeTrackingRectFromView:[self superview]];
>
> If a button is disabled while hovered, won't this wedge it in hover mode?
>
Yes it would I will add a line to make sure that the button changes to the default image, good catch.
Patch coming soon
Assignee | ||
Comment 6•19 years ago
|
||
Issues described above are fixed, fixing the warning is more part of Bug #235864, so I will address it in there.
Aaron
Reporter | ||
Comment 7•19 years ago
|
||
Comment on attachment 221928 [details] [diff] [review]
RolloverImageButton Patch
r=me; patch applies cleanly and button doesn't get "stuck" in highlight mode if you close a tab while hovering over the close button on the last remaining tab.
Attachment #221928 -
Flags: review+
Comment 8•19 years ago
|
||
Comment on attachment 221928 [details] [diff] [review]
RolloverImageButton Patch
> - (void)updateImage:(BOOL)inIsInside
> {
>- if (inIsInside)
>- [super setImage:mHoverImage];
>- else
>- [super setImage:mImage];
>+ if ([self isEnabled]) {
>+ if (inIsInside)
>+ [super setImage:mHoverImage];
>+ else
>+ [super setImage:mImage];
>+ }
> }
This makes it impossible to change the default image of a disabled button. Only the hover image part should be conditionalized.
Attachment #221928 -
Flags: review-
Assignee | ||
Comment 9•19 years ago
|
||
Great find smorgan, as always.
Attachment #221894 -
Attachment is obsolete: true
Attachment #221928 -
Attachment is obsolete: true
Assignee | ||
Updated•19 years ago
|
Attachment #222102 -
Flags: review?(smorgan)
Reporter | ||
Comment 10•19 years ago
|
||
Comment on attachment 222102 [details] [diff] [review]
RolloverImageButton Patch
Setting r flag to proper reviewer.
cl
Attachment #222102 -
Flags: review?(smorgan) → review?(stuart.morgan)
Comment 11•19 years ago
|
||
Comment on attachment 222102 [details] [diff] [review]
RolloverImageButton Patch
r=me
Attachment #222102 -
Flags: superreview?
Attachment #222102 -
Flags: review?(stuart.morgan)
Attachment #222102 -
Flags: review+
Assignee | ||
Comment 12•19 years ago
|
||
Comment on attachment 222102 [details] [diff] [review]
RolloverImageButton Patch
Targeting Pink for SR
Attachment #222102 -
Flags: superreview? → superreview?(mikepinkerton)
Comment 13•19 years ago
|
||
Comment on attachment 222102 [details] [diff] [review]
RolloverImageButton Patch
sr=pink
Attachment #222102 -
Flags: superreview?(mikepinkerton) → superreview+
Whiteboard: [needs checkin]
Comment 14•19 years ago
|
||
Checked in
Comment 15•19 years ago
|
||
hey, why is the close box disabled anyway, when we have just one tab? why not just have = red gumdrop?
Reporter | ||
Updated•19 years ago
|
Whiteboard: [needs checkin]
You need to log in
before you can comment on or make changes to this bug.
Description
•