Bug 221235

Summary: Webslice widget is only square and bad for rectangle content
Product: [Unmaintained] plasma4 Reporter: Pascal d'Hermilly <pascal>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: wishlist CC: flying-sheep, pascal, sebas
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 4.6.1
Sentry Crash Report:

Description Pascal d'Hermilly 2010-01-04 13:41:01 UTC
Version:           4.4 beta 2 (using Devel)
OS:                Linux
Installed from:    Compiled sources

The webslice widget has problems with showing non-square slices.
These are inside the widget and a lot of the widgets space is wasted. The solution is to make the widget a customizable rectangle.

E.g.
url: http://www.version2.dk/
object: #layout-main
Comment 1 Sebastian Kügler 2010-01-04 14:38:01 UTC
You can correct the aspect ratio by resizing with the control key pressed.
Comment 2 Pascal d'Hermilly 2010-01-04 14:58:11 UTC
Thank you, I didn't know that. 
It seems to me that making the widget fit the object's aspect ratio would be a good idea.
Comment 3 Philipp A. 2010-10-07 21:14:18 UTC
good workaround for insiders, but the best would be an exclusive option (radio buttons):
o fit width (vertical scrolling if the element is too high)
o fit height (horizontal scrolling if the element is too wide)
o fit width and height (fixed aspect ratio)

the square as standard aspect ratio and the strg-resizing is a rather random and counter-intuitive workaround:

also good would be a text field for a custom stylesheet which can be used e.g. to make the background of the element transparent or to remove borders.
Comment 4 Pascal Mages 2010-12-24 10:23:13 UTC
I agree with the other posters. The square as standard aspect ratio and the strg-resizing is a rather random and counter-intuitive. Other Plasmoids I use are not defaulting to a certain aspect ratio that can be overridden by strg-resize.

Automatically detecting the correct aspect ratio and size would be cool!
Comment 5 Sebastian Kügler 2011-01-27 03:14:29 UTC
SVN commit 1217394 by sebas:

Refactor kgraphicswebslice

With this larger update, we tie down the whole setup process, and waste
a lot less cycles resizing.

In particular:
- zoom method: zooms to specific slice
- less unnecessary resizing (still room for improvement)
- make switching between preview and slice mode work
- fix slice geometry for previews and slice modes
- cache geometries: faster and less dicking around with zoomFactor
- Make applet freely resizable: no fixed aspect mode anymore
- Resizing is also a lot faster now

Cleanup pending.

BUG:221235

 M  +344 -40   kgraphicswebslice.cpp  
 M  +20 -16    kgraphicswebslice.h  
 M  +39 -28    plasma/webslice.cpp  
 M  +5 -2      plasma/webslice.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1217394
Comment 6 Pascal Mages 2011-01-27 06:24:58 UTC
Great! Thanks for your work and improving the web slice widget. Looking forward to see it land in my distro. :)
Comment 7 Sebastian Kügler 2011-01-27 20:28:51 UTC
SVN commit 1217531 by sebas:

Usability and performance improvements webslice applet

In particular:
- Turn the lineedit into an editable combobox showing some of the more interesting elements (those with an id attached)
- Add a reload button to load a newly selected page, repopulate the elements dropdown after load is finished
- Show the full page zoomed out while configuring, and paint a mask highlighting the currently selected element over it
- Fix cyclic resizing problems that lead to huge performance problems while resizing
- No more fixed aspect ratio (#221235)
- Compress resize events per 100ms to make resizing smoother
- Fix picking up config changes by the slice
- Cache slice geometry, by basing the geometries on the original geometry of the elements, we get much more precise viewports, it also saves a lot of dicking around with the current zoomFactor
- (No string changes)

backported from trunk r1217392 - r1217400, OK'ed on plasma-devel

BUG:221235
FIXED-IN:4.6.1


 M  +174 -100  kgraphicswebslice.cpp  
 M  +60 -31    kgraphicswebslice.h  
 M  +92 -66    plasma/webslice.cpp  
 M  +9 -5      plasma/webslice.h  
 M  +24 -6     plasma/websliceConfig.ui  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1217531