Skip to content

Commit

Permalink
Fixed|LogWidget|libappfw: Scroll position stays fixed when not at bottom
Browse files Browse the repository at this point in the history
When new entries appear in the log, the scroll position should remain
stationary if the view is not at the bottom. Otherwise reading the
entries in the log is difficult.
  • Loading branch information
skyjake committed Oct 17, 2015
1 parent 2037258 commit 4635d9a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions doomsday/sdk/libappfw/src/widgets/logwidget.cpp
Expand Up @@ -13,7 +13,7 @@
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this program; if not, see:
* http://www.gnu.org/licenses</small>
* http://www.gnu.org/licenses</small>
*/

#include "de/LogWidget"
Expand Down Expand Up @@ -399,7 +399,7 @@ public Font::RichFormat::IStyle
}

void updateStyle()
{
{
Style const &st = style();

font = &self.font();
Expand Down Expand Up @@ -531,6 +531,11 @@ public Font::RichFormat::IStyle
// TODO: If content height changes below the visible range, we should adjust
// the current scroll position so that the entries don't change position
// inside the view.

if(!self.isAtBottom())
{
self.scrollPositionY().shift(delta);
}
}

void fetchNewCachedEntries()
Expand Down Expand Up @@ -734,7 +739,7 @@ public Font::RichFormat::IStyle
// available for drawing.
if(heightDelta)
{
modifyContentHeight(heightDelta);
modifyContentHeight(heightDelta);
if(needHeightNotify && heightDelta > 0)
{
emit self.contentHeightIncreased(heightDelta);
Expand Down

0 comments on commit 4635d9a

Please sign in to comment.