Commit Graph

304 Commits

Author SHA1 Message Date
Benjamin Otte
1c9fdc1f1f range: Changing the min slider size requires a resize 2014-11-29 03:42:28 +01:00
Benjamin Otte
c80c7f7792 range: No need to frce a recalc
A resize will already trigger a recalc, so no need to explicitly trigger
it.
2014-11-29 03:42:28 +01:00
Benjamin Otte
11233678d9 range: Remove unnecessary argument
It's always the same value passed in, so just use that value directly.
2014-11-26 13:53:57 +01:00
Benjamin Otte
230aa99967 range: Query slider position instead of updating it
We're updating it later in the function, there's no need to do it here.
2014-11-26 13:53:57 +01:00
Benjamin Otte
7193043f7d gtkrange: Fix copy/paste error
When factoring out a function in
b88584e7ba I forgot to adapt these values.
2014-11-26 13:53:57 +01:00
Benjamin Otte
98da1ddfe2 range: Setting stepper visibility requires a restyle 2014-11-26 13:53:57 +01:00
Benjamin Otte
c0123ae20e range: Don't duplicate work
The adjustment value being equal is checked by
gtk_adjustment_set_value() and the necessity of calc_layout() is handled
by the value_changed signal handler.
2014-11-25 19:19:12 +01:00
Benjamin Otte
06150aa517 range: Don't invalidate layout when computing marks
We now have a function to compute a slider position. Use that one
instead.
2014-11-25 19:19:12 +01:00
Benjamin Otte
b88584e7ba range: Split out a function
The position of a slider for a given value is something we care a
lot about and jump through hoops to get. See next commit for example.
2014-11-25 19:19:12 +01:00
Benjamin Otte
daabd0436f range: Remove 2 variables
Instead, compute their value on-demand.
2014-11-25 19:19:12 +01:00
Benjamin Otte
447a439145 range: Remove unused variable 2014-11-25 19:19:12 +01:00
Benjamin Otte
addcb7137e range: Simplify defines
- Delete unused defines
- Don't have 2 defines that are multiplied later
2014-11-25 19:19:12 +01:00
Benjamin Otte
51f5433170 range: Deprecate detail strings in class struct
... and stop setting them.
2014-11-25 19:19:12 +01:00
Benjamin Otte
0d1395d07f range: Remove unused detail quarks 2014-11-25 19:19:11 +01:00
Benjamin Otte
e7f2239cbb range: Remove unused variable 2014-11-25 19:19:11 +01:00
Lapo Calamandrei
5108a27e6c gtkrange: consider css margin on the slider
Css margin now works on the slider as they do on the trough.
The margin is not considered in the space allocation as it is for
the trough, so the slider width will be the set slider-width -
margins. Spefifying margins on the main widget in the css will
clearly affect both the trough and the slider, so theme changes are
needed.
2014-11-12 17:20:53 +01:00
Matthias Clasen
7dd466ad74 Set the clip on range widgets
This will allow better scrollbar theming.
2014-11-08 12:55:37 -05:00
Matthias Clasen
1fad6b049b GtkRange: Add a style class during dragging
This will be used to identify a scrollbar is being dragged - we
don't actually need the style class; another way to keep track
of the dragging status would be ok too.
2014-10-20 23:07:45 -04:00
Matthias Clasen
cfd2d6d2e7 Typo fix 2014-09-26 22:30:20 -04:00
Matthias Clasen
e586dd2571 GtkRange: Fix an event propagation issue
The scale in the selectable listbox in page 2 of gtk3-widget-factory
has the flaw that the row is getting selected even when one only
interacts with the scale - unlike e.g. the checkbutton and button
further down in the listbox.

The problem is that GtkRange is trying to claim the sequence for
the drag gesture from the ::pressed handler of a multipress
gesture. Since the drag gesture hasn't seen the sequence at this
point, that is ineffective.

The fix here is to rearrange the gestures so that the multipress
gesture sees the sequence before the drag gesture, and then
claim the sequence from the ::drag-begin handler.
2014-09-26 22:21:11 -04:00
Matthias Clasen
b333d5ea4e GtkRange: claim sequence when popping up menu
This was clearly an oversight - the function claims the sequence
at the end, and for the popup menu case, we have an early exit
that misses this.
2014-09-26 19:18:57 -04:00
Jesse van den Kieboom
3fa425bb9c scrolling: interpret smooth deltas as pixels on quartz
This is a temporary workaround for scrolling units being amplified
on quartz, due to the assumption that smooth scrolling deltas are
always in some abstract unit similar to the one from xi2.

A proper solution for the situation is described in bug #736121, but
since we are close to release, this patch solves the issue temporarily.

https://bugzilla.gnome.org/show_bug.cgi?id=736121
2014-09-05 14:02:11 +02:00
Benjamin Otte
6c06bd55da gtk: Don't use gtk_render_activity()
... in places where we draw a background. This was changed for GTK 3.0.0
to allow animations, but these days it doesn't make sense anymore to use
gtk_render_activity() for backgrounds.
2014-08-16 16:34:14 +02:00
Carlos Garnacho
af5a03c841 range: Make multipress gesture accept all buttons
That gesture is meant to handle clicks from several buttons, so unset
the new GDK_BUTTON_PRIMARY default. Also, remove unnecessary boilerplate
with the new default values.

https://bugzilla.gnome.org/show_bug.cgi?id=734285
2014-08-15 13:53:40 +02:00
Matthias Clasen
f1d1f139af GtkRange: Set orientable style classes initially
This was an omission, horizontal/vertical would only be set
when the orientation is changed.
2014-07-18 19:39:32 -04:00
Carlos Garnacho
d5b96b95a0 range: Avoid animations during slider drag
If the drag gesture gets a GtkGesture::updated signal, the user
is directly interacting through pointer/touch with the range slider,
animating the adjustment value change in this situation can produce
perceived lag, so set the value immediately when this is happening.
2014-07-08 21:14:41 -04:00
Matthias Clasen
b25b33f79f Drop a leftover declaration
This was left behind when resize grips were removed.
2014-07-06 22:37:57 -04:00
Jasper St. Pierre
ece9ae4bc5 gtkwindow: Remove resize grips
Resize grips were introduced for GNOME 3.0, before we had any of the
"new GNOME app" features like invisible borders and CSD. With OS X 10.6
and 10.7, Apple has replaced the classic grips in their applications
with invisible borders as well.

New GNOME app designs don't use resize grips anymore and the new
default theme for GTK+, Adwaita, disables them entirely by forcing their
width and height to 0.

They're past their time. Remove the code to support them. This can
always be reverted if some app relies on them.
2014-07-03 12:58:41 -04:00
Matthias Clasen
b0a7a6b042 GtkRange: Animate scrollbar jumps 2014-07-02 20:58:16 -04:00
Matthias Clasen
e6f413c6a7 GtkRange: Use G_PARAM_EXPLICIT_NOTIFY 2014-06-09 13:31:07 -04:00
Carlos Garnacho
26dff0d783 range: Use GtkGesture for event management
A multipress gesture takes care of clicks, and where those happened.
If the click is meant to move the slider while pressed, the drag gesture
takes over, dragging the slider while active.
2014-06-05 16:15:54 +02:00
Carlos Garnacho
d05a9f9a7b gesture: Replace gtk_gesture_attach/detach with event controller API
Event controllers now auto-attach, and the GtkCapturePhase only determines
when are events dispatched, but all controllers are managed by the widget wrt
grabs.

All callers have been updated.
2014-05-27 17:47:12 +02:00
Carlos Garnacho
5369c77029 gesture: Simplify gesture/widget interaction public API
The propagation phase property/methods in GtkEventController are gone,
This is now set directly on the GtkWidget add/remove controller API,
which has been made private.

The only public bit now are the new functions gtk_gesture_attach() and
gtk_gesture_detach() that will use the private API underneath.

All callers have been updated.
2014-05-23 19:54:29 +02:00
Carlos Garnacho
75b6f4aa52 range: Replace GtkPressAndHold with GtkGestureLongPress 2014-05-23 19:54:26 +02:00
Cosimo Cecchi
e2f2571dee range: don't use focus-line-width 2014-05-09 11:02:46 -07:00
Cosimo Cecchi
83b4e67307 range: remove unused code 2014-05-09 11:02:44 -07:00
Cosimo Cecchi
365ab7f73b range: don't use focus padding 2014-05-09 11:02:43 -07:00
Benjamin Otte
73aa7bd2f5 widgets: Remove (GtkTickCallback) casts
Instead, make the functions conform to the prototype, so that casting
isn't needed.
2014-04-29 19:35:29 +02:00
Matthias Clasen
fee33b1a81 Clean up private headers
This commit adds a few missing private headers, and cleans up
some irregularities in the existing ones
2014-04-05 02:06:29 -04:00
Matthias Clasen
07fc894020 GtkRange: make autoscrolling work for inverted ranges
This problem was discovered in
https://bugzilla.gnome.org/show_bug.cgi?id=725225
2014-03-03 17:49:38 -05:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
William Jon McCann
7a208fbbf3 docs: use proper apostrophe
https://wiki.gnome.org/Design/OS/Typography
2014-02-07 13:06:10 -05:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -05:00
Bastien Nocera
438cd857c4 all: Add names to timeouts
Add names to every timeout we setup, so it's easier to track their
usage, and debug possible misbehaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=710651
2013-10-23 13:31:18 +02:00
William Jon McCann
9fc3e59673 range: start autoscrolling near the edges of ranges
If a range goes all the way to the edge of the screen then we don't
have any way to activate autoscrolling. By adding a small region
at the ends of the range we can handle this case. This is the same
approach used in treeviews.
2013-10-07 16:38:49 -04:00
William Jon McCann
8c7a8e9314 Add autoscroll when dragging past boundary of range
A problem with the zoom scroll mode is that you have to restart
if you hit the bottom of the screen before you hit the bottom
of your document.

This commit adds an autoscroll feature to the zoom scroll: if
you move outside the window while in zoom scroll mode, we keep
scrolling in the direction you were going until you let go
of the mouse button.

https://bugzilla.gnome.org/show_bug.cgi?id=704703
2013-08-05 08:47:27 +02:00
William Jon McCann
c3e172e546 Add press and hold support to set zoom scroll mode
Triggering zoom scroll mode by Shift click was too much
of an easter egg. It also requires using keyboard and
mouse together, which is hard to do for many users.

Instead, we now trigger zoom scroll mode by click-and-hold
(or touch-and-hold).

https://bugzilla.gnome.org/show_bug.cgi?id=704703
2013-08-05 08:47:27 +02:00
Benjamin Otte
40506cf648 range: Remove dead assignment 2013-08-04 17:27:30 +02:00
William Jon McCann
57fc8763e9 Deprecate and ignore the timeout-initial and timeout-repeat settings 2013-07-11 17:08:15 -04:00
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00