Hi, everything is told in the subject. In fact, i think it is impossible because when i use "Ctrl+" or "ctrl-", lot of objects change their size except tree rows. And then, text does'nt fit any more if it was a "ctrl+" !!
Christophe Charron <christophe.charron....@gmail.com> wrote: > everything is told in the subject.
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):
Igor Tandetnik wrote: >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.
Neil <n...@parkwaycc.co.uk> wrote: > Christophe Charron wrote:
>> 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.
> Christophe Charron <christophe.charron....@gmail.com> wrote: > > everything is told in the subject.
> 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%;
> }
Thanks, both work. Is there a way to use classes with treechildren::-moz-tree-row I tried treechildren::-moz-tree-row(test) { height: 100px;
> Neil <n...@parkwaycc.co.uk> wrote: > > Christophe Charron wrote:
> >> 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
Whoua ... i'll try that ... A "last" question: Is there a way to know if font size was changed ? -- Cordially, Christophe Charron
On 6 avr, 22:00, Neil <n...@parkwaycc.co.uk> wrote:
> Christophe Charron wrote: > >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.
Why only trees ? Other objects don't seem to remember this property ? !
Igor Tandetnik wrote: > 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.
Igor Tandetnik wrote: > Neil <n...@parkwaycc.co.uk> wrote: >> Igor Tandetnik wrote:
>>> 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.
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.
On 7 avr, 01:19, Neil <n...@parkwaycc.co.uk> wrote:
> Christophe Charron wrote: > > Is there a way to use classes with treechildren::-moz-tree-row
> No. Each row in a tree is the same height.
I can understand that and i think it's a good way to build a tree. But can different trees, in the same window, have different styles and classes (i'm talking about moz-tree-row) ?
<christophe.charron....@gmail.com> wrote: > On 7 avr, 01:19, Neil <n...@parkwaycc.co.uk> wrote:> Christophe Charron wrote: > > > Is there a way to use classes with treechildren::-moz-tree-row
> > No. Each row in a tree is the same height.
> I can understand that and i think it's a good way to build a tree. But > can different trees, in the same window, have different styles and > classes (i'm talking about moz-tree-row) ?
> > -- > > Warning: May contain traces of nuts.
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... 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...
Neil Deakin <enndea...@sympatico.ca> wrote: > Igor Tandetnik wrote: >> Neil <n...@parkwaycc.co.uk> wrote: >>> Igor Tandetnik wrote:
>>>> 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.
> 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.
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.