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

Convert 'Customize Titlebar' dialog's listbox into tree, and make it's columns resizable. Fixes #25. #74

Closed
wants to merge 6 commits into from

Conversation

xabolcs
Copy link
Collaborator

@xabolcs xabolcs commented May 29, 2012

Hi!

In this pull request I did the following:

  • convert the container from listbox to tree
    • put a description to the end to be a placeholder - w/o it, the vbox undersized itself and the lower border of the tree was hiding.
    • introduce a new customTreeView object in paneTitle
    • introduce the new setupTree TreeView initializer method in paneTitle
    • hack a bit to skip some onClick event originating from scrollbar
  • make tree's columns resizable with a default 1:1:2 ratio
  • extend tree default width height

The resolution is based on some copy-pasted MDN example. Feel free to review it hard!
For example I don't know why I left the custom treeview code in paneTitle instead making it
a local function in setupTree.

@xabolcs
Copy link
Collaborator Author

xabolcs commented Jun 2, 2012

I've updated the commits:

  • not manipulating tree width
  • moved treeView to a local variable

<listcol style="width: 15em"/>
</listcols>
</listbox>
<tree id="varList" flex="1" style="height: 17em" hidecolumnpicker="true">
Copy link
Contributor

Choose a reason for hiding this comment

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

I would change the id of the tree to something more descriptive and which is loosely bound to the type of object, like 'variables'. Also I wouldn't set a height but would it auto-adjust by the window size. It should be stored inside of localstore.rdf so it keeps the latest width/height across sessions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

whimboo wrote

I would change the id of the tree to something more descriptive and which is loosely bound to the type of object, like 'variables'.

For example: variableList, variablesList, variablesTree?

Also I wouldn't set a height but would it auto-adjust by the window size.

Without style="height: xxxxx" or rows="xxx" <tree> gets collapsed! Try it! :)

It should be stored inside of localstore.rdf so it keeps the latest width/height across sessions.

This is irrelevant here. Resizing of the <tree> would be managed by the <prefpane>'s flexibility! See changes for customize.xul in #79! This issue is about columns! :P

Copy link
Contributor

Choose a reason for hiding this comment

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

For example: variableList, variablesList, variablesTree?

I would say just expand to variableList.

Without style="height: xxxxx" or rows="xxx" gets collapsed! Try it! :)

In that case please move the style definition out into the css file.

@whimboo
Copy link
Contributor

whimboo commented Jun 3, 2012

In general it looks fine and I agree that a tree will give us more changes in the future. I haven't tested this code yet but will do it once my above comments have been addressed.

@xabolcs
Copy link
Collaborator Author

xabolcs commented Jun 5, 2012

whimboo wrote

... I haven't tested this code yet but will do it once my above comments have been addressed.

Commits updated with addressed comments:

  • === comparison
  • tree's id=varList renamed to variablesTree
  • tree sizing unchanged, see comments!
  • treeView() moved to a (class-like?) global object: arrayBasedTreeView()
  • paneTitle.data[] renamed to paneTitle.variables[]
  • corrected indentation in setupTree()

get rowCount()
{
return this.data.length
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Please obey the 2 char indentation for prototype methods and properties. Also the opening brackets should always be in the same line as the function name. And there is a missing semicolon.

@whimboo
Copy link
Contributor

whimboo commented Jun 14, 2012

Ok, so I will wait for an update for the other items.

- coding style
- semicolon
- onclick listener
- onload listener
- tree height

--HG--
rename : extension/chrome/skin/options/options.css => extension/chrome/skin/titlebar/titlebar.css
arrayBasedTreeView.prototype = {
data: [],

get rowCount () {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: this is a named method, so no space is necessary before the opening brackets.

- move <prefwindow> styling to titlebar.css
- avoid defaultView.window
- no space between named function and "("
@xabolcs
Copy link
Collaborator Author

xabolcs commented Jul 9, 2012

@whimboo
Added commits:

  • a merge commit to address the CSS styling
  • and another for the nits

}

function treeOnClickListener (aEvent) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: no need for a blank after the function name. It's no a noname one.

- triple operator
- no space between named function and "(" again!
- empty line in CSS
@xabolcs
Copy link
Collaborator Author

xabolcs commented Aug 27, 2012

@whimboo
Added commit:

  • ===
  • no space between ...
  • and the CSS

@xabolcs
Copy link
Collaborator Author

xabolcs commented Oct 18, 2012

Landed as 619675b - 619675b9d840

@whimboo
Copy link
Contributor

whimboo commented Oct 18, 2012

There is no need for this additional comment. See the one before I closed the pull. It already has the link.

@xabolcs
Copy link
Collaborator Author

xabolcs commented Oct 18, 2012

Ohh. Really.
Sorry for spamming. :(

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.

2 participants