Commit Graph

93 Commits

Author SHA1 Message Date
Lapo Calamandrei
6da0a0a106 gtkheaderbar: add titlebutton styleclass to the separator
...of the window control buttons
2016-01-09 19:27:15 +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
Alberts Muktupāvels
a90926c7f0 gtkheaderbar: update window buttons also on realize
After bb34db6 _gtk_header_bar_update_window_buttons function is
called before application menu is set. This caused regression -
app menu button is initially hidden.

https://bugzilla.gnome.org/show_bug.cgi?id=756618
2016-01-01 15:55:37 +02:00
Matthias Clasen
e237c947c7 headerbar: Convert to gadgets 2015-12-15 08:41:16 -05:00
Kalev Lember
9103707922 headerbar: Don't leak internal widgets
Make sure to clean up internal widgets in destroy, as these aren't
cleaned up when GtkContainer walks the childrens list in
gtk_container_destroy().

This also fixes a gedit crash as reported in
https://bugzilla.redhat.com/show_bug.cgi?id=1288669

https://bugzilla.gnome.org/show_bug.cgi?id=759132
2015-12-07 22:15:25 -05:00
Timm Bäder
2182fe7d9d Don't pass widget state flags to GtkStyleContext API 2015-11-22 17:11:35 +01:00
Christoph Reiter
bb34db6d35 gtkheaderbar: update the window buttons on ::hierarchy-changed instead of ::realize
The window button setup depends on properties of the toplevel window.
Instead of updating the setup on realize, do it when the toplevel
changes.

This makes sure that when a GtkHeaderBar is added to a window
all the widgets are present and get_preferred_height() will return
the height the widget will have when finally shown. This allows
the logic in gtkwindow to select the right window size so that
the content size will match the requested default size.

https://bugzilla.gnome.org/show_bug.cgi?id=756618
2015-11-19 21:42:53 +01:00
Christian Hergert
5f0a8cf136 headerbar: remove G_PARAM_CONSTRUCT from custom-title
This fixes the ability to sublcass GtkHeaderBar from a UI template which
contains a custom <child type="title"> element.

https://bugzilla.gnome.org/show_bug.cgi?id=757544
2015-11-03 14:50:56 -08:00
Matthias Clasen
8c0c0f9c07 headerbar: Use an element name instead of a style class
Use the element name headerbar.
2015-10-30 01:07:58 -04:00
Matthias Clasen
84c7f6c747 header bar: Show a non-pixellated app icon
Load a hi-dpi icon when we are running with scale=2.

https://bugzilla.gnome.org/show_bug.cgi?id=751787
2015-09-30 18:42:20 -04:00
Matthias Clasen
565677a22c header bar: Don't leave a dangling pointer
This might be the cause for some crashes, like
https://bugzilla.redhat.com/show_bug.cgi?id=1264558
2015-09-29 15:15:06 -04:00
Matthias Clasen
661e51a8e2 header bar: Use g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:35 -04:00
Matthias Clasen
f881f37789 Fix csd decorations
By accident, commit b9b17c3c2a removed one line
that wasn't unused, but important for hiding close buttons on
dialogs. Bring it back.
2015-07-19 09:59:18 -04:00
Benjamin Otte
dbb1830728 headerbar: Switch css positions on direction change 2015-07-17 19:13:09 +02:00
Benjamin Otte
3d2ead0fce headerbar: Get rid of get_path_for_child()
Instead, reorder CSS nodes.
2015-07-16 06:15:13 +02:00
Benjamin Otte
a039fd1699 headerbar: Finish widget setup before showing it. 2015-07-16 06:15:13 +02:00
Benjamin Otte
792076e09b headerbar: forall() the button boxes in the right order 2015-07-16 06:15:13 +02:00
Benjamin Otte
b9b17c3c2a headerbar: Remove unused variables in private struct 2015-07-16 06:15:13 +02:00
Christoph Reiter
335c070f9b GtkHeaderBar: reduce minimum title width
The minimum title width affects the minimum window width
for CSD windows. To allow smaller windows like without
CSD reduce it a bit (276px vs 156px min width)

https://bugzilla.gnome.org/show_bug.cgi?id=751341
2015-06-23 21:16:37 +02:00
Matthias Clasen
c8d6231c3c Fix window button updates in split headers
We were only updating window buttons when the headerbar was
a direct child of the window. That is not the case in more
complicated situations, such as the split headers in gedit
or polari. To fix such cases, make the headerbar itself listen
for state changes on its toplevel.

https://bugzilla.gnome.org/show_bug.cgi?id=747805
2015-04-14 17:05:34 -04:00
Matthias Clasen
b187773053 Add style classes to the title buttons
This will let themes treat close/min/max buttons differently,
if they so desire.

https://bugzilla.gnome.org/show_bug.cgi?id=744400
2015-02-15 13:03:29 -05:00
Benjamin Otte
3fcb892831 headerbar: Implement clipping 2015-01-22 16:25:24 +01:00
Matthias Clasen
5a01208f55 GtkHeaderBar: Queue a resize when pack-type is changed
Otherwise, buttons appear to stick to the wrong side in glade.
2014-11-06 01:05:51 -05:00
Matthias Clasen
e2882e4845 GtkHeaderBar: Make the position child property writable
Glade asssumes that it is, and without this, rearranging children
in glade is very cumbersome.
2014-11-04 16:56:25 -05:00
Matthias Clasen
2873195644 GtkHeaderBar: Fix a corner-case in child properties
The child property setting must be prepared to deal with any
child property for any child, even if it doesn't make sense,
like the pack-type for the custom title. This is happening
in glade when undoing a change in the custom-title property.
2014-11-02 17:49:47 -05:00
Matthias Clasen
3404e92312 GtkHeaderBar: Update separator visibility when needed
We need to be a little more forthcoming with showing and hiding
the separators - their visibility now depends on the the visibility
and pack type of the regular headerbar children. This was observed
in gnome-contacts, where headerbar buttons are shown and hidden.
2014-08-28 22:54:18 -04:00
Nikita Churaev
684b981fb5 Only show title button separator when there is something to separate
https://bugzilla.gnome.org/show_bug.cgi?id=729636
2014-08-08 23:02:14 +02:00
Matthias Clasen
9d527c83aa GtkHeaderBar: Use defines for style classes 2014-07-04 19:06:08 -04:00
Matthias Clasen
baea175628 GtkHeaderBar: Don't forget to show the subtitle
https://bugzilla.gnome.org/show_bug.cgi?id=731790
2014-06-18 11:56:08 -04:00
Matthias Clasen
d1f6858b36 GtkHeaderBar: Use G_PARAM_EXPLICIT_NOTIFY 2014-06-09 13:31:04 -04:00
Matthias Clasen
d1d2763d00 GtkHeaderBar: Allow overdrawing
The draw function of GtkHeaderBar was returning TRUE, causing
after-signal handlers to not run. This breaks e.g. drawing of
dnd hightlights. Fix that.
2014-05-03 13:16:46 -04:00
Benjamin Otte
209781ae3c headerbar: 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
Volker Sobek
0940cbbeb9 docs: Fix parameter names for two functions
Don't use two different parameter names.
2014-04-21 22:57:35 +02:00
Yosef Or Boczko
900adae5d9 headerbar: Use popover for the fallback app menu
https://bugzilla.gnome.org/show_bug.cgi?id=723963
2014-04-06 02:23:19 -04:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
Matthias Clasen
c5874b1034 Document gtk_header_bar_get_has_subtitle 2014-02-19 01:03:37 -05:00
Matthias Clasen
e179c65da0 header bar: squeeze the title in
Let the center widget extend into the border area, to avoid
resizing header bars needlessly. This improves the uniformity
of header bars across applications, some of which don't use
subtitles, or use custom title widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=706515
https://bugzilla.gnome.org/show_bug.cgi?id=707999
2014-02-14 15:39:08 -05:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -05:00
Murray Cumming
a220871250 docs: Improve grammar in GtkHeaderBar overview 2014-01-31 11:24:34 +01:00
Matthias Clasen
6e96111d9f GtkHeaderBar: try harder to find the best window icon
GtkWindow has 4 (!) APIs for setting window icons, and we
have to try them all in the right order to find the right
icon. This commit makes it so, and keeps the icon list
manipulation inside gtkwindow.c by adding a private API
for getting a single icon at the right size.

https://bugzilla.gnome.org/show_bug.cgi?id=722515
2014-01-24 15:40:37 -05:00
Yosef Or Boczko
773e40ca7b docs: Add more a reference in GtkHeaderBar 2014-01-23 18:29:31 +02:00
William Jon McCann
0a416c7559 docs: avoid ambiguous return tags 2014-01-21 12:41:16 -05:00
Matthias Clasen
679883e098 Make sure title_bar_with is initialized
With a hidden custom title, we failed to initialize
the title_bar_width variables.
2014-01-18 17:58:44 -05:00
Volker Sobek
a4d69e7f14 docs/comments: Fix spelling of 'explicitly'
This replaces all occurrences of 'explicitely' with 'explicitly'. Only
code comments and gtk-doc statements are affected.

https://bugzilla.gnome.org/show_bug.cgi?id=722429
2014-01-18 03:47:46 +01:00
Matthias Clasen
b73d291086 header bar: Make it possible to have no title
Add a custom title had the side-effect of showing the widget.
That is not right, adding children and managing their visibility
should be independent. The headerbar size allocation code also
made the assumption that a custom title is always visible.

With these changes, GtkHeaderBar should be usable in situations
where the centering functionality is not required, and it is
important to freely pack content at both ends, such as in nautilus.

https://bugzilla.gnome.org/show_bug.cgi?id=722340
2014-01-17 19:52:29 -05:00
William Jon McCann
24aa40ed35 headerbar: Set a minimum size for the title
https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:06 -05:00
Cosimo Cecchi
197785744b window: add an is-maximized property to GtkWindow
With proper notifications, plus an accessor method for that state. This
allows client to just listen to notify::is-maximized instead of tracking
window-state-event.

https://bugzilla.gnome.org/show_bug.cgi?id=698786
2014-01-13 23:13:37 -05:00
Matthias Clasen
c3e91c7031 GtkHeaderBar: Fix positioning of pack-end widgets
This makes the positioning of pack-start and pack-end
widgets symmetric.
2014-01-06 23:37:18 -05:00
Matthias Clasen
2602372401 Be more careful when parsing gtk-decoration-layout
When the string is empty, breaking it at : will not give
us two tokens, and we were parsing garbage, leading to crash.
https://bugzilla.gnome.org/show_bug.cgi?id=721635
2014-01-06 17:07:21 -05:00
Matthias Clasen
f723113127 GtkHeaderBar: Refresh window buttons when settings change
We already do this when the shell-shows-menu settings changes,
but we forgot to do the same for the decoration layout.
2014-01-06 10:32:18 -05:00