Commit Graph

19586 Commits

Author SHA1 Message Date
William Jon McCann
f27d820aef docs: fix typo in property name 2014-01-21 18:57:37 -05:00
William Jon McCann
8e421623e6 docs: don't use properties syntax for child props 2014-01-21 18:57:37 -05:00
William Jon McCann
701651a0a5 docs: don't use properties syntax for child properties 2014-01-21 18:57:37 -05:00
William Jon McCann
9717e75ffe docs: there is no homogeneous property on bbox 2014-01-21 18:57:37 -05:00
William Jon McCann
c788b72768 docs: fix typo in property syntax 2014-01-21 18:57:37 -05:00
William Jon McCann
0b4ea6ea1b docs: fix typo in property name 2014-01-21 18:57:37 -05:00
William Jon McCann
01018e019b docs: don't use property syntax for child properties 2014-01-21 18:57:37 -05:00
William Jon McCann
dbcd452062 docs: fix use-header-bar property link 2014-01-21 18:57:37 -05:00
William Jon McCann
bc03314a06 docs: fix GtkBuilder typename 2014-01-21 18:57:37 -05:00
Volker Sobek
60c8277afb docs: fix typo
Correct the last occurrence of 'explicitely'.
2014-01-21 22:19:27 +01:00
William Jon McCann
5f37b081cf docs: fix docs for GtkIconLookupFlags 2014-01-21 13:33:47 -05:00
William Jon McCann
ed284234c9 docs: add docs for GtkTextAppearance 2014-01-21 13:33:47 -05:00
William Jon McCann
0192bb386c docs: fix docs for ActionBar 2014-01-21 13:33:47 -05:00
William Jon McCann
059f6d8a1f docs: add docs for GtkPageRange 2014-01-21 13:33:46 -05:00
William Jon McCann
0db5d93884 docs: add docs for some printing enums 2014-01-21 13:33:46 -05:00
William Jon McCann
212f6cef5e docs: add docs for GtkIconSize 2014-01-21 13:33:46 -05:00
William Jon McCann
1c5120eeec docs: add docs for GtkStockItem 2014-01-21 13:33:46 -05:00
William Jon McCann
06a619e642 docs: add docs for GtkScrollType and GtkScrollStep 2014-01-21 13:33:46 -05:00
William Jon McCann
59d35e3e51 docs: add docs for GtkPathPriorityType and GtkPathType 2014-01-21 13:33:46 -05:00
William Jon McCann
5366a21334 docs: add docs for GtkPrintPages and GtkPageSet 2014-01-21 13:33:46 -05:00
William Jon McCann
c2bd435203 docs: add docs for GtkIM*Style 2014-01-21 13:33:46 -05:00
William Jon McCann
ab41ef518a docs: add docs for GtkDirectionType and GtkDeleteType 2014-01-21 13:33:46 -05:00
William Jon McCann
75e3433d7b docs: add docs for GtkAccelFlags 2014-01-21 13:33:46 -05:00
William Jon McCann
1af6bd05dc docs: add docs for GtkRcFlags 2014-01-21 13:33:46 -05:00
William Jon McCann
b447ca7884 docs: add docs for GtkRcProperty 2014-01-21 13:33:46 -05:00
William Jon McCann
77f3f726e7 docs: add docs for GtkStyle 2014-01-21 13:33:45 -05:00
William Jon McCann
b28f04d6e9 docs: add docs for GtkCssProviderError 2014-01-21 13:33:45 -05:00
William Jon McCann
7b14899f4d docs: fix docs for GtkStyleProperties 2014-01-21 13:33:45 -05:00
William Jon McCann
f49e077c27 docs: add keys_changed signal to GtkWindowClass 2014-01-21 13:33:45 -05:00
William Jon McCann
2375148b04 docs: add docs for GtkTextDirection 2014-01-21 13:33:45 -05:00
William Jon McCann
2986456be1 docs: add docs for GtkWidgetHelpType 2014-01-21 13:33:45 -05:00
William Jon McCann
a2ba1789e1 docs: add docs for GtkWidgetAuxInfo 2014-01-21 13:33:45 -05:00
William Jon McCann
1763b94fb2 docs: add docs for GtkWidgetClass 2014-01-21 13:33:45 -05:00
William Jon McCann
badba59aac docs: add docs for GtkCellRendererAccelMode 2014-01-21 13:33:45 -05:00
William Jon McCann
224a8e1763 docs: add docs for GtkCellEditableIface 2014-01-21 13:33:45 -05:00
William Jon McCann
9f815edbf9 docs: add docs for GtkCellLayoutIface 2014-01-21 13:33:45 -05:00
William Jon McCann
4f8ae44594 docs: add docs for GtkTreeDragDestIface 2014-01-21 13:33:45 -05:00
William Jon McCann
094350df26 docs: add docs for GtkTreeDragSourceIface 2014-01-21 13:33:45 -05:00
William Jon McCann
a64ffa2958 docs: add docs for GtkTreeSortableIface 2014-01-21 13:33:45 -05:00
William Jon McCann
123fa640d2 docs: add docs for GtkTreeModelIface 2014-01-21 13:33:45 -05:00
William Jon McCann
39caa5cbb2 docs: fix docs for GtkIconTheme 2014-01-21 13:33:19 -05:00
William Jon McCann
0b5ee774e0 docs: add docs for GtkToolbarSpaceStyle 2014-01-21 13:33:19 -05:00
William Jon McCann
fad2031cea docs: add documentation for values of GtkTextWindowType 2014-01-21 13:33:19 -05:00
William Jon McCann
1ec4b0cff2 docs: add field descriptions for GtkTextAttributes 2014-01-21 13:33:19 -05:00
William Jon McCann
885d8df39c docs: add docs GtkTextBufferTargetInfo 2014-01-21 13:33:19 -05:00
William Jon McCann
339524ba0d docs: add field descriptions for GtkSettingsValue 2014-01-21 13:33:11 -05:00
William Jon McCann
34ea1919cf docs: document fields of GtkRecentFilterInfo 2014-01-21 12:41:16 -05:00
William Jon McCann
4fd6ce6a91 docs: add docs for GtkRecentChooserIface 2014-01-21 12:41:16 -05:00
William Jon McCann
cc7b5d0a57 docs: add missing flag 2014-01-21 12:41:16 -05:00
William Jon McCann
62b47774ea docs: add missing method 2014-01-21 12:41:16 -05:00
William Jon McCann
e8ba83825c docs: mark base interface as private 2014-01-21 12:41:16 -05:00
William Jon McCann
62d8baa215 docs: add missing docs for GtkAccelKey 2014-01-21 12:41:16 -05:00
William Jon McCann
33fc160cd2 docs: fill in some missing field descriptions 2014-01-21 12:41:16 -05:00
William Jon McCann
f1475c0852 docs: mark some enums values as deprecated 2014-01-21 12:41:16 -05:00
William Jon McCann
0a416c7559 docs: avoid ambiguous return tags 2014-01-21 12:41:16 -05:00
William Jon McCann
498345ffe1 docs: fix docs for out params 2014-01-21 12:41:16 -05:00
William Jon McCann
2054166c34 docs: don't use gtkdoc style for regular comments 2014-01-21 12:41:16 -05:00
Steve Frécinaux
49bf3cdba8 GtkStack: add gtk_stack_get_child_by_name()
This new method allows getting a widget from a GtkStack when we know its
name, and will also return NULL if there is no widget going by that
name.

Usage example would be to check if a child with a given name exists
before calling gtk_stack_set_visible_child_name().

https://bugzilla.gnome.org/show_bug.cgi?id=722588
2014-01-21 09:35:22 +01:00
William Jon McCann
29f2578cca docs: add docs for GtkTargetPair 2014-01-20 15:18:21 -05:00
William Jon McCann
add1ca00f4 docs: add Gtk*Class docs
https://bugzilla.gnome.org/show_bug.cgi?id=81006
2014-01-20 12:31:21 -05:00
William Jon McCann
f3f7c385d9 Remove references to removed gtk_item_select api 2014-01-20 12:31:21 -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
Matthias Clasen
7c08896384 path bar: Request enough natural width to fit all buttons
Otherwise, we are at the mercy of the container giving us
more space than we request, which does not always work.
2014-01-18 17:58:44 -05:00
Ryan Lortie
fdc66af5ce quartz: add a default application menu
When running on quartz, it is no longer expected for applications to
provide their own application menu.  Instead, they should simply ensure
that they provide "app.about", "app.preferences" and "app.quit" actions
(which many apps are already doing).

A default menu will be shown that looks like the one presented by all
other Mac OS applications, containing menu items for the above actions,
as well as the typical "Hide app", "Hide Others and "Show All" items and
the "Services" submenu.

If an application does explicitly set an application menu (via
gtk_application_set_app_menu()) then it will be respected, as before.

https://bugzilla.gnome.org/show_bug.cgi?id=720552
2014-01-17 23:14:20 -05:00
Ryan Lortie
3f1a413d0c extract-strings: support GMenu GtkBuilder markup
Add support for extracting strings from GMenu markup in GtkBuilder
files.

This means that we have to support translatable <attribute/> tags.

Unfortunately, <attribute> is also used by GtkTreeViewColumn and
GtkLabel for other purposes, and those other purposes use a value=''
(XML) attribute, so we must accept (and ignore) that in order not to
have errors.  Nothing will happen in those cases because they do not
also specify translatable='yes', so we ignore them.

https://bugzilla.gnome.org/show_bug.cgi?id=720552
2014-01-17 22:44:23 -05:00
Ryan Lortie
6da7b11ff6 application: new 'insert action group' private api
Add a new private API to GtkApplication akin to
gtk_widget_insert_action_group().

We'll use this to insert a few extra actions at the app level with a
separate namespace for the special items in the Mac OS application menu.

https://bugzilla.gnome.org/show_bug.cgi?id=720552
2014-01-17 22:40:50 -05:00
Ryan Lortie
5d63ee8e0e quartz menu: add a hack for application name
Add a private hack to allow the insertion of the name of the application
into the label of menu items.

If it appears in the label of any menu item, "%s" will be replaced with
the name of the application.

We will use this for the "Hide myapp", "Quit myapp" and "About myapp"
labels typically found on Mac OS programs.

https://bugzilla.gnome.org/show_bug.cgi?id=720552
2014-01-17 22:37:04 -05:00
Ryan Lortie
ceeef03004 quartz menu: add special items
Add support for the "Hide app", "Hide Others" and "Show All" special
items and for the "Services" submenu.

https://bugzilla.gnome.org/show_bug.cgi?id=720552
2014-01-17 22:37:04 -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
Ryan Lortie
ea0ede201e GtkMenuTracker: add 'special' items
Allow the possibility for items to be marked with a special attribute and
expose this via GtkTrackerMenuItem.  For internal use only.

We will use this to implement the special 'Hide', 'Hide Others' and 'Show All'
items and the 'Services' submenu in the Mac OS application menu.

https://bugzilla.gnome.org/show_bug.cgi?id=720552
2014-01-17 20:32:55 -05:00
Ryan Lortie
e70f506e83 quartz menu: change sensitivity approach
By default, Mac OS scans menus as they are opened, updating the
sensitivity of each item in the menu.

The current code in gtkapplication-menu-quartz disables this behaviour,
preferring to manually control the sensitivity of each item in the menu
(when told by the tracker that it has changed internally).

Change the way that this works to more closely follow the usual Mac OS
regime.

This will allow us to construct a typical "application menu" on Mac OS
containing the items that are typically found there ("Hide", "Hide
Others", "Show All", "Services") and have the OS automatically update
their sensitivity.

https://bugzilla.gnome.org/show_bug.cgi?id=720552
2014-01-17 20:29:31 -05: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
Matthias Clasen
dc749c5a27 mount operation: Use headerbar
Make GtkMountOperation use a headerbar for its dialog
when desired.
2014-01-17 17:52:08 -05:00
William Jon McCann
066810ac00 recent chooser dialog: Use headerbar
Make the recent chooser dialog use a headerbar
when desired.

https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:08 -05:00
William Jon McCann
bf14a334f4 file chooser dialog: Use headerbar
Make the file chooser dialog use a headerbar
when desired.

https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:08 -05:00
William Jon McCann
b0caf23977 custom paper dialog: Use headerbar
Make the custom paper dialog use a headerbar when desired.

https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:08 -05:00
William Jon McCann
f2d6ed3290 page setup dialog: Use headerbar
Make the page setup dialog use a headerbar when desired.

https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:08 -05:00
William Jon McCann
bb951fe783 print dialog: Use headerbar
Make the print dialog use a headerbar when desired.

https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:08 -05:00
William Jon McCann
dfaa4857f5 app chooser: Use headerbar
Use a GtkHeaderBar in the app chooser dialog when desired.

https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:08 -05:00
William Jon McCann
9c443b4a3c color chooser: Use headerbar
Make GtkColorChooserDialog use a headerbar when desired.

https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:08 -05:00
William Jon McCann
3eb2430a98 font dialog: Use headerbar
Make the font chooser dialog use a headerbar
when desired.

https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:08 -05:00
William Jon McCann
a70f8f44b4 about dialog: Use headerbar
Use a GtkHeaderBar for the credits and about buttons.

It makes less sense here than in other places to go back to
the buttons on the bottom, considering we only have a close
button, so we always use a header bar.

https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:08 -05:00
Matthias Clasen
54b1419952 dialog: Show the action area when needed
If we find that widgets are being added to the action area,
we should show it. Also warn in this situation.
2014-01-17 17:52:08 -05:00
Matthias Clasen
106bcc7f5e Make it possible to set use-header-bar from a setting
This commit introduces a private convenience API that derived
dialogs can call in their instance init. This is necessary to
make the setting work as intended in the face of 3rd party
dialogs derived e.g. from GtkFileChooserDialog, which are
created with g_object_new.
2014-01-17 17:52:08 -05:00
Matthias Clasen
3701de14a1 Add a setting for dialog headers
This setting will let us keep traditional appearance
of dialogs on platforms where this is expected.
The new setting is called gtk-dialogs-use-header, backed
by the Gtk/DialogsUseHeader xsetting.
2014-01-17 17:52:08 -05:00
William Jon McCann
f69de3c14a message dialog: Center text
https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:07 -05:00
William Jon McCann
a3b423ce5b message dialog: Don't show images
https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:07 -05:00
Matthias Clasen
c42b39a9db message dialog: Allow action area to extend to the edge
https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:07 -05:00
Matthias Clasen
38d8fdab80 message dialog: Don't use headerbar
https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:07 -05:00
Matthias Clasen
de90d5a4f8 dialog: Add style classes
These will be used in subsequent commits to better style
message dialogs.
2014-01-17 17:52:07 -05:00
William Jon McCann
9640eccd14 dialog: Add a headerbar
This change makes it possible for GtkDialog to pack
its action widgets into a header bar, instead of the
traditional action area. This change is controlled
by the use-header-bar construct-only property.

https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:07 -05:00
Matthias Clasen
25e6ba48e7 Update all internal users of alternative button order
We'll keep this code around for now to not regress
on Windows, but avoid deprecation warnings.
2014-01-17 17:52:07 -05:00
William Jon McCann
57139820c9 dialog: Mark alternate button order as deprecated
This feature was never implemented 100% correct, and
does not apply to action buttons in header bars.

https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:07 -05:00
Matthias Clasen
3d354026ca file chooser: Clean up direct action area interaction 2014-01-17 17:52:07 -05:00
Matthias Clasen
abe29dd188 Update all internal users of gtk_dialog_get_action_area
Some of these should be revisited and fixed. For now,
just avoid the deprecation warnings.
2014-01-17 17:52:07 -05:00
Matthias Clasen
32a2901294 dialog: Mark gtk_dialog_get_action_area as deprecated
Direct access to the action area by applications makes it much more
difficult to make changes to GtkDialog. Therefore, deprecate this
function.
2014-01-17 17:52:07 -05:00
Matthias Clasen
1258eadd75 button box: Set linked style for extend
This is needed for proper styling of the new extend-placement
in button boxes.
2014-01-17 17:52:07 -05:00
William Jon McCann
00326d3362 Add an expand button box type
https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:07 -05:00
William Jon McCann
8db2ba425a window: Allow unsetting custom titlebar
https://bugzilla.gnome.org/show_bug.cgi?id=720059
2014-01-17 17:52:06 -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
Paolo Borelli
4adc072952 Use gtk_window_close for gtk_dialog_close
We manually synthethized the delete event, but now we have the
corresponding method in GtkWindow
2014-01-17 19:24:27 +01:00
Debarshi Ray
a5ff70f949 widget: Add deprecation annotations for {get,set}_margin_{left,right}
Fallout from 9921bec63a
2014-01-17 18:03:52 +01:00
Paolo Borelli
609ddec1f8 Always return FALSE from the notebook leave_notify handler
As discussed on IRC with Benjamin, this should not make much
difference in practice, but it is more correct
2014-01-14 20:29:46 +01:00
Paolo Borelli
84b44dd2ac Readd line removed by mistake in the previous commit 2014-01-14 20:23:52 +01:00
Paolo Borelli
4a3f21b693 Prelight notebook tab
Set the prelight state when hovering a notebook tab with the mouse.

https://bugzilla.gnome.org/show_bug.cgi?id=711233
2014-01-14 20:18:54 +01:00
Ryan Lortie
bc3867eb85 GtkApplicationWindow: give up on handling dispose
Stop trying to deal with "theoretical possibilities".

We can't possibly continue to be a faithful GActionGroup implementation
across dispose because dispose has a side effect of removing everyone's
signal handlers.

The code that we ran after the dispose chainup to do all of the fancy
signal emulation was therefore dead.  The test that aimed to verify this
was buggy itself due to an uninitialised variable, so really, it never
worked at all.

We keep the re-ordering of the chainup from the original commit to avoid having
trouble with GtkActionMuxer and keep the checks in place that will prevent an
outright segfault in the case that someone else tries to use the interface
post-dispose.

https://bugzilla.gnome.org/show_bug.cgi?id=722189
2014-01-14 10:41:35 -05:00
Bastien Nocera
587f993444 treemodelfilter: Fix typo in API docs 2014-01-14 15:02:59 +01:00
Mike Gorse
e529dfe949 A11y: Fix text functions for table cells
Keep the PangoLayout around, and refresh in update_cache.

https://bugzilla.gnome.org/show_bug.cgi?id=707729
2014-01-13 23:51:26 -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
1691bb741d Don't implement popup_menu in GtkWindow
This leads to disastruous results, since each menu is itself
in a GtkWindow, so holding down the menu key leads to a neverending
cascade of menus on top of menus.

https://bugzilla.gnome.org/show_bug.cgi?id=722106
2014-01-13 22:59:59 -05:00
John Lindgren
7a411eb6dd Fix memory leak in GtkTreeViewAccessible
https://bugzilla.gnome.org/show_bug.cgi?id=722030
2014-01-13 22:30:38 -05:00
Yosef Or Boczko
d0787765bc Add separator before "Always on Top" to the CSD window
https://bugzilla.gnome.org/show_bug.cgi?id=722076
2014-01-13 22:25:24 -05:00
Matthias Clasen
0de1173600 Fix a memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=722029
2014-01-13 22:22:29 -05:00
Benjamin Otte
cd184b0f40 themingengine: Don't draw 0px borders
Theming code gets confused when computing the spacing for 0px wide dots
and then divides by 0. And then cairo complains and stops drawing
anything forever out of spite and then we end up with a single color
screen.

https://bugzilla.gnome.org/show_bug.cgi?id=721800
2014-01-14 03:38:04 +01:00
Matthias Clasen
6718a21b1c Add move and resize to the csd window menu
With the previous commit, these operations can be implemented
now.
2014-01-12 22:25:20 -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
Andika Triwidada
0a768d274d Changed obsolete FSF portal addresses to web address
Fixed https://bugzilla.gnome.org/show_bug.cgi?id=721530
2014-01-12 19:56:49 +07:00
Jasper St. Pierre
8a1fb19e88 gtkwindow: Rename get_decoration_size => get_shadow_width 2014-01-10 12:10:33 -05:00
Ignacio Casal Quinteiro
99ee1875ab gtkapplication: add missing annotation for set_accels_for_action 2014-01-10 15:19:05 +01:00
Alexander Larsson
664fe89f6e GtkTextView: Fix scrolling of added children
The behaviour of gtk_text_view_add_child_in_window() used to be
quite broken. It scrolled with the window during scrolling, then
jumped to the absolute position when the widget resized. Furthermore,
in 3.10 we broke the first feature, making it always be fixed.

The "proper" way to handle this is to always follow scrolling. This
is what the only user so far (gedit) wants, and if you want some
kind of overlay you should use GtkOverlay instead.

So, this changes the behaviour to something that is internally consistent
and works. I.e. all added widgets scroll with the textview as needed.

https://bugzilla.gnome.org/show_bug.cgi?id=711826
2014-01-10 12:08:52 +01:00
Ryan Lortie
7291d3e780 Simplify GtkActionHelper
Now that the last GMenuModel-based user of GtkActionHelper is gone, we
can substantially simplify it.

https://bugzilla.gnome.org/show_bug.cgi?id=721836
2014-01-08 18:21:26 -05:00
William Hua
649ff84d91 Use GtkMenuTracker for Quartz backend.
https://bugzilla.gnome.org/show_bug.cgi?id=710351
2014-01-08 18:16:05 -05:00
William Hua
2a109250d5 Move get_key_equivalent() to gdk quartz utils.
https://bugzilla.gnome.org/show_bug.cgi?id=710351
2014-01-08 17:42:19 -05:00
Ryan Lortie
d31bf779bb GtkMenuTracker: fix hidden-when='' vs. separators
Ensure that adding hidden-when='' to a menu item does not produce an
extra separator item as a side effect.

https://bugzilla.gnome.org/show_bug.cgi?id=688421
2014-01-08 14:31:16 -05:00
Ryan Lortie
2112af719a GtkMenuTracker: remove hidden items from the menu
Modify the tracker so that it manages the visibility of
GtkMenuTrackerItem by issuing insert and remove callbacks to the
user of the tracker.

This works by treating the GtkMenuTrackerItem as a virtual section which
contains 1 item when the item is visible and 0 items when it is hidden.

For efficiency reasons, we only employ this trick in the case that the
item has a hidden-when='' attribute set on it.

https://bugzilla.gnome.org/show_bug.cgi?id=688421
2014-01-08 14:21:19 -05:00
Ryan Lortie
2b1aa12f01 GtkMenuTrackerItem: add an internal 'visible' flag
Add an internal API for checking if a GtkMenuTrackerItem is visible,
along with a signal for reporting changes in that flag.  The item will
become invisible in situations according to the new hidden-when=''
attribute, which can be set to 'action-disabled' or 'action-missing'.

This new flag doesn't actually do anything yet, and none of the
consumers of GtkMenuTracker do anything with it (nor should they).  A
followup patch will address the issue.

https://bugzilla.gnome.org/show_bug.cgi?id=688421
2014-01-08 14:21:18 -05:00
Ryan Lortie
8efb1404cb GtkMenuTracker: rework action removal a bit
Refactor the code in the action observer remove function in order to
make way for the (efficient) handling of hiding of the item in the case
that hidden-when='' is given.

https://bugzilla.gnome.org/show_bug.cgi?id=688421
2014-01-08 14:21:18 -05:00
Ryan Lortie
8256b88eb1 GtkMenuTrackerItem: small logic tweak
Strictly speaking, can_activate should always be set back to FALSE when
the action disappears from the muxer (since we can't activate it
anymore) but we forgot to do that.

This 'bug' could never cause a problem because 'can_activate' is never
directly queried for anything at all and the item would get marked
insensitive anyway.  As soon as the action was re-added, can_activate
would be recalculated based on the new action before anything else could
happen.

All the same, this should be cleared here.

https://bugzilla.gnome.org/show_bug.cgi?id=688421
2014-01-08 14:21:18 -05:00
Ryan Lortie
fb14a78271 GtkMenuTracker: cache result of hash lookup
Remove a hash lookup from the separator sync logic (which is run every
time we change a menu).  Instead, we do the lookup when creating the
section and cache the result.

This refactor will also help us in a future commit to add support for
hiding menu items based on missing actions.

https://bugzilla.gnome.org/show_bug.cgi?id=688421
2014-01-08 14:21:17 -05:00
Ignacio Casal Quinteiro
75ef6096c1 colorbutton: fix crash when destroying the colorbutton from the color-set signal 2014-01-08 14:38:33 +01:00
Alexander Larsson
d07913840a PixelCache: Ensure clean cairo_t state in draw
This adds save/restore calls to the clear-to-transparent call in
the pixel cache, to avoid changing the default color of the
cairo_t. It also removes a call set_operator call that is no longer
necessary (it was trying to manually restore the state).

https://bugzilla.gnome.org/show_bug.cgi?id=721480
2014-01-08 10:48:56 +01:00
William Hua
fd13713230 GtkIconInfo: add gtk_icon_info_is_symbolic()
https://bugzilla.gnome.org/show_bug.cgi?id=710351
2014-01-08 02:10:14 -05:00
Ryan Lortie
146f3a988d gtkapplication-quartz: clean up inhibit code
When testing with bloatpad, the existing inhibit code seems not to be
working at all.  Replace it with a cleaner and simpler version that
works.

https://bugzilla.gnome.org/show_bug.cgi?id=720551
2014-01-07 23:08:45 -05:00
Ryan Lortie
2fd307fdb3 Fix GtkApplicationWindow action group implementation
GtkApplicationWindow frees its internal action group on dispose for the
usual reasons: to avoid the possibility of reference cycles caused by
actions referring back to the window again.

Unfortunately, if it happens to be inside of a GtkActionMuxer at the
time that it is disposed, it will (eventually) be removed from the muxer
after it has been disposed.  Removing an action group from a muxer
involves a call to g_action_group_list_actions() which will crash
because the internal action group to which we normally delegate the call
has been freed.

A future patch that reworks the quartz menu code will introduce a use of
GtkActionMuxer in a way that causes exactly this problem.

We can guard against the problem in a number of ways.

First, we can avoid the entire situation by ensuring that we are removed
from the muxer before we destroy the action group.  To this end, we
delay destruction of the action group until after the chain-up to the
dispose of GtkWindow (which is where the window is removed from the
GtkApplication).

Secondly, we can add checks to each of our GActionGroup and GActionMap
implementation functions to check that the internal action group is
still alive before we attempt to delegate to it.

We have to be careful, though: because our _list_actions() call will
suddenly be returning an empty list, people watching the group from
outside will have expected to see "action-removed" calls for the
now-missing items.  Make sure we send those. but only if someone is
watching.

https://bugzilla.gnome.org/show_bug.cgi?id=710351
2014-01-07 19:29:05 -05:00
Matthias Clasen
3efd0b2874 GtkActionBar: Just leave the center widget as NULL, initially
No need to construct a box that gets thrown away later.
Plus, this fixes the defaultvalue test for GtkActionBar.
2014-01-07 16:16:52 -05:00
Matthias Clasen
b39f094b21 Fix order of pack-end widgets
https://bugzilla.gnome.org/show_bug.cgi?id=721665
2014-01-07 08:46:37 -05:00
William Jon McCann
e72aca055d Add GtkActionBar
A widget intended to offer contextual actions for a given view.
It allows packing children into the start or end as well as offering
a single centered child box.

https://bugzilla.gnome.org/show_bug.cgi?id=721665
2014-01-07 08:46: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
Federico Mena Quintero
9538bc6221 filechooser: Document the settings XML 2014-01-06 17:16:16 -06: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
William Jon McCann
4b1838bde6 Fix positioning of up menu button popup
Use the menu allocation instead of the request size.

https://bugzilla.gnome.org/show_bug.cgi?id=720939
2014-01-06 12:44:59 -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
Matthias Clasen
a4e4d7d1fd GtkMenuItem: fix initial accessible selection state
When the accessible is created for an already-selected
menuitem, we were not properly setting the state of the
the accessible. Fix that.
2014-01-05 22:45:39 -05:00
Simon Feltman
efa8956718 Add introspection friendly version of gtk_tree_path_new_from_indices
Add gtk_tree_path_new_from_indicesv which takes an array of
integers with a length. Use "Rename to" annotation to rename the
method as gtk_tree_path_new_from_indices. This is needed because
the original method takes variadic arguments which is not supported
by introspection.

https://bugzilla.gnome.org/show_bug.cgi?id=706119
2014-01-05 11:23:41 -08:00
Matthias Clasen
e015102fa9 a11y: Fix keybindings in menus
GtkMenuItemAccessible was assuming that an accel label is
always the immediate child of a menu item. It also did not
deal with manually set accels.  Fix both of these.
https://bugzilla.gnome.org/show_bug.cgi?id=721086
2014-01-05 11:56:31 -05:00
Matthias Clasen
7e3f68d950 GtkAccelLabel: Add a setter for manual accels
This is needed to keep the a11y keybinding code working.
2014-01-05 11:12:09 -05:00
Matthias Clasen
29cd52c854 Emit a11y state change notification for color swatches
Improve the color swatch accessible to set a proper role
depending on whether the swatch is selectable or not, and
set the checked atk state when appropriate.

https://bugzilla.gnome.org/show_bug.cgi?id=721048
2014-01-05 10:54:43 -05:00
Matthias Clasen
b962d7686a Color chooser: More accessible names
Set the accessible name of the 'custom color' button too.
2014-01-05 09:21:32 -05:00
Matthias Clasen
6a7670efe5 Nicer nicks for GtkMenuButton properties
Requested in
https://bugzilla.gnome.org/show_bug.cgi?id=720945
2014-01-04 23:36:12 -05:00
Matthias Clasen
c6175bbe68 GtkColorChooserWidget: Set accessible names
As pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=721053
we should set the accessible name on the color swatch widgets,
not the descriptions.
2014-01-04 23:30:28 -05:00
Matthias Clasen
b4d9ea1878 GtkModelMenuItem: set initial accessible role
The initial state of GtkModelMenuItem is that of a normal menu
item, but the accessible we are using, GtkCheckMenuItemAccessible,
starts out with a role of 'check menu item'. Fix that up by
explicitly setting the initial accessible role.
2014-01-04 23:15:40 -05:00
Matthias Clasen
8085b41074 GtkCheckMenuItemAccessible: Make work with model menu items
GtkModelMenuItem does not emit the ::toggled signal when a radio
item is activated, so listen for property notification for that
property. We still keep the ::toggled signal handler, in order
to not break other uses of check and radio menu items.

https://bugzilla.gnome.org/show_bug.cgi?id=720983
2014-01-04 21:53:31 -05:00
Matthias Clasen
2a3d5823f4 GtkModelMenuItem: Add some property notification
GtkModelMenuItem emits no property notification, since none of its
properties are readable. But the toggled property is just a proxy
for GtkCheckMenuItem::active, so we should ensure that property
notification is emitted for the ::active property.
2014-01-04 21:52:36 -05:00
Tristan Van Berkom
07d6c69128 bgo #721407 - Fix scrolled window to work with template subclasses.
Ensure the hscrollbar & vscrollbar at gtk_scrolled_window_add() time,
this allows one to subclass GtkScrolledWindow with templates and add
children, as this will happen at instance initialization time before
the construct adjustment properties take effect.
2014-01-04 20:36:17 -05:00
Matthias Clasen
9137b4ed8e GtkColorSwatch: Set an accessible role
And update the colorchooser a11y test to a) use GtkColorChooser
instead of the deprecated GtkColorSelection and b) match this
change. Pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=721045
2014-01-04 18:52:46 -05:00
Matthias Clasen
2f4b577165 GtkInfoBar: Set a more accurate accessible role
And update the a11y tests to match. Pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=721042
2014-01-04 17:44:14 -05:00
Matthias Clasen
e904d1c97d GtkDrawingArea: Set an accessible role
And update the a11y tests to match. Pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=721040
2014-01-04 17:41:23 -05:00
Matthias Clasen
4de1259cd9 Trivial formatting fix 2014-01-04 17:41:23 -05:00
Clayton Walker
568e867dad gtk: remove unused GTK_BUTTONBOX_DEFAULT_STYLE from gtkenums.h tests: remove GTK_BUTTONBOX_DEFAULT_STYLE from testbbox.c and fix crashing
https://bugzilla.gnome.org/show_bug.cgi?id=721317
2014-01-04 13:56:42 -05:00
Matthias Clasen
64855f1295 GtkNotebook: Fix a problem with tab states
When replacing the tab label, we were not adding the
active-page style class. Fix that.
2014-01-04 13:01:49 -05:00
Matthias Clasen
7cd3e7c81b Raleigh: Improve notebook tab theming
The theme was not kept up-to-date when notebook tabs were
recently refactored. Fix it to show some indication of the
active tab.
2014-01-04 12:55:01 -05:00
Matthias Clasen
cda87304d9 Raleigh: Improve scale theming
Add some visual indication for fine adjustment mode in scales
and scrollbars.
2014-01-04 12:12:14 -05:00
Matthias Clasen
8b558e7889 Raleigh: Improve titlebar appearance
The default theme wasn't kept up-to-date as the header bar
and titlebar theming was tweaked. Update it to look non-broken,
at least.
2014-01-04 11:52:02 -05:00
Matthias Clasen
2ebbc724b7 GtkAboutDialog: be consistent about link activation
As pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=721394,
links in the credits part were not going through the
::link-activated signal. Fix that.
2014-01-04 11:08:29 -05:00
Matthias Clasen
08f31006cb Trivial grammar fix 2014-01-04 10:57:46 -05:00
Matthias Clasen
9bf89f2b5e GtkLabelAccessible: reorganize the code
Separate the GtkLabelAccessible, GtkLabelAccessibleLink and
GtkLabelAccessibleLinkImpl implementations more clearly.
2014-01-04 10:54:03 -05:00
Matthias Clasen
b85a8001e0 GtkLabelAccessible: update state of links
This commit makes the LinkImpl children of label accessibles
inherit all their state, except for focused and visited, which
are handled directly.

https://bugzilla.gnome.org/show_bug.cgi?id=721406
2014-01-04 10:54:03 -05:00
Matthias Clasen
5845356d66 GtkLabelAccessible: Implement AtkHypertext
This commit makes the label accessible implement AtkHypertext,
which returns a AtkHyperlink object for each link in the text.
At the same time, add AtkHyperlinkImpl objects as children
to the label accessible.

Also some private API to indicate that links have changed, and
call that from GtkLabel when needed.

Adjust expected output of the affected a11y tests.

https://bugzilla.gnome.org/show_bug.cgi?id=721410
https://bugzilla.gnome.org/show_bug.cgi?id=721421
2014-01-04 10:54:03 -05:00
Matthias Clasen
0d9efde303 GtkLabel: Add private api for links
This exposes enough information to implement the AtkHyperText
interface.

More private link api
2014-01-04 10:54:03 -05:00
Matthias Clasen
c6d9f82916 Add a gtklabelprivate.h header
For now, move the few private functions from gtklabel.h here.
2014-01-04 10:54:03 -05:00
Matthias Clasen
e375b564fb GtkLinkButtonAccessible: fix broken AtkHyperlink implementation
The get_end_index implementation was casting the accessible
to AtkText even though GtkLinkButtonAccessible does not
implement this interface. This did not show up in the a11y
tests because the they were not dumping the affected AtkHyperlinkImpl
properties. Oops.
2014-01-04 10:54:03 -05:00
Matthias Clasen
57d1e6d17d Deprecated the decoration-button-layout style property
This is now done via a setting + regular property, for
better control, and the style property is ignored.
2014-01-04 10:54:03 -05:00
Ryan Lortie
ba09124f9f GtkMenuTracker: tweak separator logic
Ignacio Casal Quinteiro reported a problem whereby an empty section at
the start of a menu has a separator placed after it.  This was caused by
the implementation of the logic that separators should be inserted at
the top of all non-empty sections that are not the first section.  This
logic is obviously incorrect in the case that the first section is empty
(in which case we would not expect to see a separator at the top of the
second section).

Change the logic so that we only insert separators when we see a
non-zero number of actual items in the menu before us.

https://bugzilla.gnome.org/show_bug.cgi?id=721119
2014-01-04 02:31:08 -05:00
Colin Walters
93bcca7f02 window: Document GtkWindow::set-focus
Not sure why this was never documented.
2014-01-02 20:04:47 -05:00
Giovanni Campagna
cecb2fa3ca GtkApplicationX11: read the startup ID from the platform data
If the platform data passed with actions and activations includes
a startup notify ID, we should read it and pass it down to GDK.
This ensures that the right startup notify is completed after the
signal emission, and that the user time of the GdkDisplay is properly
updated (which in turn makes sure the windows are not subjected
to focus-stealing-prevention)

https://bugzilla.gnome.org/show_bug.cgi?id=721304
2014-01-02 21:17:22 +01:00
Benjamin Otte
6d811a67dc treeview: Track area in cell that editable occupies
With multiple renderers per cell, editables shouldn't occupy the whole
cell's area.

https://bugzilla.gnome.org/show_bug.cgi?id=710315
2013-12-28 15:44:19 +01:00
Chun-wei Fan
adb0d2adac gtk/gtkapplication.c: Don't Include unistd.h Unconditionally
This header, which is not universally available, is accidently made to be
included unconditionally during the refactoring of gtkapplication.c,
so restore the #ifdef check.
2013-12-26 16:15:10 +08:00
Matthias Clasen
7e1a4800fa Redo header bar decorations once more
Applications need a way to fix or adapt the decoration layout,
for situations like split header bars. Setting the layout from
the theme with a style property did not offer a good way to do
this, and the ::show-close-button property does not provide
fine-grained control.

To improve the situation, move the layout string to a property of
GtkHeaderBar which is backed by a setting. This allows platforms to
set a default button layout independent of the theme, while applications
can override the default.

The style GtkWindow style property is now deprecated and ignored.
2013-12-21 21:58:24 -05:00
Matthias Clasen
1bfe9d0db9 Fix a few warnings 2013-12-20 15:15:31 -05:00
Matthias Clasen
18d439ee40 Allow close buttons on dialogs
It was a long-standing problem for some users of GtkDialog that
there is no guaranted way to close it. So, lets show a close
button.
2013-12-20 13:31:08 -05:00
Matthias Clasen
f200eebfd6 Improve menubutton a11y
The button now claims its menu as a child for a11y purposes,
which makes it possible for ATs to see it when the navigate
the tree top-down.

Update the a11y test to match.
2013-12-20 13:31:08 -05:00
Matthias Clasen
2c007a8691 Set an accessible name on menu buttons
These commonly have just an image in them, so lets at least
call them 'Menu'.
2013-12-20 13:31:08 -05:00
Matthias Clasen
465d4be3cf GtkPlacesSidebar: Don't show desktop if its home
We go to extra length to set the desktop_uri to NULL when
desktop == home, but then we were adding the (non-functional)
place item anyway. Don't do that.
2013-12-19 11:22:02 -05:00
Matthias Clasen
98bdc9321e GtkPlacesSidebar: avoid a crash
Be more careful when comparing uris during DND - they may
be NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=720264
2013-12-19 11:01:39 -05:00
Jonh Wendell
cc0c521c4c cell-renderer: Check for NULL return in vfunc start_editing()
This virtual function may return NULL, so, let's check if that's
the case and exit the function apropriately.

https://bugzilla.gnome.org/show_bug.cgi?id=720554
2013-12-19 11:06:20 -02:00
Matthias Clasen
3dab856103 GtkColorSelection: Don't leak a context menu
This was pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=720401
2013-12-17 23:26:16 -05:00
Matthias Clasen
47ebd5c6b1 Fix a compiler warning 2013-12-17 23:25:21 -05:00
Matthias Clasen
ad8a97b457 GtkAppChoserWidget: Don't leak the context menu
This was pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=720401
2013-12-17 23:21:54 -05:00
Matthias Clasen
e0b04b39be Remove an unneeded include 2013-12-17 22:41:27 -05:00
Matthias Clasen
c7e6384dbb GtkAppChooserDialog: Add a 'Software' button
Add a simple button that launches GNOME Software.
2013-12-17 22:07:40 -05:00
Matthias Clasen
de947b0ac6 GtkAppChooser: Drop PackageKit integration
This will come back in a simpler form in the next
commit.
2013-12-17 22:07:40 -05:00
Matthias Clasen
7c98d40e94 GtkAppChooserWidget: Monitor installed applications
This uses the new GAppInfoMonitor object in GIO, which provides
change notification when the set of installed applications changes.
2013-12-17 22:07:40 -05:00
Volker Sobek
94e0f1c78d GtkStyleContext: Invalidate contexts with a path
Fixes a tiny typo in commit f51c9d4154
which manifested itself in GtkSpinButton's panels being drawn with an
incorrect, not updated state.

This patch took me more hours than you might think! :P

https://bugzilla.gnome.org/show_bug.cgi?id=709491
2013-12-18 00:23:47 +01:00
Matthias Clasen
ac7c6b25bd Fix extraction of some translatable strings
The reason why some of the strings in gtkprintunixdialog.ui
were missing is that we did not extract translatable string
from <item> elements. Fix that.
2013-12-17 07:35:55 -05:00
Matthias Clasen
1ccbca42d0 GtkHeaderBar: Fix allocation of start and end boxes
We were giving these boxes too much width, consuming what
was supposed to be the spacing between the boxes and the
other content of the header bar.
2013-12-16 20:36:22 -05:00
Ryan Lortie
ced939fc11 gtkapplication: fix inhibit
The big refactor contained a small mistake that broke inhibiting.  Fix it.
2013-12-16 14:39:48 -05:00
Ryan Lortie
7fd81cf111 Refactor GtkApplication
gtkapplication.c has turned into a bit of an #ifdef mess over time, and
many of the current checks are incorrect.  As an example, if you build
Gtk for wayland, and exclude the X11 backend, much of the functionality
required by wayland (such as exporting menu models) will be disabled.

Solve that by introducing a backend mechanism to GtkApplication (named
GtkApplicationImpl) similar to the one in GApplication.  Add backends
for Wayland, X11 and Quartz, with X11 and Wayland sharing a common
'DBus' superclass.

                             GtkApplicationImpl
                                      |
                       /--------------+-------------------\
                       |                                  |
            GtkApplicationImplDBus              GtkApplicationImplQuartz
                       |
           /-----------+-----------------\
           |                             |
  GtkApplicationImplX11      GtkApplicationImplWayland

GtkApplicationImpl itself is essentially a bunch of vfuncs that serve as
hooks for various things that the platform-specific backends may be
interested in doing (startup, shutdown, managing windows, inhibit, etc.)

With this change, all platform specific code has been removed from
gtkapplication.c and gtkapplicationwindow.c (both of which are now free
of #ifdefs, except for a UNIX-specific use of GDesktopAppInfo in
gtkapplicationwindow.c).

Additionally, because of the movement of the property-setting code out
of GtkApplicationWindow, the _GTK_APPLICATION_ID properties (and
friends) will be set on non-GtkApplicationWindows, such as dialogs.

https://bugzilla.gnome.org/show_bug.cgi?id=720550
2013-12-16 13:51:54 -05:00
Matthias Clasen
8bdc3ab4c5 Fix up default csd titlebars
We were forgetting to show close buttons, and the spacing
was wrong, too.
2013-12-16 13:40:54 -05:00
William Jon McCann
bfd27445e6 about dialog: add docs for new GtkLicense values 2013-12-16 11:50:33 -05:00
William Jon McCann
63c9342e30 about dialog: differentiate GPL "or later" versions
https://bugzilla.gnome.org/show_bug.cgi?id=720410
2013-12-16 11:44:35 -05:00