Commit Graph

367 Commits

Author SHA1 Message Date
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
Matthias Clasen
0a75bb4353 Work towards a clean docs build
Remove various no-longer-existing functions from the sections
file, and exclude more private headers, etc.
2016-11-18 14:43:34 -05:00
Benjamin Otte
ab47479045 snapshot: Convert GtkButton and subclasses 2016-11-15 17:48:45 +01:00
Benjamin Otte
da207c9fdd snapshot: Add a snapshot function to GtkCssCustomGadget 2016-11-15 17:48:45 +01:00
Timm Bäder
3b970f4555 button: Remove _get_event_window 2016-11-05 11:56:36 +01:00
Timm Bäder
773c16076b widget: Remove state-flags leftovers 2016-11-02 18:40:00 +01:00
Benjamin Otte
32a5729d18 gtk: Chain up in realize()
... instead of copy/paste from gtk_widget_real_realize.
2016-11-02 07:16:08 +01:00
Timm Bäder
d7df491656 button: show() the image in gtk_button_new_from_icon_name 2016-10-31 12:23:27 +01:00
Rico Tzschichholz
471d8d6184 Remove deprecated GTK_RELIEF_HALF 2016-10-23 18:23:58 +02:00
Timm Bäder
38f2290479 button: Add Since annotations to icon-name setter/getter 2016-10-22 21:02:34 +02: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
f65af48d51 button: Fix icon-name implementation 2016-10-20 20:12:05 +02:00
Timm Bäder
f989281b38 button: Remove grab_time
Unused.
2016-10-20 20:12:05 +02:00
Matthias Clasen
9d06ee637b button: Restore focus
The custom gadget draw function has the side effect of informing
the gadget machinery wether to draw focus or not. Bring the
draw function back, just for its boolean return value. We may
want to find a better solution for this.
2016-10-18 11:49:12 +01:00
Matthias Clasen
1d5e05b0d1 button: Convert to indirect rendering
WARNING! This commit breaks GtkButton subclasses.
2016-10-18 11:49:11 +01:00
Timm Bäder
be2f19663b button: Add icon-name property
Remove the old-style button construction that allowed to show both an
icon and a label and change visibility based on a GtkSetting.
2016-10-18 00:29:19 +02:00
Timm Bäder
7e16396cc5 button: Stop implementing GtkActivatable 2016-10-18 00:29:18 +02:00
Timm Bäder
05211d200f button: Stop checking for GtkSettings:gtk-button-images setting 2016-10-18 00:29:18 +02:00
Benjamin Otte
31b5ba5bad button: Use gdk_window_new_input() 2016-10-18 00:22:35 +02:00
Benjamin Otte
4df6ddad54 API: container: Remove gtk_container_set_border_width() 2016-10-16 18:18:58 +02:00
Timm Bäder
10e24d58c3 button: Remove _{get,set}_focus_click
Deprecated for the GtkWidget variant. Also remove some unused fields
from the GtkButtonPrivate struct.
2016-10-16 18:17:21 +02:00
Timm Bäder
10a92a210b button: Remove deprecated style properties 2016-10-16 18:17:21 +02:00
Timm Bäder
9f2ca684e2 button: Remove deprecated signals from public API 2016-10-16 18:17:21 +02:00
Timm Bäder
590cd6a9f2 button: Remove GtkStock API 2016-10-16 18:17:21 +02:00
Timm Bäder
485d1b9835 Button: Remove alignment API 2016-10-16 18:17:21 +02:00
Timm Bäder
f45dadadd0 box: Remove 'padding' child property 2016-10-16 18:17:21 +02: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
Stefan Sauer
32675db490 docs: point to suggested api for deprecated functions
We deprecated a bunch of _focus_on_click() functions. Point to the new API
in GtkWidget.
2016-06-09 22:44:44 +02:00
Emmanuele Bassi
c9916fbc58 docs: Add deprecation notice for GtkButton.set_focus_on_click()
To match the deprecation annotation on the function declaration.
2016-06-09 21:35:36 +01:00
Matthias Clasen
9c50b8bc2f button: Free gadgets and gestures in finalize
This is the right place to free them.
2016-06-05 20:00:43 -04:00
Matthias Clasen
0b156ea096 Document the .circular style class 2016-03-02 19:12:10 -05:00
Timm Bäder
788ee466b8 button: Don't include margins in input window size
And do the same thing for GtkCheckButton

https://bugzilla.gnome.org/show_bug.cgi?id=760509
2016-01-12 21:56:44 +01:00
Alberto Ruiz
496f0892fc introspection: This patch fixes nullable return values fixes for the following symbols in gtk
gtk_accel_group_query
  gtk_accel_group_from_accel_closure
  gtk_accel_label_get_accel_widget
  gtk_accessible_get_widget
  gtk_actionable_get_action_name
  gtk_app_chooser_get_app_info
  gtk_app_chooser_button_get_heading
  gtk_app_chooser_dialog_get_heading
  gtk_application_get_window_by_id
  gtk_assistant_get_nth_page
  gtk_binding_set_find
  gtk_builder_get_object
  gtk_builder_lookup_callback_symbol
  gtk_builder_get_application
  gtk_button_get_image
  gtk_cell_area_get_focus_from_sibling
  gtk_cell_renderer_start_editing
  gtk_cell_view_get_model
  gtk_cell_view_get_displayed_row
  gtk_clipboard_get_owner
  gtk_container_get_focus_child
  gtk_container_get_focus_vadjustment
  gtk_container_get_focus_hadjustment
  gtk_dialog_get_widget_for_response
  gtk_drag_get_source_widget
  gtk_drag_dest_get_target_list
  gtk_drag_source_get_target_list
  gtk_entry_completion_get_model
  gtk_entry_completion_compute_prefix
  gtk_expander_get_label_widget
  gtk_file_chooser_get_filename
  gtk_file_chooser_get_current_folder
  gtk_file_chooser_get_uri
  gtk_file_chooser_get_current_folder_uri
  gtk_file_chooser_get_preview_widget
  gtk_file_chooser_get_preview_file
  gtk_file_chooser_get_preview_filename
  gtk_file_chooser_get_preview_uri
  gtk_file_chooser_get_extra_widget
  gtk_file_chooser_get_filter
  gtk_file_chooser_native_get_accept_label
  gtk_file_chooser_native_get_cancel_label
  gtk_file_filter_get_name
  gtk_font_chooser_get_font_family
  gtk_font_chooser_get_font_face
  gtk_font_chooser_get_font
  gtk_font_chooser_get_font_desc
  gtk_font_chooser_get_font_map
  gtk_frame_get_label
  gtk_gesture_get_device
  gtk_gesture_get_window
  gtk_gl_area_get_error
  gtk_header_bar_get_title
  gtk_header_bar_get_subtitle
  gtk_header_bar_get_custom_title
  gtk_icon_info_get_filename
  gtk_icon_view_get_path_at_pos
  gtk_icon_view_get_model
  gtk_image_get_pixbuf
  gtk_image_get_animation
  gtk_label_get_mnemonic_widget
  gtk_label_get_attributes
  gtk_check_version
  gtk_menu_button_get_popup
  gtk_menu_button_get_menu_model
  gtk_menu_button_get_align_widget
  gtk_menu_button_get_popover
  gtk_menu_item_get_submenu
  gtk_menu_item_get_accel_path
  gtk_native_dialog_get_title
  gtk_native_dialog_get_transient_for
  gtk_notebook_get_nth_page
  gtk_notebook_get_tab_label_text
  gtk_notebook_get_menu_label
  gtk_notebook_get_menu_label_text
  gtk_notebook_get_group_name
  gtk_notebook_get_action_widget
  gtk_offscreen_window_get_surface
  gtk_offscreen_window_get_pixbuf
  gtk_paned_get_child1
  gtk_paned_get_child2
  gtk_places_sidebar_get_location
  gtk_places_sidebar_get_nth_bookmark
  gtk_plug_get_socket_window
  gtk_popover_get_default_widget
  gtk_progress_bar_get_text
  gtk_recent_filter_get_name
  gtk_recent_manager_lookup_item
  gtk_settings_get_default
  gtk_socket_get_plug_window
  gtk_stack_sidebar_get_stack
  gtk_stack_switcher_get_stack
  gtk_style_context_get_section
  gtk_style_context_get_parent
  gtk_style_context_get_frame_clock
  gtk_test_find_widget
  gtk_text_buffer_get_mark
  gtk_text_tag_table_lookup
  gtk_text_view_get_tabs
  gtk_text_view_toggle_cursor_visible
  gtk_text_view_get_window
  gtk_toolbar_get_nth_item
  gtk_tool_button_get_label
  gtk_tool_button_get_icon_name
  gtk_tool_button_get_label_widget
  gtk_tool_button_get_icon_widget
  gtk_tool_palette_get_drop_item
  gtk_tool_palette_get_drop_group
  gtk_tree_model_filter_convert_child_path_to_path
  gtk_tree_model_filter_convert_path_to_child_path
  gtk_tree_model_sort_convert_child_path_to_path
  gtk_tree_model_sort_convert_path_to_child_path
  gtk_tree_view_get_column
  gtk_tree_view_get_bin_window
  gtk_tree_view_column_get_widget
  gtk_tree_view_column_get_tree_view
  gtk_widget_get_frame_clock
  gtk_window_group_get_current_device_grab
  GtkTextBufferSerializeFunc
2016-01-08 12:18:23 +00: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
Matthias Clasen
37e9d92632 button: Convert to gadgets 2015-12-15 08:41:16 -05:00
Carlos Garnacho
e4eeec2163 GtkButton: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:55 +01:00
Matthias Clasen
43f822e70f Annotate deprecated style properties
Use G_PARAM_DEPRECATED with deprecated style properties.
This will make it easier to identify and remove such stale
properties from css, since it will now trigger warnings.
2015-11-16 15:13:33 -05:00
Matthias Clasen
684cd47c53 button: Document some style properties as deprecated
No code change.
2015-11-16 07:20:18 -05:00
Florian Müllner
9a29a2768b Deprecate widget-specific :focus-on-click properties
The differences between the existing properties and the newly added
GtkWidget:focus-on-click property are minimal (different owner_type
in GParamSpec), so it is extremely unlikely that dropping the former
would break anything.

https://bugzilla.gnome.org/show_bug.cgi?id=757269
2015-11-03 07:44:17 -05:00
Matthias Clasen
13d091f700 button: Mention differentiating style classes
There's a lot of button variations out there, lets document
the ones we know about.
2015-11-02 12:51:00 -05:00
Matthias Clasen
a953e37735 button: Use an element name instead of a style class 2015-10-29 22:55:29 -04:00
Matthias Clasen
b10bfe128f GtkButton: Pick up images that are set early
We were failing to construct the child if an image was set
before constructed (e.g. in the init() function of a button
subclass).

https://bugzilla.gnome.org/show_bug.cgi?id=753048
2015-08-03 22:35:36 -04:00
Carlos Garnacho
a4e0de1839 button: Ensure the button is "left" when a gesture is cancelled
This prevents from stale widget states if the gesture happens to be
cancelled mid-press.
2015-03-02 12:01:07 +01:00
Marek Kasik
8b5d30d439 Remove redundant checks for NULL
Remove checks for NULL before g_free() and g_clear_object().
Merge check for NULL, freeing of pointer and its setting
to NULL by g_clear_pointer().

https://bugzilla.gnome.org/show_bug.cgi?id=733157
2014-10-02 19:06:03 +02:00
Matthias Clasen
6d3c61856b GtkButton: Use GtkLabel:xalign 2014-09-29 23:57:13 -04:00
Carlos Garnacho
d17fd81d9b button: Fix ::clicked emission on touchscreens sending pointer events
When GtkGestureMultiPress::released happens, in_button should be unset
after emitting GtkButton::released, whose default implementation uses it.
Moreover, in_button should only be unset there for real touch events, not
guaranteed to trigger crossing events, as opposed to every pointer/touch
events from touchscreens.

https://bugzilla.gnome.org/show_bug.cgi?id=737297
2014-09-25 21:25:52 +02:00
Matthias Clasen
be97bad3a0 Avoid criticals when drags end
Its seems that gtk_gesture_get_last_event may return NULL,
protect against that to avoid critical warnings.
2014-09-07 21:24:01 -04:00
Carlos Garnacho
ea830aee5d button: Track gesture point to maintain priv->in_button
This makes the active state work invariably with both mouse/touch, and
regardless of X11 pointer emulation being friendly and sending crossing
events for the emulated pointer events in the latter.

This makes GtkButtons' active state look correct when pressing on
touchscreens on wayland.

https://bugzilla.gnome.org/show_bug.cgi?id=731380
2014-08-26 23:21:24 +02:00
Benjamin Otte
b5a8b7ef3b widget: Make _gtk_set_simple_clip() take an optional content clip 2014-08-21 00:54:07 +02:00
Benjamin Otte
b520d3b7fb button: Remove unnecessary queue_redraw() calls
Setting a state automatically triggers redraws via the CSS machinery.
2014-08-17 06:47:17 +02:00