MetaFrameBorders: Add meta_frame_borders_clear
Just a quick little commit to help clean things up for when we add invisible borders. Additionally, do a little housekeeping in preview-widget as well. https://bugzilla.gnome.org/show_bug.cgi?id=644930
This commit is contained in:
parent
e0fb83c691
commit
ce9c7a210d
@ -301,6 +301,15 @@ meta_frame_get_flags (MetaFrame *frame)
|
||||
return flags;
|
||||
}
|
||||
|
||||
void
|
||||
meta_frame_borders_clear (MetaFrameBorders *self)
|
||||
{
|
||||
self->visible.top = 0;
|
||||
self->visible.bottom = 0;
|
||||
self->visible.left = 0;
|
||||
self->visible.right = 0;
|
||||
}
|
||||
|
||||
void
|
||||
meta_frame_calc_borders (MetaFrame *frame,
|
||||
MetaFrameBorders *borders)
|
||||
|
@ -311,6 +311,10 @@ struct _MetaFrameBorders
|
||||
*/
|
||||
GtkBorder visible;
|
||||
};
|
||||
|
||||
/* sets all dimensions to zero */
|
||||
void meta_frame_borders_clear (MetaFrameBorders *self);
|
||||
|
||||
/* should investigate changing these to whatever most apps use */
|
||||
#define META_ICON_WIDTH 32
|
||||
#define META_ICON_HEIGHT 32
|
||||
|
@ -53,6 +53,8 @@ struct _MetaPreview
|
||||
int text_height;
|
||||
|
||||
MetaFrameBorders borders;
|
||||
guint borders_cached : 1;
|
||||
|
||||
MetaButtonLayout button_layout;
|
||||
};
|
||||
|
||||
|
@ -94,10 +94,7 @@ meta_preview_init (MetaPreview *preview)
|
||||
META_FRAME_ALLOWS_SHADE |
|
||||
META_FRAME_ALLOWS_MOVE;
|
||||
|
||||
preview->borders.visible.left = -1;
|
||||
preview->borders.visible.right = -1;
|
||||
preview->borders.visible.top = -1;
|
||||
preview->borders.visible.bottom = -1;
|
||||
preview->borders_cached = FALSE;
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
@ -168,23 +165,17 @@ ensure_info (MetaPreview *preview)
|
||||
pango_font_description_free (font_desc);
|
||||
}
|
||||
|
||||
if (preview->borders.visible.top < 0)
|
||||
if (!preview->borders_cached)
|
||||
{
|
||||
if (preview->theme)
|
||||
{
|
||||
meta_theme_get_frame_borders (preview->theme,
|
||||
preview->type,
|
||||
preview->text_height,
|
||||
preview->flags,
|
||||
&preview->borders);
|
||||
}
|
||||
else
|
||||
{
|
||||
preview->borders.visible.top = 0;
|
||||
preview->borders.visible.bottom = 0;
|
||||
preview->borders.visible.left = 0;
|
||||
preview->borders.visible.right = 0;
|
||||
}
|
||||
meta_frame_borders_clear (&preview->borders);
|
||||
preview->borders_cached = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@ -342,10 +333,7 @@ clear_cache (MetaPreview *preview)
|
||||
preview->layout = NULL;
|
||||
}
|
||||
|
||||
preview->borders.visible.left = -1;
|
||||
preview->borders.visible.right = -1;
|
||||
preview->borders.visible.top = -1;
|
||||
preview->borders.visible.bottom = -1;
|
||||
preview->borders_cached = FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -425,10 +425,8 @@ meta_frame_layout_get_borders (const MetaFrameLayout *layout,
|
||||
|
||||
if (flags & META_FRAME_FULLSCREEN)
|
||||
{
|
||||
borders->visible.top = 0;
|
||||
borders->visible.bottom = 0;
|
||||
borders->visible.left = 0;
|
||||
borders->visible.right = 0;
|
||||
meta_frame_borders_clear (borders);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -5585,10 +5583,7 @@ meta_theme_get_frame_borders (MetaTheme *theme,
|
||||
|
||||
style = theme_get_style (theme, type, flags);
|
||||
|
||||
borders->visible.top = 0;
|
||||
borders->visible.left = 0;
|
||||
borders->visible.right = 0;
|
||||
borders->visible.bottom = 0;
|
||||
meta_frame_borders_clear (borders);
|
||||
|
||||
/* Parser is not supposed to allow this currently */
|
||||
if (style == NULL)
|
||||
|
@ -736,10 +736,7 @@ meta_ui_theme_get_frame_borders (MetaUI *ui,
|
||||
}
|
||||
else
|
||||
{
|
||||
borders->visible.top = 0;
|
||||
borders->visible.bottom = 0;
|
||||
borders->visible.left = 0;
|
||||
borders->visible.right = 0;
|
||||
meta_frame_borders_clear (borders);
|
||||
}
|
||||
|
||||
if (style != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user