started proper implementation of icon size selection: hackish and dirty at the moment
authormishas <mikhail.sobolev@gmail.com>
Mon, 30 Apr 2007 13:15:42 +0000 (13:15 +0000)
committermishas <mikhail.sobolev@gmail.com>
Mon, 30 Apr 2007 13:15:42 +0000 (13:15 +0000)
git-svn-id: file:///svnroot/simple-launcher/trunk@200 3ba93dab-e023-0410-b42a-de7732cf370a

dialog-entry.cc
dialog-entry.h

index 2db6581..6f7a6a2 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,22 @@ SettingsDialogIntegerEntry::SettingsDialogIntegerEntry(GConfIntegerOption& optio
 void SettingsDialogIntegerEntry::updateValue() {
        ((GConfIntegerOption&)myOption).setValue(hildon_number_editor_get_value(mySpinBox));
 }
+
+SettingsDialogChoiceEntry::SettingsDialogChoiceEntry(GConfIntegerOption& option, const std::string& name): SettingsDialogEntry(option, name) {
+       myWidget = gtk_combo_box_new_text();
+}
+
+///
+
+static struct {
+       int value;
+       const char *name;
+} IconSizes[] = {
+       { 26, "Extra Small (26)" },
+       { 32, "Small (32)" },
+       { 48, "Medium (48)" },
+       { 64, "Large (64)" },
+       { -1, NULL }
+};
+
+///
index daa5e81..5f13bd9 100644 (file)
@@ -71,6 +71,29 @@ private:
   HildonNumberEditor *mySpinBox;
 };
 
+class SettingsDialogChoiceEntry : public SettingsDialogEntry {
+public:
+  SettingsDialogChoiceEntry(GConfIntegerOption& option, const std::string& name);
+
+  virtual const std::string& text(int index) const = 0;
+  virtual int numberOfChoices() const = 0;
+  virtual int initialValue() const = 0;
+
+  void updateValue();
+  GtkWidget *getWidget() const { return myWidget; }
+
+private:
+  GtkWidget *myWidget;
+};
+
+class SettingsDialogIconSizeEntry : public SettingsDialogChoiceEntry {
+  SettingsDialogIconSizeEntry(GConfIntegerOption& option, const std::string& name): SettingsDialogChoiceEntry(option, name) {}
+
+  const std::string& text(int index) const;
+  int numberOfChoices() const;
+  int initialValue() const;
+};
+
 #endif
 
 // vim:ts=2:sw=2:et