Re: Reduce the size of a GtkScale indicator
- From: Stefan Salewski <mail ssalewski de>
- To: Bas Wassink <b wassink ziggo nl>, gtk-app-devel-list <gtk-app-devel-list gnome org>
- Subject: Re: Reduce the size of a GtkScale indicator
- Date: Thu, 29 Mar 2018 21:19:46 +0200
On Thu, 2018-03-29 at 18:02 +0200, Bas Wassink wrote:
Any hints?
https://developer.gnome.org/gtk3/stable/chap-css-overview.html
grep -A100 GtkScale ~/.config/gtk-3.0/gtk-default.css
Well, I do provide a colored label example at
https://github.com/StefanSalewski/gintro
Starting from that one, it is easy to get a really big slider:
import gintro/[gtk, glib, gobject, gio]
proc appActivate(app: Application) =
let window = newApplicationWindow(app)
let scale = newScaleWithRange(Orientation.horizontal, 0.0, 100.0, 10.0)
let cssProvider = newCssProvider()
let data = "scale slider {min-width: 32pt; min-height: 32pt;}"
discard cssProvider.loadFromData(data)
let styleContext = scale.getStyleContext
assert styleContext != nil
addProvider(styleContext, cssProvider, STYLE_PROVIDER_PRIORITY_USER)
window.add(scale)
showAll(window)
proc main =
let app = newApplication("org.gtk.example")
connect(app, "activate", appActivate)
discard run(app)
main()
Yes, I know you want a tiny one. But setting nim-width, min-height to
small values does not decrease size, which is not really surprising, as
that are min and max values. So we have to search for other properties
-- maybe Mr Bassi or Mr Bader will tell us.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]