Commit Graph

109 Commits

Author SHA1 Message Date
Matthias Clasen
fa7ef93bc5 scalebutton: Add autoscrolling
Use the smooth autoscrolling that the scale can do,
and at the same time stop using legacy event signals.
2017-12-12 22:21:43 -05:00
Matthias Clasen
ffd6baec42 gtk: Intern css names
This avoids a bunch of strdups at startup.
2017-11-17 22:49:57 -05:00
Matthias Clasen
dbfaa99107 image: Remove icon-size argument from icon setters
Instead, add a function gtk_image_set_icon_size() for the cases where
overriding the icon size is necessary.

Treat icon sizes the same way as pixel sizes, too. So gtk_image_clear()
no longer unsets the icon size.
2017-11-15 14:22:17 -05:00
Benjamin Otte
3da65ff233 scalebutton: Remove icon size 2017-11-15 14:22:16 -05:00
Timm Bäder
f50832864e scalebutton: Fix comparison for empty icon list 2017-10-10 09:49:35 +02:00
Carlos Garnacho
9a204921ae gtkscalebutton: Use scroll event controller 2017-09-19 18:40:50 +02:00
Carlos Garnacho
627a73cf57 scalebutton: Update to using GdkEvent API 2017-09-19 18:39:02 +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
Matthias Clasen
147e0512c5 Avoid more compiler warnings 2017-03-23 16:15:26 +00:00
Matthias Clasen
316b24e0a0 Fix reference handling in GtkScaleButton
We were leaking the adjustment, since we confuse ourselves
with a property whose initial value comes out of a template.
Stop doing that.

https://bugzilla.gnome.org/show_bug.cgi?id=775212
2016-11-28 15:04:20 -05: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
Timm Bäder
a985e62b25 Use gtk_popover_popdown/popup where appropriate
https://bugzilla.gnome.org/show_bug.cgi?id=769706
2016-08-16 11:49:26 -04:00
Christoph Reiter
f66191346c Mention GtkIconSize in all docs where the argument/return is annotated as taking an int instead of GtkIconSize
In https://bugzilla.gnome.org/show_bug.cgi?id=601425 the annotations
were changed to int as they not only take the predefined enum values
but also user defined values registered through gtk_icon_size_register()

As a result the typelib doesn't contain any information about
GtkIconSize for those arguments and the Python docstring only
shows the corresponding Python type "int".

This changes the argument docs to mention the type explicitly
so the Python doc generator can add a link to Gtk.IconSize
which contains the most useful predefined values.

https://bugzilla.gnome.org/show_bug.cgi?id=757411
2016-01-04 11:56:44 +01:00
Emmanuele Bassi
11eab60f43 scalebutton: Annotate the return type
Instead of just listing the return type of get_plus_button() and
get_minus_button() in the documentation, we can use the (type)
annotation to ensure that the introspection data reflects the actual
type of the returned widget.
2015-11-30 14:09:19 +00:00
Timm Bäder
886686973c GtkScaleButton: _get_(plus|minus)_button returns a GtkButton
https://bugzilla.gnome.org/show_bug.cgi?id=539944
2015-11-28 21:09:53 +01:00
Matthias Clasen
2c5e25a5c7 scale button: Add a style class
Add a .scale style class to differentiate scale buttons from normal
ones.
2015-10-30 00:51:13 -04:00
Carlos Garnacho
f8f74b59e3 scalebutton: Invert smooth scroll dy when adding to the current value
On regular scrolling (ie. not natural scrolling), positive deltas in the
Y axis (downwards) should actually move the value towards the adjustment
minimum value to be more intuitive. This also makes the scrolling
directions match between the button and the popped up scale.

https://bugzilla.gnome.org/show_bug.cgi?id=736830
2014-09-22 20:28:27 -04:00
Carlos Garnacho
bb3a8edb9f scalebutton: Handle smooth scroll events
This has the double effect to make scale button truly smooth, and make
scrolling work on wayland, since all scrolling is "smooth" there.

https://bugzilla.gnome.org/show_bug.cgi?id=720269
2014-08-26 14:54:08 +02:00
Simon McVittie
d329544e70 Use AC_USE_SYSTEM_EXTENSIONS to get _GNU_SOURCE, _XOPEN_SOURCE etc.
Similar to Bug #684123 in GLib.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=641638
Bug-Debian: https://bugs.debian.org/756476
Reviewed-by: Matthias Clasen
2014-08-21 09:54:12 +01:00
Matthias Clasen
0a34633914 GtkScaleButton: Set +/- sensitivity
The buttons should go insensitive when we are at their end of
the scale.
2014-07-08 10:27:30 -04:00
Matthias Clasen
d9e475ed6a GtkScaleButton: Try harder not to pop over
When the popover does fit in the window, change the orientation
to make it fit.
2014-07-04 01:20:24 -04:00
Jasper St. Pierre
9c37b3de74 gtk: Don't use GObjectClass.constructor
Use the newer constructed instead, which has a fast path in GObject.
2014-06-26 19:06:43 -04:00
Matthias Clasen
0505a189d3 GtkScaleButton: Use G_PARAM_EXPLICIT_NOTIFY 2014-06-09 13:31:08 -04:00
Carlos Garnacho
eb0f86d485 popover: Always apply the window shape
In practice this shape is only used to outline the popover when it is
above native windows, in the most normal full-csw case the shape won't apply
visibly, so popovers will still be able to cast a shadow there.

If there are native windows below the popover, the shape will exclude the
shadow, so there are no alpha contents above the window. One worst case that
might happen is that the popover lays above patches of native/client-side
windows, so the shadow could come and go around the border. But first let's
see whether that happens often or visibly enough before adding something more
convoluted.
2014-02-20 16:36:34 +01:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
William Jon McCann
326da2da58 docs: don't use <anchor> 2014-02-07 15:40:52 -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
0ce016650b docs: Use markup for links 2014-02-07 09:42:12 -05:00
Carlos Garnacho
6e88f1bcb0 scalebutton: Apply a shape on the popover
This hideous hack is necessary so far because the main users of
GtkScaleButton are also clutter users, so the GtkScaleButton popover
will be very likely shaped against a clutter-enabled native window.

https://bugzilla.gnome.org/show_bug.cgi?id=723556
2014-02-04 21:29:25 +01:00
Matthias Clasen
c46b1c2a05 GtkScaleButton: Use a popover
This works better than the contortions we're currently doing
with an undecorated dialog, and grabs.

https://bugzilla.gnome.org/show_bug.cgi?id=723181
2014-02-03 15:43:24 -05:00
William Jon McCann
4a11acdc8c resources: move resources into a subdirectory 2014-01-23 21:04:59 -05:00
Emilio Pozuelo Monfort
4e1b73325d ScaleButton: make the popup transient to the button's window
Fixes the popup positioning on wayland.

https://bugzilla.gnome.org/show_bug.cgi?id=720256
2013-12-14 15:49:38 -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
Matthias Clasen
cda60c3c40 Another round of template binding api changes
We rename the gtk_widget_class_bind_template_child{_internal}
macros by appending a _private to their name. Otherwise, it
would be too magic to pass the 'public' names as arguments,
but affect a member of the Private struct. At the same time,

Add two new macros with the old names,
gtk_widget_class_bind_template_child{_internal} that operate
on members of the instance struct.
2013-07-26 16:29:12 -04:00
Emmanuele Bassi
89ae3524a3 Rename the widget template API
The macros and functions are inconsistently named, and are not tied to
the "template" concept - to the point that it seems plausible to use
them without setting the template.

The new naming scheme is as follows:

  gtk_widget_class_bind_template_child_full
  gtk_widget_class_bind_template_callback_full

With the convenience macros:

  gtk_widget_class_bind_template_child
  gtk_widget_class_bind_template_child_internal
  gtk_widget_class_bind_template_callback

https://bugzilla.gnome.org/show_bug.cgi?id=700898
https://bugzilla.gnome.org/show_bug.cgi?id=700896
2013-07-26 13:52:15 -04:00
Alexander Larsson
a8e84545d1 widget: Use a real offset in gtk_widget_class_automate_child
Using an offset from the struct means you can have children in
both the public and private (via G_PRIVATE_OFFSET) parts of the
instance. It also matches the new private macros nicer.

https://bugzilla.gnome.org/show_bug.cgi?id=702563

Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
2013-07-26 08:41:09 -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
William Jon McCann
02c793f24a Start migrating internals away from GtkStock 2013-06-24 22:20:49 -04:00
Tristan Van Berkom
b9fd422aca GtkScaleButton: Define children with a GtkBuilder template 2013-04-08 21:19:28 +09:00
Benjamin Otte
48c6b3b4f4 gtk: Add get_type() function declarations for private objects
I'm adding a bunch of fixes for gcc complaining about
-Wmissing-declarations.

This set of patches makes private classes in gtk/*.c that use
G_DEFINE_TYPE() safe by adding definitions for the get_type() function
that can't be made static.
2012-10-02 19:32:38 +02:00
Benjamin Otte
2353d60b8a types: Move GtkAdustment declaration to gtktypes.h
... and make all the headers to not include gtkadjustment.h anymore. Of
course, also include it in the source files instead.
2012-03-03 19:45:03 +01:00
Carlos Garnacho
377eb396a3 scalebutton: Set GDK_SCROLL_MASK explicitly
selecting for button press/release doesn't suffice anymore to
get scroll events.
2012-03-01 16:29:01 -05:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Matthias Clasen
020c1846b7 Use the workarea when placing popups
This uses the new workarea API to avoid placing popups underneath
panels, docks, etc.
2011-12-18 14:29:16 -05:00
Javier Jardón
0853ce3077 Use G_VALUE_INIT
Instead of an explicit { 0, } when declaring the variable.
2011-10-15 16:45:16 +01:00
Matthias Clasen
6f39855c08 More include cleanups 2011-08-28 01:54:55 -04:00
Matthias Clasen
13e8bace97 Convert GailScaleButton to GtkScaleButtonAccessible 2011-07-05 16:08:54 -04:00
Matthias Clasen
d9fcc4c630 Silence new gcc warnings
gcc 4.6.0 has started to warn about set-but-unused variables.
So don't do that, then.
2011-01-23 21:51:38 -05:00
Pavel Holejsovsky
2fb1c06402 [GI] Add missing (out) and (array) annotations 2011-01-20 13:57:20 +01:00
Benjamin Otte
f79c6baa66 scalebutton: Update adjustment usage for sealing
Also rename all variables named "adj" to "adjustment", like they're
called everywhere else.
2011-01-05 23:50:22 +01:00