[Okular-devel] Review Request 115283: implemented a feature in okular to resize window to current page size.

Albert Astals Cid aacid at kde.org
Fri Jan 24 19:24:11 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/115283/#review48238
-----------------------------------------------------------


I don't think there's any problem with resizing, i'd say it's only your math that is wrong
    int xOffset = pageViewSize.width() - pageSize.width();
    int yOffset = pageViewSize.height() - pageSize.height();
    resize( width() - xOffset, height() - yOffset );
seems to be what you should really be doing, it doesn't perfectly work, but it may just be because the sizes you're using are not the correct.

Also I think this feature only makes sense when you're in non continuous view.



part.h
<https://git.reviewboard.kde.org/r/115283/#comment34126>

    const & in both params



part.h
<https://git.reviewboard.kde.org/r/115283/#comment34127>

    spacing is off



part.cpp
<https://git.reviewboard.kde.org/r/115283/#comment34128>

    can't you just use size() ?



part.rc
<https://git.reviewboard.kde.org/r/115283/#comment34132>

    You need to increaase the version



part.rc
<https://git.reviewboard.kde.org/r/115283/#comment34133>

    You should add some code somewhere to enable/disable the action only then there's a document open



shell/shell.cpp
<https://git.reviewboard.kde.org/r/115283/#comment34129>

    const & in both params



ui/pageview.h
<https://git.reviewboard.kde.org/r/115283/#comment34130>

    this can probably be const



ui/pageview.cpp
<https://git.reviewboard.kde.org/r/115283/#comment34131>

    this for loop needs spacing and {}, actually you may even use a foreach and save yourself the need to declare the iterators


- Albert Astals Cid


On Jan. 24, 2014, 7:50 a.m., Saheb Preet Singh wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/115283/
> -----------------------------------------------------------
> 
> (Updated Jan. 24, 2014, 7:50 a.m.)
> 
> 
> Review request for Okular and Albert Astals Cid.
> 
> 
> Bugs: 326844
>     http://bugs.kde.org/show_bug.cgi?id=326844
> 
> 
> Repository: okular
> 
> 
> Description
> -------
> 
> okular do not have a feature to resize the current window to the current page size.
> 
> The bug is solved upto some extent, the window is resizing as desired.
> 
> resize method of qwidget class is used to resize the window.
> 
> The window is resizing  as required but sometimes it doesn't resizes . It has to be moved by mouse and then again click on the button in the menu to resize the window again.  Once it is moved by mouse, it works fine. Now, when the zoom level is changed, the problem starts again.
> 
> I think the problem occurs due to something happening in the other portion of the code.
> 
> I searched about it on the internet and nobody was able to answer the solution to people with same problem. There are some alternative solutions to the problem:-
> 
> ==> Use set geometry instead of resize which works fine. but would have to be taken care of the size of the screen and the original position of the window. Also, repainting the portion outside the window when the window is resized to a smaller window.
> 
> ==> Use a timer which will signal a slot which in turn will resize the window, but that might require qsignalmapper to map the width and height to the slot. ( I didn't tried this solution ).
> 
> The best solution i could find on the internet is this http://qt-project.org/forums/viewthread/25648
> 
> Also, there is one more issue, the fit window to page button in the view menu is enabled by default. It should not be enabled when no document is open. Where should the code for enabling this button should be implemented.
> 
> 
> Diffs
> -----
> 
>   part.h 4b3aafd 
>   part.cpp 88e2c41 
>   part.rc 6b1f44e 
>   shell/shell.h c065c56 
>   shell/shell.cpp 1708501 
>   ui/pageview.h 9c15af6 
>   ui/pageview.cpp 65967bf 
> 
> Diff: https://git.reviewboard.kde.org/r/115283/diff/
> 
> 
> Testing
> -------
> 
> 
> tested when
> ==> window is maximized and restored.
> ==> thumbnails, table of content are opened and closed.
> ==> various toolbars are shown and hidden.
> ==> for all the zoom levels shown in the toolbar and custom zoom level ( example 123.23% ).
> 
> 
> Thanks,
> 
> Saheb Preet Singh
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20140124/32a49572/attachment-0001.html>


More information about the Okular-devel mailing list