Commit Graph

13621 Commits

Author SHA1 Message Date
Florian Müllner
16dc117045 window: Use settings from screen rather than default
gtk_settings_get_default() was used to monitor the
"gtk-application-prefers-dark-theme" setting, rather
than the GtkSettings object associated with the window's
screen.
2011-03-25 17:41:19 +01:00
Carlos Garnacho
b7f772eb93 Ensure GtkWidget::style-updated is emitted before first size negociation
Fixes Bug 639584 - initial emission of GtkWidget:style-set is
not happening.

GtkWidget was filtering out ::style-updated (and ::style-set)
emissions until the widget was realized in order to avoid often
useless updates during widget construction and placing.

This is now done instead until the widget has a parent/screen,
which ensures the initial emission happen prior to the first
size negociation, while still filtering out all early emissions
during construction.
2011-03-25 14:33:54 +01:00
Matthias Clasen
4a86e5b138 Make selectable labels work again
You can select something, but moving the focus somewhere else, or bringing up
the context menu makes the selection go away. This makes it impossible to
copy-paste the text.

The reason for this regression is that gtk_label_state_changed was sloppy and
assumed that it would only ever be called when a labels goes insensitive, which
is no longer the case.

The patch fixes things by explicitly checking if the widget is insensitive, and
only resetting the selection in that case, which is the same behaviour we have
for e.g. GtkEntry.
2011-03-24 12:45:59 -04:00
Cosimo Cecchi
6c3c26d9c3 switch: hardcode a smaller font size for the switch label
This should not really be done here, but we can't override font size
from the theme just yet.

https://bugzilla.gnome.org/show_bug.cgi?id=645458
2011-03-23 10:00:01 -04:00
Cosimo Cecchi
24bba4cc56 gtksettings: unset attributes set to normal from font description
So that they do not override values coming from the theme.

Based on a patch by Carlos Garnacho.

https://bugzilla.gnome.org/show_bug.cgi?id=645458
2011-03-23 10:00:00 -04:00
Cosimo Cecchi
ec2055d1b0 Revert "styleproperties: don't force replacing the font description"
It turns out the bug is more complicated than I originally understood.
Not replacing the font description fields while merging here makes it
impossible for application's CSS to override fonts.

This reverts commit 89c1d93b68.

https://bugzilla.gnome.org/show_bug.cgi?id=645458
2011-03-23 09:59:58 -04:00
Michael Natterer
41810b46e7 Bug 643805 - Allow GtkExpander to resize the toplevel upon expanding/collpasing
Add gtk_expander_get,set_resize_toplevel() and a "resize-toplevel"
property.
2011-03-21 20:57:43 +01:00
Cosimo Cecchi
1876823ef0 themingengine: don't hardcode white to draw insensitive labels shadow
Use the background color instead.
I think the optimal solution would be delegating the shadow rendering to
the theme completely, and removing this in GtkThemingEngine, but for
now, this simple fix makes the dark variant more usable.

https://bugzilla.gnome.org/show_bug.cgi?id=645405
2011-03-21 11:00:53 -04:00
Cosimo Cecchi
65d90e2019 filechooserdefault: fix a build warning 2011-03-21 11:00:38 -04:00
Garrett Regier
793d12d70d Fix leaking calls to gdk_device_manager_list_devices()
gdk_device_manager_list_devices() returns a newly allocated list.

https://bugzilla.gnome.org/show_bug.cgi?id=645234
2011-03-21 10:37:10 -04:00
Florian Müllner
3032fdce2a window: Export theme variant to X11
The metacity theme format allows to use colors from the current
GTK+ theme in window decorations. Since GTK+ now gained support
for dark theme variants, window managers using that theme format
(metacity, mutter, compiz via gtk-window-decorator) should be able
to use colors from the correct variant; so in case a variant is
requested, export it in the _GTK_THEME_VARIANT property on
toplevel windows.

https://bugzilla.gnome.org/show_bug.cgi?id=645354
2011-03-21 15:06:34 +01:00
Carlos Garcia Campos
ef061c4e96 gtkentry: Add hinting to GtkEntry
gtk_entry_set_placeholder_text() makes the entry display the given text
when it is empty and unfocused. Based on previous patch by Alberto
Garcia.

https://bugzilla.gnome.org/show_bug.cgi?id=440963
2011-03-21 09:37:37 +01:00
Cosimo Cecchi
9cd4a1b622 radiobutton: exclude states we set manually from the previous state
https://bugzilla.gnome.org/show_bug.cgi?id=645172
2011-03-18 15:16:02 -04:00
Cosimo Cecchi
ef5fb8d673 radiobutton: build the new state flags from the previous flags on click
This fixes e.g. sensitivity issues with GtkRadioButton on state update.

https://bugzilla.gnome.org/show_bug.cgi?id=645172
2011-03-18 15:16:01 -04:00
Benjamin Otte
9b93ca2848 gtk: Make region argument to gtk_widget_queue_draw_region() const 2011-03-18 16:27:59 +01:00
Cosimo Cecchi
55c86bd44d switch: fix boundaries for the switch motion
We were ignoring the focus ring padding, and we were incorrectly setting
handle_x to padding.left, while the draw handler already takes padding
into account while redrawing.

https://bugzilla.gnome.org/show_bug.cgi?id=645134
2011-03-18 09:52:58 -04:00
Cosimo Cecchi
6e1aa0e0a9 notebook: don't forget to reset the style after setting show-tabs
This fixes a regression after commit
b04f4c536a
2011-03-17 17:27:37 -04:00
Cosimo Cecchi
151cf7204b treeview: add the separator style class to the tree view separator lines 2011-03-17 17:12:58 -04:00
William Jon McCann
f7ee81bff8 filechooser: use the sidebar style class for the file chooser sidebar
https://bugzilla.gnome.org/show_bug.cgi?id=642712
2011-03-17 17:12:55 -04:00
Cosimo Cecchi
195a235cd4 stylecontext: add a sidebar style class 2011-03-17 17:12:53 -04:00
William Jon McCann
611cf8423f set initial pane position
https://bugzilla.gnome.org/show_bug.cgi?id=642712
2011-03-17 17:12:50 -04:00
Cosimo Cecchi
627735c699 filechooser: add the inline-toolbar style class to the bottom toolbar 2011-03-17 15:47:08 -04:00
Cosimo Cecchi
89e565a82f stylecontext: add an inline-toolbar style class 2011-03-17 15:47:04 -04:00
Cosimo Cecchi
2ae6becef9 styleproperties: don't force replacing the font description
Otherwise custom fonts will always get overridden by the default stored
in GtkSettings when merging them.

https://bugzilla.gnome.org/show_bug.cgi?id=644975
2011-03-17 14:34:44 -04:00
Bastien Nocera
90a4f8dc4b notebook: Don't set notebook style with hidden tabs
When tabs are not shown, and the notebook is used as a container,
we should not set the notebook style, otherwise the theme has no
way to know whether tabs are shown or not, and which colour to draw
the background.

https://bugzilla.gnome.org/show_bug.cgi?id=640692
2011-03-17 18:30:40 +00:00
Benjamin Otte
58f0bc62a9 widget: Don't override state data when recursing to children
Writing onto the passed-in GtkStateData could cause changes that would
propagate to siblings, as the data was not reset again.
By copying the data structure, this is avoided and the proper values are
passed to sibling widgets.
2011-03-17 16:47:48 +01:00
Benjamin Otte
261bcb1ed8 widget: Fix typo in docs 2011-03-17 16:47:48 +01:00
Benjamin Otte
665da2c499 widget: Queue a resize when setting widget to insensitive.
See 015f227776 for details on why this is
necessary.
2011-03-17 11:59:17 +01:00
Benjamin Otte
3f491f7157 style: Move private function into private header
The function wasn't exported, so everybody using it would have gotten
linking failures.
2011-03-17 11:59:17 +01:00
Benjamin Otte
979a68c74a paned: Remove unused variable 2011-03-17 11:59:17 +01:00
Jasper St. Pierre
ff9eb56c6e Don't only use ch != 0 to check if a character is a control char.
https://bugzilla.gnome.org/show_bug.cgi?id=644976
2011-03-16 20:09:14 -04:00
Cosimo Cecchi
9205abe374 range: allow stepper-spacing > 0 and trough-under-steppers = TRUE
Commit 4bb3d64414 introduced a limitation
to GtkRange style properties; when stepper-spacing is > 0,
trough-under-steppers is automatically set to FALSE; this means that
setting a spacing between the steppers (e.g. the scrollbar buttons) and
the trough (i.e. the area over which the slider is free to move) would
make the buttons always get the full allocation on the !orientation
direction.
The rationale is without this limitation, you would get an area which
seems clickable, but it's actually not.

While this is true, and undesirable, for big stepper spacings, themes
that use trough-under-steppers (which is TRUE by default anyway),
might want to set smaller spacings to avoid drawing a double line between
the button and the slider borders.

To add confusion, the documentation got it flipped, i.e. it stated
setting a positive stepper-spacing would set trough-under-steppers to
TRUE (which would also make the behavior expected by commit
4bb3d64414 impossible).

I don't think hardcoding either of the two limitations is a good thing.
We should let themes handle this instead, and remove this limitation. If
you want the old behavior, you can manually set trough-under-steppers to
FALSE if you set a positive stepper-spacing in your theme.

https://bugzilla.gnome.org/show_bug.cgi?id=644777
2011-03-16 13:20:07 -04:00
Cosimo Cecchi
f4930dca55 widget: reset widget style after applying style classes from GtkBuilder
Otherwise, the parsed style classes do not get propagated to the
children.

https://bugzilla.gnome.org/show_bug.cgi?id=644925
2011-03-16 10:52:32 -04:00
John (J5) Palmieri
3938d3c2e4 [gi] add Virtual annotation for gtk_container_forall vfunc 2011-03-16 10:42:24 -04:00
Cosimo Cecchi
c9f38ba518 notebook: make GtkNotebook respect the focus-padding style property
https://bugzilla.gnome.org/show_bug.cgi?id=644348
2011-03-14 11:59:27 -04:00
Matthias Clasen
ddc588236b Add annotations to gtk_window_get_position
Part of bug 644353, patch by Ulrik Sverdrup.
2011-03-12 21:25:07 -05:00
Matthias Clasen
02ac322c9a Fix annotations for gtk_accelerator_parse
Part of bug 644353, patch by Ulrik Sverdrup.
2011-03-12 21:23:25 -05:00
Matthias Clasen
4a44f3f6e1 Formatting fixes 2011-03-12 21:22:27 -05:00
Cosimo Cecchi
677f268e8d paned: don't set the "pane-separator" style class to all the container
Otherwise children inherit color properties specified for the pane
separator itself.

https://bugzilla.gnome.org/show_bug.cgi?id=644276
2011-03-12 20:36:40 -05:00
Carlos Garcia Campos
21558ae67f themingengine: Use render_background_internal() to render handle background
Instead of using always the background color. This fixes handles that
have a background image like gnome-panel applets in a transparent
panel.

https://bugzilla.gnome.org/show_bug.cgi?id=644570
2011-03-12 20:32:42 -05:00
Matthias Clasen
aa1fdb4123 GtkAboutDialog: keep toggle button state in sync
When hiding the dialog, we hide the credits/license parts, so
we need to update the toggle buttons controlling them.
https://bugzilla.gnome.org/show_bug.cgi?id=644355
2011-03-12 13:43:28 -05:00
Benjamin Otte
015f227776 gtk: Queue a resize after state changes
Lots of style properties - border-width in this case - can change the
size of widgets, so we need to queue a resize instead of just redrawing.
2011-03-11 19:51:25 +01:00
Kristian Rietveld
a55b59fef3 Include gdkquartz.h so GDK_IS_QUARTZ_SCREEN is actually defined 2011-03-10 21:20:37 +01:00
Cosimo Cecchi
5215f72bd7 notebook: add an 'initial-gap' style property
It adds a gap before the first tab in the notebook.

https://bugzilla.gnome.org/show_bug.cgi?id=643841
2011-03-09 14:15:43 -05:00
Tristan Van Berkom
f632956166 Fixed GtkTreeModel::row-deleted documentation
This documentation was in direct conflict with the documentation
of gtk_tree_model_row_deleted() docs, the function docs are TRUE,
the signal docs were FALSE, fixed.
2011-03-09 15:06:45 +09:00
Cosimo Cecchi
e772082a2a stylecontext: add a raised style class
This is useful for raised elements, for example raised buttons on
primary toolbars.

https://bugzilla.gnome.org/show_bug.cgi?id=644248
2011-03-08 20:05:30 -05:00
Carlos Garnacho
191428f596 gtksettings: plug a leak
Make the GValue take the created GString.
2011-03-07 23:06:55 +01:00
Carlos Garnacho
fe12c46531 cssprovider: Reset the scope before skipping to the next rule after an error happens.
This is so the selector token gets parsed with the correct GScanner scope/config
on all situations.
2011-03-07 23:06:54 +01:00
Carlos Garnacho
aa6eee73e5 cssprovider: plug two more leak fixes 2011-03-07 23:06:54 +01:00
Carlos Garnacho
794593a4f8 cssprovider: return immediately if there's remaining data behind a parsed value
parse_value() could fill in a GError, but yet (incorrectly) return G_TOKEN_NONE,
having the GError leaked as a result.

https://bugzilla.gnome.org/show_bug.cgi?id=642604 , Reported by Felix Riemann.
2011-03-07 23:06:54 +01:00