Could somebody tell me more about it ? a bug ?
--
Cordially,
Christophe Charron
You can assign height to rows in a stylesheet. For example:
treechildren::-moz-tree-row {
height: 100px;
}
Changing the font size in the tree also results in rows getting taller
to accomodate larger text (but in my experiments, choosing smaller font
size didn't result in rows getting shorter):
treechildren {
font-size: 200%;
}
Igor Tandetnik
>Changing the font size in the tree also results in rows getting taller to accomodate larger text (but in my experiments, choosing smaller font size didn't result in rows getting shorter)
>
The default theme styles rows with a height of 1.3em and a min-height of
18px.
--
Warning: May contain traces of nuts.
>In fact, i think it is impossible because when i use "Ctrl+" or "ctrl-", lot of objects change their size except tree rows.
>
Unfortunately tree rows remember their height when they are created, and
don't subsequently adjust for font size changes.
There's a way to force them. This works for me:
var stylesheet = document.styleSheets[0];
var rule = "tree {-moz-binding: none !important;}";
stylesheet.insertRule(rule, stylesheet.cssRules.length);
stylesheet.deleteRule(stylesheet.cssRules.length - 1);
Removing and re-enabling XBL binding seems to force the tree to
recalculate its metrics based on whatever styles are effective at the
time.
Igor Tandetnik
Why only trees ? Other objects don't seem to remember this
property ? !
--
Cordially,
Christophe Charron
> Is there a way to use classes with treechildren::-moz-tree-row
No. Each row in a tree is the same height.
> Removing and re-enabling XBL binding seems to force the tree to
> recalculate its metrics based on whatever styles are effective at the
> time.
Actually anything that will recreate the tree body frame will do -
hiding and showing the tree should work, I think.
If you mean just doing
var tree = document.getElementById(...);
tree.collapsed = true;
tree.collapsed = false;
then I just tried it, it doesn't work. Row height doesn't change.
Igor Tandetnik
Collapsing an element doesn't remove the frame, it just sets the width
and height to 0. But if you set the hidden property it should do what
you want.
/ Neil
Thanks to everybody : I managed what i wanted to do. You can see an
example here http://test03.christophe-charron.org/public/xul/2007_04_06/2007_04_06_css.xul
I just have a little problem with my "setTimeout" to allow a good
refresh and i hope i'll find my mistake but it works.
I still don't understand why 'Ctrl+" and "Ctrl-" don't change
treechildren font-size but ... nevermind...
--
Cordially,
Christophe Charron
It appears to only work if the element is "unhidden" asynchronously,
like this:
var tree = document.getElementById(...);
tree.setAttribute("hidden", "true");
window.setTimeout(function() {tree.removeAttribute("hidden");}, 0);
Unfortunately, this creates a pretty nasty flicker on the screen as a
side effect,especially if <tree> element occupies a significant area of
the window, as it does in my application. The binding technique I use
works synchronously and doesn't flicker as much.
Igor Tandetnik