Commit Graph

15958 Commits

Author SHA1 Message Date
Benjamin Otte
00e84f1cdb label: Avoid deprecation warning 2012-01-06 05:23:43 +01:00
Benjamin Otte
42d0a6de23 label: Actually mark visited labels as visited
A recalculate will clear the labels and compute them again, which will
clear the information if something was visited...
2012-01-06 05:23:43 +01:00
Benjamin Otte
d6bb8a63aa label: Make attr_list_merge() use sane merging rules
Instead of "attribute with later start index wins, make sure the
attribute list that is merged from takes precedence. This now gives the
multiple attribute lists we use in the label an order:

1) gtk_label_set_attributes()
  These attributes override everything. It's what the function's there
  for after all.
2) markup of label
  Other user-specified attributes come next.
3) attributes for links
  When we apply custom attributes on parts of the text, we put them
  last. We don't want to mess with what the user does. Also, we change
  color and underline, so we usually have something to show.
2012-01-06 05:23:42 +01:00
Benjamin Otte
e78e4d8dd8 label: Rename variable
The effective attributes aren't that anymore. They're now just the
attributes from the parsed markup.
2012-01-06 05:23:42 +01:00
Benjamin Otte
f1c9a3e633 label: Don't excessively recalculate
We don't merge attributes anymore, so no need to call the function that
used to do this job.
2012-01-06 05:23:42 +01:00
Benjamin Otte
396b177e3b label: Redo attribute application
- Don't compute link color attributes until layout creation
This is useful as a performance enhancement, because we don't have to
lookup the property after setting the text, so multiple markup sets
don't cost style lookups.
- Don't merge attrs into effective_attrs
We do this when applying link colors now. Keeping them separate allows
invalidating them separately.
2012-01-06 05:23:42 +01:00
Benjamin Otte
15ac572822 ilabel: Redo gtk_label_get_link_colors()
Don't pass out an allocated color, assign it instead. Gets rid of having
to call gdk_color_free() all the time.
2012-01-06 05:23:42 +01:00
Benjamin Otte
dd4df24382 label: Split out function that merges attr lists 2012-01-06 05:23:42 +01:00
Benjamin Otte
712d577531 label: Redo links parsing
Instead of getting confused by applied underline or color tags in the
regular markup, we store the link start/end when we actually parse the
text. As a bonus, we can avoid rescanning links when creating the
markup.
2012-01-06 05:23:42 +01:00
Benjamin Otte
18ce0b21a0 label: Move function into only caller 2012-01-06 05:23:42 +01:00
Benjamin Otte
fc37e2749c API: Deprecate key snooping
You really shouldn't be doing this. If you have to, you can use
gdk_window_add_filter() or listen to raw events on XI2.
2012-01-06 05:23:42 +01:00
Benjamin Otte
0c8ecba7dc a11y: Remove keysnooping support
As previously announced, key snooping is something that we should not
support in GTK. In particular because AT-SPI made every key press a
synchronous DBUS call / spawned a nested main loop with the key
snoopers. This breaks responsiveness, order of key presses and internal
consistency when the AT decides to remove key events.
2012-01-06 05:23:42 +01:00
Zeeshan Ali (Khattak)
43e29f7cbf gtkspinbutton: Ignore keynav when !editable
Don't allow changing of value through keyboard when 'editable' property is
set to 'FALSE.

https://bugzilla.gnome.org/show_bug.cgi?id=667229
2012-01-06 05:45:46 +02:00
Benjamin Berg
b3e352f489 Improve PICKONE_* handling in GtkPrinterOptionWidget (bug #543520)
This patch modifies GtkPrinterOptionWidget to support loading them
again. It also allows the user to enter values from the dropdown list
to select the item.
2012-01-06 00:20:42 +01:00
Matthias Clasen
f7fb2fbebd Use the right icon-name for missing images
Patch by Erik van Pienbroek, bug 629878.
2012-01-05 14:07:04 -05:00
Marek Kasik
f1995f80e7 GtkPrintUnixDialog: Hide unused tabs
Don't show tabs which are empty. This is related to
the recent GtkTable -> GtkGrid conversion. (#663479)
2012-01-05 13:17:46 +01:00
Xan Lopez
5f53045707 Revert "gtksettings.c: Do not use GdkColor API"
This reverts commit baef3e5f24.

This broke the Adwaita theme pretty severely, so I don't think it can
be right. See: http://i.imgur.com/Rq7wc.png
2012-01-05 12:22:05 +01:00
Javier Jardón
baef3e5f24 gtksettings.c: Do not use GdkColor API 2012-01-05 04:38:22 +01:00
Javier Jardón
e77ffa6f87 gtkcolorsel.c: Do not use GdkColor API 2012-01-05 04:38:22 +01:00
Javier Jardón
d005b01319 gtk/*: Use g_list_free_full() convenience function 2012-01-05 04:22:43 +01:00
Ryan Lortie
0ea48c4139 GtkComboBoxText: allow id='' tag in builder markup
Presently, GtkComboBoxText lets you list the items for it in the
GtkBuilder markup like so:

<items>
  <item translatable='yes'>Red</item>
  <item translatable='yes'>Blue</item>
</items>

but has no way to set the "id" column for added items.  Add an id='' tag
for that purpose so that you can do:

  <item id='red' translatable='yes'>Red</item>

https://bugzilla.gnome.org/show_bug.cgi?id=667319
2012-01-04 17:00:35 -05:00
Xan Lopez
eeb9de80e1 GtkNotebook: fix crash when DnD tabs between windows
When doing DnD between windows the tab label is set as the child of
the DnD info window. If this is happening the remove method of
GtkNotebook should not unparent the tab label, since it's been already
unparented, belongs to the DnD window and will be properly destroyed
when the DnD is over.

https://bugzilla.gnome.org/show_bug.cgi?id=639875
2012-01-04 08:48:46 +01:00
Javier Jardón
912375ff38 gtk/gtkcolorbutton.c: Do not use deprecated GdkColor api 2012-01-04 01:55:16 +01:00
Zeeshan Ali (Khattak)
3caa370bb5 gtkspinbutton: Respect value of inherited 'editable' property
When this property is set to 'FALSE', user's click on the buttons
should not actually update the value but rather result in error bell.

https://bugzilla.gnome.org/show_bug.cgi?id=667229
2012-01-04 00:49:35 +02:00
Federico Mena Quintero
022c576bd2 treeview: bgo#666685 - Crash when toggling the selected status of a row
The refactoring from e01af5c5c seems to have caused this inadvertently.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-01-03 15:08:34 -06:00
Javier Jardón
abb7f40fb8 gtkcolorsel: Do not use deprecated GdkColor api 2012-01-03 18:00:57 +01:00
Javier Jardón
49d232d3a0 gtkcellview: Do not use deprecated GdkColor api 2012-01-03 18:00:57 +01:00
Chun-wei Fan
9f6e7d214c gtk/gtkprivate.c: Include stdlib.h
Include stdlib.h for getenv to avoid C4013/implicit declaration of ...
warnings
2012-01-04 00:52:44 +08:00
Ignacio Casal Quinteiro
f0b8fc69e8 textdisplay: use g_list_free_full 2012-01-01 22:38:30 +01:00
Kjell Ahlstedt
6aeab7b7cc comboboxtext: Set entry-text-column and id-column props in the constructor
This is cleaner than setting the value in the _new() functions and
makes binding and GtkBuilder instantiation easier. Bug #612396, comment 65.
2011-12-30 11:10:26 +01:00
Chun-wei Fan
d273b817e8 Bug 667018-gtk/gtkwindow.c: Include deprecated/gtkstyle.h
This is needed for the prototype of gtk_widget_reset_rc_styles, to avoid
C4013/implicit declaration of ... warnings of that function
2011-12-30 17:25:48 +08:00
Chun-wei Fan
1a122a4367 gtk/gtkspinbutton.c: Remove lingering ';'
...so that C89 compilers will not complain
2011-12-30 17:25:47 +08:00
Chun-wei Fan
24e476caab gtk/Makefile.am: Update VS projects completion
Take the sources in gtk/deprecated/ into account-VS does not like '/'
in file paths.
2011-12-30 16:44:55 +08:00
Matthias Clasen
2637240abe Remove an unnecessary warning
Don't warn if there's more than one mnemonic label for a widget,
and skip invisible labels.

Bug 665015
2011-12-30 02:01:15 -05:00
Matthias Clasen
d7e8388e9d Add a Since tag
gtk_css_provider_to_string is a post-3.0 addition.
Fixes bug 659516
2011-12-30 00:38:06 -05:00
Matthias Clasen
3c70a12785 GtkImContextSimple: fix tentative match handling
When switching to the compact table format, we inadvertedly lost
the 'tentative match' handling which allows to complete longer
compose sequences even if a prefix is a complete sequence.
This was pointed out in bug 666710.
2011-12-29 23:42:03 -05:00
Matthias Clasen
694bbf4ac0 Cosmetic changes to comments 2011-12-29 23:42:03 -05:00
Benjamin Otte
45161fbb55 settings: Cache style properties
This way we don't need to compute them every lookup. (That's not the
real reason though - the real reason is that I want to add new APIs that
require the caching because they return consts).
2011-12-29 10:10:32 +01:00
Benjamin Otte
524938aa53 modifierstyle: Move Private typedef to public header 2011-12-29 10:10:22 +01:00
Ignacio Casal Quinteiro
1abf7618c0 gtktextlayout: use g_slice for GtkTextLineDisplay 2011-12-25 18:13:51 +01:00
Ignacio Casal Quinteiro
359d8c9856 gtktextbtree: use g_slice 2011-12-25 17:49:03 +01:00
Benjamin Otte
ab1699510e themingbackground: Avoid erroring cairo context 2011-12-23 22:30:45 +01:00
Benjamin Otte
58d553c604 cssprovider: Fix leak
Thanks to the heroic valgrinding efforts of Olivier Sessnik, another
leak could be plugged.
2011-12-23 22:30:45 +01:00
Matthias Clasen
fbc3db8ba9 Fix scroll_offset handling
scroll_offset can be negative here, so replace a > 0 test
by != 0.
2011-12-23 00:36:20 -05:00
Matthias Clasen
f1bfdda3fd Only push the menu in if the position function said so 2011-12-23 00:36:20 -05:00
Matthias Clasen
a553cb50ab Use gtk_widget_get_allocated_width/height where it makes sense 2011-12-23 00:36:20 -05:00
Matthias Clasen
53ce519b1f Remove an unneeded variable 2011-12-23 00:36:20 -05:00
Matthias Clasen
547baf0e5f Remove an unused struct 2011-12-23 00:36:19 -05:00
Benjamin Otte
9707d964f7 combobox: Don't allow an individual cell to cheat
Make sure we only set sensitive when the cell is sensitive and visible.
Also avoid invalid memory accesses if no cells existed.
2011-12-23 00:15:59 +01:00
Benjamin Otte
8a83f0c2d1 widget: Print a g_warning() when a cairo_t is invalid
Only print the warning on internal code, so we aren't too verbose.
2011-12-23 00:15:59 +01:00
Benjamin Otte
d1c92c38df styleproperties: Move private struct declaration into public header 2011-12-23 00:15:59 +01:00
Javier Jardón
a3abc18858 Deprecate all the public API that is using GdkColor struct 2011-12-22 02:59:39 +00:00
Javier Jardón
115d92aa11 gtkappchooserwidget: Use g_object_clear() 2011-12-22 02:57:35 +00:00
Ryan Lortie
182fbba2bf GtkModelMenu: drop extra & added by mistake 2011-12-21 17:15:16 -05:00
Cosimo Cecchi
157d9271fa application: don't unconditionally unref the GMenuModel in getters
Both the app-menu and menubar models can be NULL, so we shouldn't
blindly unref them, since g_object_unref() doesn't cope with NULL
pointers.
2011-12-21 12:20:15 +01:00
Cosimo Cecchi
72c04c064a application: mark menu/menubar getters as (transfer none)
Since they do not return a reference to the underlying GMenuModel.
2011-12-21 12:19:31 +01:00
Cosimo Cecchi
9ae0ffb9cb application: use the same variable names in definitions and declarations
gobject-introspection will be confused and mark the methods as not
introspectable otherwise.
2011-12-21 11:29:39 +01:00
Colin Walters
06307dd774 GtkAction: Hold a reference to proxy widgets
Previously we expect that a proxy widget holds a reference to the
action via gtk_activatable_do_set_related_action().  However, it
is possible for the widget to still be in a floating state when
it adds itself to the the action.

This is a problem when gtk_action_get_proxies() gets called, because
we return floating objects back to the user.  And language bindings
aren't going to be expecting that.

Fix this by calling ref_sink() and unref().

https://bugzilla.gnome.org/show_bug.cgi?id=657367
2011-12-20 15:36:48 -05:00
Matthias Clasen
b5577781d1 GtkApplicationWindow: fix a typo
And add a link to the screenshots.
2011-12-20 14:10:39 -05:00
Javier Jardón
f84c124e53 gtk/gtkcellview.c: Use new GdkRGBA api instead GdkColor one 2011-12-20 18:32:15 +00:00
Javier Jardón
e24634537e gtk/gtktrayicon-x11.c: Use new GdkRGBA api instead GDKColor one 2011-12-20 18:32:15 +00:00
Cosimo Cecchi
2827cd4518 button: deprecate the inner-border style property
Since we allocate the standard CSS border to the button now, and center
the child accordingly, there's no need for an additional inner-border
style property. Deprecate it and ignore its values.

https://bugzilla.gnome.org/show_bug.cgi?id=666600
2011-12-20 19:01:38 +01:00
Cosimo Cecchi
0021ef19fa button: add CSS borders to the size request
And allocate the button children according to it as well.

https://bugzilla.gnome.org/show_bug.cgi?id=666600
2011-12-20 19:01:38 +01:00
Cosimo Cecchi
fe59c5f954 button: add a border param to gtk_button_get_props()
We'll use it later to compute the child offsets.

https://bugzilla.gnome.org/show_bug.cgi?id=666600
2011-12-20 19:01:38 +01:00
Ryan Lortie
bac58abec3 gtkmodelmenuitem: don't crash on missing action 2011-12-20 10:51:58 -05:00
Cosimo Cecchi
13f5706488 treeview: fix an uninitialised variable warning 2011-12-20 11:41:46 +01:00
Matthias Clasen
d7652d2c06 Fix dist 2011-12-19 18:37:28 -05:00
Matthias Clasen
23ca2a953c Fix symbol lists 2011-12-19 18:07:42 -05:00
Rui Matos
f4c698ef93 Revert "progressbar: Set state flags on draw"
This reverts commit 6ed5918718 which is no
longer needed as the style context now has the state flags updated when going
into draw.
2011-12-19 20:59:06 +00:00
Matthias Clasen
5d8641dd92 Add another bloatpad screenshot 2011-12-19 15:16:11 -05:00
Rui Matos
8b444d1c03 notebook: Use the widget state flags as a base for drawing 2011-12-19 19:21:16 +00:00
Rui Matos
9a4edf7a5a menuitem: Stop setting state flags on the style context for drawing 2011-12-19 19:21:16 +00:00
Rui Matos
6b624a5a18 menubar: Stop setting state flags on the style context for drawing 2011-12-19 19:21:16 +00:00
Rui Matos
5b4cc2f0b6 label: Use the widget state flags as a base for drawing 2011-12-19 19:21:16 +00:00
Rui Matos
02dd7df653 label: Stop setting state flags on the style context for drawing 2011-12-19 19:21:16 +00:00
Rui Matos
e3d38708ab image: Stop setting state flags on the style context for drawing 2011-12-19 19:21:16 +00:00
Rui Matos
f4b9562f46 iconview: Use the widget state flags as a base for drawing items 2011-12-19 19:21:16 +00:00
Rui Matos
ffd5126a42 iconview: Stop setting state flags on the style context for drawing 2011-12-19 19:21:16 +00:00
Rui Matos
e9a8938b21 hsv: Stop setting state flags on the style context for drawing 2011-12-19 19:21:16 +00:00
Rui Matos
1facea2a8d expander: Use the widget state flags as a base for drawing 2011-12-19 19:21:16 +00:00
Rui Matos
3e0b2f7262 eventbox: Stop setting state flags on the style context for drawing 2011-12-19 19:21:16 +00:00
Rui Matos
754eabeb19 entry: Use the widget state flags as a base for drawing icons and text 2011-12-19 19:21:16 +00:00
Rui Matos
a0fd344217 entry: Stop setting state flags on the style context for drawing 2011-12-19 19:21:16 +00:00
Rui Matos
721920e9e9 combobox: Stop setting state flags on the style context for drawing 2011-12-19 19:21:15 +00:00
Rui Matos
ee669a1b51 cellview: Stop checking for sensitivity on draw
This is needless since GtkCellRenderer does it consistently before rendering.
2011-12-19 19:21:15 +00:00
Rui Matos
70970146ca cellrenderertoggle: Use the cell renderer's state flags as a base for rendering
This allows us to pick the underlying widget's state flags that we don't
explicitly set here.
2011-12-19 19:21:15 +00:00
Rui Matos
42d2a1984c cellrenderer: Use the widget state flags as a base for cell renderers' state 2011-12-19 19:21:15 +00:00
Rui Matos
8baf65b595 checkmenuitem: Clean up state flags handling on drawing 2011-12-19 19:21:15 +00:00
Rui Matos
c9bbfb5e9b checkbutton: Use the widget state flags as a base for drawing the indicator
Instead of building a set of state flags specifically for drawing the
indicator, base it on the underlying widget state flags.
2011-12-19 19:21:15 +00:00
Rui Matos
dae2675441 checkbutton: Stop setting state flags on the style context for drawing 2011-12-19 19:21:15 +00:00
Rui Matos
5f5d4db034 calendar: Use the widget state flags as a base for drawing arrows
This allows drawing calendar arrows in all possible states the main widget may
be in.

The arrow_state array is converted into a bit field since it only really needs
to store boolean information about prelight for each arrow.
2011-12-19 19:21:15 +00:00
Rui Matos
d84021a870 calendar: Use the widget state flags as a base for drawing days
Instead of building a set of state flags specifically for drawing days, base
it on the underlying widget state flags.
2011-12-19 19:21:15 +00:00
Rui Matos
e868b8d6ea button: Stop setting state flags on the style context for drawing 2011-12-19 19:21:15 +00:00
Rui Matos
cf469eeb61 arrow: Stop setting state flags on the style context for drawing 2011-12-19 19:21:15 +00:00
Rui Matos
221442aa2a accellabel: Stop setting state flags on the style context for drawing 2011-12-19 19:21:15 +00:00
Rui Matos
cc8012eb32 widget: Set style flags on the style context when the flags are set
This will allow us to simplify most draw methods by not having to explicitly
set the style flags on the context.
2011-12-19 19:21:15 +00:00
Rui Matos
eecbdb6f57 widget: Always propagate state flags to all children
https://bugzilla.gnome.org/show_bug.cgi?id=666126
2011-12-19 19:21:15 +00:00
Ryan Lortie
8578fefaa5 GtkApplication: add menu API
We add the app-menu and menubar public APIs to GtkApplication while
leaving the implementation in GApplication.

The actual implementation will be moved soon.
2011-12-19 12:51:12 -05:00
Ryan Lortie
4e5e47931d missing file 2011-12-19 12:51:12 -05:00
Ryan Lortie
06c8921975 GtkApplication: document relationship to gdkthreads 2011-12-19 12:51:12 -05:00
Ryan Lortie
6a246a85f2 GtkApplicationWindow: deal with remote actions
Deal with remote action invocations correctly by implementing
GRemoteActionGroup in the same way that GApplication does and pushing
remote activations through the before/after_emit functions of the
GApplication associated with the window.

This is the last part of getting the threading situation right.

https://bugzilla.gnome.org/show_bug.cgi?id=665737
2011-12-19 12:51:12 -05:00
Ryan Lortie
363c2d684c GtkApplication: lock gdk on incoming messages
When we have incoming activations or action invocations we should
acquire the GDK lock, just in case the program in question is using gdk
threads.

https://bugzilla.gnome.org/show_bug.cgi?id=665737
2011-12-19 12:51:12 -05:00
Ryan Lortie
76d671d6a2 Move X property handling to GtkApplicationWindow
Don't try to deal with this using a qdata and signal connections in
GtkApplication.
2011-12-19 12:51:12 -05:00
Matthias Clasen
cff5ba1bc2 Document that gtk_init is called without argv
This answers a question in bug 661823.
2011-12-19 12:51:12 -05:00
Matthias Clasen
316e0ea542 Fix a typo 2011-12-19 12:51:12 -05:00
Matthias Clasen
5562d0a57a Forgotten file 2011-12-19 12:51:12 -05:00
Matthias Clasen
080007d7cb Show off some menus 2011-12-19 12:51:12 -05:00
Matthias Clasen
06a75b7e1f Some more menu-related docs 2011-12-19 12:51:12 -05:00
Matthias Clasen
a991bb9927 GtkBuilder: pick up named submenus
When parsing GMenu xml, use the facility for pick up named submenus.
Note that <section id='foo'>...</section> is _not_ a named submenu.
It is a named item with an unnamed submenu :-(
2011-12-19 12:51:12 -05:00
William Hua
c1f9ccce5b Handle menu changes. 2011-12-19 12:51:12 -05:00
William Hua
1a02fc036d Refactor GMenuModel rendering for Mac OS. 2011-12-19 12:51:12 -05:00
William Hua
ec72f8fd81 gtkquartz-menu: fix some leaks 2011-12-19 12:51:12 -05:00
William Hua
460ac291b2 begin adding menu accelerators
Show accelerators in menus.
2011-12-19 12:51:12 -05:00
Matthias Clasen
3103ae2685 Two small fixes
Don't leak a session bus reference, and don't assume a display
is X11 just because we've built the X11 backend.
2011-12-19 12:51:12 -05:00
Matthias Clasen
d91c9f9859 Fix up includes 2011-12-19 12:51:12 -05:00
William Hua
8bc7513a7b begin GtkApplication menu support for Mac OS 2011-12-19 12:51:11 -05:00
Ryan Lortie
21f4562d10 GtkApplicationWindow: share one GActionMuxer
Use the same GActionMuxer for menubars and accels instead of recreating
a new one each time.
2011-12-19 12:51:11 -05:00
Matthias Clasen
f485dd3f08 Documentation additions 2011-12-19 12:51:11 -05:00
Matthias Clasen
0baa663182 GtkApplicationWindow: Always install accelerators
We want accelerators to work, even if the menus are not shown
locally, so we can't rely on the GtkMenu code to set them up
for us. Currently, this code only installs accelerators when the
window is realized.
2011-12-19 12:51:11 -05:00
Matthias Clasen
f7244431a9 GtkApplication: Extract accelerators from menus
This allows to specify accelerators in a convenient way, by
adding accel="..." attributes to the menu items in the
XML for the menu.

Currently, the accelerators are extracted only once, when the
menu property is changed on the application.
2011-12-19 12:51:11 -05:00
Matthias Clasen
2398d7e900 Introduce gtkaccelmapprivate.h
Move internal accel map API there and update all users.
Also, add an internal function to create an accel path for
an action and parameter, and use it in gtkapplication.c and
gtkmodelmenuitem.c instead of duplicating that code.
2011-12-19 12:51:11 -05:00
Matthias Clasen
153cc818db GtkApplication: Add API to install accelerators for actions 2011-12-19 12:51:11 -05:00
Matthias Clasen
1c6d0c3e27 GtkApplicationWindow: Set the accel group on constructed windows
This will make the menuitems pick up matching accel map entries
automatically. Currently, nothing creates such accel map entries,
though.
2011-12-19 12:51:11 -05:00
Matthias Clasen
9d62d24d65 GtkApplicationWindow: Add a GtkAccelGroup
This will be used in the following patches.
2011-12-19 12:51:11 -05:00
Matthias Clasen
d5d896f812 Fix a gtk-doc warning 2011-12-19 12:51:11 -05:00
Ryan Lortie
90fcf994d5 GtkApplication: export windows on the bus
And advertise their location on the bus using X11 properties.
2011-12-19 12:51:11 -05:00
Ryan Lortie
03db3e1ca1 (trivially) implement 'shutdown' in GtkApplication 2011-12-19 12:51:11 -05:00
Matthias Clasen
aa1faa7c70 Add an example 2011-12-19 12:51:10 -05:00
Matthias Clasen
898bc98d3b Update GtkApplicationWindow docs 2011-12-19 12:51:10 -05:00
Matthias Clasen
3205a40b84 Whitespace fix 2011-12-19 12:51:10 -05:00
Matthias Clasen
f119c834c1 Make accelmap initialization more forgiving 2011-12-19 12:51:10 -05:00
Matthias Clasen
7ef340fb87 Clean up includes 2011-12-19 12:51:10 -05:00
Ryan Lortie
cd7ce867a7 Split off GMenuModel -> GtkMenuBar code
Put this in a separate file and substantially refactor it.

Move handling of submenu creation into gtkmodelmenuitem where it
belongs.

Improve our handling of when to show separators or not.
2011-12-19 12:51:10 -05:00
Ryan Lortie
afb0c098cb Watch "shell shows menu" settings for changes
Correctly monitor the GtkSettings for changes to the
"gtk-shell-shows-app-menu" and "gtk-shell-shows-menubar" properties.
2011-12-19 12:51:10 -05:00
Ryan Lortie
88f16b13f3 GtkSettings: quartz: shell always shows menus 2011-12-19 12:51:10 -05:00
Matthias Clasen
b7de477611 Never add separators to menubars 2011-12-19 12:51:10 -05:00
Ryan Lortie
2e64177e3f GtkModelMenuItem: don't leak a GVariant 2011-12-19 12:51:10 -05:00
Ryan Lortie
f83530ae3a GtkModelMenuItem: omit indicator if not required
GtkModelMenuItem, being based on GtkCheckMenuItem, was always reserving
space for a check/radio indicator.  This ends up looking pretty strange
in a GtkMenuBar.

Don't reserve space for the indicator unless it's appropriate.
2011-12-19 12:51:10 -05:00
Ryan Lortie
de53b5226d GtkApplicationWindow: nuke some g_print spew 2011-12-19 12:51:10 -05:00
Ryan Lortie
f0c2ff39fc GtkApplcationWindow: plug two obvious leaks 2011-12-19 12:51:10 -05:00
Colin Walters
c7e7237559 GtkApplicationWindow: Consistently unparent menubar
We create it floating, and don't hold an extra ref, so we should
just unparent it.
2011-12-19 12:51:10 -05:00
Ryan Lortie
c299963428 GtkApplicationWindow: clean up menubar logic 2011-12-19 12:51:10 -05:00
Ryan Lortie
612e24dfc6 introduce GtkModelMenuItem
This GtkMenuItem subclass (and GActionObserver implementation) contains
all the knowledge necessary for converting a GMenuModel item description
into a GtkMenuItem.

Remove much of the code that used to do this from
gtkapplicationwindow.c.
2011-12-19 12:51:09 -05:00
Ryan Lortie
ecfdb834c9 GtkSettings: add shell-shows-menubar property
Unity will set this to tell us that it is going to handle displaying the
menubar.
2011-12-19 12:51:09 -05:00
Matthias Clasen
45e9d09eab Only add separators when a section actually ends 2011-12-19 12:51:09 -05:00
Colin Walters
2c6b7eff17 GtkApplicationWindow: Further sanitize handling of merging app menu and menubar
The _set_show_app_menu should really be _set_show_menubar().

Also, correctly display just the window menu in the window when run
under GNOME 3.
2011-12-19 12:51:09 -05:00
Colin Walters
65a2962733 GtkApplication: Merge app menu and menubar
Change bloatpad to have both an app menu and a menubar.
2011-12-19 12:51:09 -05:00
Matthias Clasen
aae52d4580 GtkApplicationWindow: Make mnemonics work for stateful actions 2011-12-19 12:51:09 -05:00
Colin Walters
3a088d9ac2 GtkApplicationWindow: Don't unref a NULL object 2011-12-19 12:51:09 -05:00
Ryan Lortie
b42308f8e3 Adapt to changes in GLib API
g_application_get_menu() -> get_app_menu().
2011-12-19 12:51:09 -05:00