Commit Graph

19586 Commits

Author SHA1 Message Date
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
Matthias Clasen
ea8bb7e0ea GtkHeaderBar: Center buttons
Header bars can get taller than the buttons require, and we don't
want them to extend all the way. Center them instead.
2013-12-14 22:32:11 -05:00
Matthias Clasen
269282257d GtkHeaderBar: fix flipping of window controls
We were not keepign the separators at the inside.
2013-12-14 18:30:10 -05:00
Marek Kasik
11d9e5c95c printing: Add missing strings back for translation
There are string in gtkprintunixdialog.ui marked for translation
which are not in gtkprintunixdialog.ui.h.

https://bugzilla.gnome.org/show_bug.cgi?id=708907
2013-12-14 16:41:53 -05:00
Emilio Pozuelo Monfort
4e1b73325d ScaleButton: make the popup transient to the button's window
Fixes the popup positioning on wayland.

https://bugzilla.gnome.org/show_bug.cgi?id=720256
2013-12-14 15:49:38 -05:00
Takao Fujiwara
4d6c509943 GtkIMContextSimple: Update compose table
This adds Multi_key + f + i, as well as other sequences,
mainly Greek.

https://bugzilla.gnome.org/show_bug.cgi?id=710510
2013-12-14 15:34:54 -05:00
Matthias Clasen
9f1159a1a8 Fix a compiler warning
Don't return without a value from a non-void function.
2013-12-13 20:05:03 -05:00
Benjamin Otte
9849b292a9 window: Sanitize size hint computation
We don't want the maximum size to be smaller than the minimum size. Not
just because it's wrong but also because when this happens the rest of
GTK gets mighty confused and infloops resizing to min-size and
max-size in turns causing a flickering window. Well, at least if you
run X without a window manager. Or your window manager hasn't finished
starting up.

Private RHEL bug finding this issue:
https://bugzilla.redhat.com/show_bug.cgi?id=1035409
2013-12-14 01:18:23 +01:00
Benjamin Otte
d4c8f1028a clipboard: Don't crash when data is requested from NULL window
This could happen if data was requested from a separate screen now that
multi-screen is no longer supported.

Ideally, we'd want to support copying to other screens, but that
requires solving in GDK as that's X-specific so cannot be well
abstracted by GDK (without the reintroduction of multiple screens).

https://bugzilla.gnome.org/show_bug.cgi?id=719314
2013-12-13 19:07:42 +01:00
Matthias Clasen
f3d22d2a9b Make app menu fallback a bit more reliable
If the theme has no 'menu' control in the window decorations,
show the menubar after all.
2013-12-13 01:21:06 -05:00
Jasper St. Pierre
cf8fb209e3 headerbar: Don't add hidden widgets
This is a much simpler fix.
2013-12-13 01:11:27 -05:00
Jasper St. Pierre
a3933f96eb Revert "GtkHeaderBar: don't show dangling separators"
This reverts commit a33e5748db.
2013-12-13 01:09:42 -05:00
Matthias Clasen
acdd9c8ed6 Avoid double app menu fallback
Both GtkApplicationWindow and GtkHeaderBar listen for changes
of the gtk-shell-shows-app-menu setting, so they need to somehow
coordinate who is going to take action and show a fallback.
We prefer the menu button in the title over the menubar, so
let GtkApplicationWindow opt out if it finds that the header bar
has been configured to show window controls.
2013-12-13 01:02:36 -05:00
Matthias Clasen
3b8bf01604 Drop a reference to nonexisting API
The GtkApplicationWindow documentation had a reference
to gtk_header_bar_set_show_fallback_app_menu(). That
function no longer exists, so drop it.
2013-12-13 01:02:36 -05:00
Matthias Clasen
a33e5748db GtkHeaderBar: don't show dangling separators
If we don't have a window icon, we hide the titlebar_icon,
we still add it, so we can't simply go by the number of
children when deciding whether to show the separator or
now. Instead, update the separator visibility as we create
the various buttons.
2013-12-13 01:02:36 -05:00
Matthias Clasen
dc073b8020 Make window icons work in GtkHeaderBar 2013-12-13 01:02:36 -05:00
Ryan Lortie
04897e5b09 gdk: add gdk_window_set_shadow_width()
And deprecate the X11-specific version of it.

We call this new API _set_shadow_width() and not _set_frame_extents()
because we already have a gdk_window_get_frame_extents() with a
different meaning and different type of value.

https://bugzilla.gnome.org/show_bug.cgi?id=720374
2013-12-12 23:53:47 -05:00
Jasper St. Pierre
ec61f290dc headerbar: Respect the show-close-button property 2013-12-12 21:55:06 -05:00
Jasper St. Pierre
01f5ff765b window: Update decorations when updating state
This fixes the maximize button not updating...
2013-12-12 21:55:02 -05:00
Jasper St. Pierre
d9f92424b2 headerbar: Support all kinds of CSD decorations
Move the gtkwindow.c CSD code into GtkHeaderBar, and make it triggerable
by the show-close-button property, and remove shows-fallback-app-menu.

https://bugzilla.gnome.org/show_bug.cgi?id=720233
2013-12-12 19:30:59 -05:00
Matthias Clasen
d8401c5f0a GtkHeaderBar: treat "" as 'no subtitle'
This is one of the few cases where it makes some sense to blur
the line between and empty string and NULL: without this, it is
hard to reset the subtitle e.g. from a builder file. And we
have the has-subtitle property now to enforce subtitle size
allocation independently.
2013-12-12 19:29:52 -05:00
Volker Sobek
70eb35d569 GtkFileChooser: Don't fill location_entry if we just populated the file list
Only fill the location entry with the file name of the tree view's
selected file when the selection was done by the user.

When the file chooser's action is GTK_FILE_CHOOSER_ACTION_OPEN, it
selects the first file in the tree view once loading has finished. For
this case we don't want it to insert the file name in the location
entry, as it hinders efficient navigation using the location entry. To
achieve this, use a priv flag to keep track of whether the
selection-changed signal was caused by the file chooser itself.

https://bugzilla.gnome.org/show_bug.cgi?id=386569
2013-12-12 17:42:10 -06:00
Volker Sobek
06091ed457 GtkFileChooserDefault: Remove unused struct field
The field changing_folder is no longer used anywhere.

https://bugzilla.gnome.org/show_bug.cgi?id=720293
2013-12-12 01:33:37 +01:00
Jasper St. Pierre
37baeed66e headerbar: Remove unused private API
Don't remove gtkheaderbarprivate.h, even though it's empty,
since we'll add more to it soon.

https://bugzilla.gnome.org/show_bug.cgi?id=720233
2013-12-11 19:28:30 -05:00
Jehan
57f59010b8 Gettext comment for "default:LTR" must be before the string
https://bugzilla.gnome.org/show_bug.cgi?id=720096
2013-12-10 23:31:47 -05:00
Matthias Clasen
8596a34b8b Simplify a check
Whenever titlebar is set, title_box is pointing to the
same widget, so we can just always use title_box here.
Pointed out by Jasper St. Pierre.
2013-12-10 23:19:36 -05:00
Matthias Clasen
50a206223f Trivial typo fix 2013-12-10 23:03:12 -05:00
Matthias Clasen
05d34f9a5b Use ::has-subtitle when constructing CSD titlebars
GtkWindow was constructing a custom title label to
avoid the size reservation for a subtitle. This is
now easier with the ::has-subtitle property.
2013-12-10 23:03:12 -05:00
Matthias Clasen
1a6a86a867 GtkHeaderBar: Add a ::has-subtitle property
It is a fairly common case to just want a title, and not
reserve extra space for a subtitle. This is much easier
to get right by setting a boolean property than by
constructing a custom title widget.
2013-12-10 23:03:12 -05:00
Matthias Clasen
da08592ea1 Update headerbar title from window title
This removes a possible source of confusion in our API.
The title is now synchronized both ways between the window
and the headerbar.

https://bugzilla.gnome.org/show_bug.cgi?id=720067
2013-12-10 20:45:42 -05:00
Matthias Clasen
5918a4dae8 Sync the window title initially
When setting a custom titlebar that happens to be a GtkHeaderBar,
we connect to notify::title to pick up title changes on the headerbar,
but we forgot to sync the title initially. Fix that.
2013-12-10 18:44:26 -05:00
Matthias Clasen
f08df56211 Disconnect signal handlers
We connect to notify::title on app-provided titlebars, but
we forgot to disconnect the signal handler when unsetting
the titlebar.
2013-12-10 18:21:58 -05:00
Matthias Clasen
73bd03c9ed Add a function to determine the text direction
This function can be used in the rare cases where the locale
has to be changed after gtk_init(). Based on a patch
by Jehan <jehan@girinstud.io>.

https://bugzilla.gnome.org/show_bug.cgi?id=720096
2013-12-10 17:34:23 -05:00
Benjamin Otte
b6f9ce8a73 button: Allow :hover on insensitive buttons
You can still hover a mouse on insensitive elements; it's up to the
theme to disable that.
This is in line with the HTML/CSS interpretation of :hover.

Insensitive elements still cannot be clicked.

https://bugzilla.gnome.org/show_bug.cgi?id=719486
2013-12-07 01:39:38 +01:00
Benjamin Otte
860138b302 filechooser: Don't crash if invalid thumbnails exist
Failing to load a thumbnail returns a NULL pixbuf. Since the hidpi
patches this wasn't checked when creating the surface. Result: assertion
failure.

https://bugzilla.gnome.org/show_bug.cgi?id=719977
2013-12-07 01:39:38 +01:00
Torsten Schönfeld
904bc27250 gtkradio*: add (allow-none) annotations were appropriate
https://bugzilla.gnome.org/show_bug.cgi?id=679563
2013-12-06 23:57:16 +01:00
Matthias Clasen
8d3a91d6ba docs: Add a missing Since: tag 2013-12-05 09:08:35 -05:00
Lars Uebernickel
d736e8baf9 GtkMenuItem: only set 'separator' class on the separator line
To make the separator line distinguishable from the widget's normal
border from css.

https://bugzilla.gnome.org/show_bug.cgi?id=719861
2013-12-05 12:35:12 +01:00
Jasper St. Pierre
96d2eeb6ba recentchooserdefault: Clean up load_id when we have nothing left to do
Returning FALSE from a GSourceFunc will implicitly remove it, so we need
to do this in order to make the new g_source_remove happy.
2013-12-04 19:29:06 -05:00
Lionel Landwerlin
45216c4f60 window: enable client side decorations deactivation with wayland backend 2013-12-04 17:24:48 +00:00
Benjamin Otte
f765bb8803 treeview: Don't draw a background for the bin window
The bin window's background would have to be drawn in the bin window's
size and inside the pixel cache draw function to not cause transparency
issues.

But because it's unnecessary as the view window draws the same
background, we just skip it.

https://bugzilla.gnome.org/show_bug.cgi?id=709027
2013-12-04 10:40:03 +01:00
William Jon McCann
a34702a61f file-chooser: add a sort-directories-first gsetting
Add an option to sort folders before files in order to be
more constistent with the file manager.
2013-12-03 12:12:54 -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
Benjamin Otte
9a0064c684 button: Call the new function
This simplifies a lot of code and doesn't require hacks setting
in_button anymore.
2013-12-03 01:57:38 +01:00
Benjamin Otte
804be65a09 button: Split out function
This is in preparation of the following cleanup commits.
2013-12-03 01:57:38 +01:00
Benjamin Otte
85b17e778c button: Don't emit a signal on broken grabs
We don't emit one on grab notify, so we don't want one for broken grabs
either.
2013-12-03 01:57:38 +01:00
Philip Withnall
b37f8b80b4 gtkprintunixdialog: Remove a redundant (GFile != NULL) check
g_file_new_for_uri() is guaranteed to return a non-NULL value, so this
check was redundant, and was confusing the static analyser into
returning a false positive, where it thought the file could be NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2013-12-02 10:36:26 +00:00
Philip Withnall
380150361b gtktreeselection: Eliminate a dead assignment
This is technically a dead assignment, but is nice to retain for
clarity. Moving it to the variable definition shuts scan-build up.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2013-12-02 10:36:26 +00:00
Philip Withnall
1adf0becc2 gtkthemingengine: Eliminate a dead assignment
This is technically a dead assignment, but is nice to retain for
clarity. Moving it to the variable definition shuts scan-build up.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2013-12-02 10:36:26 +00:00
Philip Withnall
5c5390f74b gtkthemingengine: Fix a definite use of an uninitialised variable
At this point, segments[1] is always uninitialised, and is used to
initialise itself. Looking at the code in the branch above, this appears
to have been a typo from segments[0], as segments[1] seems to typically
be 2 * segments[0].

Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2013-12-02 10:36:26 +00:00
Philip Withnall
99a162c69e gtkpapersize: Reformat #if preprocessor commands
This eliminates some false positive warnings from scan-build, which was
not interpreting the #ifs and hence warning about unbalanced #endifs.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2013-12-02 10:36:26 +00:00
Philip Withnall
a265d8f32d gtkmenu: Fix potential use of uninitialised variables
The child_height out variable is only valid if compute_child_offset()
returns TRUE.

Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2013-12-02 10:36:26 +00:00
Philip Withnall
480a005039 gtktreeviewaccessible: Fix potential uses of uninitialised variables
Found with scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2013-12-02 10:36:26 +00:00
Matthias Clasen
087b61f653 GtkRevealer: Fix size allocation with disabled animation
When animation is disabled, we use 'none' as the effective
transition type. So far, this transition type failed to change
the size request, causing the revealer to always take up the
space of the child, even when the child is not shown.

https://bugzilla.gnome.org/show_bug.cgi?id=719568
2013-12-01 21:45:17 -05:00
Matthias Clasen
96c0903799 Fix the AtkImage implementation for GtkIconView items
We were returning uninitialized values for image size and
position.

Found in a pile of patches in
https://bugzilla.gnome.org/review?bug=712760
2013-12-01 18:33:38 -05:00
Matthias Clasen
8377c12b15 Code cleanup
Don't compare booleans to FALSE.
2013-12-01 17:54:00 -05:00
Simon Feltman
af95d6628c annotations: Set GtkTreeModelFilterModifyFunc value argument to out
Use (out caller-allocates) annotation for the "value" argument to
GtkTreeModelFilterModifyFunc. This is needed because GI based language
bindings coerce GValue input args into native types and there is no
opportunity to set the value within the GValue itself.

https://bugzilla.gnome.org/show_bug.cgi?id=719460
2013-12-01 17:22:05 -05: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
Christian Persch
cc3c737088 infobar: Fix visibility when enable-animations=false
When enable-animations is false, the revealer's child-revealed property is
notified immediately, so make sure to connect to it before toggling the
revealer.

https://bugzilla.gnome.org/show_bug.cgi?id=719510
2013-12-01 23:17:28 +01:00
Aaron Hamilton
142d3f1d59 Correct the deprecation annotation for gtk_widget_modify_bg
It was pointing to a nonexisting function.

https://bugzilla.gnome.org/show_bug.cgi?id=719469
2013-12-01 17:03:48 -05:00
Matthias Clasen
56719c6363 Don't use depeprecated api
GtkPrintUnixDialog and testtitlebar were still using
gtk_widget_set_margin_left/right. Switch them over to
gtk_widget_set_margin_start/end.
2013-12-01 16:55:57 -05:00
Matthias Clasen
b53b5578f3 message dialog: Make labels wrap at a reasonable length
Several labels in GtkMessageDialog were set to wrap, but
did not set max-width-chars. Fix that.
2013-12-01 16:19:17 -05:00
Matthias Clasen
e036028402 about dialog: Make labels wrap at reasonable length
Several labels in GtkAboutDialog are set to wrap, but
don't set a value for max-width-chars. Fix that.
2013-12-01 16:18:07 -05:00
Matthias Clasen
8eeebda1e5 places sidebar: Use a symbolic desktop icon
This was pointed out in

https://bugzilla.gnome.org/show_bug.cgi?id=719505
2013-12-01 13:58:39 -05:00
Juan Pablo Ugarte
bbd0035625 GtkAboutDialog: fixed calling gtk_about_dialog_set_logo_icon_name()
with a NULL icon_name. Now it will actually use the default
window icon set as mention in the docs
2013-11-28 17:01:18 -03:00
Juan Pablo Ugarte
b5dff5e417 GtkIconCache: find_image_offset() return 0 if icon_name is NULL.
This avoid a crash calling gtk_about_dialog_set_logo_icon_name() with a NULL icon_name.
2013-11-28 16:56:11 -03:00
Manuel Bachmann
e45ea70936 Fix CSD check for Win32
Win32 does not have alpha channel currently ; fix the check
for this, so trying to enable CSDs on this platform will
not "succeed" and crash the app anymore.

Partially fixes gtk3-widget-factory.
2013-11-27 11:24:12 +01:00
Matthias Clasen
7c2a50728d Don't distribute gdbus-generated sources
These are supposed to be regenerated at build time,
to avoid dependencies on the dist-systems glib version.
2013-11-26 18:26:36 -05:00
Matthias Clasen
21114071ec Change the default for "show-desktop" back to TRUE
Change the GtkSettings default for "shell-shows-desktop" back to TRUE
and also change the default value of the "show-desktop" property on
GtkPlacesSidebar so that the defaultvalue test passes.

https://bugzilla.gnome.org/show_bug.cgi?id=712302
2013-11-26 14:21:01 -05:00
Michael Wood
89f78a718b bindings: Fix stray semicolons in CSS example for bindings
Semicolon shouldn't be at the end of binding set
2013-11-26 12:26:46 +00:00
Benjamin Otte
4e9356f339 menu: Do a proper min height request
The minimum height is the size of one menu item plus the arrows, not the
minimum size of all menu items.

https://bugzilla.gnome.org/show_bug.cgi?id=691974
https://bugzilla.gnome.org/show_bug.cgi?id=694859
2013-11-25 03:54:05 +01:00
Benjamin Otte
f18655c641 window: Don't assume 640x480 max default size
Instead, use the monitor's work area.

This might have unforseen side effects that warrant a later revert, such
as:
- Apparently some WMs assume maximizing when a window is maximum screen
  size.
- WMs might not shrink the window by the decorations' size when it tries
  to be fullscreen.
- Applications might have buggy size request code that causes weirdly
  sized windows.
2013-11-25 03:49:35 +01:00
Benjamin Otte
8308f4c1e9 stack: Fix crash on g_object_get("visible-child")
priv->visible_child is not a GtkWidget but a custom struct holding the
widget. So use the getter instead.
2013-11-25 03:49:35 +01:00
Benjamin Otte
46ed450a29 treemenu: Implement height-for-width properly 2013-11-25 03:49:35 +01:00
Philip Withnall
ada766025f gtktreeviewaccessible: Fix a potential division by zero
Found with scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2013-11-24 21:21:02 +00:00
Carlos Garnacho
da86918c32 combobox: Set GDK_SCROLL_MASK on the eventbox in appears-as-list mode
This is so the scroll wheel works in both modes, and there's no behavioral
change depending on a style property.

https://bugzilla.gnome.org/show_bug.cgi?id=702663
2013-11-20 13:18:37 +01:00
Jasper St. Pierre
da0ebcb7da Revert "stack: respect gtk-enable-animations setting"
It already respected enable-animations.

This reverts commit fb9ff44299.
2013-11-19 18:38:56 -05:00
Jasper St. Pierre
6f9b2ac805 wayland: Set DBus properties after we've constructed the xdg_surface 2013-11-19 16:37:25 -05:00
Jonh Wendell
7b85d1df50 treeview: Use CSS property "border-top-color" to draw grid lines
This allows themes to customize the grid line colors in treeviews.

https://bugzilla.gnome.org/show_bug.cgi?id=415415
2013-11-19 10:24:28 -02:00
Matthias Clasen
fb9ff44299 stack: respect gtk-enable-animations setting
https://bugzilla.gnome.org/show_bug.cgi?id=712632
2013-11-18 23:19:27 -05:00
Christian Persch
bf9ed44aa6 revealer: Respect gtk-enable-animations setting
https://bugzilla.gnome.org/show_bug.cgi?id=712632
2013-11-18 23:01:11 -05:00
Matthias Clasen
df455db2e3 GtkBuilder: Make IDs optional
One requirement of .ui files is that each object must have an ID,
even if it is never referred to or directly loaded from the code.
This makes editing .ui files much more onerous than it has to be,
due to the frequent need to invent new IDs, while avoiding
clashes.

This commit makes IDs optional in the XML. They only need to
be provided for objects which are referred to or explictly loaded
from the code. Since GtkBuilder needs IDs for its own internal
accounting, we create IDs of the form ___object_N___ if not
specified in the XML.

https://bugzilla.gnome.org/show_bug.cgi?id=712553
2013-11-18 06:00:02 -05:00
Jasper St. Pierre
55605fe685 gtkwindow: Fix cast warning 2013-11-17 18:50:53 -05:00
Jasper St. Pierre
1941f3ff17 gtkwidget: Fix up some deprecation warnings 2013-11-17 18:50:53 -05:00
Matthias Clasen
d297500976 Use window icons for fallback
When the window has an icon, use it for the fallback menu
button.
2013-11-16 17:04:30 -05:00
Matthias Clasen
07d71cf945 Small doc improvements 2013-11-16 15:00:16 -05:00
Matthias Clasen
9e18a52156 Fix fallback menubar size allocation
When the menubar inserted by GtkApplicationWindow is the widest
widget in a csd window, its allocation gets cut short. Fix this
by taking the decoration size into account while calculating
the size request (it is implicitly taken into account in the
size allocation phase by _gtk_window_set_allocation).
2013-11-16 14:52:26 -05:00
Matthias Clasen
73b02933d0 GtkWindow: better app menu fallback for CSD
Do the menubutton for app menu fallback ourselves in GtkWindow
for the csd, non-custom titlebar case. This fits better with
the way we handle other title buttons. Themes have control
over the placement of this button by placing menu in the
decoration-button-layout style property.
2013-11-16 14:52:21 -05:00
Matthias Clasen
cb24305f1b Trivial cleanup 2013-11-16 14:52:21 -05:00
Matthias Clasen
805bf49be9 Trivial whitespace fix 2013-11-16 14:52:21 -05:00
Matthias Clasen
3ee5404772 GtkApplicationWindow: Avoid double fallback for the app menu
If we have a header bar which has the app menu fallback
enabled, don't add the app menu to the fallback menubar.
2013-11-16 01:52:04 -05:00
Matthias Clasen
2863bb287c GtkHeaderBar: Add a fallback app menu implementation
Allow showing the fallback app menu with a menu button
in the header bar. Applications have to explicitly enable
this by calling gtk_header_bar_set_show_fallback_app_menu.
2013-11-16 01:50:39 -05:00
Matthias Clasen
cadef51b3d GtkWindow: Make titlebar widget available privately
This will be used in GtkApplicationWindow in the
following commits.
2013-11-16 01:39:41 -05:00
Matthias Clasen
9a04a27ba6 GtkButton: don't propagate double-clicks
It is basically always unexpected to have a container handle
double-clicks on a widget that handles single-clicks itself.
2013-11-15 23:43:05 -05:00
Matthias Clasen
00be62546f GtkAboutDialog: Fix a corner case of link highlighting
GtkAboutDialog highlights emails written as <...> and
urls written as http://... . gnome-terminal manages to
put <http://...> into its license text, which sadly
confuses the parser into running evolution on http://...

Fix things up far enough that <http://...> is now
recognized as url, and only the part inside the <> is
underlined (for email addresses, we include the <> in
the underline).
2013-11-15 14:42:34 -05:00
Matthias Clasen
df2b534042 GtkSettings: make show-desktop default to FALSE
This broke tests.
2013-11-15 07:49:50 -05:00
Benjamin Otte
06a64ccfcf stylecontext: Revert part of previous commit
Commit 719dd636a9 replaces
margin-left/right with margin-start/end. CSS does not have
margin-start/margin-end properties, the sed script was a bit overeager.

Fwiw, CSS implements RTL margin styling via :dir(rtl) selectors.
2013-11-15 04:33:38 +01:00
Cosimo Cecchi
f4f82e736c GtkPlacesSidebar: don't unref an object we don't own
gtk_settings_get_default() doesn't return a reference, so don't unref it
during dispose.
2013-11-14 18:30:47 -08:00
Yosef Or Boczko
719dd636a9 Replace all margin-left and margin-right with margin-start and margin-end
https://bugzilla.gnome.org/show_bug.cgi?id=710238
2013-11-15 02:54:35 +01:00
Yosef Or Boczko
9921bec63a GtkWidget: Add margin-start and margin-end properties
Add margin-{start,end} and gtk_widget_{get,set}_margin_{start,end}
and drop margin-{left,right} and gtk_widget_{get,set}_margin_{left,right}.

margin-{start,end} handle right also in RTL.

https://bugzilla.gnome.org/show_bug.cgi?id=710238
2013-11-14 21:55:50 +01:00
Ryan Lortie
c4141a2115 GtkPlacesSidebar: use shell-shows-desktop setting
Use the just-added shell-shows-desktop GtkSetting to determine if we
should also show the "Desktop" folder in the places sidebar.

https://bugzilla.gnome.org/show_bug.cgi?id=712302
2013-11-14 15:03:04 -05:00