076e902b2c
Rather than repeating the computation of borders in many different widget subclasses, add helper functions: st_theme_node_adjust_for_height() st_theme_node_adjust_preferred_width() st_theme_node_adjust_for_width() st_theme_node_adjust_preferred_height() st_theme_node_get_content_box() That are used in get_preferred_width()/get_preferred_height() and allocate() methods to consistently apply the necessary adjustments. This allows removing the StPadding type. Queueing a relayout when the borders/padding change is moved from st_widget_real_style_changed() to the invoking code to allow access to the old StThemeNode for comparison. (Should this be added as a parameter to the signal?) Borders are included in the geometry adjustments, but borders are not yet drawn. https://bugzilla.gnome.org/show_bug.cgi?id=595993
49 lines
1.2 KiB
C
49 lines
1.2 KiB
C
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
/*
|
|
* Copyright 2009 Intel Corporation.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms and conditions of the GNU Lesser General Public License,
|
|
* version 2.1, as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope it will be useful, but WITHOUT ANY
|
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
|
|
* more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
* Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
|
*
|
|
*/
|
|
|
|
/**
|
|
* SECTION:st-types
|
|
* @short_description: type definitions used throughout St
|
|
*
|
|
* Common types for StWidgets.
|
|
*/
|
|
|
|
|
|
#if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION)
|
|
#error "Only <st/st.h> can be included directly.h"
|
|
#endif
|
|
|
|
#ifndef __ST_TYPES_H__
|
|
#define __ST_TYPES_H__
|
|
|
|
#include <glib-object.h>
|
|
#include <clutter/clutter.h>
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
typedef enum {
|
|
ST_ALIGN_START,
|
|
ST_ALIGN_MIDDLE,
|
|
ST_ALIGN_END
|
|
} StAlign;
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __ST_TYPES_H__ */
|