Commit Graph

164 Commits

Author SHA1 Message Date
Alexander Larsson
7bee22bcb6 Avoid some more type checks for internal calls 2017-01-11 15:27:51 +01:00
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
Benjamin Otte
3f75b11982 frame: Implement snapshot() 2016-12-20 18:01:12 +01:00
Piotr Drąg
a2da4ddceb Use Unicode in translatable strings
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772371
2016-12-19 15:08:10 -05:00
Benjamin Otte
96a94fc21d frame: Remove the border node
It does weird clipping that
(a) nobody likes
(b) is hard to support in the new rendering world.
So we take the easy way out.

The actual frame is now drawn by the frame node around the label.
2016-12-19 05:36:06 +01:00
Timm Bäder
ac20c3eb22 frame: Use gtk_widget_measure to measure child sizes 2016-12-04 12:00:46 +01:00
Benjamin Otte
82eb223c58 Revert "GtkFrame: Convert to indirect rendering"
This reverts commit a0b2b3745f.

Frames cannot be rendered by GSK yet, because they do clipping.
2016-11-15 17:49:19 +01:00
Benjamin Otte
da207c9fdd snapshot: Add a snapshot function to GtkCssCustomGadget 2016-11-15 17:48:45 +01:00
Benjamin Otte
a0e63b8a07 rendernode: Require passing a renderer to get_draw_context()
This is in preparation of making render nodes independent of the
renderer, so that they can be rendered multiple times with different
renderers.
2016-11-01 16:32:26 +01:00
Timm Bäder
b2a0105234 frame: Get the render node from the gadget
So we get a proper css background etc. applied.
2016-10-28 19:33:47 +02:00
Timm Bäder
8c128f36c5 frame: Use measure() to measure label size 2016-10-28 16:33:02 +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
00e7c69044 frame: Remove unused constants 2016-10-20 20:12:05 +02:00
Matthias Clasen
a0b2b3745f GtkFrame: Convert to indirect rendering
Create a GskRenderNode for the contents of the frame.
2016-10-18 11:49:11 +01:00
Benjamin Otte
4df6ddad54 API: container: Remove gtk_container_set_border_width() 2016-10-16 18:18:58 +02:00
Timm Bäder
41119057dd frame: Fix horizontal size request
We were adding the border gadget size and the label widget size in any
case, but when calculating the width, we want the maximum of those two,
not the sum.

https://bugzilla.gnome.org/show_bug.cgi?id=760482
2016-02-29 14:19:38 +01:00
Timm Bäder
870a5b424f frame: Don't move border gadget and child down
Setting label-yalign should affect the border gadget, but we need to
compensate for its position by moving the child down or up, depending on
the border gadget's position, so the child never moves.

https://bugzilla.gnome.org/show_bug.cgi?id=762123
2016-02-28 09:24:21 -05:00
Timm Bäder
0213815d2f Move .keycap docs from GtkFrame to GtkLabel
That's where .keycap is used nowadays.
2016-02-25 20:45:33 +01:00
Timm Bäder
77594be976 frame: Measure border gadget separately
https://bugzilla.gnome.org/show_bug.cgi?id=760482
2016-02-25 20:45:33 +01:00
Timm Bäder
3431451463 frame: Let GtkContainer handle border-width
https://bugzilla.gnome.org/show_bug.cgi?id=760482
2016-02-25 20:45:33 +01:00
Timm Bäder
bdd182f38c frame: Set border gadget state after creating it 2016-02-10 14:03:39 +01:00
Matthias Clasen
2cf810c4c9 frame: Don't overlap label and child
We didn't do this previously, so don't start now.

https://bugzilla.gnome.org/show_bug.cgi?id=760528
2016-01-15 19:16:23 -05:00
Matthias Clasen
ea4cff1ea4 Use convenience API that was introduced recently
Use gtk_css_gadget_set_state in all the places where we previously
were getting a node from a gadget, just to call gtk_css_node_set_state.
2016-01-13 00:19:31 -05: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
Carlos Soriano
5404e124b6 gtkframe: format fix 2015-12-26 20:52:53 +01:00
Carlos Soriano
79b6d48983 gtkframe: remove unused variable
And fix the compiler warning
2015-12-26 20:52:31 +01:00
Matthias Clasen
f5f80b40c3 Fix GtkFrame padding
This was showing up in the app-notification in widget-factory.
2015-12-22 13:53:43 -05:00
Matthias Clasen
2417184a1f frame: Fix gadget conversion
The GtkCssAllocateFunc must set the clip to meaningful values.
2015-12-16 17:12:12 -05:00
Matthias Clasen
576028bdec frame: Convert to gadgets
As part of this conversion, remove the hardcoded padding around
the label.

Unfortunately, we cannot use the main gadget for drawing the frame
decoration, since we want to draw a custom border instead of the
stock css border that gadgets insist on drawing for us. Therefore,
add an extra gadget with name border and use it just for rendering
the frame.
2015-12-16 15:15:18 -05:00
Timm Bäder
2182fe7d9d Don't pass widget state flags to GtkStyleContext API 2015-11-22 17:11:35 +01:00
Matthias Clasen
aa5dc38b0d frame: Use an element name instead of a style class
Unsurprisingly, the element name is ... frame.
2015-10-31 19:09:46 -04:00
Benjamin Otte
2dad7c1319 gdk: Add gdk_rectangle_equal()
There's enough users inside GTK to warrant this convenience function.
2015-10-03 22:26:27 -04:00
Matthias Clasen
943c75fbec frame: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:13:42 -04:00
Jasper St. Pierre
18dbe181fb gtkframe: Don't queue a redraw on the entire widget every size allocate
Lots of applications often use GtkFrame as a giant toplevel container,
and that means that they get size allocated often. When frames get size
allocated, they invalidate their entire widget tree, even if they
haven't changed size or anything like that happens at all. This is
because the shadow / label needs to be redrawn if the child changes
size. We can optimize this out and only mark ourselves for a redraw if
the child has actually changed its size.
2015-07-14 18:32:45 -07:00
Benjamin Otte
0f6c955795 frame: Remove get_path_for_child implementation
As far as I can read the code it added the .frame style class to the
GtkFrame element. But GtKFrame already has a .frame style class these
days.
2015-07-08 05:48:59 +02:00
Matthias Clasen
ec7200797e GtkFrame: Use style classes for shadow
Use the FLAT style class when shadow is set to none, and
let the theme render the appropriate border.
https://bugzilla.gnome.org/show_bug.cgi?id=732256
2014-06-26 22:02:19 -04:00
Matthias Clasen
3ae562aca2 GtkFrame: Use G_PARAM_EXPLICIT_NOTIFY 2014-06-09 13:31:00 -04:00
Evan Nemerson
54ec42f035 gtk: port many nullability annotation fixes from Vala bindings
https://bugzilla.gnome.org/show_bug.cgi?id=730745
2014-05-30 13:24:20 -07:00
Benjamin Otte
562147c267 frame: 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
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
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -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
William Jon McCann
3b3d8ca456 docs: Use "#" for refsect2 instead of ## 2014-02-04 21:00:58 -05:00
Matthias Clasen
09d1b28249 docs: Convert to markdown
Specifically, switch to using markdown syntax for sections.
2014-02-02 00:30:27 -05:00
William Jon McCann
768bc44081 docs: use |[ ]| instead of <programlisting></programlisting>
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
Jasper St. Pierre
08053cbbb8 frame: Remove a couple strange casts... 2013-11-01 14:16:18 -04:00
Stefan Sauer
d4679c0a13 frame: annotate the @label params with (allow-none) 2013-08-29 09:06:31 +02: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