changed defaults: non-transparent, iconsize = 48
[simple-launcher] / dialog-entry.cc
index 2db6581..7c08961 100644 (file)
@@ -16,6 +16,7 @@
 // Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 #include <gtk/gtkcheckbutton.h>
+#include <gtk/gtkcombobox.h>
 
 #include "dialog-entry.h"
 
@@ -37,3 +38,51 @@ SettingsDialogIntegerEntry::SettingsDialogIntegerEntry(GConfIntegerOption& optio
 void SettingsDialogIntegerEntry::updateValue() {
        ((GConfIntegerOption&)myOption).setValue(hildon_number_editor_get_value(mySpinBox));
 }
+
+#if 0
+SettingsDialogChoiceEntry::SettingsDialogChoiceEntry(GConfIntegerOption& option, const std::string& name): SettingsDialogEntry(option, name) {
+       myWidget = gtk_combo_box_new_text();
+}
+#endif
+
+///
+
+static struct {
+       int value;
+       const char *name;
+} IconSizes[] = {
+       { 26, "Extra Small (26)" },
+       { 32, "Small (32)" },
+       { 48, "Medium (48)" },
+       { 54, "Large (54)" },
+       { 64, "Extra Large (64)" },
+       { -1, NULL }
+};
+
+SettingsDialogIconSizeEntry::SettingsDialogIconSizeEntry(GConfIntegerOption& option, const std::string& name): SettingsDialogEntry(option, name) {
+       myWidget = gtk_combo_box_new_text();
+
+       int active = -1;
+
+       for (int i = 0; IconSizes[i].value != -1; ++i) {
+               gtk_combo_box_append_text(GTK_COMBO_BOX(myWidget), IconSizes[i].name);
+
+               if (IconSizes[i].value == option.value()) {
+                       active = i;
+               }
+       }
+
+       if (active != -1) {
+               gtk_combo_box_set_active(GTK_COMBO_BOX(myWidget), active);
+       }
+}
+
+void SettingsDialogIconSizeEntry::updateValue() {
+       gint index = gtk_combo_box_get_active(GTK_COMBO_BOX(myWidget));
+
+       if (index != -1) {
+               ((GConfIntegerOption&)myOption).setValue(IconSizes[index].value);
+       }
+}
+
+///