Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1145604 - Close button for tabs in table view #290

Closed
wants to merge 3 commits into from

Conversation

sachin004
Copy link
Contributor

Code to fix the bug https://bugzilla.mozilla.org/show_bug.cgi?id=1145604.
Added a close button at the top right of the tab

super.init(style: style, reuseIdentifier: reuseIdentifier)

self.closeTab.setImage(UIImage(named: "toolbar_stop.png"), forState: UIControlState.Normal)
self.closeTab.backgroundColor = UIColor.clearColor()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line necessary? I thought clear was the default background color.

@thebnich
Copy link
Contributor

Thanks for the pull request! This looks pretty good. I'd like to fix a few of the comments like extracting the vars to TabTrayControllerUX, and renaming the selector before this lands.

UX will also probably want to change the interaction some, but we can handle that in a polish follow-up if they don't have time to give feedback right now.

@sachin004
Copy link
Contributor Author

@thebnich Thank you for taking time reviewing it so quickly. I really appreciate it. I have made all the changes suggested by you, please take a look at it.

@sachin004 sachin004 reopened this Apr 2, 2015
@sachin004
Copy link
Contributor Author

@thebnich let me know if I need to make any more changes or is this good to go?

@@ -113,6 +124,8 @@ private class TabCell: UITableViewCell {

innerStroke.frame = background.frame

closeTab.frame = CGRect(x: backgroundHolder.frame.width - TabTrayControllerUX.CloseButtonSize/2 - TabTrayControllerUX.Margin, y: TabTrayControllerUX.CloseButtonMargin, width: TabTrayControllerUX.CloseButtonSize, height: TabTrayControllerUX.CloseButtonSize)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand how you're calculating the x value. Why divide TabTrayControllerUX.CloseButtonSize by 2? And why subtract TabTrayControllerUX.Margin? The end result might look OK right now, but we should make sure the math makes sense instead of arbitrarily putting values together.

I think the following is more intuitive:

backgroundHolder.frame.width - TabTrayControllerUX.CloseButtonSize - TabTrayControllerUX.CloseButtonMargin

@thebnich
Copy link
Contributor

thebnich commented Apr 7, 2015

@sachin004 thanks for the updates, and sorry for the delay! Your PR got buried by all the other open PRs :)

For the future, one tip that will make sure your PR gets reviewed quickly is to flip the attachment flag to "review? bnicholson" (or someone else) in Bugzilla every time you update the pull request. This adds it to the reviewer's queue so it doesn't get overlooked.

@thebnich
Copy link
Contributor

thebnich commented Apr 8, 2015

Thanks, this looks great! Squashed and pushed 74c739a.

@thebnich thebnich closed this Apr 8, 2015
jjSDET pushed a commit to jjSDET/firefox-ios that referenced this pull request Feb 13, 2024
isabelrios pushed a commit to isabelrios/firefox-ios that referenced this pull request Feb 14, 2024
isabelrios pushed a commit to isabelrios/firefox-ios that referenced this pull request Feb 19, 2024
isabelrios pushed a commit to isabelrios/firefox-ios that referenced this pull request Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants