Currently, I have my WebKit.WebView in a ScrolledWindow, because otherwise my window would resize to fir the content. In stead, I would like the content to adjust to the container. So text should wrap, in stead of running straight through and resizing the window. A horizontal scroll bar meant to be there, but not a horizontal one.
1 Answer
You would have to apply a custom stylesheet to all pages, which set the max-width of everything in the page to 100%. If you control all the content being displayed in there, set html,body { max-width: 100%; } in your CSS. If you don't control all the content displayed in your web view, then you will have to allow the horizontal scroll bar to be shown when needed, otherwise you will break pages that need it.
-
Really? That sucks :/ Any idea how I can apply a custom style sheet? Do I have to add the style tags and stuff myself, or is there a specific function for this in the WebView widget?– RobinJJun 29, 2012 at 21:51
-
WebKit has API to inject CSS or JavaScript into the DOM, but I don't recall what the exact API is at the moment, or if it is available through the GI (gobject-introspection) bindings.– dobeyJun 29, 2012 at 21:56
-
-
@Hernantz yes it is, but all the API is not fully exposed in the GI bindings.– dobeyJun 30, 2012 at 14:49