* 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/>.
*/
#include "config.h"
#include "gtkmarshalers.h"
#include "gtkprivate.h"
#include "gtktreeprivate.h"
+#include "a11y/gtkbooleancellaccessible.h"
+
+
+/**
+ * SECTION:gtkcellrenderertoggle
+ * @Short_description: Renders a toggle button in a cell
+ * @Title: GtkCellRendererToggle
+ *
+ * #GtkCellRendererToggle renders a toggle button in a cell. The
+ * button is drawn as a radio or a checkbutton, depending on the
+ * #GtkCellRendererToggle:radio property.
+ * When activated, it emits the #GtkCellRendererToggle::toggled signal.
+ */
static void gtk_cell_renderer_toggle_get_property (GObject *object,
PROP_INDICATOR_SIZE
};
-#define TOGGLE_WIDTH 13
+#define TOGGLE_WIDTH 16
static guint toggle_cell_signals[LAST_SIGNAL] = { 0 };
G_TYPE_STRING);
g_type_class_add_private (object_class, sizeof (GtkCellRendererTogglePrivate));
+
+ gtk_cell_renderer_class_set_accessible_type (cell_class, GTK_TYPE_BOOLEAN_CELL_ACCESSIBLE);
}
static void
if (width <= 0 || height <= 0)
return;
+ state = gtk_cell_renderer_get_state (cell, widget, flags);
+
if (!priv->activatable)
- state = GTK_STATE_FLAG_INSENSITIVE;
- else
- state = gtk_cell_renderer_get_state (cell, widget, flags);
+ state |= GTK_STATE_FLAG_INSENSITIVE;
+
+ state &= ~(GTK_STATE_FLAG_INCONSISTENT | GTK_STATE_FLAG_ACTIVE);
if (priv->inconsistent)
state |= GTK_STATE_FLAG_INCONSISTENT;