[GUI] indentation_step_size vs data width
Moderator: Forum Moderators
-
- Posts: 1266
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
[GUI] indentation_step_size vs data width
Using a combination of text_alignment, linked_group, and indentation_step_size, I finally got (some of) my tree_view data lined up the way I want it.
The problem I'm running into appears to be that when the data in data_label is narrow enough, somehow relative to the indentation_step_size, wesnoth crashes.
I guess I could try to look for a way to pad the data so it's always wide enough? But I don't know how (just append a bunch of spaces???), and I don't know exactly what is being compared (the issue sure seems related to the width of the data, but the width is always >= indent, so clearly(?) they're not being measured in the same units) so I don't know what needs to be adjusted until something breaks.
I'm also a bit confused as to why the width of the data cares how deeply it is indented in the first place?
Code: Select all
T.row {
T.column { T.grid { T.row {
T.column { T.tree_view { id = "unit_info_traits",
indentation_step_size = 40,
T.node { id = "header_node",
T.node_definition { T.row { T.column { T.label { id = "header_label", text_alignment = "left", linked_group = "header_label" } } } }
},
T.node { id = "data_node",
T.node_definition { T.row { T.column { T.label { id = "data_label", text_alignment = "left", linked_group = "header_label" } } } }
} } } } } }
},
T.row {
T.column { T.grid { T.row {
T.column { T.tree_view { id = "unit_info_abilities",
indentation_step_size = 40,
T.node { id = "header_node",
T.node_definition { T.row { T.column { T.label { id = "header_label", text_alignment = "left", linked_group = "header_label" } } } }
},
T.node { id = "data_node",
T.node_definition { T.row { T.column { T.label { id = "data_label", text_alignment = "left", linked_group = "header_label"} } } }
} } } } } }
}
Code: Select all
wesnoth: src/gui/widgets/tree_view_node.cpp:580: unsigned int gui2::tree_view_node::place(unsigned int, point, unsigned int): Assertion `width >= indentation_step_size' failed.
Abort(coredump)
I'm also a bit confused as to why the width of the data cares how deeply it is indented in the first place?
Speak softly, and carry Doombringer.
- Celtic_Minstrel
- Developer
- Posts: 2263
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: [GUI] indentation_step_size vs data width
This also sounds like a bug.
(I'll refrain from asking why you're not using a unit preview pane.)
(I'll refrain from asking why you're not using a unit preview pane.)
-
- Posts: 1266
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: [GUI] indentation_step_size vs data width
unit preview pane? Sounds interesting, but I don't know what it is.
Speak softly, and carry Doombringer.
- Celtic_Minstrel
- Developer
- Posts: 2263
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: [GUI] indentation_step_size vs data width
It's one of the available widgets you can choose from.
-
- Posts: 1266
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: [GUI] indentation_step_size vs data width
Oh that is just extremely cool.
I was actually looking at unit_recall.cfg earlier, hoping I could steal something, but missed that part.
Would be nice if the tooltips worked like they do in the recall menu (smaller font, better position). I've searched for a way to do that but no luck. And I need find a way to fix its size, or at least limit its growth, and give it a scrollbar.
I was actually looking at unit_recall.cfg earlier, hoping I could steal something, but missed that part.
Would be nice if the tooltips worked like they do in the recall menu (smaller font, better position). I've searched for a way to do that but no luck. And I need find a way to fix its size, or at least limit its growth, and give it a scrollbar.
Speak softly, and carry Doombringer.