*
* Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
*
- * Contact: Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+ * Contact: Rodrigo Novo <rodrigo.novo@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; version 2.1 of
- * the License.
+ * the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
*/
-/*
+/**
* SECTION:hildon-vvolumebar
- * @short_description: A widget that displays a vertical volume bar
+ * @short_description: A widget that displays a vertical volume bar.
* @see_also: #HildonVolumebar, #HildonHVolumebar
*
* #HildonVVolumebar is a subclass of #HildonVolumebar. It displays a
* vertical volume bar that allows increasing or decreasing volume
* within a predefined range, and muting when users click the mute icon.
+ *
+ * Here is an example that creates a vertical volume bar and connects
+ * both its signals.
+ * <example>
+ * <title>HildonVVolumebar example</title>
+ * <programlisting>
+ * GtkWidget *volbar = hildon_vvolumebar_new ();
+ * g_signal_connect (G_OBJECT (volbar), "mute_toggled", G_CALLBACK (mute_toggle), NULL);
+ * g_signal_connect (G_OBJECT (volbar), "level_changed", G_CALLBACK (level_change), NULL);
+ * </programlisting>
+ * </example>
*/
+#undef HILDON_DISABLE_DEPRECATED
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "hildon-vvolumebar.h"
-#include <gtk/gtk.h>
#include "hildon-volumebar-range.h"
#include "hildon-volumebar-private.h"
/* Volume bar */
-#define DEFAULT_BAR_WIDTH 58
+#define DEFAULT_BAR_WIDTH 60
#define MINIMUM_BAR_HEIGHT 165
/* Toggle button */
-#define DEFAULT_VERTICAL_TBUTTON_WIDTH 26
+#define DEFAULT_VERTICAL_TBUTTON_WIDTH 60
-#define DEFAULT_VERTICAL_TBUTTON_HEIGHT 26
+#define DEFAULT_VERTICAL_TBUTTON_HEIGHT 60
-#define DEFAULT_ENDING_SIZE 20
+#define DEFAULT_ENDING_SIZE 0
/* Gap to leave for mute button */
-#define HORIZONTAL_MUTE_GAP 16
+#define HORIZONTAL_MUTE_GAP 0
-#define VERTICAL_MUTE_GAP 6
+#define VERTICAL_MUTE_GAP 0
static HildonVolumebarClass* parent_class;
*
* Initializes and returns the type of a hildon vvolumebar.
*
- * @Returns: GType of #HildonVVolumebar
+ * Returns: GType of #HildonVVolumebar
*/
GType G_GNUC_CONST
hildon_vvolumebar_get_type (void)
priv->volumebar = HILDON_VOLUMEBAR_RANGE (hildon_volumebar_range_new
(GTK_ORIENTATION_VERTICAL));
- GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET (vvolumebar), GTK_CAN_FOCUS);
-
gtk_widget_set_parent (GTK_WIDGET (priv->tbutton), GTK_WIDGET (vvolumebar));
gtk_widget_set_parent (GTK_WIDGET (priv->volumebar), GTK_WIDGET (vvolumebar));
/* Allocate space for the mute button */
button_allocation.x = allocation->x + HORIZONTAL_MUTE_GAP;
button_allocation.y = allocation->y + allocation->height -
+ DEFAULT_VERTICAL_TBUTTON_HEIGHT -
VERTICAL_MUTE_GAP - 2 * DEFAULT_ENDING_SIZE;
button_allocation.width = DEFAULT_VERTICAL_TBUTTON_WIDTH;
button_allocation.height = DEFAULT_VERTICAL_TBUTTON_HEIGHT;