* implementation is somewhat hackish: probably it will need some review later
* started to use the new widget
* renamed the icon size, now they are "Small, Medium, Large, Extra Large"
git-svn-id: file:///svnroot/simple-launcher/trunk@201
3ba93dab-e023-0410-b42a-
de7732cf370a
-simple-launcher (0.9.4~16) unstable; urgency=low
+simple-launcher (0.9.4~17) unstable; urgency=low
* NOT RELEASED YET
* settings dialog is moved into a separate class
* do not destroy applet's widget
* delete array when it was allocated as array
* make a private copy of icons obtained through GtkIconTheme
+ * implemented a different widget for icon size selection
- -- Mikhail Sobolev <mss@mawhrin.net> Tue, 17 Apr 2007 10:50:52 +0300
+ -- Mikhail Sobolev <mss@mawhrin.net> Thu, 10 May 2007 17:53:50 +0300
simple-launcher (0.9.3) unstable; urgency=low
((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
///
int value;
const char *name;
} IconSizes[] = {
- { 26, "Extra Small (26)" },
- { 32, "Small (32)" },
- { 48, "Medium (48)" },
- { 64, "Large (64)" },
+ { 26, "Small (26)" },
+ { 32, "Medium (32)" },
+ { 48, "Large (48)" },
+ { 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;
+ }
+ }
+}
+
+void SettingsDialogIconSizeEntry::updateValue() {
+ gint index = gtk_combo_box_get_active(GTK_COMBO_BOX(myWidget));
+
+ if (index != -1) {
+ ((GConfIntegerOption&)myOption).setValue(IconSizes[index].value);
+ }
+}
+
///
HildonNumberEditor *mySpinBox;
};
+#if 0
class SettingsDialogChoiceEntry : public SettingsDialogEntry {
public:
SettingsDialogChoiceEntry(GConfIntegerOption& option, const std::string& name);
GtkWidget *myWidget;
};
-class SettingsDialogIconSizeEntry : public SettingsDialogChoiceEntry {
- SettingsDialogIconSizeEntry(GConfIntegerOption& option, const std::string& name): SettingsDialogChoiceEntry(option, name) {}
+class SettingsDialogIconSizeEntry : public SettingsDialogChoiceEntry
+#endif
+
+class SettingsDialogIconSizeEntry : public SettingsDialogEntry {
+public:
+ SettingsDialogIconSizeEntry(GConfIntegerOption& option, const std::string& name);
+
+ void updateValue();
- const std::string& text(int index) const;
- int numberOfChoices() const;
- int initialValue() const;
+ GtkWidget *getWidget() const { return myWidget; }
+
+private:
+ GtkWidget *myWidget;
};
#endif
SettingsDialog::SettingsDialog(GtkWindow *parent, LauncherItems& items, GConfBooleanOption& transparent, GConfIntegerOption& icon_size):
myTransparent(transparent, "Transparent background:"),
- myIconSize(icon_size, "Icon Size:", 26, 64) {
+ myIconSize(icon_size, "Icon Size:") {
myDialog = GTK_DIALOG(gtk_dialog_new_with_buttons("Launcher Settings", parent, (GtkDialogFlags)(GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT), "OK", GTK_RESPONSE_OK, "Cancel", GTK_RESPONSE_CANCEL, NULL));
myNotebook = GTK_NOTEBOOK(gtk_notebook_new());
GtkNotebook *myNotebook;
SettingsDialogBooleanEntry myTransparent;
- SettingsDialogIntegerEntry myIconSize;
+ SettingsDialogIconSizeEntry myIconSize;
};
#endif