Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • gtk gtk
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 1.6k
    • Issues 1.6k
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 300
    • Merge requests 300
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • gtkgtk
  • Issues
  • #5976

`GtkRange` with `Adjustment:page-size` <> 0 causes highlight to be drawn to wrong position / behind slider value

I know :page-size is probably not hugely relevant for GtkScale, but it does introduce a drawing difference between GTK3 and GTK4, in case that indicates something larger needing fixed - which I guess it does, since the snapshot code drawing the highlight lives in GtkRange.

If a Scale has page-size set, that causes the usable/slider range to be decreased towards the max, by the page-size. Strange, but OK!

In GTK4 though, this also causes the highlight that gets drawn to lag behind the slider handle by an amount proportional to the value (not constant).

GTK3: image

GTK4: image

I guess this should work the same in both versions, even if it is a bit weird/pointless for GtkScale; it might be relevant for other GtkRange subclasses.

Test UI file:

<interface>
	<object class="GtkAdjustment" id="adjustment">
		<property name="lower">0</property>
		<property name="upper">100</property>
		<property name="step-increment">1</property>
		<property name="page-increment">19</property>
		<property name="page-size">25</property>
		<property name="value">50</property>
	</object>

	<object class="GtkWindow">
		<child>
			<object class="GtkScale">
				<property name="visible">true</property>
				<property name="draw-value">true</property>
				<property name="value-pos">right</property>
				<property name="adjustment">adjustment</property>
			</object>
		</child>
	</object>
</interface>
Edited Jul 23, 2023 by Daniel Boles
Assignee
Assign to
Time tracking