#include "settings-dialog.h"
+#define SL_APPLET_SETTINGS_ICON_SIZE 26
+
// FIXME: UGLY!!!!
inline void addPage(GtkNotebook *notebook, const std::string& name, GtkWidget *widget) {
return vbox;
}
-SettingsDialog::SettingsDialog(GtkWindow *parent, int size, LauncherItems& items) : myList(size, items) {
+SettingsDialog::SettingsDialog(GtkWindow *parent, LauncherItems& items) : myList(SL_APPLET_SETTINGS_ICON_SIZE, items) {
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));
GtkNotebook *notebook = GTK_NOTEBOOK(gtk_notebook_new());
#define SL_APPLET_DBUS_NAME "simple-launcher"
#define SL_APPLET_VERSION "0.0"
-#define SL_APPLET_ICON_SIZE 48
#define SL_APPLET_GCONF_PATH "/apps/simple-launcher"
bool myTransparent;
// bool myShowInfobanner; // FIXME: to implement
+ int myIconSize;
static char *ourDirs[];
};
};
// SimpleLauncherApplet::SimpleLauncherApplet() : myMainSettings(myClient.getKey(SL_APPLET_GCONF_PATH)), myContext(NULL), myWidget(NULL), myParent(NULL) {
-SimpleLauncherApplet::SimpleLauncherApplet() : myContext(NULL), myWidget(NULL), myParent(NULL), myTransparent(false) {
+SimpleLauncherApplet::SimpleLauncherApplet() : myContext(NULL), myWidget(NULL), myParent(NULL), myTransparent(false), myIconSize(48) {
}
bool SimpleLauncherApplet::doInit(void *state_data, int *state_size) {
gtk_event_box_set_visible_window(GTK_EVENT_BOX(button), !myTransparent);
- gtk_container_add(GTK_CONTAINER(button), gtk_image_new_from_pixbuf(item->getIcon(SL_APPLET_ICON_SIZE)));
+ gtk_container_add(GTK_CONTAINER(button), gtk_image_new_from_pixbuf(item->getIcon(myIconSize)));
gtk_object_set_user_data(GTK_OBJECT(button), item);
g_object_unref(G_OBJECT(group));
if (button_no == 0) {
- gtk_widget_set_size_request(myWidget, SL_APPLET_ICON_SIZE, SL_APPLET_ICON_SIZE);
+ gtk_widget_set_size_request(myWidget, myIconSize, myIconSize);
} else {
- gtk_widget_set_size_request(myWidget, button_no*SL_APPLET_ICON_SIZE, SL_APPLET_ICON_SIZE);
+ gtk_widget_set_size_request(myWidget, button_no*myIconSize, myIconSize);
}
gtk_widget_show_all(myWidget);
LauncherItems newItems = myItems;
- SettingsDialog dialog(myParent, SL_APPLET_ICON_SIZE, newItems);
+ SettingsDialog dialog(myParent, newItems);
switch (dialog.run()) {
case GTK_RESPONSE_OK: