From ccd89632c35881f7176e0dc0b2cbac9077818e72 Mon Sep 17 00:00:00 2001 From: mishas Date: Mon, 30 Apr 2007 13:15:42 +0000 Subject: [PATCH] started proper implementation of icon size selection: hackish and dirty at the moment git-svn-id: file:///svnroot/simple-launcher/trunk@200 3ba93dab-e023-0410-b42a-de7732cf370a --- dialog-entry.cc | 20 ++++++++++++++++++++ dialog-entry.h | 23 +++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/dialog-entry.cc b/dialog-entry.cc index 2db6581..6f7a6a2 100644 --- a/dialog-entry.cc +++ b/dialog-entry.cc @@ -16,6 +16,7 @@ // Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include +#include #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 } +}; + +/// diff --git a/dialog-entry.h b/dialog-entry.h index daa5e81..5f13bd9 100644 --- a/dialog-entry.h +++ b/dialog-entry.h @@ -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 -- 1.7.9.5