Index: button_style.install
===================================================================
RCS file: button_style.install
diff -N button_style.install
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ button_style.install	8 Jun 2010 09:44:02 -0000
@@ -0,0 +1,16 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Installation and update functions for Button style module.
+ */
+
+/**
+ * Implements hook_uninstall().
+ */ 
+function button_style_uninstall() {
+  // Remove theme settings.
+  db_query("DELETE FROM {variable} WHERE name LIKE 'button_style_%'");
+}
+
Index: button_style.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/button_style/button_style.module,v
retrieving revision 1.4.2.1
diff -u -p -r1.4.2.1 button_style.module
--- button_style.module	20 Feb 2010 22:25:29 -0000	1.4.2.1
+++ button_style.module	8 Jun 2010 09:44:02 -0000
@@ -7,9 +7,40 @@
  */
 
 /**
+ * Implements hook_form_FORMID_alter().
+ *
+ * Allow to toggle button style per-theme.
+ */
+function button_style_form_system_theme_settings_alter(&$form, &$form_state) {
+  if ($form['var']['#value'] != 'theme_settings') {
+    $form['theme_settings']['button_style'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Button style'),
+      '#default_value' => variable_get('button_style_' . $form['var']['#value'], TRUE),
+    );
+    $form['#submit'][] = 'button_style_form_system_theme_settings_submit';
+  }
+}
+
+/**
+ * Form submit handler for system_theme_settings() form.
+ */
+function button_style_form_system_theme_settings_submit($form, &$form_state) {
+  // The 'var' key will hold something like 'theme_THEME_KEY_settings'.
+  variable_set('button_style_' . $form_state['values']['var'], $form_state['values']['button_style']);
+}
+
+/**
  * Implementation of hook_form_alter().
  */
 function button_style_form_alter(&$form, &$form_state, $form_id) {
+  // Check whether button style is enabled for the current theme.
+  init_theme();
+  global $theme_key;
+  if (!variable_get('button_style_theme_' . $theme_key . '_settings', TRUE)) {
+    return;
+  }
+
   $path = drupal_get_path('module', 'button_style');
   drupal_add_css($path . '/button_style.css');
   // drupal_add_js($path . '/button_style.js', 'module', 'footer', TRUE);
