Commit Graph

431 Commits

Author SHA1 Message Date
Timm Bäder
6e74975e41 range: make the slider a gadget 2017-07-19 21:27:12 -04:00
Timm Bäder
ba6ba94184 range: Use gizmos for highlight and fill gadgets 2017-07-19 21:27:12 -04:00
Timm Bäder
395185896f range: Use a gizmo as trough 2017-07-19 21:27:12 -04:00
Timm Bäder
90cc401f1a range: Remove contents gadget
It's not needed anymore since the range only has one child gadget: the
trough.
2017-07-19 21:27:12 -04:00
Timm Bäder
7e525ca63b range: Remove steppers
Add them back into the new scrollbars later
2017-07-19 21:27:12 -04:00
Timm Bäder
5049b35fc6 range: Make GtkRange a regular class 2017-07-19 21:27:12 -04:00
Timm Bäder
9e79684762 range: Remove gadget completely 2017-07-19 21:27:12 -04:00
Timm Bäder
1d782b8930 scale: Fix value position
by not using the range's gadget which is not allocated to any position
anymore.
2017-07-19 21:27:12 -04:00
Timm Bäder
bb7b1c56ae range: Remove gadget usage 2017-07-19 21:27:11 -04:00
Carlos Garnacho
c14e6a5119 gtkrange: Remove event window
This is not necessary anymore to receive input events.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
a72404dd5a gtk: Mass delete all GtkWidget event mask API
We now rely on toplevels receiving and forwarding all the events
the windowing should be able to handle. Event masks are no longer a
way to determine whether an event is deliverable ot a widget.

Events will always be delivered in the three captured/target/bubbled
phases, widgets can now just attach GtkEventControllers and let those
handle the events.
2017-05-25 16:25:58 +02:00
Daniel Boles
db7ff6d88a Range: Remove leftover comment about update policy
Update policies were removed way back in 2011… in
commit c43a31ea33
2017-02-27 20:05:37 +00:00
Benjamin Otte
0dbdf0c428 gadget: Remove gtk_css_gadget_draw()
And with it, remove the draw func from custom gadgets, that has been
NULL everywhere.

All gadgets are snapshot now.
2016-12-20 18:01:12 +01:00
Benjamin Otte
81297857cc snapshot: Convert Range, Scale, ColorScale
And of course Scrollbar, but that one does no drawing itself.
2016-12-20 18:01:11 +01:00
Piotr Drąg
a2da4ddceb Use Unicode in translatable strings
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772371
2016-12-19 15:08:10 -05:00
Benjamin Otte
da207c9fdd snapshot: Add a snapshot function to GtkCssCustomGadget 2016-11-15 17:48:45 +01:00
Benjamin Otte
c16a7d96b8 range: Don't leak pointers to discarded gadgets 2016-11-08 02:32:40 +01:00
Benjamin Otte
13d8ac83ee range: Use gdk_window_new_input() 2016-11-06 23:46:44 +01:00
Timm Bäder
9992a616ef widget: Use ::measure vfunc to measure size
Add a new ::measure vfunc similar to GtkCssGadget's that widget
implementations have to override instead of the old get_preferred_width,
get_preferred_height, get_preferred_width_for_height,
get_preferred_height_for_width and
get_preferred_height_and_baseline_for_width.
2016-10-22 19:05:47 +02:00
Timm Bäder
3c901d6376 Remove a few more unused style properties 2016-10-16 18:17:21 +02:00
Timm Bäder
601839c825 Remove various sizing related style properties 2016-10-16 18:17:21 +02:00
Timm Bäder
efffa3b6bd range: Remove min slider size setter/getter 2016-10-16 18:17:21 +02:00
Matthias Clasen
5b21c7d79f range: Ensure we don't underallocate the highlight gadget
This was causing warnings in HighContrast.

https://bugzilla.gnome.org/show_bug.cgi?id=770614
2016-09-04 09:43:51 -04:00
Benjamin Otte
e1a03ead7a Use NULL for generic marshallers in g_signal_new()
glib will use the correct marshaller automatically. And as a side
effect, we also get all glib optimizations, like a va marshaller.
2016-08-29 16:20:54 +02:00
Matthias Clasen
7f06f2818a Ensure that GtkRange allocates enough space for the value
This is a long-standing problem of GtkScale.

https://bugzilla.gnome.org/show_bug.cgi?id=766372
https://bugzilla.gnome.org/show_bug.cgi?id=578626
https://bugzilla.gnome.org/show_bug.cgi?id=79229
2016-06-07 21:28:44 -04:00
Matthias Clasen
9a8335a135 range: Free gadgets in finalize
This is the right place for this.
2016-06-05 20:00:43 -04:00
Timm Bäder
6301827dac range: Properly indent closing brace
Make sure it's obvious what if block it belongs to.
2016-05-30 19:15:49 +02:00
Timm Bäder
301652de1f Remove useless casts from gdk_event_triggers_context_menu calls 2016-05-12 20:39:51 +02:00
Matthias Clasen
2148708917 box gadget: Redo expand flag handling
We only keep one align flag per child, so it seems odd to
keep separate h/v expand flags. Just keep one expand flag
and interpret it according to orientation. Allow setting
the expand flag for child widgets too, though, so we can
make widget expand without interfering with the recursive
widget expand flag.

Update all callers.

Use the new possibility of expanding child widgets to make
the label of check and radio buttons expand. This fixes
unexpected behavior of these widgets in RTL in some places.

https://bugzilla.gnome.org/show_bug.cgi?id=765742
2016-04-28 21:59:34 -04:00
Cosimo Cecchi
9f48b6b07a range: use gadget pointers for grab/mouse locations
Simplify code and remove the mouse location indirection.
2016-03-26 22:43:53 -07:00
Matthias Clasen
7fe1037e84 range: Simplify highlight allocation
Since we are really only interested in the center point of the
slider allocation, the pre-computed slider geometry is perfectly
fine, just use it always. This avoids the complication with
gadget visibility.
2016-03-26 13:50:42 -04:00
Matthias Clasen
e33188ad41 range: Avoid miscalculating highlight allocation
The slider gadget may be turned invisible as side-effect of
gtk_range_calc_slider(). If that happens,
gtk_css_gadget_get_content_allocation() returns { 0, 0, 0, 0},
which leads us to calculate a negative allocation for the highlight
node. Avoid this, by just reusing our already calculated slider
allocation in this case (it is not technically the same as the
content, allocation, but the difference hardly matter here.

https://bugzilla.gnome.org/show_bug.cgi?id=764022
2016-03-26 10:50:00 -04:00
Timm Bäder
4b0abc13e3 range: Fix a few typos
Depreacated -> Deprecated
through -> trough
2016-03-11 19:18:07 +01:00
Benjamin Otte
fc7335bdb4 colorscale: Draw a trough
Make sure the color info is actually drawn inside the trough.
2016-03-11 16:39:34 +01:00
Matthias Clasen
1d19065979 range: Fix trough clickability
We previously considered any click inside the trough if it
hit an area that the slider might cover. Bring this behavior
back; the trough of scales is otherwise just too narrow to
hit easily with a click.
2016-03-11 01:27:21 -05:00
Matthias Clasen
fa48dbf1a5 range: Fix gadget state propagation
The contents node was not getting state updates at all, and the
trough node was missing some state updates as well, because we
were not calling update_trough_state() in all the places where
it is needed.
2016-03-09 14:15:40 -05:00
Cosimo Cecchi
9509bbb4a1 range: remove unneeded gtk_widget_queue_draw() 2016-03-06 11:10:44 -08:00
Cosimo Cecchi
c4615eff7b range: rename function
The function queues an allocation now, not a draw.
2016-03-06 11:10:44 -08:00
Cosimo Cecchi
de1c4bad6f range: remove duplicated code
This is already called by range_grab_add().
2016-03-06 11:10:44 -08:00
Cosimo Cecchi
a9b50b6f69 scale: port scale values to gadgets
And add a default color like it was before.
This also fixes other issues with scale values interacting with scale
mark labels, which were buggy at least since 3.18.
2016-03-06 11:09:46 -08:00
Cosimo Cecchi
27a6183b98 range: simplify calculation 2016-03-05 19:09:18 -08:00
Cosimo Cecchi
8242182404 range: move declarations to inner block
Where they're needed.
2016-03-05 19:09:18 -08:00
Cosimo Cecchi
990bd03c35 range: use a fixed offset for mark "snap" size
Instead of making it dependent on the slider size.
2016-03-05 19:09:18 -08:00
Cosimo Cecchi
6efe1f411a Revert "range: use border box for slider area"
Since it causes problems with event coordinates.

This reverts commit 0883ff5eed.
2016-03-05 19:09:18 -08:00
Cosimo Cecchi
f3e068bb31 range: avoid setting slider coordinates to negative numbers
This can happen if the theme sets a negative margin, but the coordinate
should never be negative.
2016-03-04 18:13:53 -08:00
Cosimo Cecchi
fce344d31f range: factor out a function
We're going to modify this in the next commit.
2016-03-04 18:13:53 -08:00
Cosimo Cecchi
5a42c2e478 range: fix warning for gadget slider
The slider is not HFW/WFH - just pass -1 to get rid of the warnings.
2016-03-04 17:28:53 -08:00
Cosimo Cecchi
7ff2f451ce range: add positional style classes to fill/highlight
Requested by Lapo.
2016-03-04 11:57:31 -08:00
Cosimo Cecchi
8ebc03a1d1 range: use border allocation for gadget hit test
The border is typically part of the reactive part of the widget. This
matches the pre-gadget behavior.
2016-03-02 22:23:11 -08:00
Matthias Clasen
cb614cc838 range: Don't leave css nodes behind
We create and destroy gadgets inside the range hierarchy here,
and if we don't explicitly remove their CSS nodes from the parent,
they stick around.
2016-03-01 15:48:01 -05:00