diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/preview-widget.c | 22 | ||||
-rw-r--r-- | src/ui/preview-widget.h | 1 | ||||
-rw-r--r-- | src/ui/theme.c | 16 | ||||
-rw-r--r-- | src/ui/ui.c | 5 |
4 files changed, 10 insertions, 34 deletions
diff --git a/src/ui/preview-widget.c b/src/ui/preview-widget.c index 1db34950..e5573c6e 100644 --- a/src/ui/preview-widget.c +++ b/src/ui/preview-widget.c @@ -98,10 +98,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* @@ -172,23 +169,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; } } @@ -364,10 +355,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 diff --git a/src/ui/preview-widget.h b/src/ui/preview-widget.h index 11818588..898a226d 100644 --- a/src/ui/preview-widget.h +++ b/src/ui/preview-widget.h @@ -51,6 +51,7 @@ struct _MetaPreview int text_height; MetaFrameBorders borders; + guint borders_cached : 1; MetaButtonLayout button_layout; }; diff --git a/src/ui/theme.c b/src/ui/theme.c index 20cf6913..d673134c 100644 --- a/src/ui/theme.c +++ b/src/ui/theme.c @@ -219,11 +219,6 @@ meta_frame_layout_new (void) layout->right_width = -1; layout->bottom_height = -1; - layout->invisible_border.left = 10; - layout->invisible_border.right = 10; - layout->invisible_border.bottom = 10; - layout->invisible_border.top = 10; - init_border (&layout->title_border); layout->title_vertical_pad = -1; @@ -430,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; } } @@ -5658,10 +5651,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) diff --git a/src/ui/ui.c b/src/ui/ui.c index fdb9733a..a03747f2 100644 --- a/src/ui/ui.c +++ b/src/ui/ui.c @@ -682,10 +682,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) |