mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 18:11:05 -05:00
2007-07-31 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-entry.c (clutter_entry_init): Set the default size of the entry based on the size of the default font. (#414).
This commit is contained in:
parent
4c5e32ad05
commit
cae72ec419
@ -1,3 +1,8 @@
|
||||
2007-07-31 Emmanuele Bassi <ebassi@openedhand.com>
|
||||
|
||||
* clutter/clutter-entry.c (clutter_entry_init): Set the default
|
||||
size of the entry based on the size of the default font. (#414).
|
||||
|
||||
2007-07-31 Emmanuele Bassi <ebassi@openedhand.com>
|
||||
|
||||
* clutter/sdl/clutter-backend-sdl.c: Fix a typo in
|
||||
|
@ -715,6 +715,8 @@ static void
|
||||
clutter_entry_init (ClutterEntry *self)
|
||||
{
|
||||
ClutterEntryPrivate *priv;
|
||||
gdouble resolution;
|
||||
gint font_size;
|
||||
|
||||
self->priv = priv = CLUTTER_ENTRY_GET_PRIVATE (self);
|
||||
|
||||
@ -749,7 +751,16 @@ clutter_entry_init (ClutterEntry *self)
|
||||
|
||||
priv->font_name = g_strdup (DEFAULT_FONT_NAME);
|
||||
priv->desc = pango_font_description_from_string (priv->font_name);
|
||||
|
||||
|
||||
/* we use the font size to set the default width and height, in case
|
||||
* the user doesn't call clutter_actor_set_size().
|
||||
*/
|
||||
resolution = 96.0; /* FIXME use clutter_backend_get_resolution() */
|
||||
font_size = PANGO_PIXELS (pango_font_description_get_size (priv->desc))
|
||||
* resolution
|
||||
/ 72.0;
|
||||
clutter_actor_set_size (CLUTTER_ACTOR (self), font_size * 20, 50);
|
||||
|
||||
priv->cursor = clutter_rectangle_new_with_color (&priv->fgcol);
|
||||
clutter_actor_set_parent (priv->cursor, CLUTTER_ACTOR (self));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user