• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
  • tools
  • whatsinteresting
  • qml
ScrollBar.qml
Go to the documentation of this file.
1 /***************************************************************************
2  * *
3  * This program is free software; you can redistribute it and/or modify *
4  * it under the terms of the GNU General Public License as published by *
5  * the Free Software Foundation; either version 2 of the License, or *
6  * (at your option) any later version. *
7  * *
8  ***************************************************************************/
9 
15 import QtQuick 1.0
16 
17 Rectangle {
18  // The flickable to which the scrollbar is attached to, must be set
19  property variant flickable
20 
21  // If set to false, scrollbar is visible even when not scrolling
22  property bool hideScrollBarsWhenStopped: true
23 
24  // Thickness of the scrollbar, in pixels
25  property int scrollbarWidth: 10
26 
27  color: "gray"
28  radius: width/2
29 
30  function sbOpacity()
31  {
32  if (!hideScrollBarsWhenStopped || height < parent.height)
33  {
34  return 0.5;
35  }
36 
37  return (flickable.flicking || flickable.moving) ? (height >= parent.height ? 0 : 0.5) : 0;
38  }
39 
40  // Scrollbar appears automatically when content is bigger than the Flickable
41  opacity: sbOpacity()
42 
43  width: scrollbarWidth
44  height: flickable.visibleArea.heightRatio * parent.height
45  x: parent.width - width
46  y: flickable.visibleArea.yPosition * parent.height
47 
48  // Animate scrollbar appearing/disappearing
49  Behavior on opacity { NumberAnimation { duration: 200 }}
50 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal