Commit Graph

460 Commits

Author SHA1 Message Date
Dan Winship
f9e4385e02 [StWidget] add (optional) hover tracking
If track-hover is set, update the hover property automatically, and
the "hover" pseudo class to match, as StClickable used to do. (Remove
the corresponding code in StClickable). Tweak the tooltip handling to
use track-hover, which also makes it slightly more reliable in the
presence of reactive children, etc.
2010-03-24 10:03:50 -04:00
Dan Winship
909b5ec43c [StWidget] add list-like methods for style_class and pseudo_class
Since style_class and pseudo_class are space-separated lists of names,
add new methods to add and remove individual names rather than just
re-setting the entire name.

Update existing code to use the new pseudo-class methods where
appropriate. In some cases, this may result in actors having multiple
pseudoclasses where previously they only had one at a time, but there
don't seem to be any visible differences.

(There are some places that could usefully use the new style_class
methods as well, but this patch doesn't change them.)

Also, update test-theme.c to test the new methods.

https://bugzilla.gnome.org/show_bug.cgi?id=604943
2010-03-24 09:40:37 -04:00
Dan Winship
7c37e94eda st-widget.h: fix spacing
https://bugzilla.gnome.org/show_bug.cgi?id=604943
2010-03-24 09:40:37 -04:00
Dan Winship
23e11175f8 St: minor gtk-doc fixage (%NULL, %TRUE, %FALSE, not #) 2010-03-23 19:56:10 -04:00
Dan Winship
57dd02f6ae fix a gtk-doc typo that giscanner was warning about 2010-03-23 11:28:25 -04:00
Florian Müllner
744bc996db Add a --version command line option
https://bugzilla.gnome.org/show_bug.cgi?id=613164
2010-03-18 01:43:11 +01:00
Maxim Ermilov
690deeb502 unref theme_node in st_widget_dispose
https://bugzilla.gnome.org/show_bug.cgi?id=612318
2010-03-17 23:44:20 +03:00
Colin Walters
b55fd735f4 [StTextureCache] Use size in all cases for cache keys
Otherwise we're going to be returning the wrong sized image to callers,
and Clutter.Texture will scale it, which will look awful.
2010-03-13 13:11:22 -05:00
Colin Walters
32fd323153 [ShellApp] When fading, don't read alpha channel if none available 2010-03-13 12:56:15 -05:00
Colin Walters
3aea09b614 Fix app icon fading
The way we were loading data into a CoglTexture, then pulling it out
and manipulating it on the CPU, then loading it back into a texture
was a bit lame.

Clean things up a bit here by loading directly into the CPU, doing
the fading, then creating a texture.

Also cache the faded data in StTextureCache.

https://bugzilla.gnome.org/show_bug.cgi?id=612759
2010-03-13 12:50:38 -05:00
Dan Winship
374fd35476 src/Makefile.am: fix .gir dependencies
We don't need to rebuild Big-1.0.gir and St-1.0.gir when
libgnome-shell changes.

https://bugzilla.gnome.org/show_bug.cgi?id=612734
2010-03-12 14:05:58 -05:00
Dan Winship
20d3b1f8b1 Error out at startup if the GConf schemas are missing
If we don't do this, then boolean/int/list keys will seem to sort of
work (but defaulting to false/0/[] instead of the correct schema
defaults), but string keys will return null, which will usually cause
exceptions or crashes.

https://bugzilla.gnome.org/show_bug.cgi?id=611214
2010-03-12 13:48:58 -05:00
Florian Müllner
46f8d913a1 [StTextureCache] Fix an accidentally swapped ref/unref 2010-03-11 21:42:32 +01:00
Owen W. Taylor
89173544d4 Simplify handling of adjustments
The relationship between adjustments and scrollbars and
scrollable widgets was much more complex than it needed to be.

StScrollView: Have the scroll view own a pair of adjustments,
  set them on the child on add(), remove unnecessary
  change notification signal connections.
StBoxLayout: Remove auto-create of adjustments, just take the
  adjustments from the scrollbars and set them on the scrollable
  child. Notify for hadjustment/vadjustment properties.
StScrollBar: Notify adjustment property.
StScrollable: Document how adjustment setting works.

https://bugzilla.gnome.org/show_bug.cgi?id=611740
2010-03-11 15:08:48 -05:00
Owen W. Taylor
163b2d0403 Fixes for dispose and finalize
* Add missing chain-up for dispose and finalize methods
* ShellGenericContainer needs to destroy its children in dispose()
* Fix variable naming and excess casts in st_label_dispose()

https://bugzilla.gnome.org/show_bug.cgi?id=612511
2010-03-11 15:08:48 -05:00
Owen W. Taylor
c83883f1f7 Fixes for setting up scrolling adjustments
StScrollable: Document how to set adjustments
StBoxLayout: Make sure that we always have upper >= lower + page_size,
  so that clamping works properly. Set the page_increment to be slightly
  less than the page_size so there is some overlap, as is customary.
StScrollView: Remove unnecessary fabs() calls, rewrite expressions
  for additional clarity.

https://bugzilla.gnome.org/show_bug.cgi?id=611740
2010-03-11 15:08:48 -05:00
Owen W. Taylor
f6cbb14393 Incremental fixes for scrollview work
- Fix existing typos and spacing problems
- Get preferred height, not current height, of shadows
- Let shadows overflow don't clamp them when we have too little space
- Remove a now-unecessary stray MAX()
- Fix up scrollview visibility for the pathological case of no child
- Disconnect from adjustments on remove()
- Don't unset the adjustments on the child on remove(), since they
  already existed or were autocreated on add()

  (We should what we are doing and set the adjustments of the
  scrollbars on the child rather than setting the adjustments of
  the child, so we match GTK+'s scrolllable interface, but this
  at least makes it consistent instead of a weird mix.)

https://bugzilla.gnome.org/show_bug.cgi?id=611740
2010-03-11 15:08:48 -05:00
Owen W. Taylor
ffd25fe9e4 Fix size negotiation for StScrollView
StScrollable: Document how size negotation now works between the
  parent and scrollable child.

StBoxLayout: Adapt to the new contract for how size negotiation
  works; in particular, handle being allocated less than the
  minimum size when scrolled and treat the minimum size as the
  size of the scrolled area in instead of the natural size.

StScrollView: Substantially rewrite with fixes including:
 - Implement new size negotation contract; this allows us
   to determine scrollbar visibility without having to
   connect to the adjustment.
 - Implement all ALWAYS along with the existing NEVER/AUTO
 - When hiding and showing scrollbars and shadows, don't
   hide and show widgets, just turn on and off including them
   in pick and paint. This avoids queueing relayouts.
 - Cleanups for the code for connecting to adjustments,
   for changing policy, and for turning on and off shadows.

scroll-view-sizing.js: New test case for StScrollView, allowing
  resizing the scroll view interactively, changing the scrollbar
  policies and turning shadows on and off.

https://bugzilla.gnome.org/show_bug.cgi?id=611740
2010-03-11 15:08:48 -05:00
Owen W. Taylor
524e2ca8e2 [StScrollBar] avoid queueing a relayout during allocation
When an StScrollView is allocated, allocating the child would
cause the adjustment values to change, which would result in
the scrollbars queueing a relayout, which isn't allowed during
allocation.

To avoid this, instead of queueing a relayout when the adjustment
changes:

 - When we have a valid allocation already, just go ahead
   and reallocate the children.
 - Otherwise do nothing immediately and wait until we get allocated

Because the 'needs_allocation' flag in ClutterActor isn't exposed,
this requires some slightly ugly code to shadow that state locally.

https://bugzilla.gnome.org/show_bug.cgi?id=611944
2010-03-11 15:08:48 -05:00
Owen W. Taylor
33dca51650 Rework StDrawingArea not to use ClutterCairoTexture
Having StDrawingArea use ClutterCairoTexture causes circularity
problems with sizing - StDrawingArea wants to use its allocation for
the size of the texture, but ClutterTexture wants to use the size of
the texture to determine the requited size.

Avoid this by making StDrawingArea directly use Cairo and CoglTexture;
while doing this, the API is changed a bit for simplicity and to
match our use case:

 - Instead of clutter_cairo_texture_create(), we have
   st_drawing_area_get_context() to retrieve an already created
   context. This can only be called in the ::repaint signal.

 - The ::redraw signal is changed to ::repaint so we can have
   st_drawing_area_queue_repaint() that doesn't collide with
   clutter_actor_queue_redraw()

 - ::repaint is now emitted lazily when painting the actor rather
   than synchronously at various different points.

https://bugzilla.gnome.org/show_bug.cgi?id=611750
2010-03-11 15:08:48 -05:00
Owen W. Taylor
58bb0044b2 Support and require Clutter 1.2
- Specify a minimum version of clutter-1.2.0
 - Switch clutter branch in the moduleset to master
 - Replace deprecated cogl_texture/material_unref() with
   cogl_handle_unref()
 - Use cogl_clip_push_rectangle() rather than cogl_clip_push()
 - Replace cogl_check_extension() with strstr - should be
   accurate enough.

https://bugzilla.gnome.org/show_bug.cgi?id=610679
2010-03-11 15:08:48 -05:00
Adel Gadllah
730e8ffdf9 Add get_horizontal/vertical_padding() methods
Add get_horizontal_padding() and get_vertical_padding() methods,
that return the total padding (LEFT+RIGHT or TOP+BOTTOM).

https://bugzilla.gnome.org/show_bug.cgi?id=597983
2010-03-11 18:04:37 +01:00
Dan Winship
d128cc5af3 st_widget_get_theme_node: g_error if called on an unparented widget
It's wrong to do anything that requires looking up a widget's style
before you add the widget to the stage, since its final style may
depend on properties inherited from its parents.
st_widget_get_theme_node() used to emit a warning in this case, but
many would-be contributors apparently didn't notice. Help them out.

https://bugzilla.gnome.org/show_bug.cgi?id=610279
2010-03-10 09:29:48 -05:00
Colin Walters
e752193a54 [StTextureCache] The requested size needs to be part of the cache key
Otherwise we'll only render it once, which is clearly wrong.
2010-03-09 14:08:22 -05:00
Colin Walters
3333f30c42 Convert border_width, border_radius to integers
This saves the consumers from having to deal with rounding.

https://bugzilla.gnome.org/show_bug.cgi?id=607500
2010-03-08 16:46:47 -05:00
Colin Walters
a4481b38d2 Remove st_widget accessors for background and border actors
StButton animated the background for button transitions; since these aren't
presently part of the shell design, simply remove them.  We can readd
these in the future.

StTooltip should probably have :vertical and :horizontal pseudo classes
to make the arrow work but it should still function.

https://bugzilla.gnome.org/show_bug.cgi?id=607500
2010-03-08 16:28:34 -05:00
Colin Walters
176487834a Add st_texture_cache_load
Function for caching texture data from an arbitrary origin.

https://bugzilla.gnome.org/show_bug.cgi?id=607500
2010-03-08 15:50:59 -05:00
Colin Walters
394e01850b Rework internals to be string based
Rather than having ShellTextureCache know about the type of each
item it's caching, this lays the foundation for simply caching
arbitrary string -> CoglHandle.

https://bugzilla.gnome.org/show_bug.cgi?id=607500
2010-03-08 15:10:35 -05:00
Florian Müllner
5f8391314a Add hover style property
Set the entry's pseudo class to "hover" when the pointer enters the
inactive widget and reset it appropriately on leave.

https://bugzilla.gnome.org/show_bug.cgi?id=611095
2010-03-08 19:33:12 +01:00
Thomas Wood
d593877548 fix issues with hint text
Add a "hint_visible" private variable to keep track of when the hint text
is visible. Use this to determine whether to return the text from the
internal ClutterText or whether to return an empty string.

Fixes: http://bugzilla.moblin.org/show_bug.cgi?id=6837
       http://bugzilla.moblin.org/show_bug.cgi?id=6836

https://bugzilla.gnome.org/show_bug.cgi?id=611095
2010-03-08 19:33:11 +01:00
Florian Müllner
a0b5a44fe9 [StEntry] Make the cursor size stylable
Just as the cursor color can be styled using the "caret-color"
property, expose the cursor size as "caret-size".

https://bugzilla.gnome.org/show_bug.cgi?id=611095
2010-03-07 23:45:44 +01:00
Colin Walters
5ce1e3fe92 Add st_texture_cache_load_file_to_cogl_texture
For StWidget we want the ability to load raw CoglHandle references
rather than having a big pile of actors backing StWidget.

Several bits of StWidget expect to be able to synchronously load
textures; this is a crutch to support that until we can cleanly
make this asynchronous.

https://bugzilla.gnome.org/show_bug.cgi?id=607500
2010-03-05 17:08:36 -05:00
Colin Walters
22948b3d39 Merge St.TextureCache and Shell.TextureCache
Brute force merge these two by essentially replacing St.TextureCache
with a (renamed) Shell.TextureCache.

One function was added for convenience, namely "st_texture_cache_load_file_simple".
St.TextureCache had a function to load a texture from a filename, and it
returned NULL on error but only half the callers actually checked this.  This
function is better.

https://bugzilla.gnome.org/show_bug.cgi?id=607500
2010-03-05 16:19:40 -05:00
Colin Walters
1a0d507316 [ShellGenericContainer] When removing actors, remove them from skip_paint
This fixes a regression introduced by the previous patch.
2010-03-04 17:38:35 -05:00
Dan Winship
b5853fe7e5 [ShellGenericContainer] make this an StWidget
https://bugzilla.gnome.org/show_bug.cgi?id=611647
2010-03-04 15:43:02 -05:00
Dan Winship
0f81c7efe0 [ShellGenericContainer] minor style fixes
https://bugzilla.gnome.org/show_bug.cgi?id=611647
2010-03-04 15:41:26 -05:00
Dan Winship
0f0e3d9644 [ShellGenericContainer] remove example
There are plenty of examples in js/ui/ now

https://bugzilla.gnome.org/show_bug.cgi?id=611647
2010-03-04 15:41:26 -05:00
Dan Winship
f6b4fa6e7e [St] share common ClutterContainer implementation code
https://bugzilla.gnome.org/show_bug.cgi?id=611647
2010-03-04 15:41:25 -05:00
Colin Walters
c635cb7016 [ShellGenericContainer] Add method to get number of skipped children
This will be used in search results.

https://bugzilla.gnome.org/show_bug.cgi?id=610740
2010-03-04 14:08:13 -05:00
Owen W. Taylor
6423cbfc92 Fix problems on destruction
StScrollBar: Be robust against being disposed multiple times,
  which can happen, and in fact, normally happens when destroying
  the parent.

StScrollView: Implement remove() for the hscroll and vscroll members,
  and just destroy them in dispose() and let them be removed.
  unparent the shadows, instead of just unref'ing them directly.

https://bugzilla.gnome.org/show_bug.cgi?id=611203
2010-03-02 16:37:05 -05:00
Adel Gadllah
40a8e9c1a6 Fix tracking of single-process multi app cases
When starting oocalc or ooimpress from oowriter's menu get_app_for_window,
fails to recognize the newly started up as such, which result into the appMenu
still showing "Openoffice.org Writer" as app name.

Fix this by trying to window itself first before using the group for finding the app.

https://bugzilla.gnome.org/show_bug.cgi?id=611288
2010-03-01 19:29:39 +01:00
Colin Walters
2e98aab2e7 Revert "(autobuilder test) Really break the build"
This reverts commit 760b6ad9ed.
2010-03-01 10:59:51 -05:00
Colin Walters
760b6ad9ed (autobuilder test) Really break the build 2010-03-01 10:52:31 -05:00
Florian Müllner
b7c60b02d1 [StEntry] Add annotations
All setters in StEntry allow to pass NULL - add appropriate annotations.
2010-02-27 18:03:37 +01:00
Colin Walters
8552721983 [gnome-shell.in] When we don't have DISPLAY, attempt to pull in running session
This is a convenience for debugging when logging in over ssh.  Longer term
we should stick this code (in a more OS portable fashion) into ConsoleKit.
2010-02-25 14:46:27 -05:00
Colin Walters
c4e0e4197d [ShellGlobal] Add shell_global_breakpoint
This is useful for debugging with gdb.
2010-02-23 18:51:27 -05:00
Dan Winship
ef4c9b6f1f [StThemeNode] allow "background-gradient-direction: none"
this lets a more-specific CSS rule turn off the gradient inherited
from a less-specific rule

https://bugzilla.gnome.org/show_bug.cgi?id=610856
2010-02-23 14:44:57 -05:00
Owen W. Taylor
1f1f4432f6 Use gjs_context_get_native_context()
When exported into a public header, gjs_context_get_context() was
renamed to gjs_context_get_native_context(). Adapt, and remove
local prototype.

https://bugzilla.gnome.org/show_bug.cgi?id=610845
2010-02-23 11:54:56 -05:00
Owen W. Taylor
2dc8d9b462 Fix include path when building Shell-1.0.gir
Since shell-slicer.h includes st.h, and that includes
<st/*.h>, we need to add -I $(srcdir) to the command line when
running g-ir-scanner to generate Shell-1.0.gir.
2010-02-22 22:07:52 -05:00
Owen W. Taylor
ce6dd21cd3 Don't generate st.h in a subdir
For srcdir != builddir, in the builddir, the st/ subdirectory doesn't
exist, so we can't generate st.h there. Just switch to building st.h
directly in the current directory. (The other option would be to
create a st/ subdirectory in the builddir if necessary; might be a
little cleaner, but this works for now and gets things distchecking.)
2010-02-22 19:37:49 -05:00