|
@@ -123,7 +123,6 @@ namespace GtkCommonMark {
|
|
|
|
|
|
protected virtual void on_widget_embedded(MarkdownViewEmbeddedWidgetHost host, NodeInfo node) {
|
|
protected virtual void on_widget_embedded(MarkdownViewEmbeddedWidgetHost host, NodeInfo node) {
|
|
host.set_available_width(calculate_embed_size(allocated_width));
|
|
host.set_available_width(calculate_embed_size(allocated_width));
|
|
- available_size_for_embed_changed.connect(w => host.set_available_width(w));
|
|
|
|
if(node.node_type == NodeType.IMAGE) {
|
|
if(node.node_type == NodeType.IMAGE) {
|
|
widget_embedded(host, node.url, node.title);
|
|
widget_embedded(host, node.url, node.title);
|
|
}
|
|
}
|
|
@@ -153,7 +152,15 @@ namespace GtkCommonMark {
|
|
return width - tag_manager.page_margin * 2;
|
|
return width - tag_manager.page_margin * 2;
|
|
}
|
|
}
|
|
|
|
|
|
- private signal void available_size_for_embed_changed(int width);
|
|
|
|
|
|
+ private void available_size_for_embed_changed(int width) {
|
|
|
|
+ var children = observe_children();
|
|
|
|
+ for(uint i = 0; i < children.get_n_items(); i++){
|
|
|
|
+ var child = children.get_item(i);
|
|
|
|
+ if(child is MarkdownViewEmbeddedWidgetHost) {
|
|
|
|
+ child.set_available_width(width);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|