* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Modified by the GTK+ Team and others 1997-2007. See the AUTHORS
#include "gtkintl.h"
+/**
+ * SECTION:gtkcellrendererprogress
+ * @Short_description: Renders numbers as progress bars
+ * @Title: GtkCellRendererProgress
+ *
+ * #GtkCellRendererProgress renders a numeric value as a progress par in a cell.
+ * Additionally, it can display a text on top of the progress bar.
+ *
+ * The #GtkCellRendererProgress cell renderer was added in GTK+ 2.6.
+ */
+
+
enum
{
PROP_0,
priv->orientation = g_value_get_enum (value);
break;
case PROP_INVERTED:
- priv->orientation = g_value_get_boolean (value);
+ priv->inverted = g_value_get_boolean (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
GtkCellRendererProgress *cellprogress = GTK_CELL_RENDERER_PROGRESS (cell);
GtkCellRendererProgressPrivate *priv= cellprogress->priv;
GtkStyleContext *context;
- GtkBorder padding, border;
+ GtkBorder padding;
PangoLayout *layout;
PangoRectangle logical_rect;
gint x, y, w, h, x_pos, y_pos, bar_position, bar_size, start, full_size;
gtk_render_background (context, cr, x, y, w, h);
gtk_render_frame (context, cr, x, y, w, h);
- gtk_style_context_get_border (context, GTK_STATE_FLAG_NORMAL, &border);
gtk_style_context_get_padding (context, GTK_STATE_FLAG_NORMAL, &padding);
- x += border.left + padding.left;
- y += border.top + padding.top;
- w -= border.left + border.right + padding.left + padding.right;
- h -= border.top + border.bottom + padding.top + padding.bottom;
+ x += padding.left;
+ y += padding.top;
+ w -= padding.left + padding.right;
+ h -= padding.top + padding.bottom;
gtk_style_context_restore (context);