Commit Graph

337 Commits

Author SHA1 Message Date
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
Cosimo Cecchi
eff8865ab1 separatortoolitem: don't use custom sizing/rendering
Instead, just rely on the CSS gadget; we can stop using wide-separators,
separator-height and separator-width, and at the same time deprecate the
space-size style property of GtkToolbar.
2016-01-03 00:41:32 -08:00
Cosimo Cecchi
ea25985b67 toolbar: deprecate GtkToolbarSpaceStyle and space-style style property
This is completely unused already.
2016-01-03 00:41:32 -08:00
Cosimo Cecchi
48596090af toolbar: port to use a gadget 2016-01-03 00:41:32 -08:00
Cosimo Cecchi
d64304997f toolbar: use gtk_container_handle_border_width() 2016-01-03 00:41:32 -08:00
Cosimo Cecchi
10c222649e toolbar: trivial code cleanup 2016-01-03 00:41:32 -08: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
bcc6df00e5 Cosmetic: Avoid explicit state variables
Using the state of the context makes this more obviously correct.
2015-11-14 12:32:57 -05:00
Florian Müllner
e364ae3ea8 Use gtk_widget_set_focus_on_click() instead of deprecated setters
https://bugzilla.gnome.org/show_bug.cgi?id=757269
2015-11-03 07:44:17 -05:00
Matthias Clasen
7ee7019ca7 toolbar: Use an element name instead of a style class
The element name is ... toolbar.
2015-10-31 20:30:56 -04:00
Benjamin Otte
8e87988179 toolbar: Switch from get_path_for_child() to css node managing 2015-07-16 06:15:13 +02:00
Benjamin Otte
d3c147a62d stylecontext: Split render functions out into gtkrender.[ch] 2014-10-03 06:18:05 +02:00
Benjamin Otte
b5a8b7ef3b widget: Make _gtk_set_simple_clip() take an optional content clip 2014-08-21 00:54:07 +02:00
Matthias Clasen
cb60da5f6b GtkToolbar: Set clip
This allows outset box shadows to work on toolbars.

https://bugzilla.gnome.org/show_bug.cgi?id=734526
2014-08-10 07:53:59 -04:00
Matthias Clasen
f4db36ef49 GtkToolbar: Set orientable style classes initially
This was an omission, horizontal/vertical would only be set
when the orientation is changed.
2014-07-18 19:40:12 -04:00
Matthias Clasen
40c3804ecd GtkToolbar: Use G_PARAM_EXPLICIT_NOTIFY 2014-06-09 13:31:12 -04:00
Matthias Clasen
26e1b7c7d7 Drop GtkArrow use in GtkToolbar
This is in preparation for GtkArrow getting deprecated.
https://bugzilla.gnome.org/show_bug.cgi?id=729564
2014-05-13 23:50:12 -04:00
Benjamin Otte
c3dd043765 toolbar: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
2014-05-01 14:51:28 +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
Bastien Nocera
f71f7215ab all: Name more idles and timeouts
Following up from 438cd857c4,
name more timeouts and idles.

The original grep was missing checking for gdk_threads_add_*()
functions (at least for some of the files).

https://bugzilla.gnome.org/show_bug.cgi?id=726870
2014-03-26 20:09:30 -04:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
Matthias Clasen
7f6a964c47 Docs: Remove all entities and turn off sgml mode
With all element markup gone, it is time to turn off
sgml mode, and get rid of entities as well.
2014-02-09 17:58:07 -05:00
William Jon McCann
fa3f1e1488 docs: use apostrophe in *'ve 2014-02-07 13:38:26 -05:00
William Jon McCann
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -05:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -05:00
Matthias Clasen
2232430a5a Redo csd window-dragging
The window-dragging code had a number of issues: The code was
starting a drag on every button press, never bothering to cancel
them. This leads to the odd hand cursor occurring between the two
clicks to maximize. We relied on GDK's multi-click detection, which
gives us triple-clicks when we really want sequences of double-clicks.
Lastly, we didn't propery restrict double-click handling to the primary
button, so e.g. if you had a window on an empty workspace, double-right
click on the titlebar would maximize it, which is not intended.

This commit solves all three problem by a doing our own double-click
detection, and only starting a drag when the pointer goes out of
'double-click range'. We change the way dragging is implemented for
menubars and toolbars to just letting events bubble up, so they
get the same behaviour as the titlebar. To make this work, we
have to select for pointer motion events in a few more places.
2014-01-12 22:25:19 -05:00
Jonh Wendell
9d8a32b07d toolbar: draw a full box for separators
This allows themes do whatever they want as separators, with
paddings, borders and backgrounds.

If "wide-separators" property is true, then, instead of just draw
a frame, also render its background, and take into account the
padding property for its limits.

https://bugzilla.gnome.org/show_bug.cgi?id=719713
2013-12-03 09:55:58 -02:00
Marco Brito
d31f3e5766 Add class toolbar before the style context is created for the widget.
The call to gtk_button_set_relief() in gtk_toolbar_init() indirectly
used the style context of the half-created widget, before we had a
chance to add the "toolbar" style class to it.

Reorder gtk_toolbar_init() to ensure that the proper style class is
set first.

https://bugzilla.gnome.org/show_bug.cgi?id=719595
2013-12-01 17:20:30 -05:00
Lionel Landwerlin
be5b6460e7 menushell/toolbar/window: implement toggle maximize on double click
https://bugzilla.gnome.org/show_bug.cgi?id=700419
2013-11-09 14:19:47 -05:00
Jonh Wendell
c292401162 toolbar: implement minimum and natural sizes in _get_preferred family
currently it's using the same sizes for natural and minimum, but it
happens that, when it's allowed to use the arrow, the minimum size
can be smaller than natural.

https://bugzilla.gnome.org/show_bug.cgi?id=693227
2013-11-09 13:26:35 -05:00
Jasper St. Pierre
3971ed1779 gtktoolbar: Make the icon-size property actually an enum
As this is what it's interpreted as.
2013-10-18 16:14:26 -04:00
Matthias Clasen
624ec0fb7d Add a style class for context menus
Attached widgets inherit from the style of the widget they are
attached to. This can sometimes have unintended consequences,
like a context menu in the main view of gedit inheriting the font
that is configured for documents, or the context menu of the preview
in the font chooser coming up with humongous font size.

To fix this problem, we introduce a context menu style class
and use it for all menus that are used like that. The theme
can then set a font for this style class.

https://bugzilla.gnome.org/show_bug.cgi?id=697127
2013-08-18 13:46:48 -04:00
Matthias Clasen
2f1fa7cdc3 Drop some unnecessary includes
Drop includes of deprecated headers where they are
no longer needed.
2013-07-19 22:32:23 -04:00
Matthias Clasen
0aa57d26b5 Move wholly deprecated classes to gtk/deprecated/
We've recently a number of classes wholly. For these cases,
move the headers and sources to gtk/deprecated/ and adjust
Makefiles and includes accordingly.

Affected classes:
GtkAction
GtkActionGroup
GtkActivatable
GtkIconFactory
GtkImageMenuItem
GtkRadioAction
GtkRecentAction
GtkStock
GtkToggleAction
GtkUIManager
2013-07-19 21:39:47 -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
7b66956e63 Deprecate and hardcode default toolbar icon size setting
Toolbar icon size can still be changed on a per-widget basis as
needed by the application developer.
2013-07-08 15:02:28 -04:00
William Jon McCann
425e977bb6 Deprecate and hardcode default toolbar style setting
Toolbar style can still be changed on a per-widget basis as
needed by the application developer.
2013-07-08 15:02:28 -04:00
Cosimo Cecchi
a07f767ed4 Revert "toolbar: Don't special-case RTL toolbar child positions anymore"
This reverts commit 821a675013.

https://bugzilla.gnome.org/show_bug.cgi?id=694451
2013-02-23 14:53:23 -05:00
Alexander Larsson
3d4cd4db3e Add gtk_widget_(un)register_window
This replaces the previously hardcoded calls to gdk_window_set_user_data,
and also lets us track which windows are a part of a widget. Old code
should continue working as is, but new features that require the
windows may not work perfectly.

We need this for the transparent widget support to work, as we need
to specially mark the windows of child widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=687842
2013-02-07 11:11:37 +01:00
Benjamin Otte
821a675013 toolbar: Don't special-case RTL toolbar child positions anymore
If you want to get rounded corners on an hbox, instead of
  :first-child {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
  }
  :last-child {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
  }
you now need to write:
  :first-child, :last-child:dir(rtl) {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
  }
  :last-child, :first-child:dir(rtl)
  {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
  }
2012-12-18 18:25:42 +01:00
Benjamin Otte
7747910b9d gtk: Use context's font
Instead of using gtk_style_context_get_font() in
pango_context_get_metrics(), use pango_context_get_font_description().
The context contains the font description we are about to use after all.
2012-12-06 02:57:18 +01:00
Cosimo Cecchi
a5ddbaf1f8 toolbar: don't forget to set orientable style classes
So that themes can select for vertical toolbars.
2012-10-10 11:37:16 -04:00
William Jon McCann
8a9a3949dd Don't leak a ref to the settings
https://bugzilla.gnome.org/show_bug.cgi?id=683896
2012-09-16 20:21:06 -04:00
Cosimo Cecchi
8062e471d1 toolbar: deprecate shadow-type style property
While shadow-type *properties* can make sense, to opt-out of the
padding/border machinery programmatically, having it as a style
property doesn't make any sense, since we have a better way to change
the bevel style from the theme already.
This commit deprecates the shadow-type style property in GtkToolbar.
2012-08-07 16:08:45 +02:00
Cosimo Cecchi
1ec6329f18 toolbar: don't request CSS padding twice
This is a regression from commit
d0d21a4f00.

We are requesting the CSS padding twice: once unconditionally and
another time if SHADOW_TYPE != NONE, which is usually the case.
2012-08-07 16:05:30 +02:00
Cosimo Cecchi
512fee6363 toolbar: deprecate internal-padding style property
This is equivalent to a regular CSS padding, and that's what people
should use.
2012-08-07 12:55:37 +02:00
Paolo Borelli
d0d21a4f00 Make GtkToolbar honour css border and padding
The widget is already calling gtk_render_frame, but is not measuring css
border and padding when negotiating its size. This patch replaces the
already existing get_internal_padding static helper with a function that
sums the old internal-padding value with the values specified via css.
2012-08-05 12:52:36 +02:00
Cosimo Cecchi
ad63d1b59e toolbar: don't call gtk_style_context_set_background()
GtkToolbar doesn't have its own GdkWindow to draw on (it calls
gtk_widget_set_has_window(FALSE) in _init), but only an event window
(input-only).
Since gtk_widget_get_window() in that case will return the GdkWindow of
the parent container, by calling gtk_style_context_set_background() here
we're overriding the base background of the container instead of our.
While in most cases this doesn't have any noticeable effect, since
the toplevel GtkWindow will paint its background on top of it at the
beginning of the draw cycle, when the classic window hierarchy is
broken, such as when widgets are rendered through a clutter-gtk
offscreen embedding, the background will become visible, which is
undesirable.
Fix this by having GtkToolbar not call gtk_style_context_set_background
in its style_updated handler.
2012-06-13 20:10:41 -04:00
Matthias Clasen
2cecc1f922 GtkToolbar: Prevent accidental drag starts
We don't want to start drags on double- or triple clicks, and
doing so causes problems for embedded range widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=675535
2012-05-25 23:17:43 -04:00
Matthias Clasen
33d2af0036 fix the build 2012-05-25 23:14:02 -04:00