summaryrefslogtreecommitdiff
path: root/gtk/gtkrange.c
Commit message (Collapse)AuthorAgeFilesLines
* snapshot: Convert Range, Scale, ColorScaleBenjamin Otte2016-12-201-20/+18
| | | | And of course Scrollbar, but that one does no drawing itself.
* Use Unicode in translatable stringsPiotr Drąg2016-12-191-2/+2
| | | | | | See https://developer.gnome.org/hig/stable/typography.html https://bugzilla.gnome.org/show_bug.cgi?id=772371
* snapshot: Add a snapshot function to GtkCssCustomGadgetBenjamin Otte2016-11-151-0/+4
|
* range: Don't leak pointers to discarded gadgetsBenjamin Otte2016-11-081-0/+4
|
* range: Use gdk_window_new_input()Benjamin Otte2016-11-061-27/+11
|
* widget: Use ::measure vfunc to measure sizeTimm Bäder2016-10-221-33/+15
| | | | | | | | 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.
* Remove a few more unused style propertiesTimm Bäder2016-10-161-84/+0
|
* Remove various sizing related style propertiesTimm Bäder2016-10-161-49/+0
|
* range: Remove min slider size setter/getterTimm Bäder2016-10-161-78/+2
|
* range: Ensure we don't underallocate the highlight gadgetMatthias Clasen2016-09-041-6/+16
| | | | | | This was causing warnings in HighContrast. https://bugzilla.gnome.org/show_bug.cgi?id=770614
* Use NULL for generic marshallers in g_signal_new()Benjamin Otte2016-08-291-3/+3
| | | | | glib will use the correct marshaller automatically. And as a side effect, we also get all glib optimizations, like a va marshaller.
* Ensure that GtkRange allocates enough space for the valueMatthias Clasen2016-06-071-0/+11
| | | | | | | | 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
* range: Free gadgets in finalizeMatthias Clasen2016-06-051-15/+26
| | | | This is the right place for this.
* range: Properly indent closing braceTimm Bäder2016-05-301-1/+1
| | | | Make sure it's obvious what if block it belongs to.
* Remove useless casts from gdk_event_triggers_context_menu callsTimm Bäder2016-05-121-1/+1
|
* box gadget: Redo expand flag handlingMatthias Clasen2016-04-281-9/+2
| | | | | | | | | | | | | | | | | 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
* range: use gadget pointers for grab/mouse locationsCosimo Cecchi2016-03-261-150/+103
| | | | Simplify code and remove the mouse location indirection.
* range: Simplify highlight allocationMatthias Clasen2016-03-261-2/+0
| | | | | | | 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.
* range: Avoid miscalculating highlight allocationMatthias Clasen2016-03-261-2/+2
| | | | | | | | | | | | 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
* range: Fix a few typosTimm Bäder2016-03-111-4/+4
| | | | | Depreacated -> Deprecated through -> trough
* colorscale: Draw a troughBenjamin Otte2016-03-111-5/+7
| | | | Make sure the color info is actually drawn inside the trough.
* range: Fix trough clickabilityMatthias Clasen2016-03-111-1/+15
| | | | | | | 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.
* range: Fix gadget state propagationMatthias Clasen2016-03-091-0/+4
| | | | | | | 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.
* range: remove unneeded gtk_widget_queue_draw()Cosimo Cecchi2016-03-061-1/+0
|
* range: rename functionCosimo Cecchi2016-03-061-13/+13
| | | | The function queues an allocation now, not a draw.
* range: remove duplicated codeCosimo Cecchi2016-03-061-2/+0
| | | | This is already called by range_grab_add().
* scale: port scale values to gadgetsCosimo Cecchi2016-03-061-0/+6
| | | | | | 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.
* range: simplify calculationCosimo Cecchi2016-03-051-1/+1
|
* range: move declarations to inner blockCosimo Cecchi2016-03-051-8/+14
| | | | Where they're needed.
* range: use a fixed offset for mark "snap" sizeCosimo Cecchi2016-03-051-3/+2
| | | | Instead of making it dependent on the slider size.
* Revert "range: use border box for slider area"Cosimo Cecchi2016-03-051-6/+6
| | | | | | Since it causes problems with event coordinates. This reverts commit 0883ff5eedf73b1197f2a49fb7e55ce227917335.
* range: avoid setting slider coordinates to negative numbersCosimo Cecchi2016-03-041-4/+4
| | | | | This can happen if the theme sets a negative margin, but the coordinate should never be negative.
* range: factor out a functionCosimo Cecchi2016-03-041-34/+24
| | | | We're going to modify this in the next commit.
* range: fix warning for gadget sliderCosimo Cecchi2016-03-041-1/+1
| | | | The slider is not HFW/WFH - just pass -1 to get rid of the warnings.
* range: add positional style classes to fill/highlightCosimo Cecchi2016-03-041-14/+78
| | | | Requested by Lapo.
* range: use border allocation for gadget hit testCosimo Cecchi2016-03-021-6/+6
| | | | | The border is typically part of the reactive part of the widget. This matches the pre-gadget behavior.
* range: Don't leave css nodes behindMatthias Clasen2016-03-011-1/+6
| | | | | | 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.
* range: fix fill level for vertical inverted scalesCosimo Cecchi2016-02-291-1/+1
|
* range: draw slider on top of all contentsCosimo Cecchi2016-02-291-8/+4
| | | | This is so that e.g. the focus ring is drawn under the slider.
* range: better hack for GtkColorScaleCosimo Cecchi2016-02-291-16/+5
| | | | | Just draw the slider, since that is the only thing GtkColorScale cares about.
* range: deprecate gtk_range_get/set_min_slider_size()Cosimo Cecchi2016-02-291-0/+6
| | | | Nothing uses these functions inside GTK anymore.
* range: don't use gtk_range_set_min_slider_size()Cosimo Cecchi2016-02-291-11/+33
| | | | | | | | | | The way this method is used from the GtkRange subclasses doesn't really work well when the slider properties change as a consequence of e.g. a style class being applied (e.g. the fine-tune style class). In fact, there's no need to read the minimum slider size out of band, and we can obtain the same result in a way that always work by setting a private property on GtkRange.
* range: use border box for slider areaCosimo Cecchi2016-02-291-6/+6
| | | | | | Since we can use negative margins, we should not use the margin box for the slider area. Use the border box instead, since that's what is typically mapped to the visible area.
* range: use new GtkCssGadget API instead of rolling our ownCosimo Cecchi2016-02-291-34/+10
|
* range: simplify codeCosimo Cecchi2016-02-291-10/+1
| | | | | Instead of directly accessing the widget allocation, we can use the gadget API to test whether the coordinates are in the main gadget.
* range: add a gadget for the whole widget areaCosimo Cecchi2016-02-291-38/+110
| | | | | | This commit introduces another node, called "contents", that holds the main contents of the range. This allows for the main gadget itself to span across the whole surface of the widget now.
* scale: always add marks at the beginning or the endCosimo Cecchi2016-02-291-6/+0
| | | | Marks are always either the first or the last child of the scale.
* range: use new GtkBoxGadget API instead of counting childrenCosimo Cecchi2016-02-291-17/+9
|
* range: use new GtkBoxGadget API instead of removing/insertingCosimo Cecchi2016-02-291-12/+8
|
* range: move slider drawing where it belongsCosimo Cecchi2016-02-291-2/+2
| | | | | The slider gadget is a child of the trough gadget, so draw it from there.